feat: tab service added (#3367)

This commit is contained in:
Anwarul Islam
2023-10-11 18:51:07 +06:00
committed by GitHub
parent 51510566bc
commit ba31cdabea
60 changed files with 1112 additions and 841 deletions

View File

@@ -7,8 +7,9 @@ import {
} from "@hoppscotch/data"
import DispatchingStore, { defineDispatchers } from "./DispatchingStore"
import { cloneDeep } from "lodash-es"
import { getTabRefWithSaveContext } from "~/helpers/rest/tab"
import { resolveSaveContextOnRequestReorder } from "~/helpers/collection/request"
import { getService } from "~/modules/dioc"
import { RESTTabService } from "~/services/tab/rest"
const defaultRESTCollectionState = {
state: [
@@ -454,7 +455,10 @@ const restCollectionDispatchers = defineDispatchers({
// Deal with situations where a tab with the given thing is deleted
// We are just going to dissociate the save context of the tab and mark it dirty
const tab = getTabRefWithSaveContext({
const tabService = getService(RESTTabService)
const tab = tabService.getTabRefWithSaveContext({
originLocation: "user-collection",
folderPath: path,
requestIndex: requestIndex,
@@ -512,7 +516,8 @@ const restCollectionDispatchers = defineDispatchers({
destLocation.requests.push(req)
targetLocation.requests.splice(requestIndex, 1)
const possibleTab = getTabRefWithSaveContext({
const tabService = getService(RESTTabService)
const possibleTab = tabService.getTabRefWithSaveContext({
originLocation: "user-collection",
folderPath: path,
requestIndex,