@prorobotech/openapi-k8s-toolkit 1.4.0-alpha.11 → 1.4.0-alpha.12
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-BFOfLNYM.mjs → index-CWMOa8gQ.mjs} +149 -58
- package/dist/index-CWMOa8gQ.mjs.map +1 -0
- package/dist/{index-5aIG7VIs.mjs → index-DlJkWTNK.mjs} +2 -2
- package/dist/{index-5aIG7VIs.mjs.map → index-DlJkWTNK.mjs.map} +1 -1
- package/dist/openapi-k8s-toolkit.es.js +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +146 -55
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/TrimmedTags/styled.d.ts +851 -0
- package/dist/types/components/molecules/YamlEditorSingleton/utils.d.ts +5 -1
- package/dist/types/localTypes/dynamicRender.d.ts +1 -0
- package/package.json +1 -1
- package/dist/index-BFOfLNYM.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled, { css, createGlobalStyle } from 'styled-components';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default, { useState, useRef, useLayoutEffect, useReducer, useEffect, useCallback, useMemo, Fragment, createContext, useContext, memo, createElement, isValidElement, cloneElement, useInsertionEffect, useSyncExternalStore, forwardRef, useImperativeHandle, PureComponent, Children, Component, lazy, Suspense } from 'react';
|
|
4
|
-
import { Input, Tree, Modal, Alert, theme, Select, Tag, Flex, Typography, Breadcrumb, Spin, Menu, Tooltip as Tooltip$1, Space, Button, Card as Card$2, Row, Col, Tabs, notification, Form,
|
|
4
|
+
import { Input, Tree, Modal, Alert, theme, Select, Tag, Flex, Typography, Breadcrumb, Spin, Menu, Tooltip as Tooltip$1, Space, Button, ConfigProvider, Popover, Card as Card$2, Row, Col, Tabs, notification, Form, Switch, Segmented, Table, Progress, Statistic, message, InputNumber, Dropdown, Slider, Result, DatePicker, Radio, Checkbox, Empty } from 'antd';
|
|
5
5
|
import * as AntIcons from '@ant-design/icons';
|
|
6
6
|
import { LoadingOutlined, ExclamationCircleFilled, CloseCircleFilled, CheckCircleFilled, PlusOutlined, ClearOutlined, MinusOutlined, CaretDownOutlined, CaretRightOutlined, InfoCircleOutlined, SearchOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined, WarningOutlined, MoreOutlined, DownOutlined, QuestionCircleOutlined, CheckOutlined, CloseOutlined, BugOutlined, EllipsisOutlined, PoweroffOutlined, FullscreenExitOutlined, FullscreenOutlined, SettingOutlined, ReloadOutlined } from '@ant-design/icons';
|
|
7
7
|
import { useNavigate, useSearchParams, Link, useLocation, useParams } from 'react-router-dom';
|
|
@@ -1578,7 +1578,7 @@ const CustomTreeProvider = styled.div`
|
|
|
1578
1578
|
justify-content: center;
|
|
1579
1579
|
}
|
|
1580
1580
|
`;
|
|
1581
|
-
const Styled$
|
|
1581
|
+
const Styled$J = {
|
|
1582
1582
|
CustomTreeProvider
|
|
1583
1583
|
};
|
|
1584
1584
|
|
|
@@ -1643,7 +1643,7 @@ const TreeWithSearch = ({ treeData, onSelect }) => {
|
|
|
1643
1643
|
});
|
|
1644
1644
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
1645
1645
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Search$1, { style: { marginBottom: 8 }, placeholder: "Search", onChange }),
|
|
1646
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
1646
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$J.CustomTreeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1647
1647
|
Tree,
|
|
1648
1648
|
{
|
|
1649
1649
|
treeData: loop(treeData),
|
|
@@ -8243,14 +8243,14 @@ const ContentContainer = styled.div`
|
|
|
8243
8243
|
display: ${({ $displayFlex }) => $displayFlex ? "flex" : "block"};
|
|
8244
8244
|
flex-flow: ${({ $flexFlow }) => $flexFlow};
|
|
8245
8245
|
`;
|
|
8246
|
-
const Styled$
|
|
8246
|
+
const Styled$I = {
|
|
8247
8247
|
ContentContainer
|
|
8248
8248
|
};
|
|
8249
8249
|
|
|
8250
8250
|
const ContentCard$1 = ({ children, flexGrow, displayFlex, flexFlow, maxHeight }) => {
|
|
8251
8251
|
const { token } = theme.useToken();
|
|
8252
8252
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8253
|
-
Styled$
|
|
8253
|
+
Styled$I.ContentContainer,
|
|
8254
8254
|
{
|
|
8255
8255
|
$flexGrow: flexGrow,
|
|
8256
8256
|
$bgColor: token.colorBgContainer,
|
|
@@ -8311,13 +8311,13 @@ const UncontrolledSelect$1 = styled(Select)`
|
|
|
8311
8311
|
padding-inline: 8px;
|
|
8312
8312
|
}
|
|
8313
8313
|
`;
|
|
8314
|
-
const Styled$
|
|
8314
|
+
const Styled$H = {
|
|
8315
8315
|
UncontrolledSelect: UncontrolledSelect$1
|
|
8316
8316
|
};
|
|
8317
8317
|
|
|
8318
8318
|
const UncontrolledSelect = (props) => {
|
|
8319
8319
|
const { isCursorPointer } = props;
|
|
8320
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8320
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$H.UncontrolledSelect, { ...props, $isCursorPointer: isCursorPointer });
|
|
8321
8321
|
};
|
|
8322
8322
|
|
|
8323
8323
|
const CustomSelect$5 = styled(Select)`
|
|
@@ -8365,13 +8365,13 @@ const CustomSelect$5 = styled(Select)`
|
|
|
8365
8365
|
margin-block: 0 !important;
|
|
8366
8366
|
}
|
|
8367
8367
|
`;
|
|
8368
|
-
const Styled$
|
|
8368
|
+
const Styled$G = {
|
|
8369
8369
|
CustomSelect: CustomSelect$5
|
|
8370
8370
|
};
|
|
8371
8371
|
|
|
8372
8372
|
const CustomSelect$4 = (props) => {
|
|
8373
8373
|
const { paddingContainerEnd, ...rest } = props;
|
|
8374
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8374
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$G.CustomSelect, { $paddingContainerEnd: paddingContainerEnd, ...rest });
|
|
8375
8375
|
};
|
|
8376
8376
|
|
|
8377
8377
|
const CursorPointerTag = styled(Tag)`
|
|
@@ -8518,7 +8518,7 @@ const Abbr$2 = styled.span`
|
|
|
8518
8518
|
height: min-content;
|
|
8519
8519
|
margin-right: 4px;
|
|
8520
8520
|
`;
|
|
8521
|
-
const Styled$
|
|
8521
|
+
const Styled$F = {
|
|
8522
8522
|
Abbr: Abbr$2
|
|
8523
8523
|
};
|
|
8524
8524
|
|
|
@@ -8558,7 +8558,7 @@ const ResourceLink = ({
|
|
|
8558
8558
|
baseFactoriesMapping
|
|
8559
8559
|
});
|
|
8560
8560
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
|
|
8561
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8561
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$F.Abbr, { $bgColor: bgColor, children: abbr }),
|
|
8562
8562
|
resourceLink ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8563
8563
|
Typography.Link,
|
|
8564
8564
|
{
|
|
@@ -8597,7 +8597,7 @@ const NoWrapContainer = styled.div`
|
|
|
8597
8597
|
flex-wrap: nowrap !important;
|
|
8598
8598
|
}
|
|
8599
8599
|
`;
|
|
8600
|
-
const Styled$
|
|
8600
|
+
const Styled$E = {
|
|
8601
8601
|
PositionRelativeContainer,
|
|
8602
8602
|
FullWidthContainer,
|
|
8603
8603
|
NoWrapContainer
|
|
@@ -8640,9 +8640,9 @@ const CollapsibleBreadcrumb = ({ items }) => {
|
|
|
8640
8640
|
};
|
|
8641
8641
|
return [firstItem, ellipsisItem, lastItem];
|
|
8642
8642
|
};
|
|
8643
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$
|
|
8644
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8645
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8643
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$E.PositionRelativeContainer, { children: [
|
|
8644
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$E.FullWidthContainer, { ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, { separator: ">", items: renderItems() }) }),
|
|
8645
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$E.NoWrapContainer, { ref: breadcrumbRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, { separator: ">", items, style: { display: "flex", flexWrap: "nowrap" } }) })
|
|
8646
8646
|
] });
|
|
8647
8647
|
};
|
|
8648
8648
|
|
|
@@ -8650,12 +8650,12 @@ const HeightDiv$1 = styled.div`
|
|
|
8650
8650
|
min-height: 22px;
|
|
8651
8651
|
width: 100%;
|
|
8652
8652
|
`;
|
|
8653
|
-
const Styled$
|
|
8653
|
+
const Styled$D = {
|
|
8654
8654
|
HeightDiv: HeightDiv$1
|
|
8655
8655
|
};
|
|
8656
8656
|
|
|
8657
8657
|
const ManageableBreadcrumbs = ({ data }) => {
|
|
8658
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8658
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$D.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleBreadcrumb, { items: data.breadcrumbItems }) });
|
|
8659
8659
|
};
|
|
8660
8660
|
|
|
8661
8661
|
const kindByGvr = (entries) => (gvr) => {
|
|
@@ -9642,7 +9642,7 @@ const HeightDiv = styled.div`
|
|
|
9642
9642
|
min-height: 22px;
|
|
9643
9643
|
width: 100%;
|
|
9644
9644
|
`;
|
|
9645
|
-
const Styled$
|
|
9645
|
+
const Styled$C = {
|
|
9646
9646
|
HeightDiv
|
|
9647
9647
|
};
|
|
9648
9648
|
|
|
@@ -9672,7 +9672,7 @@ const ManageableBreadcrumbsProvider = ({
|
|
|
9672
9672
|
return null;
|
|
9673
9673
|
}
|
|
9674
9674
|
if (rawDataLoading) {
|
|
9675
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
9675
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$C.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}) });
|
|
9676
9676
|
}
|
|
9677
9677
|
if (!rawData) {
|
|
9678
9678
|
return null;
|
|
@@ -9688,7 +9688,7 @@ const ManageableBreadcrumbsProvider = ({
|
|
|
9688
9688
|
fallbackIdToCompare
|
|
9689
9689
|
});
|
|
9690
9690
|
if (!result) {
|
|
9691
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
9691
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$C.HeightDiv, {});
|
|
9692
9692
|
}
|
|
9693
9693
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableBreadcrumbs, { data: result }, JSON.stringify(idToCompare));
|
|
9694
9694
|
};
|
|
@@ -9716,7 +9716,7 @@ const CustomMenu = styled(Menu)`
|
|
|
9716
9716
|
margin: 0 !important;
|
|
9717
9717
|
}
|
|
9718
9718
|
`;
|
|
9719
|
-
const Styled$
|
|
9719
|
+
const Styled$B = {
|
|
9720
9720
|
CustomMenu
|
|
9721
9721
|
};
|
|
9722
9722
|
|
|
@@ -9743,7 +9743,7 @@ const ManageableSidebar = ({ data, noMarginTop }) => {
|
|
|
9743
9743
|
setSelectedKeys(data.selectedKeys);
|
|
9744
9744
|
}, [data.selectedKeys]);
|
|
9745
9745
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9746
|
-
Styled$
|
|
9746
|
+
Styled$B.CustomMenu,
|
|
9747
9747
|
{
|
|
9748
9748
|
selectedKeys,
|
|
9749
9749
|
onSelect: () => {
|
|
@@ -34284,7 +34284,7 @@ const ShortenedText = styled.div`
|
|
|
34284
34284
|
white-space: nowrap;
|
|
34285
34285
|
text-overflow: ellipsis;
|
|
34286
34286
|
`;
|
|
34287
|
-
const Styled$
|
|
34287
|
+
const Styled$A = {
|
|
34288
34288
|
ShortenedText
|
|
34289
34289
|
};
|
|
34290
34290
|
|
|
@@ -34293,7 +34293,7 @@ const ShortenedTextWithTooltip = ({ text, trimLength, maxWidth = 200 }) => {
|
|
|
34293
34293
|
const trimmedText = text.substring(0, trimLength);
|
|
34294
34294
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip$1, { title: text, placement: "top", children: trimmedText });
|
|
34295
34295
|
}
|
|
34296
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip$1, { title: text, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
34296
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip$1, { title: text, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$A.ShortenedText, { $maxWidth: maxWidth, children: text }) });
|
|
34297
34297
|
};
|
|
34298
34298
|
|
|
34299
34299
|
const FilterDropdown = ({
|
|
@@ -34429,18 +34429,48 @@ const TextAlignContainer = styled.div`
|
|
|
34429
34429
|
text-align: ${({ $align }) => $align};
|
|
34430
34430
|
`;
|
|
34431
34431
|
|
|
34432
|
+
const TableTag = styled(Tag)`
|
|
34433
|
+
margin: 0;
|
|
34434
|
+
flex-shrink: 0;
|
|
34435
|
+
`;
|
|
34436
|
+
const TooltipTagsContainer = styled(Flex)`
|
|
34437
|
+
max-width: min(95vw, 900px);
|
|
34438
|
+
min-width: min(60vw, 320px);
|
|
34439
|
+
`;
|
|
34440
|
+
const TooltipTag = styled(Tag)`
|
|
34441
|
+
margin: 0;
|
|
34442
|
+
width: 100%;
|
|
34443
|
+
white-space: nowrap;
|
|
34444
|
+
overflow: hidden;
|
|
34445
|
+
text-overflow: ellipsis;
|
|
34446
|
+
`;
|
|
34447
|
+
const Styled$z = {
|
|
34448
|
+
TableTag,
|
|
34449
|
+
TooltipTagsContainer,
|
|
34450
|
+
TooltipTag
|
|
34451
|
+
};
|
|
34452
|
+
|
|
34432
34453
|
const TrimmedTags = ({ tags, trimLength }) => {
|
|
34433
|
-
const
|
|
34454
|
+
const renderTableTags = (tags2) => tags2.map((tag) => /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$z.TableTag, { children: tag }, tag));
|
|
34455
|
+
const popoverTheme = { components: { Popover: { zIndexPopup: 2100 } } };
|
|
34456
|
+
const renderTooltipTags = (tags2) => /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$z.TooltipTagsContainer, { vertical: true, gap: 4, children: tags2.map((tag) => /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$z.TooltipTag, { children: tag }, tag)) });
|
|
34434
34457
|
if (trimLength && trimLength < tags.length) {
|
|
34435
34458
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { wrap: "nowrap", gap: "4px", children: [
|
|
34436
|
-
|
|
34437
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34438
|
-
|
|
34439
|
-
|
|
34440
|
-
|
|
34459
|
+
renderTableTags(tags.slice(0, trimLength)),
|
|
34460
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ConfigProvider, { theme: popoverTheme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34461
|
+
Popover,
|
|
34462
|
+
{
|
|
34463
|
+
content: renderTooltipTags(tags.slice(trimLength)),
|
|
34464
|
+
styles: { root: { maxWidth: "min(95vw, 900px)" } },
|
|
34465
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$z.TableTag, { children: [
|
|
34466
|
+
"+",
|
|
34467
|
+
tags.length - trimLength
|
|
34468
|
+
] }, "more")
|
|
34469
|
+
}
|
|
34470
|
+
) })
|
|
34441
34471
|
] });
|
|
34442
34472
|
}
|
|
34443
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { wrap: "nowrap", gap: "4px", children:
|
|
34473
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { wrap: "nowrap", gap: "4px", children: renderTableTags(tags) });
|
|
34444
34474
|
};
|
|
34445
34475
|
|
|
34446
34476
|
const isFlatObject = (obj) => {
|
|
@@ -43516,7 +43546,6 @@ const Styled$y = {
|
|
|
43516
43546
|
BigText: BigText$1
|
|
43517
43547
|
};
|
|
43518
43548
|
|
|
43519
|
-
const collapsedVersionByModel = /* @__PURE__ */ new WeakMap();
|
|
43520
43549
|
const findManagedFieldsLine = (model) => {
|
|
43521
43550
|
let inMetadata = false;
|
|
43522
43551
|
let metadataIndent = -1;
|
|
@@ -43537,17 +43566,55 @@ const findManagedFieldsLine = (model) => {
|
|
|
43537
43566
|
}
|
|
43538
43567
|
return null;
|
|
43539
43568
|
};
|
|
43540
|
-
const
|
|
43569
|
+
const findManagedFieldsRange = (model) => {
|
|
43570
|
+
const startLineNumber = findManagedFieldsLine(model);
|
|
43571
|
+
if (startLineNumber === null) return null;
|
|
43572
|
+
const startLine = model.getLineContent(startLineNumber);
|
|
43573
|
+
const managedFieldsIndent = startLine.match(/^\s*/)?.[0].length ?? 0;
|
|
43574
|
+
for (let lineNumber = startLineNumber + 1; lineNumber <= model.getLineCount(); lineNumber++) {
|
|
43575
|
+
const line = model.getLineContent(lineNumber);
|
|
43576
|
+
const trimmed = line.trim();
|
|
43577
|
+
const indent = line.match(/^\s*/)?.[0].length ?? 0;
|
|
43578
|
+
if (trimmed && indent <= managedFieldsIndent) {
|
|
43579
|
+
const endLineNumber = lineNumber - 1;
|
|
43580
|
+
if (endLineNumber <= startLineNumber) return null;
|
|
43581
|
+
return { startLineNumber, endLineNumber };
|
|
43582
|
+
}
|
|
43583
|
+
}
|
|
43584
|
+
if (startLineNumber >= model.getLineCount()) return null;
|
|
43585
|
+
return { startLineNumber, endLineNumber: model.getLineCount() };
|
|
43586
|
+
};
|
|
43587
|
+
const collapseManagedFieldsInEditor = async (editor) => {
|
|
43541
43588
|
const model = editor.getModel();
|
|
43542
|
-
if (!model) return;
|
|
43543
|
-
const
|
|
43544
|
-
if (
|
|
43545
|
-
const managedFieldsLine =
|
|
43546
|
-
|
|
43547
|
-
|
|
43548
|
-
|
|
43549
|
-
|
|
43550
|
-
|
|
43589
|
+
if (!model) return false;
|
|
43590
|
+
const range = findManagedFieldsRange(model);
|
|
43591
|
+
if (!range) return false;
|
|
43592
|
+
const managedFieldsLine = range.startLineNumber;
|
|
43593
|
+
const foldingController = editor.getContribution?.(
|
|
43594
|
+
"editor.contrib.folding"
|
|
43595
|
+
);
|
|
43596
|
+
if (!foldingController?.getFoldingModel) {
|
|
43597
|
+
editor.trigger("managed-fields-collapse", "editor.fold", {
|
|
43598
|
+
selectionLines: [managedFieldsLine],
|
|
43599
|
+
levels: 1,
|
|
43600
|
+
direction: "down"
|
|
43601
|
+
});
|
|
43602
|
+
return true;
|
|
43603
|
+
}
|
|
43604
|
+
const foldingModel = await foldingController.getFoldingModel();
|
|
43605
|
+
if (!foldingModel) return false;
|
|
43606
|
+
const { regions } = foldingModel;
|
|
43607
|
+
let managedFieldsRegionIndex = -1;
|
|
43608
|
+
for (let index = 0; index < regions.length; index++) {
|
|
43609
|
+
if (regions.getStartLineNumber(index) === managedFieldsLine) {
|
|
43610
|
+
managedFieldsRegionIndex = index;
|
|
43611
|
+
break;
|
|
43612
|
+
}
|
|
43613
|
+
}
|
|
43614
|
+
if (managedFieldsRegionIndex === -1) return false;
|
|
43615
|
+
if (regions.isCollapsed(managedFieldsRegionIndex)) return true;
|
|
43616
|
+
foldingModel.toggleCollapseState([{ regionIndex: managedFieldsRegionIndex }]);
|
|
43617
|
+
return regions.isCollapsed(managedFieldsRegionIndex);
|
|
43551
43618
|
};
|
|
43552
43619
|
|
|
43553
43620
|
const NOTIFICATION_KEY = "yaml-data-changed";
|
|
@@ -43577,18 +43644,43 @@ const YamlEditorSingleton$1 = ({
|
|
|
43577
43644
|
const latestPrefillYamlRef = useRef(null);
|
|
43578
43645
|
const firstLoadRef = useRef(true);
|
|
43579
43646
|
const editorRef = useRef(null);
|
|
43647
|
+
const shouldCollapseOnNextYamlRef = useRef(false);
|
|
43648
|
+
const collapseRetriesRef = useRef(0);
|
|
43580
43649
|
const collapseManagedFieldsIfNeeded = useCallback(() => {
|
|
43581
43650
|
const editor = editorRef.current;
|
|
43582
|
-
if (!editor) return;
|
|
43583
|
-
collapseManagedFieldsInEditor(editor);
|
|
43651
|
+
if (!editor) return Promise.resolve(false);
|
|
43652
|
+
return collapseManagedFieldsInEditor(editor);
|
|
43653
|
+
}, []);
|
|
43654
|
+
const setYamlDataWithManagedFieldsCollapsed = useCallback((nextYaml) => {
|
|
43655
|
+
shouldCollapseOnNextYamlRef.current = true;
|
|
43656
|
+
collapseRetriesRef.current = 0;
|
|
43657
|
+
setYamlData(nextYaml);
|
|
43584
43658
|
}, []);
|
|
43659
|
+
const tryCollapseManagedFields = useCallback(() => {
|
|
43660
|
+
if (!shouldCollapseOnNextYamlRef.current) return;
|
|
43661
|
+
const MAX_RETRIES = 10;
|
|
43662
|
+
const RETRY_DELAY_MS = 50;
|
|
43663
|
+
setTimeout(() => {
|
|
43664
|
+
collapseManagedFieldsIfNeeded().then((collapsed) => {
|
|
43665
|
+
if (collapsed) {
|
|
43666
|
+
shouldCollapseOnNextYamlRef.current = false;
|
|
43667
|
+
collapseRetriesRef.current = 0;
|
|
43668
|
+
return;
|
|
43669
|
+
}
|
|
43670
|
+
collapseRetriesRef.current += 1;
|
|
43671
|
+
if (collapseRetriesRef.current <= MAX_RETRIES) {
|
|
43672
|
+
tryCollapseManagedFields();
|
|
43673
|
+
}
|
|
43674
|
+
});
|
|
43675
|
+
}, RETRY_DELAY_MS);
|
|
43676
|
+
}, [collapseManagedFieldsIfNeeded]);
|
|
43585
43677
|
const handleReload = useCallback(() => {
|
|
43586
43678
|
api.destroy(NOTIFICATION_KEY);
|
|
43587
43679
|
const nextYaml = latestPrefillYamlRef.current ?? initialPrefillYamlRef.current;
|
|
43588
43680
|
if (nextYaml !== null) {
|
|
43589
|
-
|
|
43681
|
+
setYamlDataWithManagedFieldsCollapsed(nextYaml);
|
|
43590
43682
|
}
|
|
43591
|
-
}, [api]);
|
|
43683
|
+
}, [api, setYamlDataWithManagedFieldsCollapsed]);
|
|
43592
43684
|
const openNotificationYamlChanged = useCallback(() => {
|
|
43593
43685
|
const btn = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43594
43686
|
Button,
|
|
@@ -43616,7 +43708,7 @@ const YamlEditorSingleton$1 = ({
|
|
|
43616
43708
|
if (firstLoadRef.current) {
|
|
43617
43709
|
initialPrefillYamlRef.current = nextYaml;
|
|
43618
43710
|
latestPrefillYamlRef.current = nextYaml;
|
|
43619
|
-
|
|
43711
|
+
setYamlDataWithManagedFieldsCollapsed(nextYaml);
|
|
43620
43712
|
firstLoadRef.current = false;
|
|
43621
43713
|
return;
|
|
43622
43714
|
}
|
|
@@ -43624,13 +43716,12 @@ const YamlEditorSingleton$1 = ({
|
|
|
43624
43716
|
openNotificationYamlChanged();
|
|
43625
43717
|
}
|
|
43626
43718
|
latestPrefillYamlRef.current = nextYaml;
|
|
43627
|
-
}, [prefillValuesSchema, openNotificationYamlChanged]);
|
|
43719
|
+
}, [prefillValuesSchema, openNotificationYamlChanged, setYamlDataWithManagedFieldsCollapsed]);
|
|
43628
43720
|
useEffect(() => {
|
|
43629
|
-
|
|
43630
|
-
|
|
43631
|
-
|
|
43632
|
-
|
|
43633
|
-
}, [yamlData, collapseManagedFieldsIfNeeded]);
|
|
43721
|
+
if (!shouldCollapseOnNextYamlRef.current) return void 0;
|
|
43722
|
+
tryCollapseManagedFields();
|
|
43723
|
+
return void 0;
|
|
43724
|
+
}, [yamlData, tryCollapseManagedFields]);
|
|
43634
43725
|
const onSubmit = () => {
|
|
43635
43726
|
setIsLoading(true);
|
|
43636
43727
|
setError(void 0);
|
|
@@ -43690,9 +43781,9 @@ const YamlEditorSingleton$1 = ({
|
|
|
43690
43781
|
value: yamlData,
|
|
43691
43782
|
onMount: (editor) => {
|
|
43692
43783
|
editorRef.current = editor;
|
|
43693
|
-
|
|
43694
|
-
|
|
43695
|
-
}
|
|
43784
|
+
if (shouldCollapseOnNextYamlRef.current) {
|
|
43785
|
+
tryCollapseManagedFields();
|
|
43786
|
+
}
|
|
43696
43787
|
},
|
|
43697
43788
|
onChange: (value) => {
|
|
43698
43789
|
if (!readOnly) {
|
|
@@ -78460,7 +78551,7 @@ const TolerationsModal = ({
|
|
|
78460
78551
|
};
|
|
78461
78552
|
|
|
78462
78553
|
const LazyEnrichedTableModal = lazy(
|
|
78463
|
-
() => import('./index-
|
|
78554
|
+
() => import('./index-DlJkWTNK.mjs').then((mod) => ({ default: mod.EnrichedTableModal }))
|
|
78464
78555
|
);
|
|
78465
78556
|
const renderActiveType = (activeType, extraProps) => {
|
|
78466
78557
|
if (!activeType) return null;
|
|
@@ -90040,4 +90131,4 @@ const usePluginManifest = ({
|
|
|
90040
90131
|
};
|
|
90041
90132
|
|
|
90042
90133
|
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, ReadOnlyModal as R, useBuiltinResourceSingle 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, parseQuotaValueMemoryAndStorage as a$, useK8sVerbs as a0, useManyK8sSmartResource as a1, useSmartResourceParams as a2, useResourceScope as a3, useKinds as a4, usePluginManifest as a5, Spacer$1 as a6, TreeWithSearch as a7, ConfirmModal as a8, UpIcon as a9, EnrichedTable as aA, getEnrichedColumns as aB, getEnrichedColumnsWithControls as aC, YamlEditorSingleton$1 as aD, BlackholeFormProvider as aE, BlackholeForm as aF, getObjectFormItemsDraft as aG, MarketPlace as aH, MarketplaceCard as aI, ProjectInfoCard as aJ, PodTerminal as aK, NodeTerminal as aL, PodLogs as aM, PodLogsMonaco as aN, VMVNC as aO, Search as aP, Events as aQ, DynamicRenderer as aR, DynamicComponents as aS, DynamicRendererWithProviders as aT, prepareTemplate as aU, isFlatObject as aV, filterSelectOptions as aW, getStringByName as aX, floorToDecimal as aY, parseQuotaValue as aZ, parseQuotaValueCpu as a_, DownIcon as aa, BackToDefaultIcon as ab, SuccessIcon as ac, feedbackIcons as ad, PlusIcon as ae, MinusIcon as af, LockedIcon as ag, UnlockedIcon as ah, PauseCircleIcon as ai, ResumeCircleIcon as aj, LookingGlassIcon as ak, EarthIcon as al, ContentCard$1 as am, FlexGrow as an, UncontrolledSelect as ao, CustomSelect$4 as ap, CursorPointerTag as aq, CursorPointerTagMinContent as ar, CursorDefaultDiv as as, ResourceLink as at, ManageableBreadcrumbsProvider as au, prepareDataForManageableBreadcrumbs as av, ManageableBreadcrumbs as aw, ManageableSidebarProvider as ax, prepareDataForManageableSidebar as ay, ManageableSidebar as az, usePartsOfUrl as b, normalizeValuesForQuotasToNumber as b0, getAllPathsFromObj as b1, getPrefixSubarrays as b2, groupsToTreeData as b3, getBuiltinTreeData as b4, getGroupsByCategory as b5, createContextFactory as b6, prepareUrlsToFetchForDynamicRenderer as b7, deepMerge as b8, getSortedKinds as b9, getSortedKindsAll as ba, hslFromString as bb, getUppercase as bc, kindByGvr as bd, pluralByKind as be, namespacedByGvr as bf, getLinkToBuiltinForm as bg, getLinkToApiForm as bh, isMultilineString as bi, isMultilineFromYaml as bj, includesArray as bk, getResourceLink as bl, getNamespaceLink as bm, convertBytes as bn, formatBytesAuto as bo, toBytes as bp, convertStorage as bq, parseValueWithUnit as br, convertCores as bs, formatCoresAuto as bt, toCores as bu, convertCompute as bv, parseCoresWithUnit as bw, formatDateAuto as bx, isValidRFC3339 as by, usePermissions as c, useDirectUnknownResource as d, useK8sSmartResource as e, jsxRuntimeExports as f, EditIcon as g, getLinkToForm as h, DeleteModal as i, jp 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 };
|
|
90043
|
-
//# sourceMappingURL=index-
|
|
90134
|
+
//# sourceMappingURL=index-CWMOa8gQ.mjs.map
|