@gravitee/gamma-lib-observability 2.2.3-fix-obs-60-keep-dirty-draft-on-failed-refetch.033c8f8 → 2.2.3-fix-obs-60-keep-dirty-draft-on-failed-refetch.70b90b2
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.
|
@@ -56,13 +56,21 @@ export declare function isDraftDirty(state: DashboardDraftState): boolean;
|
|
|
56
56
|
export declare function dashboardDraftReducer(state: DashboardDraftState, action: DashboardDraftAction): DashboardDraftState;
|
|
57
57
|
export declare function generateWidgetId(): string;
|
|
58
58
|
export declare function generateDashboardId(): string;
|
|
59
|
+
export interface DuplicateDashboardOptions {
|
|
60
|
+
/**
|
|
61
|
+
* Whether what is being copied is still on the server. Defaults to true,
|
|
62
|
+
* which is every deliberate duplication: the list, the detail page, and an
|
|
63
|
+
* author who chose to keep both versions of a contested dashboard.
|
|
64
|
+
*/
|
|
65
|
+
readonly originalStillExists?: boolean;
|
|
66
|
+
}
|
|
59
67
|
/**
|
|
60
68
|
* A copy of a dashboard ready to be created: new identity, marked title,
|
|
61
69
|
* everything else carried over. Shared by the list and the detail page so the
|
|
62
70
|
* two entry points cannot drift apart. Timestamps are deliberately left alone:
|
|
63
71
|
* the persistence layer owns them.
|
|
64
72
|
*/
|
|
65
|
-
export declare function duplicateDashboard(source: Dashboard): Dashboard;
|
|
73
|
+
export declare function duplicateDashboard(source: Dashboard, options?: DuplicateDashboardOptions): Dashboard;
|
|
66
74
|
/** Shared with `convert-widget-type`, so both routes into a widget agree. */
|
|
67
75
|
export declare const DEFAULT_TOP_LIST_VARIANT = "stacked";
|
|
68
76
|
/** Buckets a fresh facet widget asks for, whatever the visualization. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-editor-state.d.ts","sourceRoot":"","sources":["../../../src/dashboards/editor/dashboard-editor-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,E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QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACxC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,yBAA8B,GAAG,SAAS,CAWxG;AAED,6EAA6E;AAC7E,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAepC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAErE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAmDpG;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,CAIvD;AAED,wBAAgB,oBAAoB,CAAC,GAAG,GAAE,IAAiB,GAAG,SAAS,CAUtE"}
|
package/dist/index.js
CHANGED
|
@@ -7232,7 +7232,7 @@ function md({ busy: e, pending: t, onResolve: n, onCancel: r }) {
|
|
|
7232
7232
|
}), /* @__PURE__ */ F(z, {
|
|
7233
7233
|
disabled: e,
|
|
7234
7234
|
onClick: () => n("save-as-copy"),
|
|
7235
|
-
children: t === "save-as-copy" ? "Saving…" : "Save as a
|
|
7235
|
+
children: t === "save-as-copy" ? "Saving…" : "Save as a new dashboard"
|
|
7236
7236
|
})] })] });
|
|
7237
7237
|
}
|
|
7238
7238
|
function hd({ dashboard: e }) {
|
|
@@ -7551,11 +7551,12 @@ function Pd() {
|
|
|
7551
7551
|
function Fd() {
|
|
7552
7552
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
7553
7553
|
}
|
|
7554
|
-
function Id(e) {
|
|
7554
|
+
function Id(e, t = {}) {
|
|
7555
|
+
let { originalStillExists: n = !0 } = t;
|
|
7555
7556
|
return {
|
|
7556
7557
|
...e,
|
|
7557
7558
|
id: Fd(),
|
|
7558
|
-
title: `${e.title} (copy)`
|
|
7559
|
+
title: n ? `${e.title} (copy)` : e.title
|
|
7559
7560
|
};
|
|
7560
7561
|
}
|
|
7561
7562
|
var Ld = "stacked", Rd = {
|
|
@@ -9530,16 +9531,31 @@ function gp({ dashboardId: e, scopeFilterField: t }) {
|
|
|
9530
9531
|
mode: "edit",
|
|
9531
9532
|
reloadError: i,
|
|
9532
9533
|
scopeFilterField: t
|
|
9533
|
-
}, n.id) : /* @__PURE__ */ F(_p, {
|
|
9534
|
+
}, n.id) : /* @__PURE__ */ F(_p, {
|
|
9535
|
+
name: e,
|
|
9536
|
+
deleted: !1
|
|
9537
|
+
});
|
|
9534
9538
|
}
|
|
9535
|
-
function _p({
|
|
9539
|
+
function _p({ name: e, deleted: t }) {
|
|
9540
|
+
let n = zn();
|
|
9536
9541
|
return /* @__PURE__ */ I("div", {
|
|
9537
|
-
className: "flex items-center justify-center p-8
|
|
9538
|
-
children: [
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9542
|
+
className: "flex flex-col items-center justify-center gap-4 p-8",
|
|
9543
|
+
children: [/* @__PURE__ */ F("p", {
|
|
9544
|
+
className: "text-muted-foreground",
|
|
9545
|
+
children: t ? /* @__PURE__ */ I(P, { children: [
|
|
9546
|
+
"\"",
|
|
9547
|
+
e,
|
|
9548
|
+
"\" was deleted while you had it open."
|
|
9549
|
+
] }) : /* @__PURE__ */ I(P, { children: [
|
|
9550
|
+
"Dashboard \"",
|
|
9551
|
+
e,
|
|
9552
|
+
"\" was not found. It may have been deleted."
|
|
9553
|
+
] })
|
|
9554
|
+
}), /* @__PURE__ */ F(z, {
|
|
9555
|
+
variant: "outline",
|
|
9556
|
+
onClick: () => n("../..", { relative: "path" }),
|
|
9557
|
+
children: "Back to dashboards"
|
|
9558
|
+
})]
|
|
9543
9559
|
});
|
|
9544
9560
|
}
|
|
9545
9561
|
var vp = {
|
|
@@ -9561,7 +9577,7 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9561
9577
|
e.id,
|
|
9562
9578
|
C
|
|
9563
9579
|
]);
|
|
9564
|
-
let T = id(), ee = ad(), te = od(), ne = sd(), re = T.isPending || ee.isPending || te.isPending, E = a.draft, ae = jd(a), [oe, se] = N(null), le =
|
|
9580
|
+
let T = id(), ee = ad(), te = od(), ne = sd(), re = T.isPending || ee.isPending || te.isPending, E = a.draft, ae = jd(a), [oe, se] = N(null), le = n instanceof Wu, [ue, de] = N(!1), O = oe ?? (ae && le && !ue ? vp : null), [fe, pe] = N(!1), me = le || fe, he = () => {
|
|
9565
9581
|
se(null), le && de(!0);
|
|
9566
9582
|
};
|
|
9567
9583
|
A(() => {
|
|
@@ -9571,22 +9587,22 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9571
9587
|
};
|
|
9572
9588
|
return window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
|
|
9573
9589
|
}, [ae]);
|
|
9574
|
-
let
|
|
9590
|
+
let ge = k((e = "..") => {
|
|
9575
9591
|
i(e, { relative: "path" });
|
|
9576
|
-
}, [i]),
|
|
9592
|
+
}, [i]), _e = k(() => {
|
|
9577
9593
|
if (ae) {
|
|
9578
9594
|
m(!0);
|
|
9579
9595
|
return;
|
|
9580
9596
|
}
|
|
9581
|
-
|
|
9582
|
-
}, [ae,
|
|
9597
|
+
ge();
|
|
9598
|
+
}, [ae, ge]), ve = (e) => t === "create" ? `../${e}` : `../../${e}`, be = (e, t) => {
|
|
9583
9599
|
o({
|
|
9584
9600
|
type: "markSaved",
|
|
9585
9601
|
dashboard: e
|
|
9586
|
-
}), X.success(t),
|
|
9587
|
-
},
|
|
9602
|
+
}), X.success(t), ge(ve(e.id));
|
|
9603
|
+
}, xe = () => {
|
|
9588
9604
|
(t === "create" ? T : ee).mutate(E, {
|
|
9589
|
-
onSuccess: (e) =>
|
|
9605
|
+
onSuccess: (e) => be(e, t === "create" ? "Dashboard created" : "Dashboard saved"),
|
|
9590
9606
|
onError: (e) => {
|
|
9591
9607
|
if (e instanceof Gu) {
|
|
9592
9608
|
se({
|
|
@@ -9596,23 +9612,20 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9596
9612
|
return;
|
|
9597
9613
|
}
|
|
9598
9614
|
if (t === "edit" && e instanceof Wu) {
|
|
9599
|
-
se(
|
|
9600
|
-
theirs: null,
|
|
9601
|
-
deleted: !0
|
|
9602
|
-
});
|
|
9615
|
+
pe(!0), se(vp);
|
|
9603
9616
|
return;
|
|
9604
9617
|
}
|
|
9605
9618
|
X.error(`Could not save the dashboard: ${e.message}`);
|
|
9606
9619
|
}
|
|
9607
9620
|
});
|
|
9608
|
-
},
|
|
9621
|
+
}, we = () => {
|
|
9609
9622
|
te.mutate(E, {
|
|
9610
9623
|
onSuccess: (e) => {
|
|
9611
|
-
se(null),
|
|
9624
|
+
se(null), be(e, "Dashboard saved over the other version");
|
|
9612
9625
|
},
|
|
9613
9626
|
onError: (e) => {
|
|
9614
9627
|
if (e instanceof Wu) {
|
|
9615
|
-
se((e) => e && {
|
|
9628
|
+
pe(!0), se((e) => e && {
|
|
9616
9629
|
...e,
|
|
9617
9630
|
deleted: !0
|
|
9618
9631
|
});
|
|
@@ -9621,20 +9634,20 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9621
9634
|
X.error(`Could not overwrite the dashboard: ${e.message}`);
|
|
9622
9635
|
}
|
|
9623
9636
|
});
|
|
9624
|
-
},
|
|
9637
|
+
}, Ee = () => {
|
|
9625
9638
|
let e = O?.theirs;
|
|
9626
9639
|
e && (ne(e), o({
|
|
9627
9640
|
type: "init",
|
|
9628
9641
|
dashboard: e
|
|
9629
9642
|
}), f(qd(e)), c(null), b(null), se(null), X.success("Showing the version saved by the other author"));
|
|
9630
|
-
},
|
|
9631
|
-
T.mutate(Id(E), {
|
|
9643
|
+
}, De = () => {
|
|
9644
|
+
T.mutate(Id(E, { originalStillExists: !me }), {
|
|
9632
9645
|
onSuccess: (e) => {
|
|
9633
|
-
se(null),
|
|
9646
|
+
se(null), be(e, `Saved as "${e.title}"`);
|
|
9634
9647
|
},
|
|
9635
9648
|
onError: (e) => X.error(`Could not save a copy: ${e.message}`)
|
|
9636
9649
|
});
|
|
9637
|
-
},
|
|
9650
|
+
}, Oe = (e) => e === "overwrite" ? we() : e === "take-theirs" ? Ee() : De(), ke = () => te.isPending ? "overwrite" : T.isPending ? "save-as-copy" : null, Ae = (e) => {
|
|
9638
9651
|
if (c(null), b(null), e === "json") {
|
|
9639
9652
|
f(qd(E)), u("json");
|
|
9640
9653
|
return;
|
|
@@ -9651,7 +9664,7 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9651
9664
|
}), X.success("JSON applied to the dashboard");
|
|
9652
9665
|
}
|
|
9653
9666
|
u("builder");
|
|
9654
|
-
},
|
|
9667
|
+
}, je = (e) => {
|
|
9655
9668
|
o({
|
|
9656
9669
|
type: "replaceEditable",
|
|
9657
9670
|
fields: e
|
|
@@ -9659,17 +9672,17 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9659
9672
|
...E,
|
|
9660
9673
|
...e
|
|
9661
9674
|
}));
|
|
9662
|
-
},
|
|
9675
|
+
}, Me = () => {
|
|
9663
9676
|
x({
|
|
9664
9677
|
widget: Bd("cartesian", Pd(), E.widgets),
|
|
9665
9678
|
isNew: !0
|
|
9666
9679
|
});
|
|
9667
|
-
},
|
|
9680
|
+
}, Ne = (e) => {
|
|
9668
9681
|
o({
|
|
9669
9682
|
type: "upsertWidget",
|
|
9670
9683
|
widget: e
|
|
9671
9684
|
}), c(null);
|
|
9672
|
-
},
|
|
9685
|
+
}, Pe = k((e) => /* @__PURE__ */ I("div", {
|
|
9673
9686
|
className: "flex items-center gap-0.5",
|
|
9674
9687
|
children: [/* @__PURE__ */ F(z, {
|
|
9675
9688
|
variant: "ghost",
|
|
@@ -9718,13 +9731,16 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9718
9731
|
})
|
|
9719
9732
|
]
|
|
9720
9733
|
})] })]
|
|
9721
|
-
}), [x]),
|
|
9722
|
-
return
|
|
9734
|
+
}), [x]), Fe = j(() => Yu([...E.filters ?? [], ...E.widgets.flatMap((e) => e.filters ?? [])]), [E.filters, E.widgets]), Ie = ja(E.filters), Le = j(() => fp(Ie, E.widgets), [Ie, E.widgets]), Re = j(() => kd(g, E.timeRange), [g, E.timeRange]);
|
|
9735
|
+
return le && !ae ? /* @__PURE__ */ F(_p, {
|
|
9736
|
+
name: e.title,
|
|
9737
|
+
deleted: !0
|
|
9738
|
+
}) : /* @__PURE__ */ I("div", {
|
|
9723
9739
|
className: "flex flex-col gap-4 p-4",
|
|
9724
9740
|
children: [
|
|
9725
9741
|
/* @__PURE__ */ I(Yt, {
|
|
9726
9742
|
value: l,
|
|
9727
|
-
onValueChange:
|
|
9743
|
+
onValueChange: Ae,
|
|
9728
9744
|
className: "flex flex-col gap-4",
|
|
9729
9745
|
children: [
|
|
9730
9746
|
/* @__PURE__ */ I("div", {
|
|
@@ -9735,7 +9751,7 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9735
9751
|
variant: "ghost",
|
|
9736
9752
|
size: "icon",
|
|
9737
9753
|
"aria-label": "Back",
|
|
9738
|
-
onClick:
|
|
9754
|
+
onClick: _e,
|
|
9739
9755
|
children: /* @__PURE__ */ F(S, { className: "size-4" })
|
|
9740
9756
|
}), /* @__PURE__ */ I("div", {
|
|
9741
9757
|
className: "flex min-w-0 flex-col gap-0.5",
|
|
@@ -9773,17 +9789,21 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9773
9789
|
})] }),
|
|
9774
9790
|
/* @__PURE__ */ F(z, {
|
|
9775
9791
|
variant: "outline",
|
|
9776
|
-
onClick:
|
|
9792
|
+
onClick: _e,
|
|
9777
9793
|
children: "Cancel"
|
|
9778
9794
|
}),
|
|
9779
9795
|
/* @__PURE__ */ F(z, {
|
|
9780
|
-
onClick:
|
|
9796
|
+
onClick: xe,
|
|
9781
9797
|
disabled: re || !ae && t === "edit",
|
|
9782
9798
|
children: re ? "Saving…" : "Save"
|
|
9783
9799
|
})
|
|
9784
9800
|
]
|
|
9785
9801
|
})]
|
|
9786
9802
|
}),
|
|
9803
|
+
me && /* @__PURE__ */ I(Xe, {
|
|
9804
|
+
variant: "warning",
|
|
9805
|
+
children: [/* @__PURE__ */ F(Qe, { children: "This dashboard was deleted" }), /* @__PURE__ */ F(Ze, { children: "Someone removed it while you had it open. Your changes are safe here, and saving will offer to keep them as a new dashboard." })]
|
|
9806
|
+
}),
|
|
9787
9807
|
/* @__PURE__ */ I(Xt, {
|
|
9788
9808
|
value: "builder",
|
|
9789
9809
|
className: "flex flex-col gap-4",
|
|
@@ -9805,7 +9825,7 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9805
9825
|
/* @__PURE__ */ I("div", {
|
|
9806
9826
|
className: "flex items-center gap-1.5",
|
|
9807
9827
|
children: [
|
|
9808
|
-
!
|
|
9828
|
+
!Re && /* @__PURE__ */ I(z, {
|
|
9809
9829
|
variant: "ghost",
|
|
9810
9830
|
size: "sm",
|
|
9811
9831
|
className: "text-xs",
|
|
@@ -9818,7 +9838,7 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9818
9838
|
},
|
|
9819
9839
|
children: [/* @__PURE__ */ F(ce, { className: "size-3.5" }), "Set as default"]
|
|
9820
9840
|
}),
|
|
9821
|
-
|
|
9841
|
+
Re && /* @__PURE__ */ I("span", {
|
|
9822
9842
|
className: "flex items-center gap-1 text-xs text-muted-foreground",
|
|
9823
9843
|
title: "This is the dashboard default range",
|
|
9824
9844
|
children: [/* @__PURE__ */ F(ie, { className: "size-3.5" }), "Default"]
|
|
@@ -9830,25 +9850,25 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9830
9850
|
]
|
|
9831
9851
|
}),
|
|
9832
9852
|
/* @__PURE__ */ I(z, {
|
|
9833
|
-
onClick:
|
|
9853
|
+
onClick: Me,
|
|
9834
9854
|
children: [/* @__PURE__ */ F(Ce, { className: "size-4" }), "Add widget"]
|
|
9835
9855
|
})
|
|
9836
9856
|
]
|
|
9837
9857
|
}),
|
|
9838
|
-
|
|
9858
|
+
Fe.length > 0 && /* @__PURE__ */ I(Xe, {
|
|
9839
9859
|
variant: "destructive",
|
|
9840
9860
|
children: [/* @__PURE__ */ F(Qe, { children: "These dashboard filters cannot be queried" }), /* @__PURE__ */ I(Ze, { children: [
|
|
9841
|
-
|
|
9861
|
+
Fe.map((e) => `${e.label || e.field} (${e.operator})`).join(", "),
|
|
9842
9862
|
". The analytics API only accepts ",
|
|
9843
9863
|
Xu.join(", "),
|
|
9844
9864
|
". The affected widgets stay empty until the operator is changed, from a widget's Filters tab or from the JSON tab."
|
|
9845
9865
|
] })]
|
|
9846
9866
|
}),
|
|
9847
|
-
|
|
9867
|
+
Le.length > 0 && /* @__PURE__ */ I(Xe, {
|
|
9848
9868
|
variant: "warning",
|
|
9849
9869
|
children: [/* @__PURE__ */ F(Qe, { children: "These widgets ignore a locked dashboard filter" }), /* @__PURE__ */ I(Ze, { children: [/* @__PURE__ */ F("ul", {
|
|
9850
9870
|
className: "list-inside list-disc",
|
|
9851
|
-
children:
|
|
9871
|
+
children: Le.map((e) => /* @__PURE__ */ I("li", { children: [
|
|
9852
9872
|
/* @__PURE__ */ F("span", {
|
|
9853
9873
|
className: "font-medium",
|
|
9854
9874
|
children: e.widgetTitle
|
|
@@ -9865,7 +9885,7 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9865
9885
|
] }, `${e.widgetId}-${e.field}`))
|
|
9866
9886
|
}), "A widget's own filter wins, so the widget value is what gets queried, within whatever scope this module is mounted with. Readers still see the locked chip. Either change the widget's filter or unlock the dashboard one."] })]
|
|
9867
9887
|
}),
|
|
9868
|
-
E.widgets.length === 0 ? /* @__PURE__ */ F(sf, { onAddWidget:
|
|
9888
|
+
E.widgets.length === 0 ? /* @__PURE__ */ F(sf, { onAddWidget: Me }) : /* @__PURE__ */ F(zs, {
|
|
9869
9889
|
dashboard: E,
|
|
9870
9890
|
timeRange: g,
|
|
9871
9891
|
filters: E.filters,
|
|
@@ -9874,7 +9894,7 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9874
9894
|
type: "applyLayouts",
|
|
9875
9895
|
layouts: e
|
|
9876
9896
|
}),
|
|
9877
|
-
widgetActions:
|
|
9897
|
+
widgetActions: Pe,
|
|
9878
9898
|
highlightedWidgetId: s && !s.isNew ? s.widget.id : void 0
|
|
9879
9899
|
})
|
|
9880
9900
|
]
|
|
@@ -9885,7 +9905,7 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9885
9905
|
text: d,
|
|
9886
9906
|
onTextChange: f,
|
|
9887
9907
|
dirty: d !== qd(E),
|
|
9888
|
-
onApply:
|
|
9908
|
+
onApply: je
|
|
9889
9909
|
})
|
|
9890
9910
|
})
|
|
9891
9911
|
]
|
|
@@ -9896,7 +9916,7 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9896
9916
|
isNew: s?.isNew ?? !1,
|
|
9897
9917
|
timeRange: g,
|
|
9898
9918
|
dashboardFilters: E.filters,
|
|
9899
|
-
onSave:
|
|
9919
|
+
onSave: Ne,
|
|
9900
9920
|
onCancel: () => c(null),
|
|
9901
9921
|
onDirtyChange: (e) => {
|
|
9902
9922
|
v.current = e;
|
|
@@ -9906,9 +9926,9 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9906
9926
|
open: O !== null,
|
|
9907
9927
|
theirDashboard: O?.theirs ?? null,
|
|
9908
9928
|
deleted: O?.deleted ?? !1,
|
|
9909
|
-
pending: O ?
|
|
9910
|
-
onResolve:
|
|
9911
|
-
onCancel:
|
|
9929
|
+
pending: O ? ke() : null,
|
|
9930
|
+
onResolve: Oe,
|
|
9931
|
+
onCancel: he
|
|
9912
9932
|
}),
|
|
9913
9933
|
/* @__PURE__ */ F(pt, {
|
|
9914
9934
|
open: y !== null,
|
|
@@ -9940,7 +9960,7 @@ function yp({ initial: e, mode: t, reloadError: n = null, scopeFilterField: r })
|
|
|
9940
9960
|
}), /* @__PURE__ */ F(z, {
|
|
9941
9961
|
variant: "destructive",
|
|
9942
9962
|
onClick: () => {
|
|
9943
|
-
m(!1),
|
|
9963
|
+
m(!1), ge();
|
|
9944
9964
|
},
|
|
9945
9965
|
children: "Discard changes"
|
|
9946
9966
|
})] })] })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravitee/gamma-lib-observability",
|
|
3
|
-
"version": "2.2.3-fix-obs-60-keep-dirty-draft-on-failed-refetch.
|
|
3
|
+
"version": "2.2.3-fix-obs-60-keep-dirty-draft-on-failed-refetch.70b90b2",
|
|
4
4
|
"description": "Shared observability library for Gamma modules — dashboards, logs, tracing UI components and integration with business rules.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "yarn@4.14.1",
|