@equinor/roma-framework 4.0.0 → 5.0.0
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/cypress.mjs +13 -14
- package/dev-portal/lib/dev-portal/config/AppClient.d.ts +7 -3
- package/dev-portal/lib/test-utils/modules.d.ts +6 -7
- package/dev-portal/package.json +4 -2
- package/dev-portal/roma-framework.umd.js +27156 -15223
- package/lib/dev-portal/config/AppClient.d.ts +7 -3
- package/lib/test-utils/modules.d.ts +6 -7
- package/package.json +4 -2
- package/roma-framework.mjs +204 -175
- package/{router-JkkLp8wN.mjs → router-lZjM0_Ti.mjs} +174 -105
- package/dev-portal/lib/dev-portal/config.d.ts +0 -3
- package/lib/dev-portal/config.d.ts +0 -3
package/roma-framework.mjs
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
var __typeError = (msg) => {
|
|
2
|
-
throw TypeError(msg);
|
|
3
|
-
};
|
|
4
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
5
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
6
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
7
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
8
|
-
var _config, _connections, _builderCallbacks, _endpoints, _manifests;
|
|
9
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
10
2
|
import { useFramework, FrameworkProvider } from "@equinor/fusion-framework-react";
|
|
11
3
|
import { configureModules } from "@equinor/fusion-framework-app";
|
|
@@ -14,11 +6,12 @@ import { useState, useEffect, lazy, useRef, createContext, useContext, useMemo }
|
|
|
14
6
|
import { ModuleProvider } from "@equinor/fusion-framework-react-module";
|
|
15
7
|
import styled, { StyleSheetManager, keyframes } from "styled-components";
|
|
16
8
|
import { EdsProvider, StarProgress, Typography, Card, Button, TopBar, Chip, SideSheet, Menu, Tooltip, Icon, List } from "@equinor/eds-core-react";
|
|
17
|
-
import { E as EmptyError, o as operate, c as createOperatorSubscriber, i as innerFrom, a as identity, b as isFunction, I as IntlProvider, d as invariant, j as joinPaths, g as
|
|
9
|
+
import { E as EmptyError, o as operate, c as createOperatorSubscriber, i as innerFrom, a as identity, b as isFunction, I as IntlProvider, d as invariant, j as joinPaths, g as getResolveToMatches, r as resolveTo, w as warning, s as stripBasename, e as createPath, m as matchPath, B as BehaviorSubject, f as firstValueFrom, h as getDefaultExportFromCjs, k as of, l as from } from "./router-lZjM0_Ti.mjs";
|
|
18
10
|
import { QueryClient, QueryClientProvider, useQueryClient, useQuery, useMutation } from "@tanstack/react-query";
|
|
19
11
|
import { useCurrentApp, useApps as useApps$1 } from "@equinor/fusion-framework-react/app";
|
|
20
12
|
import { App } from "@equinor/fusion-framework-module-app/app";
|
|
21
13
|
import { tokens } from "@equinor/eds-tokens";
|
|
14
|
+
import "react-dom";
|
|
22
15
|
import { comment_more, accessible, account_circle, help_outline } from "@equinor/eds-icons";
|
|
23
16
|
import { enableAppModule } from "@equinor/fusion-framework-module-app";
|
|
24
17
|
import { enableContext } from "@equinor/fusion-framework-module-context";
|
|
@@ -30,8 +23,7 @@ const createExtraScopePlugin = (scope) => {
|
|
|
30
23
|
const plugin = (element, index, childEls) => {
|
|
31
24
|
if (element.type === "rule") {
|
|
32
25
|
element.props = element.props.map((value) => {
|
|
33
|
-
|
|
34
|
-
if (((_a = element.parent) == null ? void 0 : _a.type) === "@keyframes") {
|
|
26
|
+
if (element.parent?.type === "@keyframes") {
|
|
35
27
|
return value;
|
|
36
28
|
}
|
|
37
29
|
const containerMatch = `div[id^='eds-']`;
|
|
@@ -335,7 +327,6 @@ function AppLoader({
|
|
|
335
327
|
return appModule;
|
|
336
328
|
}
|
|
337
329
|
useEffect(() => {
|
|
338
|
-
var _a;
|
|
339
330
|
setError(null);
|
|
340
331
|
if (!app) {
|
|
341
332
|
dispatchEvent("onAppInitializeFailed", { detail: "App not found" });
|
|
@@ -344,13 +335,13 @@ function AppLoader({
|
|
|
344
335
|
}
|
|
345
336
|
setLoading(true);
|
|
346
337
|
const el = document.createElement("div");
|
|
347
|
-
|
|
338
|
+
ref.current?.appendChild(el);
|
|
348
339
|
const appModule = renderApplication(el);
|
|
349
340
|
setLoading(false);
|
|
350
341
|
const currentRef = ref.current;
|
|
351
342
|
return () => {
|
|
352
343
|
try {
|
|
353
|
-
currentRef
|
|
344
|
+
currentRef?.removeChild(el);
|
|
354
345
|
} catch {
|
|
355
346
|
}
|
|
356
347
|
appModule.dispose();
|
|
@@ -368,16 +359,6 @@ function AppLoader({
|
|
|
368
359
|
error && /* @__PURE__ */ jsx(ErrorViewer, { error })
|
|
369
360
|
] });
|
|
370
361
|
}
|
|
371
|
-
/**
|
|
372
|
-
* React Router v6.15.0
|
|
373
|
-
*
|
|
374
|
-
* Copyright (c) Remix Software Inc.
|
|
375
|
-
*
|
|
376
|
-
* This source code is licensed under the MIT license found in the
|
|
377
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
378
|
-
*
|
|
379
|
-
* @license MIT
|
|
380
|
-
*/
|
|
381
362
|
function _extends$1() {
|
|
382
363
|
_extends$1 = Object.assign ? Object.assign.bind() : function(target) {
|
|
383
364
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -490,6 +471,7 @@ function useNavigateUnstable() {
|
|
|
490
471
|
let dataRouterContext = React.useContext(DataRouterContext);
|
|
491
472
|
let {
|
|
492
473
|
basename,
|
|
474
|
+
future,
|
|
493
475
|
navigator: navigator2
|
|
494
476
|
} = React.useContext(NavigationContext);
|
|
495
477
|
let {
|
|
@@ -498,7 +480,7 @@ function useNavigateUnstable() {
|
|
|
498
480
|
let {
|
|
499
481
|
pathname: locationPathname
|
|
500
482
|
} = useLocation();
|
|
501
|
-
let routePathnamesJson = JSON.stringify(
|
|
483
|
+
let routePathnamesJson = JSON.stringify(getResolveToMatches(matches, future.v7_relativeSplatPath));
|
|
502
484
|
let activeRef = React.useRef(false);
|
|
503
485
|
useIsomorphicLayoutEffect(() => {
|
|
504
486
|
activeRef.current = true;
|
|
@@ -532,22 +514,25 @@ function useResolvedPath(to, _temp2) {
|
|
|
532
514
|
let {
|
|
533
515
|
relative
|
|
534
516
|
} = _temp2 === void 0 ? {} : _temp2;
|
|
517
|
+
let {
|
|
518
|
+
future
|
|
519
|
+
} = React.useContext(NavigationContext);
|
|
535
520
|
let {
|
|
536
521
|
matches
|
|
537
522
|
} = React.useContext(RouteContext);
|
|
538
523
|
let {
|
|
539
524
|
pathname: locationPathname
|
|
540
525
|
} = useLocation();
|
|
541
|
-
let routePathnamesJson = JSON.stringify(
|
|
526
|
+
let routePathnamesJson = JSON.stringify(getResolveToMatches(matches, future.v7_relativeSplatPath));
|
|
542
527
|
return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]);
|
|
543
528
|
}
|
|
544
|
-
var DataRouterHook$1 = /* @__PURE__ */ function(DataRouterHook2) {
|
|
529
|
+
var DataRouterHook$1 = /* @__PURE__ */ (function(DataRouterHook2) {
|
|
545
530
|
DataRouterHook2["UseBlocker"] = "useBlocker";
|
|
546
531
|
DataRouterHook2["UseRevalidator"] = "useRevalidator";
|
|
547
532
|
DataRouterHook2["UseNavigateStable"] = "useNavigate";
|
|
548
533
|
return DataRouterHook2;
|
|
549
|
-
}(DataRouterHook$1 || {});
|
|
550
|
-
var DataRouterStateHook$1 = /* @__PURE__ */ function(DataRouterStateHook2) {
|
|
534
|
+
})(DataRouterHook$1 || {});
|
|
535
|
+
var DataRouterStateHook$1 = /* @__PURE__ */ (function(DataRouterStateHook2) {
|
|
551
536
|
DataRouterStateHook2["UseBlocker"] = "useBlocker";
|
|
552
537
|
DataRouterStateHook2["UseLoaderData"] = "useLoaderData";
|
|
553
538
|
DataRouterStateHook2["UseActionData"] = "useActionData";
|
|
@@ -559,9 +544,9 @@ var DataRouterStateHook$1 = /* @__PURE__ */ function(DataRouterStateHook2) {
|
|
|
559
544
|
DataRouterStateHook2["UseNavigateStable"] = "useNavigate";
|
|
560
545
|
DataRouterStateHook2["UseRouteId"] = "useRouteId";
|
|
561
546
|
return DataRouterStateHook2;
|
|
562
|
-
}(DataRouterStateHook$1 || {});
|
|
547
|
+
})(DataRouterStateHook$1 || {});
|
|
563
548
|
function getDataRouterConsoleError$1(hookName) {
|
|
564
|
-
return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
549
|
+
return hookName + " must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.";
|
|
565
550
|
}
|
|
566
551
|
function useDataRouterContext$1(hookName) {
|
|
567
552
|
let ctx = React.useContext(DataRouterContext);
|
|
@@ -609,16 +594,6 @@ function useNavigateStable() {
|
|
|
609
594
|
}
|
|
610
595
|
new Promise(() => {
|
|
611
596
|
});
|
|
612
|
-
/**
|
|
613
|
-
* React Router DOM v6.15.0
|
|
614
|
-
*
|
|
615
|
-
* Copyright (c) Remix Software Inc.
|
|
616
|
-
*
|
|
617
|
-
* This source code is licensed under the MIT license found in the
|
|
618
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
619
|
-
*
|
|
620
|
-
* @license MIT
|
|
621
|
-
*/
|
|
622
597
|
function _extends() {
|
|
623
598
|
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
624
599
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -747,11 +722,26 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
747
722
|
body
|
|
748
723
|
};
|
|
749
724
|
}
|
|
750
|
-
const _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset"], _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"], _excluded3 = ["reloadDocument", "replace", "state", "method", "action", "onSubmit", "
|
|
725
|
+
const _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "viewTransition"], _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "viewTransition", "children"], _excluded3 = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "viewTransition"];
|
|
726
|
+
const REACT_ROUTER_VERSION = "6";
|
|
727
|
+
try {
|
|
728
|
+
window.__reactRouterVersion = REACT_ROUTER_VERSION;
|
|
729
|
+
} catch (e) {
|
|
730
|
+
}
|
|
731
|
+
const ViewTransitionContext = /* @__PURE__ */ React.createContext({
|
|
732
|
+
isTransitioning: false
|
|
733
|
+
});
|
|
734
|
+
if (process.env.NODE_ENV !== "production") {
|
|
735
|
+
ViewTransitionContext.displayName = "ViewTransition";
|
|
736
|
+
}
|
|
737
|
+
const FetchersContext = /* @__PURE__ */ React.createContext(/* @__PURE__ */ new Map());
|
|
738
|
+
if (process.env.NODE_ENV !== "production") {
|
|
739
|
+
FetchersContext.displayName = "Fetchers";
|
|
740
|
+
}
|
|
751
741
|
if (process.env.NODE_ENV !== "production") ;
|
|
752
742
|
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
753
743
|
const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
754
|
-
const Link = /* @__PURE__ */ React.forwardRef(function LinkWithRef(
|
|
744
|
+
const Link = /* @__PURE__ */ React.forwardRef(function LinkWithRef(_ref7, ref) {
|
|
755
745
|
let {
|
|
756
746
|
onClick,
|
|
757
747
|
relative,
|
|
@@ -760,8 +750,9 @@ const Link = /* @__PURE__ */ React.forwardRef(function LinkWithRef(_ref4, ref) {
|
|
|
760
750
|
state,
|
|
761
751
|
target,
|
|
762
752
|
to,
|
|
763
|
-
preventScrollReset
|
|
764
|
-
|
|
753
|
+
preventScrollReset,
|
|
754
|
+
viewTransition
|
|
755
|
+
} = _ref7, rest = _objectWithoutPropertiesLoose(_ref7, _excluded);
|
|
765
756
|
let {
|
|
766
757
|
basename
|
|
767
758
|
} = React.useContext(NavigationContext);
|
|
@@ -792,7 +783,8 @@ const Link = /* @__PURE__ */ React.forwardRef(function LinkWithRef(_ref4, ref) {
|
|
|
792
783
|
state,
|
|
793
784
|
target,
|
|
794
785
|
preventScrollReset,
|
|
795
|
-
relative
|
|
786
|
+
relative,
|
|
787
|
+
viewTransition
|
|
796
788
|
});
|
|
797
789
|
function handleClick(event) {
|
|
798
790
|
if (onClick) onClick(event);
|
|
@@ -813,7 +805,7 @@ const Link = /* @__PURE__ */ React.forwardRef(function LinkWithRef(_ref4, ref) {
|
|
|
813
805
|
if (process.env.NODE_ENV !== "production") {
|
|
814
806
|
Link.displayName = "Link";
|
|
815
807
|
}
|
|
816
|
-
const NavLink = /* @__PURE__ */ React.forwardRef(function NavLinkWithRef(
|
|
808
|
+
const NavLink = /* @__PURE__ */ React.forwardRef(function NavLinkWithRef(_ref8, ref) {
|
|
817
809
|
let {
|
|
818
810
|
"aria-current": ariaCurrentProp = "page",
|
|
819
811
|
caseSensitive = false,
|
|
@@ -821,16 +813,21 @@ const NavLink = /* @__PURE__ */ React.forwardRef(function NavLinkWithRef(_ref5,
|
|
|
821
813
|
end = false,
|
|
822
814
|
style: styleProp,
|
|
823
815
|
to,
|
|
816
|
+
viewTransition,
|
|
824
817
|
children
|
|
825
|
-
} =
|
|
818
|
+
} = _ref8, rest = _objectWithoutPropertiesLoose(_ref8, _excluded2);
|
|
826
819
|
let path = useResolvedPath(to, {
|
|
827
820
|
relative: rest.relative
|
|
828
821
|
});
|
|
829
822
|
let location = useLocation();
|
|
830
823
|
let routerState = React.useContext(DataRouterStateContext);
|
|
831
824
|
let {
|
|
832
|
-
navigator: navigator2
|
|
825
|
+
navigator: navigator2,
|
|
826
|
+
basename
|
|
833
827
|
} = React.useContext(NavigationContext);
|
|
828
|
+
let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
|
|
829
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
830
|
+
useViewTransitionState(path) && viewTransition === true;
|
|
834
831
|
let toPathname = navigator2.encodeLocation ? navigator2.encodeLocation(path).pathname : path.pathname;
|
|
835
832
|
let locationPathname = location.pathname;
|
|
836
833
|
let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
|
|
@@ -839,62 +836,56 @@ const NavLink = /* @__PURE__ */ React.forwardRef(function NavLinkWithRef(_ref5,
|
|
|
839
836
|
nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
|
|
840
837
|
toPathname = toPathname.toLowerCase();
|
|
841
838
|
}
|
|
842
|
-
|
|
839
|
+
if (nextLocationPathname && basename) {
|
|
840
|
+
nextLocationPathname = stripBasename(nextLocationPathname, basename) || nextLocationPathname;
|
|
841
|
+
}
|
|
842
|
+
const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
|
|
843
|
+
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
|
|
843
844
|
let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");
|
|
845
|
+
let renderProps = {
|
|
846
|
+
isActive,
|
|
847
|
+
isPending,
|
|
848
|
+
isTransitioning
|
|
849
|
+
};
|
|
844
850
|
let ariaCurrent = isActive ? ariaCurrentProp : void 0;
|
|
845
851
|
let className;
|
|
846
852
|
if (typeof classNameProp === "function") {
|
|
847
|
-
className = classNameProp(
|
|
848
|
-
isActive,
|
|
849
|
-
isPending
|
|
850
|
-
});
|
|
853
|
+
className = classNameProp(renderProps);
|
|
851
854
|
} else {
|
|
852
|
-
className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null].filter(Boolean).join(" ");
|
|
855
|
+
className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null, isTransitioning ? "transitioning" : null].filter(Boolean).join(" ");
|
|
853
856
|
}
|
|
854
|
-
let style = typeof styleProp === "function" ? styleProp(
|
|
855
|
-
isActive,
|
|
856
|
-
isPending
|
|
857
|
-
}) : styleProp;
|
|
857
|
+
let style = typeof styleProp === "function" ? styleProp(renderProps) : styleProp;
|
|
858
858
|
return /* @__PURE__ */ React.createElement(Link, _extends({}, rest, {
|
|
859
859
|
"aria-current": ariaCurrent,
|
|
860
860
|
className,
|
|
861
861
|
ref,
|
|
862
862
|
style,
|
|
863
|
-
to
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
isPending
|
|
867
|
-
}) : children);
|
|
863
|
+
to,
|
|
864
|
+
viewTransition
|
|
865
|
+
}), typeof children === "function" ? children(renderProps) : children);
|
|
868
866
|
});
|
|
869
867
|
if (process.env.NODE_ENV !== "production") {
|
|
870
868
|
NavLink.displayName = "NavLink";
|
|
871
869
|
}
|
|
872
|
-
const Form = /* @__PURE__ */ React.forwardRef((
|
|
873
|
-
let submit = useSubmit();
|
|
874
|
-
return /* @__PURE__ */ React.createElement(FormImpl, _extends({}, props, {
|
|
875
|
-
submit,
|
|
876
|
-
ref
|
|
877
|
-
}));
|
|
878
|
-
});
|
|
879
|
-
if (process.env.NODE_ENV !== "production") {
|
|
880
|
-
Form.displayName = "Form";
|
|
881
|
-
}
|
|
882
|
-
const FormImpl = /* @__PURE__ */ React.forwardRef((_ref6, forwardedRef) => {
|
|
870
|
+
const Form = /* @__PURE__ */ React.forwardRef((_ref9, forwardedRef) => {
|
|
883
871
|
let {
|
|
872
|
+
fetcherKey,
|
|
873
|
+
navigate,
|
|
884
874
|
reloadDocument,
|
|
885
875
|
replace,
|
|
886
876
|
state,
|
|
887
877
|
method = defaultMethod,
|
|
888
878
|
action,
|
|
889
879
|
onSubmit,
|
|
890
|
-
submit,
|
|
891
880
|
relative,
|
|
892
|
-
preventScrollReset
|
|
893
|
-
|
|
894
|
-
|
|
881
|
+
preventScrollReset,
|
|
882
|
+
viewTransition
|
|
883
|
+
} = _ref9, props = _objectWithoutPropertiesLoose(_ref9, _excluded3);
|
|
884
|
+
let submit = useSubmit();
|
|
895
885
|
let formAction = useFormAction(action, {
|
|
896
886
|
relative
|
|
897
887
|
});
|
|
888
|
+
let formMethod = method.toLowerCase() === "get" ? "get" : "post";
|
|
898
889
|
let submitHandler = (event) => {
|
|
899
890
|
onSubmit && onSubmit(event);
|
|
900
891
|
if (event.defaultPrevented) return;
|
|
@@ -902,11 +893,14 @@ const FormImpl = /* @__PURE__ */ React.forwardRef((_ref6, forwardedRef) => {
|
|
|
902
893
|
let submitter = event.nativeEvent.submitter;
|
|
903
894
|
let submitMethod = (submitter == null ? void 0 : submitter.getAttribute("formmethod")) || method;
|
|
904
895
|
submit(submitter || event.currentTarget, {
|
|
896
|
+
fetcherKey,
|
|
905
897
|
method: submitMethod,
|
|
898
|
+
navigate,
|
|
906
899
|
replace,
|
|
907
900
|
state,
|
|
908
901
|
relative,
|
|
909
|
-
preventScrollReset
|
|
902
|
+
preventScrollReset,
|
|
903
|
+
viewTransition
|
|
910
904
|
});
|
|
911
905
|
};
|
|
912
906
|
return /* @__PURE__ */ React.createElement("form", _extends({
|
|
@@ -917,7 +911,7 @@ const FormImpl = /* @__PURE__ */ React.forwardRef((_ref6, forwardedRef) => {
|
|
|
917
911
|
}, props));
|
|
918
912
|
});
|
|
919
913
|
if (process.env.NODE_ENV !== "production") {
|
|
920
|
-
|
|
914
|
+
Form.displayName = "Form";
|
|
921
915
|
}
|
|
922
916
|
if (process.env.NODE_ENV !== "production") ;
|
|
923
917
|
var DataRouterHook;
|
|
@@ -926,14 +920,16 @@ var DataRouterHook;
|
|
|
926
920
|
DataRouterHook2["UseSubmit"] = "useSubmit";
|
|
927
921
|
DataRouterHook2["UseSubmitFetcher"] = "useSubmitFetcher";
|
|
928
922
|
DataRouterHook2["UseFetcher"] = "useFetcher";
|
|
923
|
+
DataRouterHook2["useViewTransitionState"] = "useViewTransitionState";
|
|
929
924
|
})(DataRouterHook || (DataRouterHook = {}));
|
|
930
925
|
var DataRouterStateHook;
|
|
931
926
|
(function(DataRouterStateHook2) {
|
|
927
|
+
DataRouterStateHook2["UseFetcher"] = "useFetcher";
|
|
932
928
|
DataRouterStateHook2["UseFetchers"] = "useFetchers";
|
|
933
929
|
DataRouterStateHook2["UseScrollRestoration"] = "useScrollRestoration";
|
|
934
930
|
})(DataRouterStateHook || (DataRouterStateHook = {}));
|
|
935
931
|
function getDataRouterConsoleError(hookName) {
|
|
936
|
-
return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
932
|
+
return hookName + " must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.";
|
|
937
933
|
}
|
|
938
934
|
function useDataRouterContext(hookName) {
|
|
939
935
|
let ctx = React.useContext(DataRouterContext);
|
|
@@ -946,7 +942,8 @@ function useLinkClickHandler(to, _temp) {
|
|
|
946
942
|
replace: replaceProp,
|
|
947
943
|
state,
|
|
948
944
|
preventScrollReset,
|
|
949
|
-
relative
|
|
945
|
+
relative,
|
|
946
|
+
viewTransition
|
|
950
947
|
} = _temp === void 0 ? {} : _temp;
|
|
951
948
|
let navigate = useNavigate();
|
|
952
949
|
let location = useLocation();
|
|
@@ -961,16 +958,19 @@ function useLinkClickHandler(to, _temp) {
|
|
|
961
958
|
replace,
|
|
962
959
|
state,
|
|
963
960
|
preventScrollReset,
|
|
964
|
-
relative
|
|
961
|
+
relative,
|
|
962
|
+
viewTransition
|
|
965
963
|
});
|
|
966
964
|
}
|
|
967
|
-
}, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative]);
|
|
965
|
+
}, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative, viewTransition]);
|
|
968
966
|
}
|
|
969
967
|
function validateClientSideSubmission() {
|
|
970
968
|
if (typeof document === "undefined") {
|
|
971
969
|
throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
|
|
972
970
|
}
|
|
973
971
|
}
|
|
972
|
+
let fetcherId = 0;
|
|
973
|
+
let getUniqueFetcherId = () => "__" + String(++fetcherId) + "__";
|
|
974
974
|
function useSubmit() {
|
|
975
975
|
let {
|
|
976
976
|
router
|
|
@@ -991,16 +991,30 @@ function useSubmit() {
|
|
|
991
991
|
formData,
|
|
992
992
|
body
|
|
993
993
|
} = getFormSubmissionInfo(target, basename);
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
994
|
+
if (options.navigate === false) {
|
|
995
|
+
let key = options.fetcherKey || getUniqueFetcherId();
|
|
996
|
+
router.fetch(key, currentRouteId, options.action || action, {
|
|
997
|
+
preventScrollReset: options.preventScrollReset,
|
|
998
|
+
formData,
|
|
999
|
+
body,
|
|
1000
|
+
formMethod: options.method || method,
|
|
1001
|
+
formEncType: options.encType || encType,
|
|
1002
|
+
flushSync: options.flushSync
|
|
1003
|
+
});
|
|
1004
|
+
} else {
|
|
1005
|
+
router.navigate(options.action || action, {
|
|
1006
|
+
preventScrollReset: options.preventScrollReset,
|
|
1007
|
+
formData,
|
|
1008
|
+
body,
|
|
1009
|
+
formMethod: options.method || method,
|
|
1010
|
+
formEncType: options.encType || encType,
|
|
1011
|
+
replace: options.replace,
|
|
1012
|
+
state: options.state,
|
|
1013
|
+
fromRouteId: currentRouteId,
|
|
1014
|
+
flushSync: options.flushSync,
|
|
1015
|
+
viewTransition: options.viewTransition
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1004
1018
|
}, [router, basename, currentRouteId]);
|
|
1005
1019
|
}
|
|
1006
1020
|
function useFormAction(action, _temp2) {
|
|
@@ -1019,10 +1033,14 @@ function useFormAction(action, _temp2) {
|
|
|
1019
1033
|
let location = useLocation();
|
|
1020
1034
|
if (action == null) {
|
|
1021
1035
|
path.search = location.search;
|
|
1022
|
-
|
|
1023
|
-
|
|
1036
|
+
let params = new URLSearchParams(path.search);
|
|
1037
|
+
let indexValues = params.getAll("index");
|
|
1038
|
+
let hasNakedIndexParam = indexValues.some((v) => v === "");
|
|
1039
|
+
if (hasNakedIndexParam) {
|
|
1024
1040
|
params.delete("index");
|
|
1025
|
-
|
|
1041
|
+
indexValues.filter((v) => v).forEach((v) => params.append("index", v));
|
|
1042
|
+
let qs = params.toString();
|
|
1043
|
+
path.search = qs ? "?" + qs : "";
|
|
1026
1044
|
}
|
|
1027
1045
|
}
|
|
1028
1046
|
if ((!action || action === ".") && match.route.index) {
|
|
@@ -1033,6 +1051,25 @@ function useFormAction(action, _temp2) {
|
|
|
1033
1051
|
}
|
|
1034
1052
|
return createPath(path);
|
|
1035
1053
|
}
|
|
1054
|
+
function useViewTransitionState(to, opts) {
|
|
1055
|
+
if (opts === void 0) {
|
|
1056
|
+
opts = {};
|
|
1057
|
+
}
|
|
1058
|
+
let vtContext = React.useContext(ViewTransitionContext);
|
|
1059
|
+
!(vtContext != null) ? process.env.NODE_ENV !== "production" ? invariant(false, "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?") : invariant(false) : void 0;
|
|
1060
|
+
let {
|
|
1061
|
+
basename
|
|
1062
|
+
} = useDataRouterContext(DataRouterHook.useViewTransitionState);
|
|
1063
|
+
let path = useResolvedPath(to, {
|
|
1064
|
+
relative: opts.relative
|
|
1065
|
+
});
|
|
1066
|
+
if (!vtContext.isTransitioning) {
|
|
1067
|
+
return false;
|
|
1068
|
+
}
|
|
1069
|
+
let currentPath = stripBasename(vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
|
|
1070
|
+
let nextPath = stripBasename(vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
|
|
1071
|
+
return matchPath(path.pathname, nextPath) != null || matchPath(path.pathname, currentPath) != null;
|
|
1072
|
+
}
|
|
1036
1073
|
const AppContext = createContext({
|
|
1037
1074
|
isLoading: false,
|
|
1038
1075
|
apps: void 0
|
|
@@ -1089,7 +1126,7 @@ const AppViewer = () => {
|
|
|
1089
1126
|
const { appKey } = useParams();
|
|
1090
1127
|
const { apps } = useApps({ includeHidden: true });
|
|
1091
1128
|
const app = useMemo(() => {
|
|
1092
|
-
return apps
|
|
1129
|
+
return apps?.find((app2) => app2.appKey === appKey);
|
|
1093
1130
|
}, [appKey, apps]);
|
|
1094
1131
|
if (!apps) {
|
|
1095
1132
|
return /* @__PURE__ */ jsx(EquinorLoader, { text: "Loading apps..." });
|
|
@@ -1195,17 +1232,16 @@ const HeaderMenu = ({ menuState }) => {
|
|
|
1195
1232
|
const { event } = useFramework().modules;
|
|
1196
1233
|
const { auth } = useFramework().modules;
|
|
1197
1234
|
const user = useMemo(() => {
|
|
1198
|
-
return auth.
|
|
1235
|
+
return auth.account;
|
|
1199
1236
|
}, [auth]);
|
|
1200
1237
|
const roles = useMemo(() => {
|
|
1201
|
-
|
|
1202
|
-
return ((_a = user == null ? void 0 : user.idTokenClaims) == null ? void 0 : _a.roles) ?? ["No access role"];
|
|
1238
|
+
return user?.idTokenClaims?.roles ?? ["No access role"];
|
|
1203
1239
|
}, [user]);
|
|
1204
1240
|
const getFeedbackAreaFromTags = (currentApp2, applications2) => {
|
|
1205
1241
|
const manifest = applications2.find(
|
|
1206
|
-
(app) => app.appKey ===
|
|
1242
|
+
(app) => app.appKey === currentApp2?.appKey
|
|
1207
1243
|
);
|
|
1208
|
-
const tags =
|
|
1244
|
+
const tags = manifest?.keywords ?? [];
|
|
1209
1245
|
if (tags.includes("trading")) return "10543";
|
|
1210
1246
|
if (tags.includes("liquids-operations")) return "10511";
|
|
1211
1247
|
return "10540";
|
|
@@ -1327,7 +1363,6 @@ const getEnvironment = async () => {
|
|
|
1327
1363
|
};
|
|
1328
1364
|
};
|
|
1329
1365
|
const Header = () => {
|
|
1330
|
-
var _a;
|
|
1331
1366
|
const [a11yOpen, setA11yOpen] = useState(false);
|
|
1332
1367
|
const [userMenuOpen, setUserMenuOpen] = useState(false);
|
|
1333
1368
|
const [activityLogOpen, setActivityLogOpen] = useState(false);
|
|
@@ -1351,14 +1386,14 @@ const Header = () => {
|
|
|
1351
1386
|
TopBarFadeIn,
|
|
1352
1387
|
{
|
|
1353
1388
|
id: "cli-top-bar",
|
|
1354
|
-
style: !
|
|
1389
|
+
style: !env?.isProd ? {
|
|
1355
1390
|
backgroundColor: tokens.colors.interactive.warning__highlight.rgba
|
|
1356
1391
|
} : void 0,
|
|
1357
1392
|
children: [
|
|
1358
1393
|
/* @__PURE__ */ jsx(TopBar.Header, { children: /* @__PURE__ */ jsxs(Styled.Title, { children: [
|
|
1359
1394
|
/* @__PURE__ */ jsx(Icon, { color: "#eb0037", data: logoIcon, viewBox: "0 0 42 48" }),
|
|
1360
1395
|
/* @__PURE__ */ jsx("span", { children: "Roma" }),
|
|
1361
|
-
env && !
|
|
1396
|
+
env && !env?.isProd && /* @__PURE__ */ jsx(EnvChip, { children: env?.environmentName?.split(" ")[0].toUpperCase() })
|
|
1362
1397
|
] }) }),
|
|
1363
1398
|
/* @__PURE__ */ jsx(TopBar.CustomContent, {}),
|
|
1364
1399
|
/* @__PURE__ */ jsx(TopBar.Actions, { children: /* @__PURE__ */ jsx(HeaderMenu, { menuState: headerMenuState }) })
|
|
@@ -1703,50 +1738,46 @@ class Connection {
|
|
|
1703
1738
|
}
|
|
1704
1739
|
}
|
|
1705
1740
|
class SseModuleProvider {
|
|
1741
|
+
#config;
|
|
1742
|
+
#connections = {};
|
|
1706
1743
|
constructor(config) {
|
|
1707
|
-
|
|
1708
|
-
__privateAdd(this, _connections, {});
|
|
1709
|
-
__privateSet(this, _config, config);
|
|
1744
|
+
this.#config = config;
|
|
1710
1745
|
}
|
|
1711
1746
|
connect(name) {
|
|
1712
|
-
if (!(name in
|
|
1713
|
-
|
|
1714
|
-
const options =
|
|
1747
|
+
if (!(name in this.#connections)) {
|
|
1748
|
+
this.#connections[name] = new Connection();
|
|
1749
|
+
const options = this.#config.endpoints[name];
|
|
1715
1750
|
this.createConnection(name, options);
|
|
1716
1751
|
}
|
|
1717
|
-
return
|
|
1752
|
+
return this.#connections[name];
|
|
1718
1753
|
}
|
|
1719
1754
|
createConnection(name, options) {
|
|
1720
|
-
const config =
|
|
1755
|
+
const config = this.#connections[name];
|
|
1721
1756
|
setupEventSource(options, config.messageList, config.abort).catch(
|
|
1722
1757
|
(err) => console.error(`Failed to set up connection for ${name}:`, err)
|
|
1723
1758
|
);
|
|
1724
1759
|
}
|
|
1725
1760
|
}
|
|
1726
|
-
_config = new WeakMap();
|
|
1727
|
-
_connections = new WeakMap();
|
|
1728
1761
|
class SseModuleConfigBuilder extends ModuleConfigBuilder {
|
|
1729
1762
|
addEndpoint(name, config) {
|
|
1730
1763
|
this._config.addEndpoint(name, config);
|
|
1731
1764
|
}
|
|
1732
1765
|
}
|
|
1733
1766
|
class SseConfigurator {
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
__privateAdd(this, _endpoints, {});
|
|
1737
|
-
}
|
|
1767
|
+
#builderCallbacks = [];
|
|
1768
|
+
#endpoints = {};
|
|
1738
1769
|
/**
|
|
1739
1770
|
* register SSE endpoint configuration.
|
|
1740
1771
|
*/
|
|
1741
1772
|
addEndpoint(name, config) {
|
|
1742
|
-
|
|
1773
|
+
this.#endpoints[name] = config;
|
|
1743
1774
|
}
|
|
1744
1775
|
/**
|
|
1745
1776
|
* add callback for building config on when configurator is creating config.
|
|
1746
1777
|
* {@link SseConfigurator.createConfig}
|
|
1747
1778
|
*/
|
|
1748
1779
|
onCreateConfig(cb) {
|
|
1749
|
-
|
|
1780
|
+
this.#builderCallbacks.push(cb);
|
|
1750
1781
|
}
|
|
1751
1782
|
/**
|
|
1752
1783
|
* normally executed in `init` phase of module, which creates configuration to the module provider.
|
|
@@ -1754,20 +1785,18 @@ class SseConfigurator {
|
|
|
1754
1785
|
* await all registered hub configurations.
|
|
1755
1786
|
*/
|
|
1756
1787
|
async createConfig(init) {
|
|
1757
|
-
for (const cb of
|
|
1788
|
+
for (const cb of this.#builderCallbacks) {
|
|
1758
1789
|
const builder = new SseModuleConfigBuilder(
|
|
1759
1790
|
init,
|
|
1760
1791
|
this
|
|
1761
1792
|
);
|
|
1762
1793
|
await Promise.resolve(cb(builder));
|
|
1763
1794
|
}
|
|
1764
|
-
return { endpoints:
|
|
1795
|
+
return { endpoints: this.#endpoints };
|
|
1765
1796
|
}
|
|
1766
1797
|
}
|
|
1767
|
-
_builderCallbacks = new WeakMap();
|
|
1768
|
-
_endpoints = new WeakMap();
|
|
1769
1798
|
const moduleKey = "sse";
|
|
1770
|
-
const module = {
|
|
1799
|
+
const module$1 = {
|
|
1771
1800
|
name: moduleKey,
|
|
1772
1801
|
configure: () => new SseConfigurator(),
|
|
1773
1802
|
initialize: async (init) => {
|
|
@@ -1789,7 +1818,9 @@ const configureFromFramework = async (args, builder) => {
|
|
|
1789
1818
|
options: {
|
|
1790
1819
|
accessTokenFactory: async () => {
|
|
1791
1820
|
const token = await authProvider.acquireAccessToken({
|
|
1792
|
-
|
|
1821
|
+
request: {
|
|
1822
|
+
scopes: service.scopes ?? service.defaultScopes
|
|
1823
|
+
}
|
|
1793
1824
|
});
|
|
1794
1825
|
if (!token) {
|
|
1795
1826
|
throw Error("failed to acquire access token");
|
|
@@ -1803,7 +1834,7 @@ const configureFromFramework = async (args, builder) => {
|
|
|
1803
1834
|
function enableSse(configurator, name, optionsOrCallback) {
|
|
1804
1835
|
{
|
|
1805
1836
|
configurator.addConfig({
|
|
1806
|
-
module,
|
|
1837
|
+
module: module$1,
|
|
1807
1838
|
configure: (sseConfigurator) => {
|
|
1808
1839
|
sseConfigurator.onCreateConfig(
|
|
1809
1840
|
(builder) => configureFromFramework({ name }, builder)
|
|
@@ -3924,16 +3955,16 @@ const rootSchema = create$3({
|
|
|
3924
3955
|
});
|
|
3925
3956
|
class CustomAppClient {
|
|
3926
3957
|
constructor(client, graphClient) {
|
|
3927
|
-
__privateAdd(this, _manifests, []);
|
|
3928
3958
|
this.client = client;
|
|
3929
3959
|
this.graphClient = graphClient;
|
|
3930
3960
|
}
|
|
3961
|
+
#manifests = [];
|
|
3931
3962
|
// eslint-disable-next-line no-empty-pattern
|
|
3932
3963
|
getAppConfig({}) {
|
|
3933
3964
|
return of({});
|
|
3934
3965
|
}
|
|
3935
3966
|
getAppManifest({ appKey }) {
|
|
3936
|
-
const manifest =
|
|
3967
|
+
const manifest = this.#manifests.find(
|
|
3937
3968
|
(manifest2) => manifest2.appKey === appKey
|
|
3938
3969
|
);
|
|
3939
3970
|
if (!manifest)
|
|
@@ -4048,16 +4079,13 @@ class CustomAppClient {
|
|
|
4048
4079
|
const list = res.value.map(
|
|
4049
4080
|
(v) => v.id
|
|
4050
4081
|
);
|
|
4051
|
-
return apps.map((app) => {
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
hasAccess: (((_a = app.config) == null ? void 0 : _a.groups) ?? []).length === 0 || ((_b = app.config) == null ? void 0 : _b.groups.some((g) => list.includes(g)))
|
|
4056
|
-
};
|
|
4057
|
-
});
|
|
4082
|
+
return apps.map((app) => ({
|
|
4083
|
+
...app,
|
|
4084
|
+
hasAccess: (app.config?.groups ?? []).length === 0 || app.config?.groups.some((g) => list.includes(g))
|
|
4085
|
+
}));
|
|
4058
4086
|
});
|
|
4059
4087
|
}),
|
|
4060
|
-
tap((v) =>
|
|
4088
|
+
tap((v) => this.#manifests = v),
|
|
4061
4089
|
catchError((err) => {
|
|
4062
4090
|
console.error("Error fetching app manifests", err);
|
|
4063
4091
|
return of([]);
|
|
@@ -4074,8 +4102,10 @@ class CustomAppClient {
|
|
|
4074
4102
|
}
|
|
4075
4103
|
[Symbol.dispose]() {
|
|
4076
4104
|
}
|
|
4105
|
+
getAppBuild(args) {
|
|
4106
|
+
return of({});
|
|
4107
|
+
}
|
|
4077
4108
|
}
|
|
4078
|
-
_manifests = new WeakMap();
|
|
4079
4109
|
class ServiceDiscoveryClient {
|
|
4080
4110
|
constructor() {
|
|
4081
4111
|
this.cacheTime = 0;
|
|
@@ -4102,17 +4132,16 @@ class ServiceDiscoveryClient {
|
|
|
4102
4132
|
}
|
|
4103
4133
|
}
|
|
4104
4134
|
const configure = async (config) => {
|
|
4105
|
-
var _a, _b;
|
|
4106
4135
|
const request = await fetch("/_discovery/environments/current");
|
|
4107
4136
|
const environment = await request.json();
|
|
4108
4137
|
const services = environment.services;
|
|
4109
4138
|
if (!services) {
|
|
4110
4139
|
throw new Error(`ServiceDiscoveryMissingError: No services found`);
|
|
4111
4140
|
}
|
|
4112
|
-
const portalService =
|
|
4141
|
+
const portalService = environment.services?.find(
|
|
4113
4142
|
(v) => v.key === "portal"
|
|
4114
4143
|
);
|
|
4115
|
-
const graphService =
|
|
4144
|
+
const graphService = environment.services?.find(
|
|
4116
4145
|
(v) => v.key === "graph"
|
|
4117
4146
|
);
|
|
4118
4147
|
if (!portalService || !environment.frontendClientId) {
|
|
@@ -4122,12 +4151,13 @@ const configure = async (config) => {
|
|
|
4122
4151
|
throw new Error(`Missing environment information:
|
|
4123
4152
|
${error.join("\n")}`);
|
|
4124
4153
|
}
|
|
4125
|
-
config.logger.level = 2;
|
|
4126
4154
|
config.configureMsal(
|
|
4127
4155
|
{
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4156
|
+
auth: {
|
|
4157
|
+
tenantId: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0",
|
|
4158
|
+
clientId: environment.frontendClientId,
|
|
4159
|
+
redirectUri: "/authentication/login-callback"
|
|
4160
|
+
}
|
|
4131
4161
|
},
|
|
4132
4162
|
true
|
|
4133
4163
|
);
|
|
@@ -4145,7 +4175,7 @@ ${error.join("\n")}`);
|
|
|
4145
4175
|
});
|
|
4146
4176
|
const graphHttpClient = http.createClient({
|
|
4147
4177
|
...graphService,
|
|
4148
|
-
baseUri:
|
|
4178
|
+
baseUri: graphService?.uri ?? graphService?.baseUri
|
|
4149
4179
|
});
|
|
4150
4180
|
return new CustomAppClient(httpClient, graphHttpClient);
|
|
4151
4181
|
});
|
|
@@ -4277,7 +4307,7 @@ const getGetSettingByUserAndIdQueryKey = (userId, id) => {
|
|
|
4277
4307
|
};
|
|
4278
4308
|
const useGetSettingByUserAndIdQueryOptions = (userId, id, options) => {
|
|
4279
4309
|
const { query: queryOptions } = options ?? {};
|
|
4280
|
-
const queryKey =
|
|
4310
|
+
const queryKey = queryOptions?.queryKey ?? getGetSettingByUserAndIdQueryKey(userId, id);
|
|
4281
4311
|
const getSettingByUserAndId = useGetSettingByUserAndIdHook();
|
|
4282
4312
|
const queryFn = ({ signal }) => getSettingByUserAndId(userId, id, signal);
|
|
4283
4313
|
return {
|
|
@@ -4358,7 +4388,7 @@ const getGetPublicSettingByUserAndIdQueryKey = (appShortName, id) => {
|
|
|
4358
4388
|
};
|
|
4359
4389
|
const useGetPublicSettingByUserAndIdQueryOptions = (appShortName, id, options) => {
|
|
4360
4390
|
const { query: queryOptions } = options ?? {};
|
|
4361
|
-
const queryKey =
|
|
4391
|
+
const queryKey = queryOptions?.queryKey ?? getGetPublicSettingByUserAndIdQueryKey(appShortName, id);
|
|
4362
4392
|
const getPublicSettingByUserAndId = useGetPublicSettingByUserAndIdHook();
|
|
4363
4393
|
const queryFn = ({ signal }) => getPublicSettingByUserAndId(appShortName, id, signal);
|
|
4364
4394
|
return {
|
|
@@ -4439,7 +4469,7 @@ const getGetSettingsByUserIdQueryKey = (userId) => {
|
|
|
4439
4469
|
};
|
|
4440
4470
|
const useGetSettingsByUserIdQueryOptions = (userId, options) => {
|
|
4441
4471
|
const { query: queryOptions } = options ?? {};
|
|
4442
|
-
const queryKey =
|
|
4472
|
+
const queryKey = queryOptions?.queryKey ?? getGetSettingsByUserIdQueryKey(userId);
|
|
4443
4473
|
const getSettingsByUserId = useGetSettingsByUserIdHook();
|
|
4444
4474
|
const queryFn = ({ signal }) => getSettingsByUserId(userId, signal);
|
|
4445
4475
|
return {
|
|
@@ -4494,7 +4524,7 @@ const getGetSettingsByAppShortNameQueryKey = (appShortName) => {
|
|
|
4494
4524
|
};
|
|
4495
4525
|
const useGetSettingsByAppShortNameQueryOptions = (appShortName, options) => {
|
|
4496
4526
|
const { query: queryOptions } = options ?? {};
|
|
4497
|
-
const queryKey =
|
|
4527
|
+
const queryKey = queryOptions?.queryKey ?? getGetSettingsByAppShortNameQueryKey(appShortName);
|
|
4498
4528
|
const getSettingsByAppShortName = useGetSettingsByAppShortNameHook();
|
|
4499
4529
|
const queryFn = ({ signal }) => getSettingsByAppShortName(appShortName, signal);
|
|
4500
4530
|
return {
|
|
@@ -4574,7 +4604,7 @@ const getGetAllAppsQueryKey = () => {
|
|
|
4574
4604
|
};
|
|
4575
4605
|
const useGetAllAppsQueryOptions = (options) => {
|
|
4576
4606
|
const { query: queryOptions } = options ?? {};
|
|
4577
|
-
const queryKey =
|
|
4607
|
+
const queryKey = queryOptions?.queryKey ?? getGetAllAppsQueryKey();
|
|
4578
4608
|
const getAllApps = useGetAllAppsHook();
|
|
4579
4609
|
const queryFn = ({ signal }) => getAllApps(signal);
|
|
4580
4610
|
return { queryKey, queryFn, ...queryOptions };
|
|
@@ -4620,7 +4650,7 @@ const getGetAppByKeyQueryKey = (key) => {
|
|
|
4620
4650
|
};
|
|
4621
4651
|
const useGetAppByKeyQueryOptions = (key, options) => {
|
|
4622
4652
|
const { query: queryOptions } = options ?? {};
|
|
4623
|
-
const queryKey =
|
|
4653
|
+
const queryKey = queryOptions?.queryKey ?? getGetAppByKeyQueryKey(key);
|
|
4624
4654
|
const getAppByKey = useGetAppByKeyHook();
|
|
4625
4655
|
const queryFn = ({ signal }) => getAppByKey(key, signal);
|
|
4626
4656
|
return {
|
|
@@ -4666,7 +4696,7 @@ const getGetAllServicesQueryKey = () => {
|
|
|
4666
4696
|
};
|
|
4667
4697
|
const useGetAllServicesQueryOptions = (options) => {
|
|
4668
4698
|
const { query: queryOptions } = options ?? {};
|
|
4669
|
-
const queryKey =
|
|
4699
|
+
const queryKey = queryOptions?.queryKey ?? getGetAllServicesQueryKey();
|
|
4670
4700
|
const getAllServices = useGetAllServicesHook();
|
|
4671
4701
|
const queryFn = ({ signal }) => getAllServices(signal);
|
|
4672
4702
|
return { queryKey, queryFn, ...queryOptions };
|
|
@@ -4716,7 +4746,7 @@ const getGetServiceByKeyQueryKey = (key) => {
|
|
|
4716
4746
|
};
|
|
4717
4747
|
const useGetServiceByKeyQueryOptions = (key, options) => {
|
|
4718
4748
|
const { query: queryOptions } = options ?? {};
|
|
4719
|
-
const queryKey =
|
|
4749
|
+
const queryKey = queryOptions?.queryKey ?? getGetServiceByKeyQueryKey(key);
|
|
4720
4750
|
const getServiceByKey = useGetServiceByKeyHook();
|
|
4721
4751
|
const queryFn = ({ signal }) => getServiceByKey(key, signal);
|
|
4722
4752
|
return {
|
|
@@ -4769,7 +4799,7 @@ const getGetAllCategoriesQueryKey = () => {
|
|
|
4769
4799
|
};
|
|
4770
4800
|
const useGetAllCategoriesQueryOptions = (options) => {
|
|
4771
4801
|
const { query: queryOptions } = options ?? {};
|
|
4772
|
-
const queryKey =
|
|
4802
|
+
const queryKey = queryOptions?.queryKey ?? getGetAllCategoriesQueryKey();
|
|
4773
4803
|
const getAllCategories = useGetAllCategoriesHook();
|
|
4774
4804
|
const queryFn = ({ signal }) => getAllCategories(signal);
|
|
4775
4805
|
return { queryKey, queryFn, ...queryOptions };
|
|
@@ -4819,7 +4849,7 @@ const getGetCategoryByIdQueryKey = (id) => {
|
|
|
4819
4849
|
};
|
|
4820
4850
|
const useGetCategoryByIdQueryOptions = (id, options) => {
|
|
4821
4851
|
const { query: queryOptions } = options ?? {};
|
|
4822
|
-
const queryKey =
|
|
4852
|
+
const queryKey = queryOptions?.queryKey ?? getGetCategoryByIdQueryKey(id);
|
|
4823
4853
|
const getCategoryById = useGetCategoryByIdHook();
|
|
4824
4854
|
const queryFn = ({ signal }) => getCategoryById(id, signal);
|
|
4825
4855
|
return {
|
|
@@ -4872,7 +4902,7 @@ const getStreamEventsQueryKey = () => {
|
|
|
4872
4902
|
};
|
|
4873
4903
|
const useStreamEventsQueryOptions = (options) => {
|
|
4874
4904
|
const { query: queryOptions } = options ?? {};
|
|
4875
|
-
const queryKey =
|
|
4905
|
+
const queryKey = queryOptions?.queryKey ?? getStreamEventsQueryKey();
|
|
4876
4906
|
const streamEvents = useStreamEventsHook();
|
|
4877
4907
|
const queryFn = ({ signal }) => streamEvents(signal);
|
|
4878
4908
|
return { queryKey, queryFn, ...queryOptions };
|
|
@@ -4898,7 +4928,7 @@ const getGetCurrentEnvironmentQueryKey = () => {
|
|
|
4898
4928
|
};
|
|
4899
4929
|
const useGetCurrentEnvironmentQueryOptions = (options) => {
|
|
4900
4930
|
const { query: queryOptions } = options ?? {};
|
|
4901
|
-
const queryKey =
|
|
4931
|
+
const queryKey = queryOptions?.queryKey ?? getGetCurrentEnvironmentQueryKey();
|
|
4902
4932
|
const getCurrentEnvironment = useGetCurrentEnvironmentHook();
|
|
4903
4933
|
const queryFn = ({ signal }) => getCurrentEnvironment(signal);
|
|
4904
4934
|
return { queryKey, queryFn, ...queryOptions };
|
|
@@ -4927,7 +4957,7 @@ const getGetRomaConfigurationByIdQueryKey = (id) => {
|
|
|
4927
4957
|
};
|
|
4928
4958
|
const useGetRomaConfigurationByIdQueryOptions = (id, options) => {
|
|
4929
4959
|
const { query: queryOptions } = options ?? {};
|
|
4930
|
-
const queryKey =
|
|
4960
|
+
const queryKey = queryOptions?.queryKey ?? getGetRomaConfigurationByIdQueryKey(id);
|
|
4931
4961
|
const getRomaConfigurationById = useGetRomaConfigurationByIdHook();
|
|
4932
4962
|
const queryFn = ({ signal }) => getRomaConfigurationById(id, signal);
|
|
4933
4963
|
return {
|
|
@@ -5004,7 +5034,7 @@ const getGetAllRomaConfigurationQueryKey = () => {
|
|
|
5004
5034
|
};
|
|
5005
5035
|
const useGetAllRomaConfigurationQueryOptions = (options) => {
|
|
5006
5036
|
const { query: queryOptions } = options ?? {};
|
|
5007
|
-
const queryKey =
|
|
5037
|
+
const queryKey = queryOptions?.queryKey ?? getGetAllRomaConfigurationQueryKey();
|
|
5008
5038
|
const getAllRomaConfiguration = useGetAllRomaConfigurationHook();
|
|
5009
5039
|
const queryFn = ({ signal }) => getAllRomaConfiguration(signal);
|
|
5010
5040
|
return { queryKey, queryFn, ...queryOptions };
|
|
@@ -5054,7 +5084,7 @@ const getGetAllRomaConfigurationTypesQueryKey = () => {
|
|
|
5054
5084
|
};
|
|
5055
5085
|
const useGetAllRomaConfigurationTypesQueryOptions = (options) => {
|
|
5056
5086
|
const { query: queryOptions } = options ?? {};
|
|
5057
|
-
const queryKey =
|
|
5087
|
+
const queryKey = queryOptions?.queryKey ?? getGetAllRomaConfigurationTypesQueryKey();
|
|
5058
5088
|
const getAllRomaConfigurationTypes = useGetAllRomaConfigurationTypesHook();
|
|
5059
5089
|
const queryFn = ({ signal }) => getAllRomaConfigurationTypes(signal);
|
|
5060
5090
|
return { queryKey, queryFn, ...queryOptions };
|
|
@@ -5080,7 +5110,7 @@ const getGetAllRomaConfigurationByTypeQueryKey = (type) => {
|
|
|
5080
5110
|
};
|
|
5081
5111
|
const useGetAllRomaConfigurationByTypeQueryOptions = (type, options) => {
|
|
5082
5112
|
const { query: queryOptions } = options ?? {};
|
|
5083
|
-
const queryKey =
|
|
5113
|
+
const queryKey = queryOptions?.queryKey ?? getGetAllRomaConfigurationByTypeQueryKey(type);
|
|
5084
5114
|
const getAllRomaConfigurationByType = useGetAllRomaConfigurationByTypeHook();
|
|
5085
5115
|
const queryFn = ({ signal }) => getAllRomaConfigurationByType(type, signal);
|
|
5086
5116
|
return {
|
|
@@ -5139,7 +5169,7 @@ const getListFeedbacksByCurrentUserQueryKey = (params) => {
|
|
|
5139
5169
|
};
|
|
5140
5170
|
const useListFeedbacksByCurrentUserQueryOptions = (params, options) => {
|
|
5141
5171
|
const { query: queryOptions } = options ?? {};
|
|
5142
|
-
const queryKey =
|
|
5172
|
+
const queryKey = queryOptions?.queryKey ?? getListFeedbacksByCurrentUserQueryKey(params);
|
|
5143
5173
|
const listFeedbacksByCurrentUser = useListFeedbacksByCurrentUserHook();
|
|
5144
5174
|
const queryFn = ({ signal }) => listFeedbacksByCurrentUser(params, signal);
|
|
5145
5175
|
return { queryKey, queryFn, ...queryOptions };
|
|
@@ -5396,10 +5426,7 @@ function createIDBPersister(idbValidKey = "reactQuery") {
|
|
|
5396
5426
|
clientState: {
|
|
5397
5427
|
...persistedClient.clientState,
|
|
5398
5428
|
queries: persistedClient.clientState.queries.filter(
|
|
5399
|
-
(query) =>
|
|
5400
|
-
var _a;
|
|
5401
|
-
return query.queryKey.includes("persist") || checkRomaApi(query.queryKey) || ((_a = query.meta) == null ? void 0 : _a.persist);
|
|
5402
|
-
}
|
|
5429
|
+
(query) => query.queryKey.includes("persist") || checkRomaApi(query.queryKey) || query.meta?.persist
|
|
5403
5430
|
)
|
|
5404
5431
|
}
|
|
5405
5432
|
};
|
|
@@ -5449,15 +5476,17 @@ function useGetApiRoles(api, defaultEmptyArray = true) {
|
|
|
5449
5476
|
useEffect(() => {
|
|
5450
5477
|
serviceDiscovery.resolveService(api).then(async (s) => {
|
|
5451
5478
|
const jwt = await auth.acquireAccessToken({
|
|
5452
|
-
|
|
5479
|
+
request: {
|
|
5480
|
+
scopes: s.scopes ?? s.defaultScopes
|
|
5481
|
+
}
|
|
5453
5482
|
});
|
|
5454
5483
|
if (!jwt) {
|
|
5455
5484
|
throw new Error(`No jwt found for ${api}`);
|
|
5456
5485
|
}
|
|
5457
5486
|
const token = parseJwt(jwt);
|
|
5458
|
-
if ((
|
|
5487
|
+
if ((roles?.length ?? 0) === 0) setRoles(token?.roles ?? []);
|
|
5459
5488
|
});
|
|
5460
|
-
}, [api, auth, serviceDiscovery, roles
|
|
5489
|
+
}, [api, auth, serviceDiscovery, roles?.length]);
|
|
5461
5490
|
if (defaultEmptyArray) return roles ?? [];
|
|
5462
5491
|
return roles;
|
|
5463
5492
|
}
|
|
@@ -5656,8 +5685,8 @@ const useManageWatchList = (system) => {
|
|
|
5656
5685
|
}
|
|
5657
5686
|
});
|
|
5658
5687
|
const framework = useFramework();
|
|
5659
|
-
const user = framework.modules.auth.
|
|
5660
|
-
const userId =
|
|
5688
|
+
const user = framework.modules.auth.account;
|
|
5689
|
+
const userId = user?.username.split("@")[0].toLowerCase() ?? "MISSINGUSER";
|
|
5661
5690
|
const queryClient = useQueryClient();
|
|
5662
5691
|
const updateMutator = useUpdateByUserIdAndId();
|
|
5663
5692
|
const createMutator = useCreateSettingByUserId();
|