From 4010e9da52aaa0f535d68f19672586151cdd52f5 Mon Sep 17 00:00:00 2001 From: John Obelenus Date: Mon, 5 Aug 2024 17:52:28 -0400 Subject: [PATCH] Removing "within-a-changeset" conflict detection & retry we no longer need --- .../ModelingDiagram/ModelingDiagram.vue | 1 - .../src/components/StatusBar/StatusBar.vue | 4 - .../StatusBar/StatusBarConflictSummary.vue | 180 ------------------ app/web/src/components/toasts/Conflict.vue | 58 ------ app/web/src/store/status.store.ts | 12 -- lib/vue-lib/src/pinia/pinia_api_tools.ts | 28 --- 6 files changed, 283 deletions(-) delete mode 100644 app/web/src/components/StatusBar/StatusBarConflictSummary.vue delete mode 100644 app/web/src/components/toasts/Conflict.vue diff --git a/app/web/src/components/ModelingDiagram/ModelingDiagram.vue b/app/web/src/components/ModelingDiagram/ModelingDiagram.vue index f01eca6c8a..6a7d6648a2 100644 --- a/app/web/src/components/ModelingDiagram/ModelingDiagram.vue +++ b/app/web/src/components/ModelingDiagram/ModelingDiagram.vue @@ -199,7 +199,6 @@ overflow hidden */ - RECTS: {{ selectionRects }} diff --git a/app/web/src/components/StatusBar/StatusBar.vue b/app/web/src/components/StatusBar/StatusBar.vue index 0241887abf..e416d00010 100644 --- a/app/web/src/components/StatusBar/StatusBar.vue +++ b/app/web/src/components/StatusBar/StatusBar.vue @@ -10,9 +10,6 @@
System Initiative
-
- -
@@ -31,7 +28,6 @@ import * as _ from "lodash-es"; import clsx from "clsx"; import { useChangeSetsStore } from "@/store/change_sets.store"; -import StatusBarConflictSummary from "./StatusBarConflictSummary.vue"; import StatusBarDiffSummary from "./StatusBarDiffSummary.vue"; import StatusBarResourceSummary from "./StatusBarResourceSummary.vue"; import StatusBarQualificationSummary from "./StatusBarQualificationSummary.vue"; diff --git a/app/web/src/components/StatusBar/StatusBarConflictSummary.vue b/app/web/src/components/StatusBar/StatusBarConflictSummary.vue deleted file mode 100644 index 8e814baa47..0000000000 --- a/app/web/src/components/StatusBar/StatusBarConflictSummary.vue +++ /dev/null @@ -1,180 +0,0 @@ - - - - - diff --git a/app/web/src/components/toasts/Conflict.vue b/app/web/src/components/toasts/Conflict.vue deleted file mode 100644 index 761b9d7222..0000000000 --- a/app/web/src/components/toasts/Conflict.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - - diff --git a/app/web/src/store/status.store.ts b/app/web/src/store/status.store.ts index eab10bbca1..3067830f8b 100644 --- a/app/web/src/store/status.store.ts +++ b/app/web/src/store/status.store.ts @@ -10,7 +10,6 @@ import { ComponentId, SocketId } from "@/api/sdf/dal/component"; import { useChangeSetsStore } from "./change_sets.store"; import { useRealtimeStore } from "./realtime/realtime.store"; import UpdatingModel from "../components/toasts/UpdatingModel.vue"; -import ConflictToast from "../components/toasts/Conflict.vue"; import { useComponentsStore } from "./components.store"; import handleStoreError from "./errors"; @@ -271,17 +270,6 @@ export const useStatusStore = (forceChangeSetId?: ChangeSetId) => { return `Updating ${latestUpdate.componentLabel}`; }, }, - actions: { - addConflictFromHttp(conflict: Conflict): void { - this.rawConflicts.push(conflict); - toast({ - component: ConflictToast, - props: { - conflict, - }, - }); - }, - }, onActivated() { if (!changeSetId) return; diff --git a/lib/vue-lib/src/pinia/pinia_api_tools.ts b/lib/vue-lib/src/pinia/pinia_api_tools.ts index 90dfac99f1..b86064030a 100644 --- a/lib/vue-lib/src/pinia/pinia_api_tools.ts +++ b/lib/vue-lib/src/pinia/pinia_api_tools.ts @@ -81,7 +81,6 @@ declare module "pinia" { // augments the store's state export interface PiniaCustomStateProperties { apiRequestStatuses: RawRequestStatusesByKey; - availableRetries: ConflictsForRetry; } } @@ -230,15 +229,10 @@ export const initPiniaApiToolkitPlugin = (config: { api: AxiosInstance }) => { store.apiRequestStatuses = reactive({} as RawRequestStatusesByKey); (store.$state as any).apiRequestStatuses = store.apiRequestStatuses; - // 409 conflicts get stored in here - store.availableRetries = reactive({} as ConflictsForRetry); - (store.$state as any).availableRetries = store.availableRetries; - // make available to devtools if (import.meta.env.DEV) { // eslint-disable-next-line no-underscore-dangle store._customProperties.add("apiRequestStatuses"); - store._customProperties.add("availableRetries"); } // triggers a named api request passing in a payload @@ -433,14 +427,6 @@ export const initPiniaApiToolkitPlugin = (config: { api: AxiosInstance }) => { span.end(); }); request.setFailedResult(triggerResult.error); - if ( - actionName !== "SET_COMPONENT_GEOMETRY" && - triggerResult.error.response?.status === 409 - ) { - store.$patch((state) => { - state.availableRetries[requestUlid] = [actionName, actionResult]; - }); - } } else { request.setSuccessfulResult(triggerResult.data); } @@ -552,24 +538,10 @@ export const initPiniaApiToolkitPlugin = (config: { api: AxiosInstance }) => { delete store.$state.apiRequestStatuses[fullKey]; }; - const RETRY_CONFLICT = async (requestUlid: RequestUlid) => { - const r = store.$state.availableRetries[requestUlid]; - if (!r) throw Error(`No retry found for: ${requestUlid}`); - const actionName = r[0]; - const apiRequest = r[1]; - store.$patch((state) => { - delete state.availableRetries[requestUlid]; - }); - const newRequestUlid = ulid(); - await fireActionResult(actionName, apiRequest, newRequestUlid); - return apiRequest; - }; - return { getRequestStatus, getRequestStatuses, clearRequestStatus, - RETRY_CONFLICT, ...apiRequestActions, }; };