@prorobotech/openapi-k8s-toolkit 1.3.0-alpha.13 → 1.3.0-alpha.15
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/dist/{index-BA00s3b1.mjs → index-DbdDoNsP.mjs} +159 -48
- package/dist/index-DbdDoNsP.mjs.map +1 -0
- package/dist/{index-Cw_DSYZi.mjs → index-DnswMIbx.mjs} +2 -2
- package/dist/{index-Cw_DSYZi.mjs.map → index-DnswMIbx.mjs.map} +1 -1
- package/dist/openapi-k8s-toolkit.es.js +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +157 -46
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeFormProvider/BlackholeFormProvider.d.ts +7 -0
- package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/ManageableSidebarProvider.d.ts +1 -0
- package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/utils.d.ts +2 -1
- package/dist/types/components/molecules/YamlEditorSingleton/YamlEditorSingleton.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/atoms/modals/AnnotationsEditModal/AnnotationsEditModal.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/atoms/modals/LabelsEditModal/LabelsEditModal.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/atoms/modals/TaintsEditModal/TaintsEditModal.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/atoms/modals/TolerationsEditModal/TolerationsEditModal.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/AggregatedCounterCard/molecules/AnnotationsModal/AnnotationsModal.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/AggregatedCounterCard/molecules/LabelsModal/LabelsModal.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/AggregatedCounterCard/molecules/TaintsModal/TaintsModal.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/AggregatedCounterCard/molecules/TolerationsModal/TolerationsModal.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/AggregatedCounterCard/utils.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/types/YamlEditorSingleton.d.ts +13 -0
- package/package.json +1 -1
- package/dist/index-BA00s3b1.mjs.map +0 -1
|
@@ -9767,13 +9767,31 @@ const mapLinksFromRaw = ({
|
|
|
9767
9767
|
const findMatchingItems = ({
|
|
9768
9768
|
items,
|
|
9769
9769
|
pathname,
|
|
9770
|
+
searchParams,
|
|
9770
9771
|
tags
|
|
9771
9772
|
}) => {
|
|
9773
|
+
const normalizePath = (value) => {
|
|
9774
|
+
if (!value) {
|
|
9775
|
+
return void 0;
|
|
9776
|
+
}
|
|
9777
|
+
return value.startsWith("/") ? value.slice(1) : value;
|
|
9778
|
+
};
|
|
9772
9779
|
const traverse = (nodes, parents) => nodes.flatMap((node) => {
|
|
9773
9780
|
const currentPath = [...parents, node.key ? node.key : String(node.key)];
|
|
9774
|
-
const cleanNodeInternalMetaLink =
|
|
9775
|
-
const cleanPathname = pathname.
|
|
9776
|
-
|
|
9781
|
+
const cleanNodeInternalMetaLink = normalizePath(node.internalMetaLink);
|
|
9782
|
+
const cleanPathname = normalizePath(pathname.split("?")[0]);
|
|
9783
|
+
let searchSuffix;
|
|
9784
|
+
if (searchParams && searchParams.length > 0) {
|
|
9785
|
+
searchSuffix = searchParams.startsWith("?") ? searchParams : `?${searchParams}`;
|
|
9786
|
+
}
|
|
9787
|
+
let pathnameWithSearch;
|
|
9788
|
+
if (searchSuffix) {
|
|
9789
|
+
pathnameWithSearch = `${pathname}${searchSuffix}`;
|
|
9790
|
+
} else if (pathname.includes("?")) {
|
|
9791
|
+
pathnameWithSearch = pathname;
|
|
9792
|
+
}
|
|
9793
|
+
const cleanPathnameWithSearch = normalizePath(pathnameWithSearch);
|
|
9794
|
+
const matched = cleanNodeInternalMetaLink === cleanPathname || cleanPathnameWithSearch && cleanNodeInternalMetaLink === cleanPathnameWithSearch ? currentPath : [];
|
|
9777
9795
|
const tagsToMatch = tags && tags.keysAndTags && node.key ? tags.keysAndTags[typeof node.key === "string" ? node.key : String(node.key)] : void 0;
|
|
9778
9796
|
const matchedByTags = tags && tags.currentTags && tagsToMatch && tagsToMatch.some((tag) => tags.currentTags?.includes(tag)) ? currentPath : [];
|
|
9779
9797
|
let childrenResults = [];
|
|
@@ -9788,6 +9806,7 @@ const prepareDataForManageableSidebar = ({
|
|
|
9788
9806
|
data,
|
|
9789
9807
|
replaceValues,
|
|
9790
9808
|
pathname,
|
|
9809
|
+
searchParams,
|
|
9791
9810
|
idToCompare,
|
|
9792
9811
|
fallbackIdToCompare,
|
|
9793
9812
|
currentTags
|
|
@@ -9807,6 +9826,7 @@ const prepareDataForManageableSidebar = ({
|
|
|
9807
9826
|
const openedKeys = result?.menuItems ? findMatchingItems({
|
|
9808
9827
|
items: result?.menuItems,
|
|
9809
9828
|
pathname,
|
|
9829
|
+
searchParams,
|
|
9810
9830
|
tags: { keysAndTags: foundData.keysAndTags, currentTags: preparedCurrentTags }
|
|
9811
9831
|
}) : [];
|
|
9812
9832
|
const stringedOpenedKeys = openedKeys.map((el) => typeof el === "string" ? el : String(el));
|
|
@@ -9821,6 +9841,7 @@ const ManageableSidebarProvider = ({
|
|
|
9821
9841
|
isEnabled,
|
|
9822
9842
|
replaceValues,
|
|
9823
9843
|
pathname,
|
|
9844
|
+
searchParams,
|
|
9824
9845
|
idToCompare,
|
|
9825
9846
|
fallbackIdToCompare,
|
|
9826
9847
|
currentTags,
|
|
@@ -9858,6 +9879,7 @@ const ManageableSidebarProvider = ({
|
|
|
9858
9879
|
data: parsedData,
|
|
9859
9880
|
replaceValues,
|
|
9860
9881
|
pathname,
|
|
9882
|
+
searchParams,
|
|
9861
9883
|
idToCompare,
|
|
9862
9884
|
fallbackIdToCompare,
|
|
9863
9885
|
currentTags
|
|
@@ -43142,7 +43164,8 @@ const YamlEditorSingleton$1 = ({
|
|
|
43142
43164
|
designNewLayout,
|
|
43143
43165
|
designNewLayoutHeight,
|
|
43144
43166
|
openNotification,
|
|
43145
|
-
readOnly = false
|
|
43167
|
+
readOnly = false,
|
|
43168
|
+
canEdit
|
|
43146
43169
|
}) => {
|
|
43147
43170
|
const { token } = theme.useToken();
|
|
43148
43171
|
const navigate = useNavigate();
|
|
@@ -43266,7 +43289,7 @@ const YamlEditorSingleton$1 = ({
|
|
|
43266
43289
|
}
|
|
43267
43290
|
) }),
|
|
43268
43291
|
!readOnly && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$y.ControlsRowContainer, { $bgColor: token.colorPrimaryBg, $designNewLayout: designNewLayout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: designNewLayout ? 10 : 16, align: "center", children: [
|
|
43269
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "primary", onClick: onSubmit, loading: isLoading, children: "Submit" }),
|
|
43292
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "primary", onClick: onSubmit, loading: isLoading, disabled: canEdit === false, children: "Submit" }),
|
|
43270
43293
|
backlink && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => navigate(backlink), children: "Cancel" }),
|
|
43271
43294
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: handleReload, children: "Reload" })
|
|
43272
43295
|
] }) }),
|
|
@@ -43337,6 +43360,8 @@ const YamlEditorSingleton = ({
|
|
|
43337
43360
|
prefillValuesRequestIndex,
|
|
43338
43361
|
pathToData,
|
|
43339
43362
|
substractHeight,
|
|
43363
|
+
permissions,
|
|
43364
|
+
permissionContext,
|
|
43340
43365
|
...props
|
|
43341
43366
|
} = data;
|
|
43342
43367
|
const [height, setHeight] = useState(0);
|
|
@@ -43357,6 +43382,26 @@ const YamlEditorSingleton = ({
|
|
|
43357
43382
|
acc[index.toString()] = value;
|
|
43358
43383
|
return acc;
|
|
43359
43384
|
}, {});
|
|
43385
|
+
const safeMultiQueryData = multiQueryData || {};
|
|
43386
|
+
const permissionContextPrepared = permissionContext ? {
|
|
43387
|
+
cluster: parseAll({ text: permissionContext.cluster, replaceValues, multiQueryData: safeMultiQueryData }),
|
|
43388
|
+
namespace: permissionContext.namespace ? parseAll({ text: permissionContext.namespace, replaceValues, multiQueryData: safeMultiQueryData }) : void 0,
|
|
43389
|
+
apiGroup: permissionContext.apiGroup ? parseAll({ text: permissionContext.apiGroup, replaceValues, multiQueryData: safeMultiQueryData }) : void 0,
|
|
43390
|
+
plural: parseAll({ text: permissionContext.plural, replaceValues, multiQueryData: safeMultiQueryData })
|
|
43391
|
+
} : void 0;
|
|
43392
|
+
const isPermissionContextValid = !!permissionContextPrepared && !isMultiqueryLoading && !!permissionContextPrepared.cluster && permissionContextPrepared.cluster !== "-" && !!permissionContextPrepared.plural && permissionContextPrepared.plural !== "-";
|
|
43393
|
+
const updatePermission = usePermissions({
|
|
43394
|
+
cluster: permissionContextPrepared?.cluster || "",
|
|
43395
|
+
namespace: permissionContextPrepared?.namespace,
|
|
43396
|
+
apiGroup: permissionContextPrepared?.apiGroup,
|
|
43397
|
+
plural: permissionContextPrepared?.plural || "",
|
|
43398
|
+
verb: "update",
|
|
43399
|
+
refetchInterval: false,
|
|
43400
|
+
enabler: isPermissionContextValid
|
|
43401
|
+
});
|
|
43402
|
+
const canUpdate = permissions?.canUpdate ?? updatePermission.data?.status.allowed;
|
|
43403
|
+
const shouldGateEdit = Boolean(permissions || permissionContext);
|
|
43404
|
+
const canEdit = !shouldGateEdit || canUpdate === true;
|
|
43360
43405
|
const clusterPrepared = parseAll({ text: cluster, replaceValues, multiQueryData });
|
|
43361
43406
|
const apiGroupPrepared = apiGroup ? parseAll({ text: apiGroup, replaceValues, multiQueryData }) : "no-api-group";
|
|
43362
43407
|
const apiVersionPrepared = apiVersion ? parseAll({ text: apiVersion, replaceValues, multiQueryData }) : "no-api-version";
|
|
@@ -43382,6 +43427,7 @@ const YamlEditorSingleton = ({
|
|
|
43382
43427
|
designNewLayout: true,
|
|
43383
43428
|
designNewLayoutHeight: height,
|
|
43384
43429
|
openNotification: true,
|
|
43430
|
+
canEdit,
|
|
43385
43431
|
...props
|
|
43386
43432
|
}
|
|
43387
43433
|
),
|
|
@@ -43824,6 +43870,7 @@ const LabelsEditModal = ({
|
|
|
43824
43870
|
close,
|
|
43825
43871
|
values,
|
|
43826
43872
|
openNotificationSuccess,
|
|
43873
|
+
disableSubmit,
|
|
43827
43874
|
modalTitle,
|
|
43828
43875
|
modalDescriptionText,
|
|
43829
43876
|
inputLabel,
|
|
@@ -43885,6 +43932,7 @@ const LabelsEditModal = ({
|
|
|
43885
43932
|
setError(void 0);
|
|
43886
43933
|
},
|
|
43887
43934
|
okText: "Save",
|
|
43935
|
+
okButtonProps: { disabled: disableSubmit },
|
|
43888
43936
|
confirmLoading: isLoading,
|
|
43889
43937
|
maskClosable: false,
|
|
43890
43938
|
width: editModalWidth || 520,
|
|
@@ -43960,6 +44008,7 @@ const TaintsEditModal = ({
|
|
|
43960
44008
|
close,
|
|
43961
44009
|
values,
|
|
43962
44010
|
openNotificationSuccess,
|
|
44011
|
+
disableSubmit,
|
|
43963
44012
|
modalTitle,
|
|
43964
44013
|
modalDescriptionText,
|
|
43965
44014
|
inputLabel,
|
|
@@ -44015,6 +44064,7 @@ const TaintsEditModal = ({
|
|
|
44015
44064
|
setError(void 0);
|
|
44016
44065
|
},
|
|
44017
44066
|
okText: "Save",
|
|
44067
|
+
okButtonProps: { disabled: disableSubmit },
|
|
44018
44068
|
confirmLoading: isLoading,
|
|
44019
44069
|
maskClosable: false,
|
|
44020
44070
|
width: editModalWidth || 520,
|
|
@@ -44106,6 +44156,7 @@ const TolerationsEditModal = ({
|
|
|
44106
44156
|
close,
|
|
44107
44157
|
values,
|
|
44108
44158
|
openNotificationSuccess,
|
|
44159
|
+
disableSubmit,
|
|
44109
44160
|
modalTitle,
|
|
44110
44161
|
modalDescriptionText,
|
|
44111
44162
|
inputLabel,
|
|
@@ -44162,6 +44213,7 @@ const TolerationsEditModal = ({
|
|
|
44162
44213
|
setError(void 0);
|
|
44163
44214
|
},
|
|
44164
44215
|
okText: "Save",
|
|
44216
|
+
okButtonProps: { disabled: disableSubmit },
|
|
44165
44217
|
confirmLoading: isLoading,
|
|
44166
44218
|
maskClosable: false,
|
|
44167
44219
|
width: editModalWidth || 520,
|
|
@@ -44293,6 +44345,7 @@ const AnnotationsEditModal = ({
|
|
|
44293
44345
|
close,
|
|
44294
44346
|
values,
|
|
44295
44347
|
openNotificationSuccess,
|
|
44348
|
+
disableSubmit,
|
|
44296
44349
|
modalTitle,
|
|
44297
44350
|
modalDescriptionText,
|
|
44298
44351
|
inputLabel,
|
|
@@ -44354,6 +44407,7 @@ const AnnotationsEditModal = ({
|
|
|
44354
44407
|
setError(void 0);
|
|
44355
44408
|
},
|
|
44356
44409
|
okText: "Save",
|
|
44410
|
+
okButtonProps: { disabled: disableSubmit },
|
|
44357
44411
|
confirmLoading: isLoading,
|
|
44358
44412
|
maskClosable: false,
|
|
44359
44413
|
width: editModalWidth || 520,
|
|
@@ -44468,7 +44522,8 @@ const Labels = ({ data, children }) => {
|
|
|
44468
44522
|
});
|
|
44469
44523
|
const canPatch = permissions?.canPatch ?? patchPermission.data?.status.allowed;
|
|
44470
44524
|
const shouldGateEdit = Boolean(permissions || permissionContext);
|
|
44471
|
-
const
|
|
44525
|
+
const canOpenEdit = !readOnly;
|
|
44526
|
+
const canSubmitEdit = !readOnly && (!shouldGateEdit || canPatch === true);
|
|
44472
44527
|
if (isMultiQueryLoading) {
|
|
44473
44528
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
44474
44529
|
}
|
|
@@ -44508,7 +44563,7 @@ const Labels = ({ data, children }) => {
|
|
|
44508
44563
|
});
|
|
44509
44564
|
};
|
|
44510
44565
|
const EmptySelect = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
44511
|
-
|
|
44566
|
+
canOpenEdit && !verticalViewList && /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { justify: "flex-end", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44512
44567
|
Button,
|
|
44513
44568
|
{
|
|
44514
44569
|
type: "text",
|
|
@@ -44536,7 +44591,7 @@ const Labels = ({ data, children }) => {
|
|
|
44536
44591
|
isCursorPointer: true
|
|
44537
44592
|
}
|
|
44538
44593
|
),
|
|
44539
|
-
|
|
44594
|
+
canOpenEdit && verticalViewList && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
44540
44595
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
|
|
44541
44596
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { justify: "flex-start", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44542
44597
|
Button,
|
|
@@ -44555,12 +44610,13 @@ const Labels = ({ data, children }) => {
|
|
|
44555
44610
|
] }),
|
|
44556
44611
|
children,
|
|
44557
44612
|
contextHolder,
|
|
44558
|
-
|
|
44613
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44559
44614
|
LabelsEditModal,
|
|
44560
44615
|
{
|
|
44561
44616
|
open,
|
|
44562
44617
|
close: () => setOpen(false),
|
|
44563
44618
|
openNotificationSuccess,
|
|
44619
|
+
disableSubmit: !canSubmitEdit,
|
|
44564
44620
|
modalTitle: modalTitlePrepared,
|
|
44565
44621
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
44566
44622
|
modalDescriptionTextStyle,
|
|
@@ -44583,7 +44639,7 @@ const Labels = ({ data, children }) => {
|
|
|
44583
44639
|
}
|
|
44584
44640
|
const labels = Object.entries(labelsRaw).map(([key, value]) => `${key}=${value}`);
|
|
44585
44641
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
44586
|
-
|
|
44642
|
+
canOpenEdit && !verticalViewList && /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { justify: "flex-end", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44587
44643
|
Button,
|
|
44588
44644
|
{
|
|
44589
44645
|
type: "text",
|
|
@@ -44667,7 +44723,7 @@ const Labels = ({ data, children }) => {
|
|
|
44667
44723
|
}
|
|
44668
44724
|
}
|
|
44669
44725
|
),
|
|
44670
|
-
|
|
44726
|
+
canOpenEdit && verticalViewList && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
44671
44727
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
|
|
44672
44728
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { justify: "flex-start", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44673
44729
|
Button,
|
|
@@ -44686,13 +44742,14 @@ const Labels = ({ data, children }) => {
|
|
|
44686
44742
|
] }),
|
|
44687
44743
|
children,
|
|
44688
44744
|
contextHolder,
|
|
44689
|
-
|
|
44745
|
+
canOpenEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44690
44746
|
LabelsEditModal,
|
|
44691
44747
|
{
|
|
44692
44748
|
open,
|
|
44693
44749
|
close: () => setOpen(false),
|
|
44694
44750
|
values: labelsRaw,
|
|
44695
44751
|
openNotificationSuccess,
|
|
44752
|
+
disableSubmit: !canSubmitEdit,
|
|
44696
44753
|
modalTitle: modalTitlePrepared,
|
|
44697
44754
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
44698
44755
|
modalDescriptionTextStyle,
|
|
@@ -44871,7 +44928,7 @@ const Taints = ({ data, children }) => {
|
|
|
44871
44928
|
});
|
|
44872
44929
|
const canPatch = permissions?.canPatch ?? patchPermission.data?.status.allowed;
|
|
44873
44930
|
const shouldGateEdit = Boolean(permissions || permissionContext);
|
|
44874
|
-
const
|
|
44931
|
+
const canSubmitEdit = !shouldGateEdit || canPatch === true;
|
|
44875
44932
|
if (isMultiQueryLoading) {
|
|
44876
44933
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
44877
44934
|
}
|
|
@@ -44916,7 +44973,7 @@ const Taints = ({ data, children }) => {
|
|
|
44916
44973
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
44917
44974
|
errorText,
|
|
44918
44975
|
" ",
|
|
44919
|
-
|
|
44976
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44920
44977
|
Button,
|
|
44921
44978
|
{
|
|
44922
44979
|
type: "text",
|
|
@@ -44930,13 +44987,14 @@ const Taints = ({ data, children }) => {
|
|
|
44930
44987
|
)
|
|
44931
44988
|
] }) }),
|
|
44932
44989
|
contextHolder,
|
|
44933
|
-
|
|
44990
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44934
44991
|
TaintsEditModal,
|
|
44935
44992
|
{
|
|
44936
44993
|
open,
|
|
44937
44994
|
close: () => setOpen(false),
|
|
44938
44995
|
values: taints,
|
|
44939
44996
|
openNotificationSuccess,
|
|
44997
|
+
disableSubmit: !canSubmitEdit,
|
|
44940
44998
|
modalTitle: modalTitlePrepared,
|
|
44941
44999
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
44942
45000
|
modalDescriptionTextStyle,
|
|
@@ -44956,7 +45014,7 @@ const Taints = ({ data, children }) => {
|
|
|
44956
45014
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
44957
45015
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
44958
45016
|
parsedTextWithCounter,
|
|
44959
|
-
|
|
45017
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44960
45018
|
Button,
|
|
44961
45019
|
{
|
|
44962
45020
|
type: "text",
|
|
@@ -44972,13 +45030,14 @@ const Taints = ({ data, children }) => {
|
|
|
44972
45030
|
children
|
|
44973
45031
|
] }),
|
|
44974
45032
|
contextHolder,
|
|
44975
|
-
|
|
45033
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44976
45034
|
TaintsEditModal,
|
|
44977
45035
|
{
|
|
44978
45036
|
open,
|
|
44979
45037
|
close: () => setOpen(false),
|
|
44980
45038
|
values: taints,
|
|
44981
45039
|
openNotificationSuccess,
|
|
45040
|
+
disableSubmit: !canSubmitEdit,
|
|
44982
45041
|
modalTitle: modalTitlePrepared,
|
|
44983
45042
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
44984
45043
|
inputLabel: inputLabelPrepared,
|
|
@@ -45084,7 +45143,7 @@ const Tolerations = ({
|
|
|
45084
45143
|
});
|
|
45085
45144
|
const canPatch = permissions?.canPatch ?? patchPermission.data?.status.allowed;
|
|
45086
45145
|
const shouldGateEdit = Boolean(permissions || permissionContext);
|
|
45087
|
-
const
|
|
45146
|
+
const canSubmitEdit = !shouldGateEdit || canPatch === true;
|
|
45088
45147
|
if (isMultiQueryLoading) {
|
|
45089
45148
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
45090
45149
|
}
|
|
@@ -45128,7 +45187,7 @@ const Tolerations = ({
|
|
|
45128
45187
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45129
45188
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
45130
45189
|
errorText,
|
|
45131
|
-
|
|
45190
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45132
45191
|
Button,
|
|
45133
45192
|
{
|
|
45134
45193
|
type: "text",
|
|
@@ -45142,13 +45201,14 @@ const Tolerations = ({
|
|
|
45142
45201
|
)
|
|
45143
45202
|
] }) }),
|
|
45144
45203
|
contextHolder,
|
|
45145
|
-
|
|
45204
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45146
45205
|
TolerationsEditModal,
|
|
45147
45206
|
{
|
|
45148
45207
|
open,
|
|
45149
45208
|
close: () => setOpen(false),
|
|
45150
45209
|
values: tolerations,
|
|
45151
45210
|
openNotificationSuccess,
|
|
45211
|
+
disableSubmit: !canSubmitEdit,
|
|
45152
45212
|
modalTitle: modalTitlePrepared,
|
|
45153
45213
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
45154
45214
|
modalDescriptionTextStyle,
|
|
@@ -45168,7 +45228,7 @@ const Tolerations = ({
|
|
|
45168
45228
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
45169
45229
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
45170
45230
|
parsedTextWithCounter,
|
|
45171
|
-
|
|
45231
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45172
45232
|
Button,
|
|
45173
45233
|
{
|
|
45174
45234
|
type: "text",
|
|
@@ -45184,13 +45244,14 @@ const Tolerations = ({
|
|
|
45184
45244
|
children
|
|
45185
45245
|
] }),
|
|
45186
45246
|
contextHolder,
|
|
45187
|
-
|
|
45247
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45188
45248
|
TolerationsEditModal,
|
|
45189
45249
|
{
|
|
45190
45250
|
open,
|
|
45191
45251
|
close: () => setOpen(false),
|
|
45192
45252
|
values: tolerations,
|
|
45193
45253
|
openNotificationSuccess,
|
|
45254
|
+
disableSubmit: !canSubmitEdit,
|
|
45194
45255
|
modalTitle: modalTitlePrepared,
|
|
45195
45256
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
45196
45257
|
modalDescriptionTextStyle,
|
|
@@ -45272,7 +45333,7 @@ const Annotations = ({
|
|
|
45272
45333
|
});
|
|
45273
45334
|
const canPatch = permissions?.canPatch ?? patchPermission.data?.status.allowed;
|
|
45274
45335
|
const shouldGateEdit = Boolean(permissions || permissionContext);
|
|
45275
|
-
const
|
|
45336
|
+
const canSubmitEdit = !shouldGateEdit || canPatch === true;
|
|
45276
45337
|
if (isMultiQueryLoading) {
|
|
45277
45338
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
45278
45339
|
}
|
|
@@ -45316,7 +45377,7 @@ const Annotations = ({
|
|
|
45316
45377
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45317
45378
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
45318
45379
|
errorText,
|
|
45319
|
-
|
|
45380
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45320
45381
|
Button,
|
|
45321
45382
|
{
|
|
45322
45383
|
type: "text",
|
|
@@ -45330,13 +45391,14 @@ const Annotations = ({
|
|
|
45330
45391
|
)
|
|
45331
45392
|
] }) }),
|
|
45332
45393
|
contextHolder,
|
|
45333
|
-
|
|
45394
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45334
45395
|
AnnotationsEditModal,
|
|
45335
45396
|
{
|
|
45336
45397
|
open,
|
|
45337
45398
|
close: () => setOpen(false),
|
|
45338
45399
|
values: annotations,
|
|
45339
45400
|
openNotificationSuccess,
|
|
45401
|
+
disableSubmit: !canSubmitEdit,
|
|
45340
45402
|
modalTitle: modalTitlePrepared,
|
|
45341
45403
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
45342
45404
|
modalDescriptionTextStyle,
|
|
@@ -45356,7 +45418,7 @@ const Annotations = ({
|
|
|
45356
45418
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
45357
45419
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
45358
45420
|
parsedTextWithCounter,
|
|
45359
|
-
|
|
45421
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45360
45422
|
Button,
|
|
45361
45423
|
{
|
|
45362
45424
|
type: "text",
|
|
@@ -45372,13 +45434,14 @@ const Annotations = ({
|
|
|
45372
45434
|
children
|
|
45373
45435
|
] }),
|
|
45374
45436
|
contextHolder,
|
|
45375
|
-
|
|
45437
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45376
45438
|
AnnotationsEditModal,
|
|
45377
45439
|
{
|
|
45378
45440
|
open,
|
|
45379
45441
|
close: () => setOpen(false),
|
|
45380
45442
|
values: annotations,
|
|
45381
45443
|
openNotificationSuccess,
|
|
45444
|
+
disableSubmit: !canSubmitEdit,
|
|
45382
45445
|
modalTitle: modalTitlePrepared,
|
|
45383
45446
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
45384
45447
|
modalDescriptionTextStyle,
|
|
@@ -77314,6 +77377,7 @@ const CopyButton = ({
|
|
|
77314
77377
|
const LabelsModal = ({
|
|
77315
77378
|
open,
|
|
77316
77379
|
onClose,
|
|
77380
|
+
disableSubmit,
|
|
77317
77381
|
reqIndex,
|
|
77318
77382
|
jsonPathToLabels,
|
|
77319
77383
|
notificationSuccessMessage,
|
|
@@ -77382,6 +77446,7 @@ const LabelsModal = ({
|
|
|
77382
77446
|
open,
|
|
77383
77447
|
close: onClose,
|
|
77384
77448
|
openNotificationSuccess,
|
|
77449
|
+
disableSubmit,
|
|
77385
77450
|
modalTitle: modalTitlePrepared,
|
|
77386
77451
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
77387
77452
|
modalDescriptionTextStyle,
|
|
@@ -77411,6 +77476,7 @@ const LabelsModal = ({
|
|
|
77411
77476
|
close: onClose,
|
|
77412
77477
|
values: labelsRaw,
|
|
77413
77478
|
openNotificationSuccess,
|
|
77479
|
+
disableSubmit,
|
|
77414
77480
|
modalTitle: modalTitlePrepared,
|
|
77415
77481
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
77416
77482
|
modalDescriptionTextStyle,
|
|
@@ -77430,6 +77496,7 @@ const LabelsModal = ({
|
|
|
77430
77496
|
const AnnotationsModal = ({
|
|
77431
77497
|
open,
|
|
77432
77498
|
onClose,
|
|
77499
|
+
disableSubmit,
|
|
77433
77500
|
reqIndex,
|
|
77434
77501
|
jsonPathToObj,
|
|
77435
77502
|
notificationSuccessMessage,
|
|
@@ -77500,6 +77567,7 @@ const AnnotationsModal = ({
|
|
|
77500
77567
|
close: onClose,
|
|
77501
77568
|
values: annotations,
|
|
77502
77569
|
openNotificationSuccess,
|
|
77570
|
+
disableSubmit,
|
|
77503
77571
|
modalTitle: modalTitlePrepared,
|
|
77504
77572
|
modalDescriptionText: errorArrayOfObjects,
|
|
77505
77573
|
modalDescriptionTextStyle,
|
|
@@ -77522,6 +77590,7 @@ const AnnotationsModal = ({
|
|
|
77522
77590
|
close: onClose,
|
|
77523
77591
|
values: annotations,
|
|
77524
77592
|
openNotificationSuccess,
|
|
77593
|
+
disableSubmit,
|
|
77525
77594
|
modalTitle: modalTitlePrepared,
|
|
77526
77595
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
77527
77596
|
modalDescriptionTextStyle,
|
|
@@ -77539,6 +77608,7 @@ const AnnotationsModal = ({
|
|
|
77539
77608
|
const TaintsModal = ({
|
|
77540
77609
|
open,
|
|
77541
77610
|
onClose,
|
|
77611
|
+
disableSubmit,
|
|
77542
77612
|
reqIndex,
|
|
77543
77613
|
jsonPathToArray,
|
|
77544
77614
|
notificationSuccessMessage,
|
|
@@ -77608,6 +77678,7 @@ const TaintsModal = ({
|
|
|
77608
77678
|
close: onClose,
|
|
77609
77679
|
values: taints,
|
|
77610
77680
|
openNotificationSuccess,
|
|
77681
|
+
disableSubmit,
|
|
77611
77682
|
modalTitle: modalTitlePrepared,
|
|
77612
77683
|
modalDescriptionText: errorArrayOfObjects,
|
|
77613
77684
|
modalDescriptionTextStyle,
|
|
@@ -77630,6 +77701,7 @@ const TaintsModal = ({
|
|
|
77630
77701
|
close: onClose,
|
|
77631
77702
|
values: taints,
|
|
77632
77703
|
openNotificationSuccess,
|
|
77704
|
+
disableSubmit,
|
|
77633
77705
|
modalTitle: modalTitlePrepared,
|
|
77634
77706
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
77635
77707
|
inputLabel: inputLabelPrepared,
|
|
@@ -77647,6 +77719,7 @@ const TaintsModal = ({
|
|
|
77647
77719
|
const TolerationsModal = ({
|
|
77648
77720
|
open,
|
|
77649
77721
|
onClose,
|
|
77722
|
+
disableSubmit,
|
|
77650
77723
|
reqIndex,
|
|
77651
77724
|
jsonPathToArray,
|
|
77652
77725
|
notificationSuccessMessage,
|
|
@@ -77717,6 +77790,7 @@ const TolerationsModal = ({
|
|
|
77717
77790
|
close: onClose,
|
|
77718
77791
|
values: tolerations,
|
|
77719
77792
|
openNotificationSuccess,
|
|
77793
|
+
disableSubmit,
|
|
77720
77794
|
modalTitle: modalTitlePrepared,
|
|
77721
77795
|
modalDescriptionText: errorArrayOfObjects,
|
|
77722
77796
|
modalDescriptionTextStyle,
|
|
@@ -77739,6 +77813,7 @@ const TolerationsModal = ({
|
|
|
77739
77813
|
close: onClose,
|
|
77740
77814
|
values: tolerations,
|
|
77741
77815
|
openNotificationSuccess,
|
|
77816
|
+
disableSubmit,
|
|
77742
77817
|
modalTitle: modalTitlePrepared,
|
|
77743
77818
|
modalDescriptionText: modalDescriptionTextPrepared,
|
|
77744
77819
|
modalDescriptionTextStyle,
|
|
@@ -77754,21 +77829,22 @@ const TolerationsModal = ({
|
|
|
77754
77829
|
};
|
|
77755
77830
|
|
|
77756
77831
|
const LazyEnrichedTableModal = lazy(
|
|
77757
|
-
() => import('./index-
|
|
77832
|
+
() => import('./index-DnswMIbx.mjs').then((mod) => ({ default: mod.EnrichedTableModal }))
|
|
77758
77833
|
);
|
|
77759
77834
|
const renderActiveType = (activeType, extraProps) => {
|
|
77760
77835
|
if (!activeType) return null;
|
|
77836
|
+
const { open, onClose, disableSubmit } = extraProps;
|
|
77761
77837
|
switch (activeType.type) {
|
|
77762
77838
|
case "labels":
|
|
77763
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(LabelsModal, { ...activeType.props,
|
|
77839
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(LabelsModal, { ...activeType.props, open, onClose, disableSubmit });
|
|
77764
77840
|
case "annotations":
|
|
77765
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(AnnotationsModal, { ...activeType.props,
|
|
77841
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(AnnotationsModal, { ...activeType.props, open, onClose, disableSubmit });
|
|
77766
77842
|
case "taints":
|
|
77767
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(TaintsModal, { ...activeType.props,
|
|
77843
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TaintsModal, { ...activeType.props, open, onClose, disableSubmit });
|
|
77768
77844
|
case "tolerations":
|
|
77769
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(TolerationsModal, { ...activeType.props,
|
|
77845
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TolerationsModal, { ...activeType.props, open, onClose, disableSubmit });
|
|
77770
77846
|
case "table":
|
|
77771
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(LazyEnrichedTableModal, { ...activeType.props,
|
|
77847
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(LazyEnrichedTableModal, { ...activeType.props, open, onClose }) });
|
|
77772
77848
|
default: {
|
|
77773
77849
|
const _exhaustive = activeType;
|
|
77774
77850
|
return _exhaustive;
|
|
@@ -77889,7 +77965,8 @@ const AggregatedCounterCard = ({ data, children }) => {
|
|
|
77889
77965
|
});
|
|
77890
77966
|
const canPatch = patchActiveType?.props.permissions?.canPatch ?? patchPermission.data?.status.allowed;
|
|
77891
77967
|
const shouldGateEdit = Boolean(patchActiveType?.props.permissions || patchActiveType?.props.permissionContext);
|
|
77892
|
-
const canOpenActiveType = !!activeType
|
|
77968
|
+
const canOpenActiveType = !!activeType;
|
|
77969
|
+
const canSubmitActiveType = !patchActiveType || !shouldGateEdit || canPatch === true;
|
|
77893
77970
|
useEffect(() => {
|
|
77894
77971
|
if (open && !canOpenActiveType) {
|
|
77895
77972
|
setOpen(false);
|
|
@@ -77988,7 +78065,11 @@ const AggregatedCounterCard = ({ data, children }) => {
|
|
|
77988
78065
|
]
|
|
77989
78066
|
}
|
|
77990
78067
|
),
|
|
77991
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$o.HiddenContainer, { $isHidden: !open, children: canOpenActiveType && renderActiveType(activeType, {
|
|
78068
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$o.HiddenContainer, { $isHidden: !open, children: canOpenActiveType && renderActiveType(activeType, {
|
|
78069
|
+
open,
|
|
78070
|
+
onClose: () => setOpen(false),
|
|
78071
|
+
disableSubmit: !canSubmitActiveType
|
|
78072
|
+
}) }),
|
|
77992
78073
|
children
|
|
77993
78074
|
] });
|
|
77994
78075
|
};
|
|
@@ -83643,14 +83724,6 @@ const BlackholeForm = ({
|
|
|
83643
83724
|
message: "Only the data from the form will be sent. Empty fields will be removed recursively."
|
|
83644
83725
|
}
|
|
83645
83726
|
)
|
|
83646
|
-
] }),
|
|
83647
|
-
isCreate && createPermission.data?.status.allowed === false && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
83648
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
|
|
83649
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { type: "warning", message: "Insufficient rights to create" })
|
|
83650
|
-
] }),
|
|
83651
|
-
!isCreate && updatePermission.data?.status.allowed === false && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
83652
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
|
|
83653
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { type: "warning", message: "Insufficient rights to edit" })
|
|
83654
83727
|
] })
|
|
83655
83728
|
]
|
|
83656
83729
|
}
|
|
@@ -83668,7 +83741,16 @@ const BlackholeForm = ({
|
|
|
83668
83741
|
] }),
|
|
83669
83742
|
/* @__PURE__ */ jsxRuntimeExports.jsx(FlexGrow, {}),
|
|
83670
83743
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$h.ControlsRowContainer, { $bgColor: token.colorPrimaryBg, $designNewLayout: designNewLayout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: designNewLayout ? 10 : 16, align: "center", children: [
|
|
83671
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
83744
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
83745
|
+
Button,
|
|
83746
|
+
{
|
|
83747
|
+
type: "primary",
|
|
83748
|
+
onClick: onSubmit,
|
|
83749
|
+
loading: isLoading,
|
|
83750
|
+
disabled: isCreate && createPermission.data?.status.allowed !== true || !isCreate && updatePermission.data?.status.allowed !== true,
|
|
83751
|
+
children: "Submit"
|
|
83752
|
+
}
|
|
83753
|
+
),
|
|
83672
83754
|
backlink && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => navigate(backlink), children: "Cancel" }),
|
|
83673
83755
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => setIsDebugModalOpen(true), icon: /* @__PURE__ */ jsxRuntimeExports.jsx(BugOutlined, {}) }),
|
|
83674
83756
|
designNewLayout && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { children: "Only the data from the form will be sent. Empty fields will be removed recursively." }) })
|
|
@@ -83721,6 +83803,7 @@ const BlackholeFormProvider = ({
|
|
|
83721
83803
|
urlParamsForPermissions,
|
|
83722
83804
|
data,
|
|
83723
83805
|
customizationId,
|
|
83806
|
+
forcingCustomization,
|
|
83724
83807
|
isCreate,
|
|
83725
83808
|
backlink,
|
|
83726
83809
|
modeData,
|
|
@@ -83728,21 +83811,49 @@ const BlackholeFormProvider = ({
|
|
|
83728
83811
|
designNewLayoutHeight
|
|
83729
83812
|
}) => {
|
|
83730
83813
|
const [preparedData, setPreparedData] = useState();
|
|
83731
|
-
const [isLoading, setIsLoading] = useState(
|
|
83814
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
83732
83815
|
const [isNamespaced, setIsNamespaced] = useState(false);
|
|
83733
83816
|
const [isError, setIsError] = useState(false);
|
|
83817
|
+
const { data: overridesData, isLoading: overridesLoading } = useK8sSmartResource({
|
|
83818
|
+
cluster,
|
|
83819
|
+
apiGroup: forcingCustomization.baseApiGroup,
|
|
83820
|
+
apiVersion: forcingCustomization.baseApiVersion,
|
|
83821
|
+
plural: "customformsoverrides",
|
|
83822
|
+
isEnabled: Boolean(cluster && forcingCustomization.baseApiGroup && forcingCustomization.baseApiVersion)
|
|
83823
|
+
});
|
|
83824
|
+
const { data: mappingData, isLoading: mappingLoading } = useK8sSmartResource({
|
|
83825
|
+
cluster,
|
|
83826
|
+
apiGroup: forcingCustomization.baseApiGroup,
|
|
83827
|
+
apiVersion: forcingCustomization.baseApiVersion,
|
|
83828
|
+
plural: forcingCustomization.cfoMappingPlural,
|
|
83829
|
+
fieldSelector: `metadata.name=${forcingCustomization.cfoMappinResourceName}`,
|
|
83830
|
+
isEnabled: Boolean(
|
|
83831
|
+
cluster && forcingCustomization.baseApiGroup && forcingCustomization.baseApiVersion && forcingCustomization.cfoMappingPlural && forcingCustomization.cfoMappinResourceName
|
|
83832
|
+
)
|
|
83833
|
+
});
|
|
83734
83834
|
const fallbackToManualMode = useCallback(() => {
|
|
83735
83835
|
if (modeData) {
|
|
83736
83836
|
modeData.onChange("Manual");
|
|
83737
83837
|
modeData.onDisabled();
|
|
83738
83838
|
}
|
|
83739
83839
|
}, [modeData]);
|
|
83840
|
+
const forcedCustomizationId = customizationId ? mappingData?.items?.[0]?.spec?.mappings?.[customizationId] : void 0;
|
|
83841
|
+
const hasMatchingOverride = Boolean(
|
|
83842
|
+
customizationId && overridesData?.items?.some((item) => item?.spec?.customizationId === customizationId)
|
|
83843
|
+
);
|
|
83844
|
+
const hasForcedMatchingOverride = Boolean(
|
|
83845
|
+
forcedCustomizationId && overridesData?.items?.some((item) => item?.spec?.customizationId === forcedCustomizationId)
|
|
83846
|
+
);
|
|
83847
|
+
const isResolutionReady = !customizationId || !overridesLoading && !mappingLoading;
|
|
83848
|
+
const resolvedCustomizationId = isResolutionReady ? hasMatchingOverride ? customizationId : hasForcedMatchingOverride ? forcedCustomizationId : forcingCustomization.fallbackId : void 0;
|
|
83740
83849
|
useEffect(() => {
|
|
83850
|
+
if (!isResolutionReady) return;
|
|
83851
|
+
if (customizationId && !resolvedCustomizationId) return;
|
|
83741
83852
|
setIsLoading(true);
|
|
83742
83853
|
const payload = {
|
|
83743
83854
|
data,
|
|
83744
83855
|
cluster,
|
|
83745
|
-
customizationId
|
|
83856
|
+
customizationId: resolvedCustomizationId
|
|
83746
83857
|
};
|
|
83747
83858
|
axios.post(`/api/clusters/${cluster}/openapi-bff/forms/formPrepare/prepareFormProps`, payload).then(({ data: data2 }) => {
|
|
83748
83859
|
if (data2.isNamespaced) {
|
|
@@ -83771,7 +83882,7 @@ const BlackholeFormProvider = ({
|
|
|
83771
83882
|
}).finally(() => {
|
|
83772
83883
|
setIsLoading(false);
|
|
83773
83884
|
});
|
|
83774
|
-
}, [cluster, data, customizationId, fallbackToManualMode]);
|
|
83885
|
+
}, [cluster, data, customizationId, resolvedCustomizationId, isResolutionReady, fallbackToManualMode]);
|
|
83775
83886
|
if (isLoading) {
|
|
83776
83887
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {});
|
|
83777
83888
|
}
|
|
@@ -88328,4 +88439,4 @@ const usePluginManifest = ({
|
|
|
88328
88439
|
};
|
|
88329
88440
|
|
|
88330
88441
|
export { useInfiniteSentinel as $, getBuiltinResourceTypes as A, getCrdData as B, getDirectUnknownResource as C, DeleteIcon as D, EnrichedTableProvider as E, checkPermission as F, getSwagger as G, filterIfApiInstanceNamespaceScoped as H, filterIfBuiltInInstanceNamespaceScoped as I, checkIfApiInstanceNamespaceScoped as J, checkIfBuiltInInstanceNamespaceScoped as K, getKinds as L, useClusterList as M, useApiResources as N, useApiResourceSingle as O, PaddingContainer as P, useBuiltinResources as Q, useBuiltinResourceSingle as R, Spacer$1 as S, useCrdResources as T, useCrdResourceSingle as U, useApisResourceTypes as V, useApiResourceTypesByGroup as W, useBuiltinResourceTypes as X, useCrdData as Y, useListWatch as Z, _$1 as _, useTheme as a, getAllPathsFromObj as a$, useK8sVerbs as a0, useManyK8sSmartResource as a1, useSmartResourceParams as a2, useResourceScope as a3, useKinds as a4, usePluginManifest as a5, TreeWithSearch as a6, UpIcon as a7, DownIcon as a8, BackToDefaultIcon as a9, getEnrichedColumnsWithControls as aA, YamlEditorSingleton$1 as aB, BlackholeFormProvider as aC, BlackholeForm as aD, getObjectFormItemsDraft as aE, MarketPlace as aF, MarketplaceCard as aG, ProjectInfoCard as aH, PodTerminal as aI, NodeTerminal as aJ, PodLogs as aK, PodLogsMonaco as aL, VMVNC as aM, Search as aN, Events as aO, DynamicRenderer as aP, DynamicComponents as aQ, DynamicRendererWithProviders as aR, prepareTemplate as aS, isFlatObject as aT, filterSelectOptions as aU, getStringByName as aV, floorToDecimal as aW, parseQuotaValue as aX, parseQuotaValueCpu as aY, parseQuotaValueMemoryAndStorage as aZ, normalizeValuesForQuotasToNumber as a_, SuccessIcon as aa, feedbackIcons as ab, PlusIcon as ac, MinusIcon as ad, LockedIcon as ae, UnlockedIcon as af, PauseCircleIcon as ag, ResumeCircleIcon as ah, LookingGlassIcon as ai, EarthIcon as aj, ContentCard$1 as ak, FlexGrow as al, UncontrolledSelect as am, CustomSelect$4 as an, CursorPointerTag as ao, CursorPointerTagMinContent as ap, CursorDefaultDiv as aq, ResourceLink as ar, ManageableBreadcrumbsProvider as as, prepareDataForManageableBreadcrumbs as at, ManageableBreadcrumbs as au, ManageableSidebarProvider as av, prepareDataForManageableSidebar as aw, ManageableSidebar as ax, EnrichedTable as ay, getEnrichedColumns as az, usePartsOfUrl as b, getPrefixSubarrays as b0, groupsToTreeData as b1, getBuiltinTreeData as b2, getGroupsByCategory as b3, createContextFactory as b4, prepareUrlsToFetchForDynamicRenderer as b5, deepMerge as b6, getSortedKinds as b7, getSortedKindsAll as b8, hslFromString as b9, getUppercase as ba, kindByGvr as bb, pluralByKind as bc, namespacedByGvr as bd, getLinkToBuiltinForm as be, getLinkToApiForm as bf, isMultilineString as bg, isMultilineFromYaml as bh, includesArray as bi, getResourceLink as bj, getNamespaceLink as bk, convertBytes as bl, formatBytesAuto as bm, toBytes as bn, convertStorage as bo, parseValueWithUnit as bp, convertCores as bq, formatCoresAuto as br, toCores as bs, convertCompute as bt, parseCoresWithUnit as bu, formatDateAuto as bv, isValidRFC3339 as bw, usePermissions as c, jp as d, useDirectUnknownResource as e, useK8sSmartResource as f, EditIcon as g, getLinkToForm as h, DeleteModal as i, jsxRuntimeExports as j, DeleteModalMany as k, getClusterList as l, createNewEntry as m, updateEntry as n, deleteEntry as o, parseAll as p, getApiResources as q, getApiResourceSingle as r, serializeLabelsWithNoEncoding$1 as s, getBuiltinResources as t, useMultiQuery as u, getBuiltinResourceSingle as v, getCrdResources as w, getCrdResourceSingle as x, getApiResourceTypes as y, getApiResourceTypesByApiGroup as z };
|
|
88331
|
-
//# sourceMappingURL=index-
|
|
88442
|
+
//# sourceMappingURL=index-DbdDoNsP.mjs.map
|