@gravitee/graphene-policy-studio 3.26.2-fix-found-336-save-button-reset.dd1cd09 → 3.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/USAGE_GUIDE.md +0 -3
- package/dist/hooks/use-flow-state.d.ts +1 -18
- package/dist/hooks/use-flow-state.d.ts.map +1 -1
- package/dist/hooks/use-policy-config.d.ts.map +1 -1
- package/dist/hooks/use-save.d.ts +1 -6
- package/dist/hooks/use-save.d.ts.map +1 -1
- package/dist/index.js +1529 -1562
- package/package.json +2 -2
package/USAGE_GUIDE.md
CHANGED
|
@@ -362,9 +362,6 @@ The error message is extracted from the rejection value: if it is an `Error` ins
|
|
|
362
362
|
- A `saving` state is held for 5 seconds (configurable internally) after a successful save.
|
|
363
363
|
- If save fails (rejected promise), saving resets immediately and `canSave` re-enables.
|
|
364
364
|
- When the host pushes new data (updating `plans`, `commonFlows`, or `flowExecution` props), the saving state and any error reset; the cycle starts fresh.
|
|
365
|
-
- Pushed `plans` / `commonFlows` replace the studio's working copy when their content differs from the previous push. Once the saved data comes back, nothing is left to save and the Save button stays disabled. A push with identical content, such as a new array reference from a refetch, changes nothing.
|
|
366
|
-
- Edits made since the last save (or since the last push) survive a push that keeps the structure the studio had at that point, typically the saved data coming back while the user kept editing. Only the flows edited since keep their local version: every other flow takes the pushed one, so a host that pushes common flows then plans updates both. The Save button then re-enables for those edits. A push with another structure (flows or steps added, removed or reordered, plan groups appearing after the common flows loaded) replaces everything.
|
|
367
|
-
- If the host never pushes the saved data back, the studio still compares against the old data: the Save button re-enables when the saving window ends.
|
|
368
365
|
|
|
369
366
|
Saving does not clear schema or documentation caches.
|
|
370
367
|
|
|
@@ -1,28 +1,11 @@
|
|
|
1
1
|
import { FlowGroupsAction } from '../lib/flow-groups-reducer';
|
|
2
2
|
import { FlowGroupVM } from '../types';
|
|
3
3
|
export type { FlowGroupsAction };
|
|
4
|
-
export interface SaveBaselineControls {
|
|
5
|
-
readonly markSaveStarted: () => void;
|
|
6
|
-
readonly markSaveFailed: () => void;
|
|
7
|
-
}
|
|
8
4
|
/**
|
|
9
5
|
* Holds the mutable working copy of flow groups for the editing session.
|
|
10
6
|
*
|
|
11
7
|
* Resets when host **content** changes, not when `plans` / `commonFlows` get new
|
|
12
8
|
* array references with identical data (common with React Query hosts).
|
|
13
|
-
*
|
|
14
|
-
* The key covers step configurations and flow attributes, not only the flow and
|
|
15
|
-
* policy lists: after a save, the host pushes back data that may differ only in a
|
|
16
|
-
* step configuration, and the working copy must take it as its new baseline.
|
|
17
|
-
*
|
|
18
|
-
* Flows edited since the last push or the last save start are kept when the host
|
|
19
|
-
* pushes data with the structure the studio had at that point (typically the saved
|
|
20
|
-
* data coming back while the user kept editing); every other flow takes the pushed
|
|
21
|
-
* version, so a host that pushes common flows then plans updates both. A push with
|
|
22
|
-
* another structure, such as plan groups appearing after the common flows loaded,
|
|
23
|
-
* always resets. Call `markSaveStarted` when a save starts, so that the edits it
|
|
24
|
-
* carries are not mistaken for later ones, and `markSaveFailed` when it fails, so
|
|
25
|
-
* that they stay protected.
|
|
26
9
|
*/
|
|
27
|
-
export declare function useFlowGroups(initialGroups: readonly FlowGroupVM[]): [readonly FlowGroupVM[], React.Dispatch<FlowGroupsAction
|
|
10
|
+
export declare function useFlowGroups(initialGroups: readonly FlowGroupVM[]): [readonly FlowGroupVM[], React.Dispatch<FlowGroupsAction>];
|
|
28
11
|
//# sourceMappingURL=use-flow-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-flow-state.d.ts","sourceRoot":"","sources":["../../src/hooks/use-flow-state.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,4BAA4B,CAAC;AAEtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC
|
|
1
|
+
{"version":3,"file":"use-flow-state.d.ts","sourceRoot":"","sources":["../../src/hooks/use-flow-state.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,4BAA4B,CAAC;AAEtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,aAAa,EAAE,SAAS,WAAW,EAAE,GACpC,CAAC,SAAS,WAAW,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAkB5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-policy-config.d.ts","sourceRoot":"","sources":["../../src/hooks/use-policy-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG1C,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEjE,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3D,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD;AAED,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC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E,SAAS,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,IAAI,EACJ,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,EAAE,sBAAsB,GAAG,qBAAqB,CA0GhD"}
|
package/dist/hooks/use-save.d.ts
CHANGED
|
@@ -18,18 +18,13 @@ export interface UseSaveResult {
|
|
|
18
18
|
* If `onSave` returns a `Promise` that rejects, the error is captured in
|
|
19
19
|
* `saveError`, `saving` is reset immediately, and `canSave` re-enables
|
|
20
20
|
* so the user can retry.
|
|
21
|
-
*
|
|
22
|
-
* `onSaveStart` runs right before `onSave` is called, and `onSaveFailed` when
|
|
23
|
-
* it throws or rejects.
|
|
24
21
|
*/
|
|
25
|
-
export declare function useSave({ initialGroups, currentGroups, initialFlowExecution, currentFlowExecution, stepValidity, onSave,
|
|
22
|
+
export declare function useSave({ initialGroups, currentGroups, initialFlowExecution, currentFlowExecution, stepValidity, onSave, }: {
|
|
26
23
|
readonly initialGroups: readonly FlowGroupVM[];
|
|
27
24
|
readonly currentGroups: readonly FlowGroupVM[];
|
|
28
25
|
readonly initialFlowExecution: FlowExecution;
|
|
29
26
|
readonly currentFlowExecution: FlowExecution;
|
|
30
27
|
readonly stepValidity: Map<string, boolean>;
|
|
31
28
|
readonly onSave: (output: SaveOutput) => Promise<void> | void;
|
|
32
|
-
readonly onSaveStart?: () => void;
|
|
33
|
-
readonly onSaveFailed?: () => void;
|
|
34
29
|
}): UseSaveResult;
|
|
35
30
|
//# sourceMappingURL=use-save.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-save.d.ts","sourceRoot":"","sources":["../../src/hooks/use-save.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEvE,MAAM,WAAW,aAAa;IAC5B,QAAQ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