refactor: persist only request handles under tab saveContext at runtime

Remove provider, workspace and request IDs.
This commit is contained in:
jamesgeorge007
2024-05-01 13:53:44 +05:30
parent 7ca94a99b7
commit 8b65090dfb
6 changed files with 8 additions and 22 deletions

View File

@@ -79,7 +79,7 @@
interactive
trigger="click"
theme="popover"
:on-shown="() => tippyActions.focus()"
:on-shown="() => tippyActions?.focus()"
>
<HoppButtonSecondary
v-tippy="{ theme: 'tooltip' }"

View File

@@ -501,10 +501,7 @@ import {
updateInheritedPropertiesForAffectedRequests,
updateSaveContextForAffectedRequests,
} from "~/helpers/collection/collection"
import {
getRequestsByPath,
resolveSaveContextOnRequestReorder,
} from "~/helpers/collection/request"
import { getRequestsByPath } from "~/helpers/collection/request"
import { HoppInheritedProperty } from "~/helpers/types/HoppInheritedProperties"
import { Picked } from "~/helpers/types/HoppPicked"
import {
@@ -842,16 +839,11 @@ const onAddRequest = async (requestName: string) => {
const { auth, headers } = cascadingAuthHeadersHandle.value.data
const { providerID, requestID, workspaceID } = requestHandle.value.data
tabs.createNewTab({
request: newRequest,
isDirty: false,
saveContext: {
originLocation: "workspace-user-collection",
workspaceID,
providerID,
requestID,
requestHandle,
},
inheritedProperties: {
@@ -1160,8 +1152,6 @@ const selectRequest = async (requestIndexPath: string) => {
const { auth, headers } = cascadingAuthHeadersHandle.value.data
const { providerID, requestID, workspaceID } = requestHandle.value.data
// If there is a request with this save context, switch into it
const possibleTab = tabs.getTabRefWithSaveContext({
originLocation: "workspace-user-collection",
@@ -1177,9 +1167,6 @@ const selectRequest = async (requestIndexPath: string) => {
isDirty: false,
saveContext: {
originLocation: "workspace-user-collection",
workspaceID,
providerID,
requestID,
requestHandle,
},
inheritedProperties: {