@devtron-labs/devtron-fe-common-lib 0.0.58-beta-6 → 0.0.58-beta-7
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/Common/Constants.d.ts +1 -14
- package/dist/Common/Hooks/index.d.ts +0 -1
- package/dist/Common/Types.d.ts +3 -2
- package/dist/Common/index.d.ts +0 -1
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.d.ts +4 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.d.ts +4 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.d.ts +7 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.d.ts +4 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.d.ts +4 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/Descriptor.d.ts +4 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/Footer.d.ts +4 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/constants.d.ts +47 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/index.d.ts +7 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/services.d.ts +13 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/types.d.ts +282 -0
- package/dist/Pages/GlobalConfigurations/BuildInfra/utils.d.ts +12 -0
- package/dist/Pages/GlobalConfigurations/index.d.ts +1 -0
- package/dist/Pages/index.d.ts +1 -0
- package/dist/Shared/Components/APIResponseHandler/APIResponseHandler.d.ts +4 -0
- package/dist/Shared/Components/APIResponseHandler/index.d.ts +2 -0
- package/dist/Shared/Components/APIResponseHandler/types.d.ts +37 -0
- package/dist/Shared/Components/ReactSelect/index.d.ts +1 -0
- package/dist/Shared/Components/ReactSelect/utils.d.ts +12 -0
- package/dist/Shared/Components/index.d.ts +2 -0
- package/dist/Shared/index.d.ts +2 -0
- package/dist/Shared/validations.d.ts +7 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1123 -339
- package/package.json +1 -1
- package/src/Assets/Icon/ic-cpu.svg +4 -0
- package/src/Assets/Icon/ic-memory.svg +3 -0
- package/src/Assets/Icon/ic-timer.svg +3 -0
- package/src/Common/BreadCrumb/Types.ts +0 -1
- package/src/Common/Checkbox.tsx +1 -0
- package/src/Common/Constants.ts +3 -18
- package/src/Common/CustomInput/CustomInput.tsx +2 -1
- package/src/Common/DraggableWrapper/DraggableWrapper.tsx +3 -1
- package/src/Common/Hooks/index.ts +0 -1
- package/src/Common/RJSF/utils.ts +3 -0
- package/src/Common/SearchBar/SearchBar.component.tsx +26 -13
- package/src/Common/SearchBar/searchBar.scss +1 -1
- package/src/Common/Types.ts +2 -1
- package/src/Common/index.ts +0 -1
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.tsx +121 -0
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.tsx +44 -0
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.tsx +104 -0
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.tsx +55 -0
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.tsx +32 -0
- package/src/Pages/GlobalConfigurations/BuildInfra/Descriptor.tsx +38 -0
- package/src/Pages/GlobalConfigurations/BuildInfra/Footer.tsx +45 -0
- package/src/Pages/GlobalConfigurations/BuildInfra/Readme.md +4 -0
- package/src/Pages/GlobalConfigurations/BuildInfra/constants.tsx +136 -0
- package/src/Pages/GlobalConfigurations/BuildInfra/index.ts +7 -0
- package/src/Pages/GlobalConfigurations/BuildInfra/services.tsx +184 -0
- package/src/Pages/GlobalConfigurations/BuildInfra/types.tsx +335 -0
- package/src/Pages/GlobalConfigurations/BuildInfra/utils.tsx +494 -0
- package/src/Pages/GlobalConfigurations/index.ts +1 -0
- package/src/Pages/index.ts +1 -0
- package/src/Shared/Components/APIResponseHandler/APIResponseHandler.tsx +39 -0
- package/src/Shared/Components/APIResponseHandler/index.ts +2 -0
- package/src/Shared/Components/APIResponseHandler/types.tsx +39 -0
- package/src/Shared/Components/ReactSelect/index.ts +1 -0
- package/src/Shared/Components/ReactSelect/utils.tsx +97 -0
- package/src/Shared/Components/index.ts +2 -0
- package/src/Shared/index.ts +2 -0
- package/src/Shared/validations.tsx +72 -0
- package/src/index.ts +3 -1
- package/dist/Common/Hooks/useUrlFilters/constants.d.ts +0 -8
- package/dist/Common/Hooks/useUrlFilters/index.d.ts +0 -2
- package/dist/Common/Hooks/useUrlFilters/types.d.ts +0 -6
- package/dist/Common/Hooks/useUrlFilters/useUrlFilters.d.ts +0 -32
- package/dist/Common/SortableTableHeaderCell/SortableTableHeaderCell.d.ts +0 -18
- package/dist/Common/SortableTableHeaderCell/index.d.ts +0 -2
- package/dist/Common/SortableTableHeaderCell/types.d.ts +0 -8
- package/src/Assets/Icon/ic-arrow-up-down.svg +0 -3
- package/src/Assets/Icon/ic-sort-arrow-down.svg +0 -3
- package/src/Common/Hooks/useUrlFilters/constants.ts +0 -9
- package/src/Common/Hooks/useUrlFilters/index.ts +0 -2
- package/src/Common/Hooks/useUrlFilters/types.ts +0 -6
- package/src/Common/Hooks/useUrlFilters/useUrlFilters.ts +0 -120
- package/src/Common/SortableTableHeaderCell/SortableTableHeaderCell.tsx +0 -44
- package/src/Common/SortableTableHeaderCell/index.ts +0 -2
- package/src/Common/SortableTableHeaderCell/types.ts +0 -9
package/dist/index.js
CHANGED
|
@@ -50,7 +50,8 @@ var ROUTES = {
|
|
|
50
50
|
USER_CHECK_ROLE: 'user/check/roles',
|
|
51
51
|
IMAGE_TAGGING: 'app/image-tagging',
|
|
52
52
|
CD_MATERIAL_GET: 'app/cd-pipeline',
|
|
53
|
-
DEPLOYMENT_TEMPLATE_LIST: 'app/template/list'
|
|
53
|
+
DEPLOYMENT_TEMPLATE_LIST: 'app/template/list',
|
|
54
|
+
INFRA_CONFIG_PROFILE: 'infra-config/profile',
|
|
54
55
|
};
|
|
55
56
|
exports.KEY_VALUE = void 0;
|
|
56
57
|
(function (KEY_VALUE) {
|
|
@@ -267,22 +268,7 @@ var MAX_Z_INDEX = 2147483647;
|
|
|
267
268
|
var SELECTED_APPROVAL_TAB_STATE = {
|
|
268
269
|
APPROVAL: 'approval',
|
|
269
270
|
PENDING: 'pending',
|
|
270
|
-
};
|
|
271
|
-
exports.SortingOrder = void 0;
|
|
272
|
-
(function (SortingOrder) {
|
|
273
|
-
/**
|
|
274
|
-
* Ascending order
|
|
275
|
-
*/
|
|
276
|
-
SortingOrder["ASC"] = "ASC";
|
|
277
|
-
/**
|
|
278
|
-
* Descending order
|
|
279
|
-
*/
|
|
280
|
-
SortingOrder["DESC"] = "DESC";
|
|
281
|
-
})(exports.SortingOrder || (exports.SortingOrder = {}));
|
|
282
|
-
/**
|
|
283
|
-
* Base page size for pagination
|
|
284
|
-
*/
|
|
285
|
-
var DEFAULT_BASE_PAGE_SIZE = 20;
|
|
271
|
+
};
|
|
286
272
|
|
|
287
273
|
/******************************************************************************
|
|
288
274
|
Copyright (c) Microsoft Corporation.
|
|
@@ -444,6 +430,7 @@ exports.CHECKBOX_VALUE = void 0;
|
|
|
444
430
|
(function (CHECKBOX_VALUE) {
|
|
445
431
|
CHECKBOX_VALUE["CHECKED"] = "CHECKED";
|
|
446
432
|
CHECKBOX_VALUE["INTERMEDIATE"] = "INTERMEDIATE";
|
|
433
|
+
CHECKBOX_VALUE["BULK_CHECKED"] = "BULK_CHECKED";
|
|
447
434
|
})(exports.CHECKBOX_VALUE || (exports.CHECKBOX_VALUE = {}));
|
|
448
435
|
exports.ImageType = void 0;
|
|
449
436
|
(function (ImageType) {
|
|
@@ -780,9 +767,9 @@ var css_248z$9 = ".empty-state {\n height: 100%;\n}\n.empty-state img {\n heig
|
|
|
780
767
|
styleInject(css_248z$9);
|
|
781
768
|
|
|
782
769
|
var _g$7;
|
|
783
|
-
function _extends$
|
|
770
|
+
function _extends$r() { _extends$r = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
|
|
784
771
|
var SvgIcProgressing = function SvgIcProgressing(props) {
|
|
785
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
772
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
|
|
786
773
|
xmlns: "http://www.w3.org/2000/svg",
|
|
787
774
|
viewBox: "0 0 24 24",
|
|
788
775
|
width: "1em",
|
|
@@ -834,8 +821,8 @@ EmptyState.Loading = Loading;
|
|
|
834
821
|
|
|
835
822
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
836
823
|
|
|
837
|
-
function _extends$
|
|
838
|
-
_extends$
|
|
824
|
+
function _extends$q() {
|
|
825
|
+
_extends$q = Object.assign || function (target) {
|
|
839
826
|
for (var i = 1; i < arguments.length; i++) {
|
|
840
827
|
var source = arguments[i];
|
|
841
828
|
|
|
@@ -849,7 +836,7 @@ function _extends$p() {
|
|
|
849
836
|
return target;
|
|
850
837
|
};
|
|
851
838
|
|
|
852
|
-
return _extends$
|
|
839
|
+
return _extends$q.apply(this, arguments);
|
|
853
840
|
}
|
|
854
841
|
|
|
855
842
|
function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
@@ -1575,7 +1562,7 @@ function ProgressBar(_ref) {
|
|
|
1575
1562
|
isIn = _ref.isIn,
|
|
1576
1563
|
theme = _ref.theme;
|
|
1577
1564
|
|
|
1578
|
-
var style = _extends$
|
|
1565
|
+
var style = _extends$q({}, userStyle, {
|
|
1579
1566
|
animationDuration: delay + "ms",
|
|
1580
1567
|
animationPlayState: isRunning ? 'running' : 'paused',
|
|
1581
1568
|
opacity: hide ? 0 : 1
|
|
@@ -1852,9 +1839,9 @@ var ToastContainer = function ToastContainer(props) {
|
|
|
1852
1839
|
,
|
|
1853
1840
|
id: containerId
|
|
1854
1841
|
}, getToastToRender(function (position, toastList) {
|
|
1855
|
-
var containerStyle = !toastList.length ? _extends$
|
|
1842
|
+
var containerStyle = !toastList.length ? _extends$q({}, style, {
|
|
1856
1843
|
pointerEvents: 'none'
|
|
1857
|
-
}) : _extends$
|
|
1844
|
+
}) : _extends$q({}, style);
|
|
1858
1845
|
return React.createElement("div", {
|
|
1859
1846
|
className: getClassName(position),
|
|
1860
1847
|
style: containerStyle,
|
|
@@ -1961,7 +1948,7 @@ function dispatchToast(content, options) {
|
|
|
1961
1948
|
|
|
1962
1949
|
|
|
1963
1950
|
function mergeOptions(type, options) {
|
|
1964
|
-
return _extends$
|
|
1951
|
+
return _extends$q({}, options, {
|
|
1965
1952
|
type: options && options.type || type,
|
|
1966
1953
|
toastId: getToastId(options)
|
|
1967
1954
|
});
|
|
@@ -1978,7 +1965,7 @@ function toast(content, options) {
|
|
|
1978
1965
|
}
|
|
1979
1966
|
|
|
1980
1967
|
toast.loading = function (content, options) {
|
|
1981
|
-
return dispatchToast(content, mergeOptions(TYPE.DEFAULT, _extends$
|
|
1968
|
+
return dispatchToast(content, mergeOptions(TYPE.DEFAULT, _extends$q({
|
|
1982
1969
|
isLoading: true,
|
|
1983
1970
|
autoClose: false,
|
|
1984
1971
|
closeOnClick: false,
|
|
@@ -1994,7 +1981,7 @@ function handlePromise(promise, _ref2, options) {
|
|
|
1994
1981
|
var id;
|
|
1995
1982
|
|
|
1996
1983
|
if (pending) {
|
|
1997
|
-
id = isStr(pending) ? toast.loading(pending, options) : toast.loading(pending.render, _extends$
|
|
1984
|
+
id = isStr(pending) ? toast.loading(pending, options) : toast.loading(pending.render, _extends$q({}, options, pending));
|
|
1998
1985
|
}
|
|
1999
1986
|
|
|
2000
1987
|
var resetParams = {
|
|
@@ -2013,7 +2000,7 @@ function handlePromise(promise, _ref2, options) {
|
|
|
2013
2000
|
return;
|
|
2014
2001
|
}
|
|
2015
2002
|
|
|
2016
|
-
var baseParams = _extends$
|
|
2003
|
+
var baseParams = _extends$q({
|
|
2017
2004
|
type: type
|
|
2018
2005
|
}, resetParams, options, {
|
|
2019
2006
|
data: result
|
|
@@ -2024,10 +2011,10 @@ function handlePromise(promise, _ref2, options) {
|
|
|
2024
2011
|
} : input; // if the id is set we know that it's an update
|
|
2025
2012
|
|
|
2026
2013
|
if (id) {
|
|
2027
|
-
toast.update(id, _extends$
|
|
2014
|
+
toast.update(id, _extends$q({}, baseParams, params));
|
|
2028
2015
|
} else {
|
|
2029
2016
|
// using toast.promise without loading
|
|
2030
|
-
toast(params.render, _extends$
|
|
2017
|
+
toast(params.render, _extends$q({}, baseParams, params));
|
|
2031
2018
|
}
|
|
2032
2019
|
|
|
2033
2020
|
return result;
|
|
@@ -2051,7 +2038,7 @@ toast.warning = /*#__PURE__*/createToastByType(TYPE.WARNING);
|
|
|
2051
2038
|
toast.warn = toast.warning;
|
|
2052
2039
|
|
|
2053
2040
|
toast.dark = function (content, options) {
|
|
2054
|
-
return dispatchToast(content, mergeOptions(TYPE.DEFAULT, _extends$
|
|
2041
|
+
return dispatchToast(content, mergeOptions(TYPE.DEFAULT, _extends$q({
|
|
2055
2042
|
theme: 'dark'
|
|
2056
2043
|
}, options)));
|
|
2057
2044
|
};
|
|
@@ -2108,7 +2095,7 @@ toast.update = function (toastId, options) {
|
|
|
2108
2095
|
var oldOptions = toast.props,
|
|
2109
2096
|
oldContent = toast.content;
|
|
2110
2097
|
|
|
2111
|
-
var nextOptions = _extends$
|
|
2098
|
+
var nextOptions = _extends$q({}, oldOptions, options, {
|
|
2112
2099
|
toastId: options.toastId || toastId,
|
|
2113
2100
|
updateId: generateToastId()
|
|
2114
2101
|
});
|
|
@@ -12025,16 +12012,16 @@ var Modal = function (_a) {
|
|
|
12025
12012
|
}, id: "popup", className: "".concat(rootClassName, " popup ").concat(modal ? 'modal' : ''), style: __assign({}, style) }, { children: children })), document.getElementById('visible-modal'));
|
|
12026
12013
|
};
|
|
12027
12014
|
|
|
12028
|
-
var _path$
|
|
12029
|
-
function _extends$
|
|
12015
|
+
var _path$g;
|
|
12016
|
+
function _extends$p() { _extends$p = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
|
|
12030
12017
|
var SvgIcCross = function SvgIcCross(props) {
|
|
12031
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
12018
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
|
|
12032
12019
|
width: "1em",
|
|
12033
12020
|
height: "1em",
|
|
12034
12021
|
viewBox: "0 0 24 24",
|
|
12035
12022
|
fill: "none",
|
|
12036
12023
|
xmlns: "http://www.w3.org/2000/svg"
|
|
12037
|
-
}, props), _path$
|
|
12024
|
+
}, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
|
|
12038
12025
|
d: "M19.28 5.78a.75.75 0 0 0-1.06-1.06l1.06 1.06ZM4.72 18.22a.75.75 0 1 0 1.06 1.06l-1.06-1.06Zm13.5 1.06a.75.75 0 1 0 1.06-1.06l-1.06 1.06ZM5.78 4.72a.75.75 0 0 0-1.06 1.06l1.06-1.06Zm12.44 0-6.75 6.75 1.06 1.06 6.75-6.75-1.06-1.06Zm-6.75 6.75-6.75 6.75 1.06 1.06 6.75-6.75-1.06-1.06Zm7.81 6.75-6.75-6.75-1.06 1.06 6.75 6.75 1.06-1.06Zm-6.75-6.75L5.78 4.72 4.72 5.78l6.75 6.75 1.06-1.06Z",
|
|
12039
12026
|
fill: "#596168"
|
|
12040
12027
|
})));
|
|
@@ -16333,30 +16320,30 @@ var index = /*#__PURE__*/forwardRef( /*#__PURE__*/TippyGenerator(tippy));
|
|
|
16333
16320
|
|
|
16334
16321
|
var Tippy = index;
|
|
16335
16322
|
|
|
16336
|
-
var _path$
|
|
16337
|
-
function _extends$
|
|
16323
|
+
var _path$f;
|
|
16324
|
+
function _extends$o() { _extends$o = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
|
|
16338
16325
|
var SvgIcHelp = function SvgIcHelp(props) {
|
|
16339
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
16326
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
|
|
16340
16327
|
xmlns: "http://www.w3.org/2000/svg",
|
|
16341
16328
|
width: "1em",
|
|
16342
16329
|
height: "1em",
|
|
16343
16330
|
viewBox: "0 0 24 24"
|
|
16344
|
-
}, props), _path$
|
|
16331
|
+
}, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
|
|
16345
16332
|
fill: "#767D84",
|
|
16346
16333
|
fillRule: "evenodd",
|
|
16347
16334
|
d: "M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm-.205 12.868c-.615 0-1.12.505-1.12 1.12 0 .617.505 1.121 1.12 1.121.615 0 1.12-.504 1.12-1.12 0-.616-.506-1.12-1.12-1.12zM11.863 7c-1.667 0-3.197 1.187-3.196 2.527 0 .546.41.833.888.833 1.325 0 .642-1.803 2.39-1.803.82 0 1.311.438 1.311 1.175 0 1.34-2.39 1.708-2.39 3.334 0 .438.287.915.874.915.902 0 .792-.67 1.12-1.148.438-.642 2.473-1.325 2.473-3.101 0-1.927-1.721-2.732-3.47-2.732z"
|
|
16348
16335
|
})));
|
|
16349
16336
|
};
|
|
16350
16337
|
|
|
16351
|
-
var _path$
|
|
16352
|
-
function _extends$
|
|
16338
|
+
var _path$e;
|
|
16339
|
+
function _extends$n() { _extends$n = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
|
|
16353
16340
|
var SvgIcHelpOutline = function SvgIcHelpOutline(props) {
|
|
16354
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
16341
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
|
|
16355
16342
|
xmlns: "http://www.w3.org/2000/svg",
|
|
16356
16343
|
viewBox: "0 0 17 16",
|
|
16357
16344
|
width: "1em",
|
|
16358
16345
|
height: "1em"
|
|
16359
|
-
}, props), _path$
|
|
16346
|
+
}, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
|
|
16360
16347
|
fill: "#767D84",
|
|
16361
16348
|
fillRule: "evenodd",
|
|
16362
16349
|
d: "M9 1.333a6.667 6.667 0 1 1 0 13.334A6.667 6.667 0 0 1 9 1.333zm0 1.334C6.054 2.667 3.667 5.054 3.667 8S6.054 13.333 9 13.333 14.333 10.946 14.333 8 11.946 2.667 9 2.667zm-.137 7.245c.41 0 .747.337.747.747s-.337.747-.747.747-.747-.336-.747-.747a.75.75 0 0 1 .747-.747zm.046-5.245c1.166 0 2.313.537 2.313 1.82 0 1.185-1.357 1.64-1.648 2.068-.22.319-.146.766-.747.766-.392 0-.583-.319-.583-.61 0-1.085 1.593-1.33 1.593-2.223 0-.492-.327-.783-.873-.783-1.166 0-.711 1.202-1.594 1.202-.319 0-.592-.191-.592-.556 0-.893 1.02-1.684 2.13-1.684z"
|
|
@@ -16408,16 +16395,16 @@ function TippyCustomized(props) {
|
|
|
16408
16395
|
return (jsxRuntime.jsx(Tippy, __assign({ className: "".concat(isWhiteTheme ? 'tippy-white-container default-white' : 'tippy-black-container default-black', " no-content-padding tippy-shadow ").concat(className), arrow: arrow || false, interactive: interactive || false, placement: placement || 'top', content: getTippyContent(), trigger: trigger || 'mouseenter', onMount: onTippyMount, onClickOutside: closeTippy, showOnCreate: showOnCreate || false, animation: animation || 'fade', duration: duration || 300, visible: props.visible }, { children: children })));
|
|
16409
16396
|
}
|
|
16410
16397
|
|
|
16411
|
-
var _path$
|
|
16412
|
-
function _extends$
|
|
16398
|
+
var _path$d, _circle, _path2$2;
|
|
16399
|
+
function _extends$m() { _extends$m = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
|
|
16413
16400
|
var SvgInjectTag = function SvgInjectTag(props) {
|
|
16414
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
16401
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
|
|
16415
16402
|
width: "1em",
|
|
16416
16403
|
height: "1em",
|
|
16417
16404
|
viewBox: "0 0 20 20",
|
|
16418
16405
|
fill: "none",
|
|
16419
16406
|
xmlns: "http://www.w3.org/2000/svg"
|
|
16420
|
-
}, props), _path$
|
|
16407
|
+
}, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
|
|
16421
16408
|
d: "M10 10H3.333",
|
|
16422
16409
|
stroke: "#596168",
|
|
16423
16410
|
strokeWidth: 1.5,
|
|
@@ -16428,7 +16415,7 @@ var SvgInjectTag = function SvgInjectTag(props) {
|
|
|
16428
16415
|
cy: 10,
|
|
16429
16416
|
r: 1.667,
|
|
16430
16417
|
fill: "#596168"
|
|
16431
|
-
})), _path2$
|
|
16418
|
+
})), _path2$2 || (_path2$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
16432
16419
|
d: "m4.415 6.403 5.347-3.008a.486.486 0 0 1 .476 0l5.348 3.008a.486.486 0 0 1 .247.424v5.994a.485.485 0 0 1-.247.424l-5.348 3.007a.485.485 0 0 1-.476 0l-5.347-3.007",
|
|
16433
16420
|
stroke: "#596168",
|
|
16434
16421
|
strokeWidth: 1.5,
|
|
@@ -16445,15 +16432,15 @@ function PropagateTagInfo(_a) {
|
|
|
16445
16432
|
return (jsxRuntime.jsx(TippyCustomized, __assign({ theme: exports.TippyTheme.white, className: "w-300", placement: "top", Icon: SvgInjectTag, heading: 'Propagate tags to K8s resources', infoText: "", additionalContent: additionalInfo(), showCloseButton: true, trigger: "click", interactive: true, documentationLink: isCreateApp ? DOCUMENTATION.APP_TAGS : DOCUMENTATION.APP_OVERVIEW_TAGS, documentationLinkText: "View Documentation" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flexbox cursor" }, { children: [jsxRuntime.jsx(SvgInjectTag, { className: "icon-dim-16 mt-2 mr-4" }), jsxRuntime.jsx("span", { children: "Propagate tags" }), jsxRuntime.jsx(SvgIcHelpOutline, { className: "icon-dim-16 mt-2 ml-4" })] })) })));
|
|
16446
16433
|
}
|
|
16447
16434
|
|
|
16448
|
-
var _path$
|
|
16449
|
-
function _extends$
|
|
16435
|
+
var _path$c;
|
|
16436
|
+
function _extends$l() { _extends$l = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
|
|
16450
16437
|
var SvgIcInfoOutlined = function SvgIcInfoOutlined(props) {
|
|
16451
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
16438
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
|
|
16452
16439
|
xmlns: "http://www.w3.org/2000/svg",
|
|
16453
16440
|
width: "1em",
|
|
16454
16441
|
height: "1em",
|
|
16455
16442
|
viewBox: "0 0 20 20"
|
|
16456
|
-
}, props), _path$
|
|
16443
|
+
}, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
|
|
16457
16444
|
d: "M10 1.667c4.6 0 8.333 3.733 8.333 8.333S14.6 18.333 10 18.333 1.667 14.6 1.667 10 5.4 1.667 10 1.667zm0 1.666A6.67 6.67 0 0 0 3.333 10 6.67 6.67 0 0 0 10 16.667 6.67 6.67 0 0 0 16.667 10 6.67 6.67 0 0 0 10 3.333zm0 5.834c.46 0 .833.373.833.833v3.333a.834.834 0 1 1-1.666 0V10c0-.46.373-.833.833-.833zm0-3.334A.833.833 0 1 1 10 7.5a.833.833 0 0 1 0-1.667z",
|
|
16458
16445
|
fill: "#06C",
|
|
16459
16446
|
fillRule: "evenodd"
|
|
@@ -16687,15 +16674,15 @@ var TagDetails = function (_a) {
|
|
|
16687
16674
|
return (jsxRuntime.jsxs("div", __assign({ className: "flexbox mb-8" }, { children: [jsxRuntime.jsx("div", __assign({ className: "dc__border h-30 pl-4 pr-4 br-4 mr-8 pointer ".concat(tagData.propagate ? 'bcn-7' : '', " ").concat(tagData.key.startsWith("devtron.ai/") ? 'cursor-not-allowed bcn-1' : ''), onClick: propagateTagToResource, "data-testid": "propagate-tag-".concat(index) }, { children: jsxRuntime.jsx(SvgInjectTag, { className: "icon-dim-20 mt-4 ".concat(tagData.propagate ? 'scn-0' : '') }) })), jsxRuntime.jsx(TagLabelValueSelector, { selectedTagIndex: index, tagData: tagData, setTagData: setTagData, tagInputType: exports.KEY_VALUE.KEY, placeholder: "Enter key", tabIndex: tabIndex - 1, refVar: keyRef, dependentRef: valueRef, tagOptions: suggestedTagsOptions }), jsxRuntime.jsx(TagLabelValueSelector, { selectedTagIndex: index, tagData: tagData, setTagData: setTagData, tagInputType: exports.KEY_VALUE.VALUE, placeholder: "Enter value", tabIndex: tabIndex, refVar: valueRef, dependentRef: keyRef }), jsxRuntime.jsx("div", __assign({ className: "dc__border pl-4 pr-4 dc__right-radius-4 pointer flex top", onClick: deleteTag, "data-testid": "delete-tag-".concat(index) }, { children: jsxRuntime.jsx(SvgIcCross, { className: "icon-dim-20 mt-4" }) }))] })));
|
|
16688
16675
|
};
|
|
16689
16676
|
|
|
16690
|
-
var _path$
|
|
16691
|
-
function _extends$
|
|
16677
|
+
var _path$b;
|
|
16678
|
+
function _extends$k() { _extends$k = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
|
|
16692
16679
|
var SvgIcAdd = function SvgIcAdd(props) {
|
|
16693
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
16680
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
|
|
16694
16681
|
xmlns: "http://www.w3.org/2000/svg",
|
|
16695
16682
|
width: "1em",
|
|
16696
16683
|
height: "1em",
|
|
16697
16684
|
viewBox: "0 0 24 24"
|
|
16698
|
-
}, props), _path$
|
|
16685
|
+
}, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
|
|
16699
16686
|
className: "ic-add_svg__fill-color",
|
|
16700
16687
|
fill: "#999",
|
|
16701
16688
|
d: "M18 13h-5v5a1 1 0 0 1-2 0v-5H6a1 1 0 0 1 0-2h5V6a1 1 0 0 1 2 0v5h5a1 1 0 0 1 0 2z"
|
|
@@ -16825,8 +16812,8 @@ function ForceDeleteDialog(_a) {
|
|
|
16825
16812
|
return (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(DeleteDialog, __assign({ title: forceDeleteDialogTitle, delete: onClickDelete, closeDelete: closeDeleteModal, deletePrefix: "Force " }, { children: jsxRuntime.jsxs(DeleteDialog.Description, { children: [jsxRuntime.jsxs("p", __assign({ className: "mt-12 mb-12 p-8 dc__break-word dc__window-bg" }, { children: ["Error: ", forceDeleteDialogMessage] })), jsxRuntime.jsx("p", { children: "Do you want to force delete?" })] }) })) }));
|
|
16826
16813
|
}
|
|
16827
16814
|
|
|
16828
|
-
function _extends$
|
|
16829
|
-
_extends$
|
|
16815
|
+
function _extends$j() {
|
|
16816
|
+
_extends$j = Object.assign ? Object.assign.bind() : function (target) {
|
|
16830
16817
|
for (var i = 1; i < arguments.length; i++) {
|
|
16831
16818
|
var source = arguments[i];
|
|
16832
16819
|
for (var key in source) {
|
|
@@ -16837,7 +16824,7 @@ function _extends$i() {
|
|
|
16837
16824
|
}
|
|
16838
16825
|
return target;
|
|
16839
16826
|
};
|
|
16840
|
-
return _extends$
|
|
16827
|
+
return _extends$j.apply(this, arguments);
|
|
16841
16828
|
}
|
|
16842
16829
|
|
|
16843
16830
|
/*
|
|
@@ -20378,7 +20365,7 @@ var Menu = function Menu(props) {
|
|
|
20378
20365
|
getStyles = props.getStyles,
|
|
20379
20366
|
innerRef = props.innerRef,
|
|
20380
20367
|
innerProps = props.innerProps;
|
|
20381
|
-
return jsx("div", _extends$
|
|
20368
|
+
return jsx("div", _extends$j({
|
|
20382
20369
|
css: getStyles('menu', props),
|
|
20383
20370
|
className: cx({
|
|
20384
20371
|
menu: true
|
|
@@ -20410,7 +20397,7 @@ var MenuList$1 = function MenuList(props) {
|
|
|
20410
20397
|
innerProps = props.innerProps,
|
|
20411
20398
|
innerRef = props.innerRef,
|
|
20412
20399
|
isMulti = props.isMulti;
|
|
20413
|
-
return jsx("div", _extends$
|
|
20400
|
+
return jsx("div", _extends$j({
|
|
20414
20401
|
css: getStyles('menuList', props),
|
|
20415
20402
|
className: cx({
|
|
20416
20403
|
'menu-list': true,
|
|
@@ -20441,7 +20428,7 @@ var NoOptionsMessage = function NoOptionsMessage(props) {
|
|
|
20441
20428
|
cx = props.cx,
|
|
20442
20429
|
getStyles = props.getStyles,
|
|
20443
20430
|
innerProps = props.innerProps;
|
|
20444
|
-
return jsx("div", _extends$
|
|
20431
|
+
return jsx("div", _extends$j({
|
|
20445
20432
|
css: getStyles('noOptionsMessage', props),
|
|
20446
20433
|
className: cx({
|
|
20447
20434
|
'menu-notice': true,
|
|
@@ -20458,7 +20445,7 @@ var LoadingMessage = function LoadingMessage(props) {
|
|
|
20458
20445
|
cx = props.cx,
|
|
20459
20446
|
getStyles = props.getStyles,
|
|
20460
20447
|
innerProps = props.innerProps;
|
|
20461
|
-
return jsx("div", _extends$
|
|
20448
|
+
return jsx("div", _extends$j({
|
|
20462
20449
|
css: getStyles('loadingMessage', props),
|
|
20463
20450
|
className: cx({
|
|
20464
20451
|
'menu-notice': true,
|
|
@@ -20546,7 +20533,7 @@ var MenuPortal = /*#__PURE__*/function (_Component2) {
|
|
|
20546
20533
|
rect: rect
|
|
20547
20534
|
}; // same wrapper element whether fixed or portalled
|
|
20548
20535
|
|
|
20549
|
-
var menuWrapper = jsx("div", _extends$
|
|
20536
|
+
var menuWrapper = jsx("div", _extends$j({
|
|
20550
20537
|
css: getStyles('menuPortal', state),
|
|
20551
20538
|
className: cx({
|
|
20552
20539
|
'menu-portal': true
|
|
@@ -20582,7 +20569,7 @@ var SelectContainer = function SelectContainer(props) {
|
|
|
20582
20569
|
innerProps = props.innerProps,
|
|
20583
20570
|
isDisabled = props.isDisabled,
|
|
20584
20571
|
isRtl = props.isRtl;
|
|
20585
|
-
return jsx("div", _extends$
|
|
20572
|
+
return jsx("div", _extends$j({
|
|
20586
20573
|
css: getStyles('container', props),
|
|
20587
20574
|
className: cx({
|
|
20588
20575
|
'--is-disabled': isDisabled,
|
|
@@ -20617,7 +20604,7 @@ var ValueContainer = function ValueContainer(props) {
|
|
|
20617
20604
|
isMulti = props.isMulti,
|
|
20618
20605
|
getStyles = props.getStyles,
|
|
20619
20606
|
hasValue = props.hasValue;
|
|
20620
|
-
return jsx("div", _extends$
|
|
20607
|
+
return jsx("div", _extends$j({
|
|
20621
20608
|
css: getStyles('valueContainer', props),
|
|
20622
20609
|
className: cx({
|
|
20623
20610
|
'value-container': true,
|
|
@@ -20643,7 +20630,7 @@ var IndicatorsContainer = function IndicatorsContainer(props) {
|
|
|
20643
20630
|
cx = props.cx,
|
|
20644
20631
|
innerProps = props.innerProps,
|
|
20645
20632
|
getStyles = props.getStyles;
|
|
20646
|
-
return jsx("div", _extends$
|
|
20633
|
+
return jsx("div", _extends$j({
|
|
20647
20634
|
css: getStyles('indicatorsContainer', props),
|
|
20648
20635
|
className: cx({
|
|
20649
20636
|
indicators: true
|
|
@@ -20674,7 +20661,7 @@ var Svg = function Svg(_ref) {
|
|
|
20674
20661
|
var size = _ref.size,
|
|
20675
20662
|
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
20676
20663
|
|
|
20677
|
-
return jsx("svg", _extends$
|
|
20664
|
+
return jsx("svg", _extends$j({
|
|
20678
20665
|
height: size,
|
|
20679
20666
|
width: size,
|
|
20680
20667
|
viewBox: "0 0 20 20",
|
|
@@ -20685,14 +20672,14 @@ var Svg = function Svg(_ref) {
|
|
|
20685
20672
|
};
|
|
20686
20673
|
|
|
20687
20674
|
var CrossIcon = function CrossIcon(props) {
|
|
20688
|
-
return jsx(Svg, _extends$
|
|
20675
|
+
return jsx(Svg, _extends$j({
|
|
20689
20676
|
size: 20
|
|
20690
20677
|
}, props), jsx("path", {
|
|
20691
20678
|
d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"
|
|
20692
20679
|
}));
|
|
20693
20680
|
};
|
|
20694
20681
|
var DownChevron = function DownChevron(props) {
|
|
20695
|
-
return jsx(Svg, _extends$
|
|
20682
|
+
return jsx(Svg, _extends$j({
|
|
20696
20683
|
size: 20
|
|
20697
20684
|
}, props), jsx("path", {
|
|
20698
20685
|
d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"
|
|
@@ -20725,7 +20712,7 @@ var DropdownIndicator$1 = function DropdownIndicator(props) {
|
|
|
20725
20712
|
cx = props.cx,
|
|
20726
20713
|
getStyles = props.getStyles,
|
|
20727
20714
|
innerProps = props.innerProps;
|
|
20728
|
-
return jsx("div", _extends$
|
|
20715
|
+
return jsx("div", _extends$j({
|
|
20729
20716
|
css: getStyles('dropdownIndicator', props),
|
|
20730
20717
|
className: cx({
|
|
20731
20718
|
indicator: true,
|
|
@@ -20740,7 +20727,7 @@ var ClearIndicator$1 = function ClearIndicator(props) {
|
|
|
20740
20727
|
cx = props.cx,
|
|
20741
20728
|
getStyles = props.getStyles,
|
|
20742
20729
|
innerProps = props.innerProps;
|
|
20743
|
-
return jsx("div", _extends$
|
|
20730
|
+
return jsx("div", _extends$j({
|
|
20744
20731
|
css: getStyles('clearIndicator', props),
|
|
20745
20732
|
className: cx({
|
|
20746
20733
|
indicator: true,
|
|
@@ -20770,7 +20757,7 @@ var IndicatorSeparator = function IndicatorSeparator(props) {
|
|
|
20770
20757
|
cx = props.cx,
|
|
20771
20758
|
getStyles = props.getStyles,
|
|
20772
20759
|
innerProps = props.innerProps;
|
|
20773
|
-
return jsx("span", _extends$
|
|
20760
|
+
return jsx("span", _extends$j({}, innerProps, {
|
|
20774
20761
|
css: getStyles('indicatorSeparator', props),
|
|
20775
20762
|
className: cx({
|
|
20776
20763
|
'indicator-separator': true
|
|
@@ -20825,7 +20812,7 @@ var LoadingIndicator = function LoadingIndicator(props) {
|
|
|
20825
20812
|
getStyles = props.getStyles,
|
|
20826
20813
|
innerProps = props.innerProps,
|
|
20827
20814
|
isRtl = props.isRtl;
|
|
20828
|
-
return jsx("div", _extends$
|
|
20815
|
+
return jsx("div", _extends$j({
|
|
20829
20816
|
css: getStyles('loadingIndicator', props),
|
|
20830
20817
|
className: cx({
|
|
20831
20818
|
indicator: true,
|
|
@@ -20886,7 +20873,7 @@ var Control = function Control(props) {
|
|
|
20886
20873
|
innerRef = props.innerRef,
|
|
20887
20874
|
innerProps = props.innerProps,
|
|
20888
20875
|
menuIsOpen = props.menuIsOpen;
|
|
20889
|
-
return jsx("div", _extends$
|
|
20876
|
+
return jsx("div", _extends$j({
|
|
20890
20877
|
ref: innerRef,
|
|
20891
20878
|
css: getStyles('control', props),
|
|
20892
20879
|
className: cx({
|
|
@@ -20918,12 +20905,12 @@ var Group = function Group(props) {
|
|
|
20918
20905
|
label = props.label,
|
|
20919
20906
|
theme = props.theme,
|
|
20920
20907
|
selectProps = props.selectProps;
|
|
20921
|
-
return jsx("div", _extends$
|
|
20908
|
+
return jsx("div", _extends$j({
|
|
20922
20909
|
css: getStyles('group', props),
|
|
20923
20910
|
className: cx({
|
|
20924
20911
|
group: true
|
|
20925
20912
|
}, className)
|
|
20926
|
-
}, innerProps), jsx(Heading, _extends$
|
|
20913
|
+
}, innerProps), jsx(Heading, _extends$j({}, headingProps, {
|
|
20927
20914
|
selectProps: selectProps,
|
|
20928
20915
|
theme: theme,
|
|
20929
20916
|
getStyles: getStyles,
|
|
@@ -20955,7 +20942,7 @@ var GroupHeading = function GroupHeading(props) {
|
|
|
20955
20942
|
_cleanCommonProps.data;
|
|
20956
20943
|
var innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded$1$1);
|
|
20957
20944
|
|
|
20958
|
-
return jsx("div", _extends$
|
|
20945
|
+
return jsx("div", _extends$j({
|
|
20959
20946
|
css: getStyles('groupHeading', props),
|
|
20960
20947
|
className: cx({
|
|
20961
20948
|
'group-heading': true
|
|
@@ -21031,7 +21018,7 @@ var Input = function Input(props) {
|
|
|
21031
21018
|
}, className),
|
|
21032
21019
|
css: getStyles('input', props),
|
|
21033
21020
|
"data-value": value || ''
|
|
21034
|
-
}, jsx("input", _extends$
|
|
21021
|
+
}, jsx("input", _extends$j({
|
|
21035
21022
|
className: cx({
|
|
21036
21023
|
input: true
|
|
21037
21024
|
}, inputClassName),
|
|
@@ -21101,7 +21088,7 @@ var MultiValueLabel = MultiValueGeneric;
|
|
|
21101
21088
|
function MultiValueRemove$1(_ref5) {
|
|
21102
21089
|
var children = _ref5.children,
|
|
21103
21090
|
innerProps = _ref5.innerProps;
|
|
21104
|
-
return jsx("div", _extends$
|
|
21091
|
+
return jsx("div", _extends$j({
|
|
21105
21092
|
role: "button"
|
|
21106
21093
|
}, innerProps), children || jsx(CrossIcon, {
|
|
21107
21094
|
size: 14
|
|
@@ -21190,7 +21177,7 @@ var Option$1 = function Option(props) {
|
|
|
21190
21177
|
isSelected = props.isSelected,
|
|
21191
21178
|
innerRef = props.innerRef,
|
|
21192
21179
|
innerProps = props.innerProps;
|
|
21193
|
-
return jsx("div", _extends$
|
|
21180
|
+
return jsx("div", _extends$j({
|
|
21194
21181
|
css: getStyles('option', props),
|
|
21195
21182
|
className: cx({
|
|
21196
21183
|
option: true,
|
|
@@ -21222,7 +21209,7 @@ var Placeholder = function Placeholder(props) {
|
|
|
21222
21209
|
cx = props.cx,
|
|
21223
21210
|
getStyles = props.getStyles,
|
|
21224
21211
|
innerProps = props.innerProps;
|
|
21225
|
-
return jsx("div", _extends$
|
|
21212
|
+
return jsx("div", _extends$j({
|
|
21226
21213
|
css: getStyles('placeholder', props),
|
|
21227
21214
|
className: cx({
|
|
21228
21215
|
placeholder: true
|
|
@@ -21255,7 +21242,7 @@ var SingleValue = function SingleValue(props) {
|
|
|
21255
21242
|
getStyles = props.getStyles,
|
|
21256
21243
|
isDisabled = props.isDisabled,
|
|
21257
21244
|
innerProps = props.innerProps;
|
|
21258
|
-
return jsx("div", _extends$
|
|
21245
|
+
return jsx("div", _extends$j({
|
|
21259
21246
|
css: getStyles('singleValue', props),
|
|
21260
21247
|
className: cx({
|
|
21261
21248
|
'single-value': true,
|
|
@@ -21503,7 +21490,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
21503
21490
|
};
|
|
21504
21491
|
|
|
21505
21492
|
var A11yText = function A11yText(props) {
|
|
21506
|
-
return jsx("span", _extends$
|
|
21493
|
+
return jsx("span", _extends$j({
|
|
21507
21494
|
css: _ref
|
|
21508
21495
|
}, props));
|
|
21509
21496
|
};
|
|
@@ -22039,7 +22026,7 @@ function DummyInput(_ref) {
|
|
|
22039
22026
|
var innerRef = _ref.innerRef,
|
|
22040
22027
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
22041
22028
|
|
|
22042
|
-
return jsx("input", _extends$
|
|
22029
|
+
return jsx("input", _extends$j({
|
|
22043
22030
|
ref: innerRef
|
|
22044
22031
|
}, props, {
|
|
22045
22032
|
css: /*#__PURE__*/css$2({
|
|
@@ -23674,7 +23661,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
23674
23661
|
|
|
23675
23662
|
if (!isSearchable) {
|
|
23676
23663
|
// use a dummy input to maintain focus/blur functionality
|
|
23677
|
-
return /*#__PURE__*/React__namespace.createElement(DummyInput, _extends$
|
|
23664
|
+
return /*#__PURE__*/React__namespace.createElement(DummyInput, _extends$j({
|
|
23678
23665
|
id: id,
|
|
23679
23666
|
innerRef: this.getInputRef,
|
|
23680
23667
|
onBlur: this.onInputBlur,
|
|
@@ -23688,7 +23675,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
23688
23675
|
}, ariaAttributes));
|
|
23689
23676
|
}
|
|
23690
23677
|
|
|
23691
|
-
return /*#__PURE__*/React__namespace.createElement(Input, _extends$
|
|
23678
|
+
return /*#__PURE__*/React__namespace.createElement(Input, _extends$j({}, commonProps, {
|
|
23692
23679
|
autoCapitalize: "none",
|
|
23693
23680
|
autoComplete: "off",
|
|
23694
23681
|
autoCorrect: "off",
|
|
@@ -23732,7 +23719,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
23732
23719
|
isFocused = _this$state5.isFocused;
|
|
23733
23720
|
|
|
23734
23721
|
if (!this.hasValue() || !controlShouldRenderValue) {
|
|
23735
|
-
return inputValue ? null : /*#__PURE__*/React__namespace.createElement(Placeholder, _extends$
|
|
23722
|
+
return inputValue ? null : /*#__PURE__*/React__namespace.createElement(Placeholder, _extends$j({}, commonProps, {
|
|
23736
23723
|
key: "placeholder",
|
|
23737
23724
|
isDisabled: isDisabled,
|
|
23738
23725
|
isFocused: isFocused,
|
|
@@ -23746,7 +23733,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
23746
23733
|
return selectValue.map(function (opt, index) {
|
|
23747
23734
|
var isOptionFocused = opt === focusedValue;
|
|
23748
23735
|
var key = "".concat(_this3.getOptionLabel(opt), "-").concat(_this3.getOptionValue(opt));
|
|
23749
|
-
return /*#__PURE__*/React__namespace.createElement(MultiValue, _extends$
|
|
23736
|
+
return /*#__PURE__*/React__namespace.createElement(MultiValue, _extends$j({}, commonProps, {
|
|
23750
23737
|
components: {
|
|
23751
23738
|
Container: MultiValueContainer,
|
|
23752
23739
|
Label: MultiValueLabel,
|
|
@@ -23778,7 +23765,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
23778
23765
|
}
|
|
23779
23766
|
|
|
23780
23767
|
var singleValue = selectValue[0];
|
|
23781
|
-
return /*#__PURE__*/React__namespace.createElement(SingleValue, _extends$
|
|
23768
|
+
return /*#__PURE__*/React__namespace.createElement(SingleValue, _extends$j({}, commonProps, {
|
|
23782
23769
|
data: singleValue,
|
|
23783
23770
|
isDisabled: isDisabled
|
|
23784
23771
|
}), this.formatOptionLabel(singleValue, 'value'));
|
|
@@ -23804,7 +23791,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
23804
23791
|
onTouchEnd: this.onClearIndicatorTouchEnd,
|
|
23805
23792
|
'aria-hidden': 'true'
|
|
23806
23793
|
};
|
|
23807
|
-
return /*#__PURE__*/React__namespace.createElement(ClearIndicator, _extends$
|
|
23794
|
+
return /*#__PURE__*/React__namespace.createElement(ClearIndicator, _extends$j({}, commonProps, {
|
|
23808
23795
|
innerProps: innerProps,
|
|
23809
23796
|
isFocused: isFocused
|
|
23810
23797
|
}));
|
|
@@ -23824,7 +23811,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
23824
23811
|
var innerProps = {
|
|
23825
23812
|
'aria-hidden': 'true'
|
|
23826
23813
|
};
|
|
23827
|
-
return /*#__PURE__*/React__namespace.createElement(LoadingIndicator, _extends$
|
|
23814
|
+
return /*#__PURE__*/React__namespace.createElement(LoadingIndicator, _extends$j({}, commonProps, {
|
|
23828
23815
|
innerProps: innerProps,
|
|
23829
23816
|
isDisabled: isDisabled,
|
|
23830
23817
|
isFocused: isFocused
|
|
@@ -23842,7 +23829,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
23842
23829
|
var commonProps = this.commonProps;
|
|
23843
23830
|
var isDisabled = this.props.isDisabled;
|
|
23844
23831
|
var isFocused = this.state.isFocused;
|
|
23845
|
-
return /*#__PURE__*/React__namespace.createElement(IndicatorSeparator, _extends$
|
|
23832
|
+
return /*#__PURE__*/React__namespace.createElement(IndicatorSeparator, _extends$j({}, commonProps, {
|
|
23846
23833
|
isDisabled: isDisabled,
|
|
23847
23834
|
isFocused: isFocused
|
|
23848
23835
|
}));
|
|
@@ -23862,7 +23849,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
23862
23849
|
onTouchEnd: this.onDropdownIndicatorTouchEnd,
|
|
23863
23850
|
'aria-hidden': 'true'
|
|
23864
23851
|
};
|
|
23865
|
-
return /*#__PURE__*/React__namespace.createElement(DropdownIndicator, _extends$
|
|
23852
|
+
return /*#__PURE__*/React__namespace.createElement(DropdownIndicator, _extends$j({}, commonProps, {
|
|
23866
23853
|
innerProps: innerProps,
|
|
23867
23854
|
isDisabled: isDisabled,
|
|
23868
23855
|
isFocused: isFocused
|
|
@@ -23925,7 +23912,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
23925
23912
|
onMouseOver: onHover,
|
|
23926
23913
|
tabIndex: -1
|
|
23927
23914
|
};
|
|
23928
|
-
return /*#__PURE__*/React__namespace.createElement(Option, _extends$
|
|
23915
|
+
return /*#__PURE__*/React__namespace.createElement(Option, _extends$j({}, commonProps, {
|
|
23929
23916
|
innerProps: innerProps,
|
|
23930
23917
|
data: data,
|
|
23931
23918
|
isDisabled: isDisabled,
|
|
@@ -23949,7 +23936,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
23949
23936
|
groupIndex = item.index;
|
|
23950
23937
|
var groupId = "".concat(_this4.getElementId('group'), "-").concat(groupIndex);
|
|
23951
23938
|
var headingId = "".concat(groupId, "-heading");
|
|
23952
|
-
return /*#__PURE__*/React__namespace.createElement(Group, _extends$
|
|
23939
|
+
return /*#__PURE__*/React__namespace.createElement(Group, _extends$j({}, commonProps, {
|
|
23953
23940
|
key: groupId,
|
|
23954
23941
|
data: _data,
|
|
23955
23942
|
options: options,
|
|
@@ -23988,12 +23975,12 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
23988
23975
|
menuPosition: menuPosition,
|
|
23989
23976
|
menuShouldScrollIntoView: menuShouldScrollIntoView
|
|
23990
23977
|
};
|
|
23991
|
-
var menuElement = /*#__PURE__*/React__namespace.createElement(MenuPlacer, _extends$
|
|
23978
|
+
var menuElement = /*#__PURE__*/React__namespace.createElement(MenuPlacer, _extends$j({}, commonProps, menuPlacementProps), function (_ref4) {
|
|
23992
23979
|
var ref = _ref4.ref,
|
|
23993
23980
|
_ref4$placerProps = _ref4.placerProps,
|
|
23994
23981
|
placement = _ref4$placerProps.placement,
|
|
23995
23982
|
maxHeight = _ref4$placerProps.maxHeight;
|
|
23996
|
-
return /*#__PURE__*/React__namespace.createElement(Menu, _extends$
|
|
23983
|
+
return /*#__PURE__*/React__namespace.createElement(Menu, _extends$j({}, commonProps, menuPlacementProps, {
|
|
23997
23984
|
innerRef: ref,
|
|
23998
23985
|
innerProps: {
|
|
23999
23986
|
onMouseDown: _this4.onMenuMouseDown,
|
|
@@ -24008,7 +23995,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
24008
23995
|
onBottomArrive: onMenuScrollToBottom,
|
|
24009
23996
|
lockEnabled: menuShouldBlockScroll
|
|
24010
23997
|
}, function (scrollTargetRef) {
|
|
24011
|
-
return /*#__PURE__*/React__namespace.createElement(MenuList, _extends$
|
|
23998
|
+
return /*#__PURE__*/React__namespace.createElement(MenuList, _extends$j({}, commonProps, {
|
|
24012
23999
|
innerRef: function innerRef(instance) {
|
|
24013
24000
|
_this4.getMenuListRef(instance);
|
|
24014
24001
|
|
|
@@ -24023,7 +24010,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
24023
24010
|
// so we use the same component. the actual portalling logic is forked
|
|
24024
24011
|
// within the component based on `menuPosition`
|
|
24025
24012
|
|
|
24026
|
-
return menuPortalTarget || menuPosition === 'fixed' ? /*#__PURE__*/React__namespace.createElement(MenuPortal, _extends$
|
|
24013
|
+
return menuPortalTarget || menuPosition === 'fixed' ? /*#__PURE__*/React__namespace.createElement(MenuPortal, _extends$j({}, commonProps, {
|
|
24027
24014
|
appendTo: menuPortalTarget,
|
|
24028
24015
|
controlElement: this.controlRef,
|
|
24029
24016
|
menuPlacement: menuPlacement,
|
|
@@ -24088,7 +24075,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
24088
24075
|
isFocused = _this$state6.isFocused,
|
|
24089
24076
|
selectValue = _this$state6.selectValue;
|
|
24090
24077
|
var focusableOptions = this.getFocusableOptions();
|
|
24091
|
-
return /*#__PURE__*/React__namespace.createElement(LiveRegion, _extends$
|
|
24078
|
+
return /*#__PURE__*/React__namespace.createElement(LiveRegion, _extends$j({}, commonProps, {
|
|
24092
24079
|
id: this.getElementId('live-region'),
|
|
24093
24080
|
ariaSelection: ariaSelection,
|
|
24094
24081
|
focusedOption: focusedOption,
|
|
@@ -24114,7 +24101,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
24114
24101
|
menuIsOpen = _this$props14.menuIsOpen;
|
|
24115
24102
|
var isFocused = this.state.isFocused;
|
|
24116
24103
|
var commonProps = this.commonProps = this.getCommonProps();
|
|
24117
|
-
return /*#__PURE__*/React__namespace.createElement(SelectContainer, _extends$
|
|
24104
|
+
return /*#__PURE__*/React__namespace.createElement(SelectContainer, _extends$j({}, commonProps, {
|
|
24118
24105
|
className: className,
|
|
24119
24106
|
innerProps: {
|
|
24120
24107
|
id: id,
|
|
@@ -24122,7 +24109,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
24122
24109
|
},
|
|
24123
24110
|
isDisabled: isDisabled,
|
|
24124
24111
|
isFocused: isFocused
|
|
24125
|
-
}), this.renderLiveRegion(), /*#__PURE__*/React__namespace.createElement(Control, _extends$
|
|
24112
|
+
}), this.renderLiveRegion(), /*#__PURE__*/React__namespace.createElement(Control, _extends$j({}, commonProps, {
|
|
24126
24113
|
innerRef: this.getControlRef,
|
|
24127
24114
|
innerProps: {
|
|
24128
24115
|
onMouseDown: this.onControlMouseDown,
|
|
@@ -24131,9 +24118,9 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
24131
24118
|
isDisabled: isDisabled,
|
|
24132
24119
|
isFocused: isFocused,
|
|
24133
24120
|
menuIsOpen: menuIsOpen
|
|
24134
|
-
}), /*#__PURE__*/React__namespace.createElement(ValueContainer, _extends$
|
|
24121
|
+
}), /*#__PURE__*/React__namespace.createElement(ValueContainer, _extends$j({}, commonProps, {
|
|
24135
24122
|
isDisabled: isDisabled
|
|
24136
|
-
}), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/React__namespace.createElement(IndicatorsContainer, _extends$
|
|
24123
|
+
}), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/React__namespace.createElement(IndicatorsContainer, _extends$j({}, commonProps, {
|
|
24137
24124
|
isDisabled: isDisabled
|
|
24138
24125
|
}), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());
|
|
24139
24126
|
}
|
|
@@ -24206,7 +24193,7 @@ Select$1.defaultProps = defaultProps;
|
|
|
24206
24193
|
|
|
24207
24194
|
var StateManagedSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
24208
24195
|
var baseSelectProps = useStateManager(props);
|
|
24209
|
-
return /*#__PURE__*/React__namespace.createElement(Select$1, _extends$
|
|
24196
|
+
return /*#__PURE__*/React__namespace.createElement(Select$1, _extends$j({
|
|
24210
24197
|
ref: ref
|
|
24211
24198
|
}, baseSelectProps));
|
|
24212
24199
|
});
|
|
@@ -24214,9 +24201,9 @@ var StateManagedSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
24214
24201
|
var ReactSelect = StateManagedSelect;
|
|
24215
24202
|
|
|
24216
24203
|
var _g$6;
|
|
24217
|
-
function _extends$
|
|
24204
|
+
function _extends$i() { _extends$i = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$i.apply(this, arguments); }
|
|
24218
24205
|
var SvgIcAppstatusCancelled = function SvgIcAppstatusCancelled(props) {
|
|
24219
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
24206
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
|
|
24220
24207
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24221
24208
|
viewBox: "0 0 28 28",
|
|
24222
24209
|
width: "1em",
|
|
@@ -24237,15 +24224,15 @@ var SvgIcAppstatusCancelled = function SvgIcAppstatusCancelled(props) {
|
|
|
24237
24224
|
}))));
|
|
24238
24225
|
};
|
|
24239
24226
|
|
|
24240
|
-
var _path$
|
|
24241
|
-
function _extends$
|
|
24227
|
+
var _path$a;
|
|
24228
|
+
function _extends$h() { _extends$h = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$h.apply(this, arguments); }
|
|
24242
24229
|
var SvgIcCheck = function SvgIcCheck(props) {
|
|
24243
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
24230
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
|
|
24244
24231
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24245
24232
|
width: "1em",
|
|
24246
24233
|
height: "1em",
|
|
24247
24234
|
viewBox: "0 0 24 24"
|
|
24248
|
-
}, props), _path$
|
|
24235
|
+
}, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
|
|
24249
24236
|
stroke: "#06C",
|
|
24250
24237
|
strokeLinecap: "round",
|
|
24251
24238
|
strokeLinejoin: "round",
|
|
@@ -24257,9 +24244,9 @@ var SvgIcCheck = function SvgIcCheck(props) {
|
|
|
24257
24244
|
};
|
|
24258
24245
|
|
|
24259
24246
|
var _g$5;
|
|
24260
|
-
function _extends$
|
|
24247
|
+
function _extends$g() { _extends$g = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
|
|
24261
24248
|
var SvgIcErrorMedium = function SvgIcErrorMedium(props) {
|
|
24262
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
24249
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
|
|
24263
24250
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24264
24251
|
width: "1em",
|
|
24265
24252
|
height: "1em",
|
|
@@ -24588,6 +24575,7 @@ Valid States of Checkbox:
|
|
|
24588
24575
|
5. disabled: false, checked: true, value: INTERMIDIATE
|
|
24589
24576
|
6. disabled: false, checked: true, value: CHECKED
|
|
24590
24577
|
*/
|
|
24578
|
+
// TODO: Associate label with input element
|
|
24591
24579
|
var Checkbox$1 = /** @class */ (function (_super) {
|
|
24592
24580
|
__extends$1(Checkbox, _super);
|
|
24593
24581
|
function Checkbox() {
|
|
@@ -24602,9 +24590,9 @@ var Checkbox$1 = /** @class */ (function (_super) {
|
|
|
24602
24590
|
}(React.Component));
|
|
24603
24591
|
|
|
24604
24592
|
var _g$4;
|
|
24605
|
-
function _extends$
|
|
24593
|
+
function _extends$f() { _extends$f = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
|
|
24606
24594
|
var SvgIcSearch = function SvgIcSearch(props) {
|
|
24607
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
24595
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
|
|
24608
24596
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24609
24597
|
viewBox: "0 0 24 24",
|
|
24610
24598
|
width: "1em",
|
|
@@ -24621,9 +24609,9 @@ var SvgIcSearch = function SvgIcSearch(props) {
|
|
|
24621
24609
|
};
|
|
24622
24610
|
|
|
24623
24611
|
var _g$3;
|
|
24624
|
-
function _extends$
|
|
24612
|
+
function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
|
|
24625
24613
|
var SvgIcErrorCross = function SvgIcErrorCross(props) {
|
|
24626
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
24614
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
|
|
24627
24615
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24628
24616
|
width: "1em",
|
|
24629
24617
|
height: "1em",
|
|
@@ -24645,7 +24633,7 @@ var SvgIcErrorCross = function SvgIcErrorCross(props) {
|
|
|
24645
24633
|
}))));
|
|
24646
24634
|
};
|
|
24647
24635
|
|
|
24648
|
-
var css_248z$5 = ".search-bar:focus, .search-bar:focus-within {\n outline: none;\n border: solid 1px var(--B500);\n}\n.search-bar__input:focus, .search-bar__input:focus-visible {\n border: none;\n outline: none;\n}\n.search-bar__icon {\n z-index: 1;\n top: 50%;\n left: 8px;\n transform: translateY(-50%);\n}\n.search-bar__clear-button {\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n}";
|
|
24636
|
+
var css_248z$5 = ".search-bar:focus, .search-bar:focus-within {\n outline: none;\n border: solid 1px var(--B500) !important;\n}\n.search-bar__input:focus, .search-bar__input:focus-visible {\n border: none;\n outline: none;\n}\n.search-bar__icon {\n z-index: 1;\n top: 50%;\n left: 8px;\n transform: translateY(-50%);\n}\n.search-bar__clear-button {\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n}";
|
|
24649
24637
|
styleInject(css_248z$5);
|
|
24650
24638
|
|
|
24651
24639
|
/**
|
|
@@ -24690,9 +24678,26 @@ var SearchBar = function (_a) {
|
|
|
24690
24678
|
handleSearchChange,
|
|
24691
24679
|
debounceTimeout,
|
|
24692
24680
|
]);
|
|
24681
|
+
// In most case would reset the state by doing history.push('/')
|
|
24682
|
+
React.useEffect(function () {
|
|
24683
|
+
inputRef.current.value = initialSearchText;
|
|
24684
|
+
}, [initialSearchText]);
|
|
24685
|
+
var _applySearch = function (value) {
|
|
24686
|
+
handleSearchChange(value);
|
|
24687
|
+
handleEnter(value);
|
|
24688
|
+
};
|
|
24689
|
+
var clearSearch = function () {
|
|
24690
|
+
inputRef.current.value = '';
|
|
24691
|
+
_applySearch('');
|
|
24692
|
+
setShowClearButton(false);
|
|
24693
|
+
};
|
|
24693
24694
|
var handleChange = function (e) {
|
|
24694
24695
|
var value = e.target.value;
|
|
24695
24696
|
setShowClearButton(!!value);
|
|
24697
|
+
if (!value) {
|
|
24698
|
+
clearSearch();
|
|
24699
|
+
return;
|
|
24700
|
+
}
|
|
24696
24701
|
if (shouldDebounce) {
|
|
24697
24702
|
debouncedSearchChange(value);
|
|
24698
24703
|
}
|
|
@@ -24700,10 +24705,6 @@ var SearchBar = function (_a) {
|
|
|
24700
24705
|
handleSearchChange(value);
|
|
24701
24706
|
}
|
|
24702
24707
|
};
|
|
24703
|
-
var _applySearch = function (value) {
|
|
24704
|
-
handleSearchChange(value);
|
|
24705
|
-
handleEnter(value);
|
|
24706
|
-
};
|
|
24707
24708
|
var handleKeyDown = function (e) {
|
|
24708
24709
|
var key = e.key;
|
|
24709
24710
|
if (key === 'Enter') {
|
|
@@ -24712,66 +24713,7 @@ var SearchBar = function (_a) {
|
|
|
24712
24713
|
_applySearch(value);
|
|
24713
24714
|
}
|
|
24714
24715
|
};
|
|
24715
|
-
|
|
24716
|
-
inputRef.current.value = '';
|
|
24717
|
-
_applySearch('');
|
|
24718
|
-
};
|
|
24719
|
-
return (jsxRuntime.jsx("div", __assign({ className: containerClassName }, { children: jsxRuntime.jsxs("div", __assign({ className: "search-bar bcn-0 dc__block w-100 min-w-200 dc__position-rel en-2 bw-1 br-4 h-32" }, { children: [jsxRuntime.jsx(SvgIcSearch, { className: "search-bar__icon dc__position-abs icon-color-n6 icon-dim-18" }), jsxRuntime.jsx("input", __assign({ placeholder: "Search", "data-testid": "search-bar", type: "text" }, inputProps, { defaultValue: initialSearchText, className: "search-bar__input bcn-0 dc__position-abs w-100 h-100 br-4 dc__no-border pt-6 pr-10 pb-6 pl-30 fs-13 lh-20 fw-4 cn-9 placeholder-cn5 ".concat(showClearButton ? 'pr-30' : 'pr-10'), onChange: handleChange, onKeyDown: handleKeyDown, ref: inputRef })), showClearButton && (jsxRuntime.jsx("button", __assign({ className: "flex search-bar__clear-button dc__position-abs dc__transparent mt-0 mb-0 mr-5 ml-5", type: "button", onClick: clearSearch, "aria-label": "Clear search" }, { children: jsxRuntime.jsx(SvgIcErrorCross, { className: "icon-dim-18 icon-n4 dc__vertical-align-middle" }) })))] })) })));
|
|
24720
|
-
};
|
|
24721
|
-
|
|
24722
|
-
var _path$8;
|
|
24723
|
-
function _extends$c() { _extends$c = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
|
|
24724
|
-
var SvgIcArrowUpDown = function SvgIcArrowUpDown(props) {
|
|
24725
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
|
|
24726
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
24727
|
-
width: "1em",
|
|
24728
|
-
height: "1em",
|
|
24729
|
-
viewBox: "0 0 12 12",
|
|
24730
|
-
fill: "none"
|
|
24731
|
-
}, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
24732
|
-
d: "M4.125 8.5 6 10.75 7.875 8.5m-3.75-5L6 1.25 7.875 3.5",
|
|
24733
|
-
stroke: "#3B444C",
|
|
24734
|
-
strokeWidth: 1.5,
|
|
24735
|
-
strokeLinecap: "round",
|
|
24736
|
-
strokeLinejoin: "round"
|
|
24737
|
-
})));
|
|
24738
|
-
};
|
|
24739
|
-
|
|
24740
|
-
var _path$7;
|
|
24741
|
-
function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
|
|
24742
|
-
var SvgIcSortArrowDown = function SvgIcSortArrowDown(props) {
|
|
24743
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
|
|
24744
|
-
width: "1em",
|
|
24745
|
-
height: "1em",
|
|
24746
|
-
viewBox: "0 0 12 12",
|
|
24747
|
-
fill: "none",
|
|
24748
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
24749
|
-
}, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
24750
|
-
d: "M3.5 7.5 6 10m0 0 2.5-2.5M6 10V2",
|
|
24751
|
-
stroke: "#596168",
|
|
24752
|
-
strokeWidth: 1.5,
|
|
24753
|
-
strokeLinecap: "round",
|
|
24754
|
-
strokeLinejoin: "round"
|
|
24755
|
-
})));
|
|
24756
|
-
};
|
|
24757
|
-
|
|
24758
|
-
/**
|
|
24759
|
-
* Reusable component for the table header cell with support for sorting icons
|
|
24760
|
-
*
|
|
24761
|
-
* @example Usage
|
|
24762
|
-
* ```tsx
|
|
24763
|
-
* <SortableTableHeaderCell
|
|
24764
|
-
* isSorted={currentSortedCell === 'cell'}
|
|
24765
|
-
* triggerSorting={() => {}}
|
|
24766
|
-
* sortOrder={SortingOrder.ASC}
|
|
24767
|
-
* title="Header Cell"
|
|
24768
|
-
* disabled={isDisabled}
|
|
24769
|
-
* />
|
|
24770
|
-
* ```
|
|
24771
|
-
*/
|
|
24772
|
-
var SortableTableHeaderCell = function (_a) {
|
|
24773
|
-
var isSorted = _a.isSorted, triggerSorting = _a.triggerSorting, sortOrder = _a.sortOrder, title = _a.title, disabled = _a.disabled;
|
|
24774
|
-
return (jsxRuntime.jsxs("button", __assign({ type: "button", className: "dc__transparent p-0 bcn-0 cn-7 flex dc__content-start dc__gap-4 cursor", onClick: triggerSorting, disabled: disabled }, { children: [jsxRuntime.jsx("span", __assign({ className: "dc__uppercase dc__ellipsis-right" }, { children: title })), isSorted ? (jsxRuntime.jsx(SvgIcSortArrowDown, { className: "icon-dim-12 mw-12 scn-7 ".concat(sortOrder === exports.SortingOrder.DESC ? 'dc__flip-180' : '') })) : (jsxRuntime.jsx(SvgIcArrowUpDown, { className: "icon-dim-12 mw-12 scn-7" }))] })));
|
|
24716
|
+
return (jsxRuntime.jsx("div", __assign({ className: containerClassName }, { children: jsxRuntime.jsxs("div", __assign({ className: "search-bar bc-n50 focus-within-border-b5 dc__hover-border-n300 dc__block w-100 min-w-200 dc__position-rel en-2 bw-1 br-4 h-32" }, { children: [jsxRuntime.jsx(SvgIcSearch, { className: "search-bar__icon dc__position-abs icon-color-n6 icon-dim-18" }), jsxRuntime.jsx("input", __assign({ placeholder: "Search", "data-testid": "search-bar", type: "text" }, inputProps, { defaultValue: initialSearchText, className: "search-bar__input bc-n50 dc__position-abs w-100 h-100 br-4 dc__no-border pt-6 pr-10 pb-6 pl-30 fs-13 lh-20 fw-4 cn-9 placeholder-cn5 ".concat(showClearButton ? 'pr-30' : 'pr-10'), onChange: handleChange, onKeyDown: handleKeyDown, ref: inputRef })), showClearButton && (jsxRuntime.jsx("button", __assign({ className: "flex search-bar__clear-button dc__position-abs dc__transparent mt-0 mb-0 mr-5 ml-5", type: "button", onClick: clearSearch, "aria-label": "Clear search" }, { children: jsxRuntime.jsx(SvgIcErrorCross, { className: "icon-dim-18 icon-n4 dc__vertical-align-middle" }) })))] })) })));
|
|
24775
24717
|
};
|
|
24776
24718
|
|
|
24777
24719
|
var css_248z$4 = ".toggle__switch {\n position: relative;\n display: inline-block;\n width: 100%;\n height: 100%;\n}\n.toggle__switch.disabled {\n cursor: not-allowed;\n}\n.toggle__switch.disabled .toggle__slider {\n cursor: not-allowed;\n}\n\n/* Hide default HTML checkbox */\n.toggle__switch input {\n opacity: 0;\n width: 0;\n height: 0;\n}\n\n/* The slider */\n.toggle__slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #ccc;\n transition: all 0.4s ease;\n}\n.toggle__slider.round {\n border-radius: 34px;\n}\n.toggle__slider.round:before {\n border-radius: 50%;\n}\n.toggle__slider:before {\n position: absolute;\n content: \"\";\n height: calc(100% - 8px);\n width: calc(50% - 4px);\n left: 4px;\n bottom: 4px;\n background-color: white;\n transition: all 0.4s ease;\n}\n.toggle__slider.with-icon {\n background-color: var(--N000) !important;\n}\n.toggle__slider.with-icon svg {\n position: absolute;\n content: \"\";\n top: -1px;\n left: -1px;\n background-color: var(--N300);\n transition: all 0.4s ease;\n}\n\ninput:checked + .toggle__slider {\n background-color: var(--color);\n}\ninput:checked + .toggle__slider:before {\n transform: translateX(100%);\n}\ninput:checked + .toggle__slider.with-icon svg {\n transform: translateX(100%);\n background-color: var(--color);\n}\n\ninput:focus + .toggle__slider {\n box-shadow: 0 0 1px var(--color);\n}";
|
|
@@ -24910,9 +24852,9 @@ exports.ConsequenceAction = void 0;
|
|
|
24910
24852
|
})(exports.ConsequenceAction || (exports.ConsequenceAction = {}));
|
|
24911
24853
|
|
|
24912
24854
|
var _g$2;
|
|
24913
|
-
function _extends$
|
|
24855
|
+
function _extends$d() { _extends$d = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); }
|
|
24914
24856
|
var SvgIcInfoFilled = function SvgIcInfoFilled(props) {
|
|
24915
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
24857
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
|
|
24916
24858
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24917
24859
|
width: "1em",
|
|
24918
24860
|
height: "1em",
|
|
@@ -24991,16 +24933,16 @@ function DeleteComponent(_a) {
|
|
|
24991
24933
|
return (jsxRuntime.jsxs("div", { children: [!showCannotDeleteDialogModal && renderDeleteDialog(), showCannotDeleteDialogModal && renderCannotDeleteDialogModal()] }));
|
|
24992
24934
|
}
|
|
24993
24935
|
|
|
24994
|
-
var _path$
|
|
24995
|
-
function _extends$
|
|
24936
|
+
var _path$9;
|
|
24937
|
+
function _extends$c() { _extends$c = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
|
|
24996
24938
|
var SvgIcPencil = function SvgIcPencil(props) {
|
|
24997
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
24939
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
|
|
24998
24940
|
width: "1em",
|
|
24999
24941
|
height: "1em",
|
|
25000
24942
|
viewBox: "0 0 20 20",
|
|
25001
24943
|
fill: "none",
|
|
25002
24944
|
xmlns: "http://www.w3.org/2000/svg"
|
|
25003
|
-
}, props), _path$
|
|
24945
|
+
}, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
25004
24946
|
d: "M10.625 5 15 9.375m-7.5 7.5H3.75a.625.625 0 0 1-.625-.625v-3.491a.625.625 0 0 1 .183-.442l9.375-9.375a.625.625 0 0 1 .884 0l3.491 3.491a.625.625 0 0 1 0 .884L7.5 16.875Z",
|
|
25005
24947
|
stroke: "#596168",
|
|
25006
24948
|
strokeWidth: 1.5,
|
|
@@ -25009,19 +24951,19 @@ var SvgIcPencil = function SvgIcPencil(props) {
|
|
|
25009
24951
|
})));
|
|
25010
24952
|
};
|
|
25011
24953
|
|
|
25012
|
-
var _path$
|
|
25013
|
-
function _extends$
|
|
24954
|
+
var _path$8, _path2$1, _path3;
|
|
24955
|
+
function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
|
|
25014
24956
|
var SvgIcArrowCounterClockwise = function SvgIcArrowCounterClockwise(props) {
|
|
25015
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
24957
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
|
|
25016
24958
|
width: "1em",
|
|
25017
24959
|
height: "1em",
|
|
25018
24960
|
viewBox: "0 0 12 12",
|
|
25019
24961
|
fill: "none",
|
|
25020
24962
|
xmlns: "http://www.w3.org/2000/svg"
|
|
25021
|
-
}, props), _path$
|
|
24963
|
+
}, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
25022
24964
|
d: "M3.742 4.674h-2.25v-2.25",
|
|
25023
24965
|
fill: "#767D84"
|
|
25024
|
-
})), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
24966
|
+
})), _path2$1 || (_path2$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
25025
24967
|
d: "M3.742 4.674h-2.25v-2.25",
|
|
25026
24968
|
stroke: "#596168",
|
|
25027
24969
|
strokeWidth: 1.5,
|
|
@@ -25036,15 +24978,15 @@ var SvgIcArrowCounterClockwise = function SvgIcArrowCounterClockwise(props) {
|
|
|
25036
24978
|
})));
|
|
25037
24979
|
};
|
|
25038
24980
|
|
|
25039
|
-
var _path$
|
|
25040
|
-
function _extends$
|
|
24981
|
+
var _path$7;
|
|
24982
|
+
function _extends$a() { _extends$a = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
|
|
25041
24983
|
var SvgIcMinus = function SvgIcMinus(props) {
|
|
25042
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
24984
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
|
|
25043
24985
|
xmlns: "http://www.w3.org/2000/svg",
|
|
25044
24986
|
width: "1em",
|
|
25045
24987
|
height: "1em",
|
|
25046
24988
|
viewBox: "0 0 14 14"
|
|
25047
|
-
}, props), _path$
|
|
24989
|
+
}, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
25048
24990
|
fill: "#959BA1",
|
|
25049
24991
|
className: "ic-minus_svg__fill-color",
|
|
25050
24992
|
fillRule: "evenodd",
|
|
@@ -25053,9 +24995,9 @@ var SvgIcMinus = function SvgIcMinus(props) {
|
|
|
25053
24995
|
};
|
|
25054
24996
|
|
|
25055
24997
|
var _g$1;
|
|
25056
|
-
function _extends$
|
|
24998
|
+
function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
|
|
25057
24999
|
var SvgIcWarning = function SvgIcWarning(props) {
|
|
25058
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
25000
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
|
|
25059
25001
|
xmlns: "http://www.w3.org/2000/svg",
|
|
25060
25002
|
width: "1em",
|
|
25061
25003
|
height: "1em",
|
|
@@ -25075,9 +25017,9 @@ var SvgIcWarning = function SvgIcWarning(props) {
|
|
|
25075
25017
|
};
|
|
25076
25018
|
|
|
25077
25019
|
var _g;
|
|
25078
|
-
function _extends$
|
|
25020
|
+
function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
|
|
25079
25021
|
var SvgIcErrorExclamation = function SvgIcErrorExclamation(props) {
|
|
25080
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
25022
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
|
|
25081
25023
|
xmlns: "http://www.w3.org/2000/svg",
|
|
25082
25024
|
width: "1em",
|
|
25083
25025
|
height: "1em",
|
|
@@ -25094,16 +25036,16 @@ var SvgIcErrorExclamation = function SvgIcErrorExclamation(props) {
|
|
|
25094
25036
|
}))));
|
|
25095
25037
|
};
|
|
25096
25038
|
|
|
25097
|
-
var _path$
|
|
25098
|
-
function _extends$
|
|
25039
|
+
var _path$6;
|
|
25040
|
+
function _extends$7() { _extends$7 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
|
|
25099
25041
|
var SvgIcEnter = function SvgIcEnter(props) {
|
|
25100
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
25042
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
|
|
25101
25043
|
width: "1em",
|
|
25102
25044
|
height: "1em",
|
|
25103
25045
|
viewBox: "0 0 16 16",
|
|
25104
25046
|
fill: "none",
|
|
25105
25047
|
xmlns: "http://www.w3.org/2000/svg"
|
|
25106
|
-
}, props), _path$
|
|
25048
|
+
}, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
25107
25049
|
d: "M12.667 4a.667.667 0 0 0-.667.667v2.666a.667.667 0 0 1-.667.667H4.94l.867-.86a.67.67 0 1 0-.947-.947l-2 2a.667.667 0 0 0-.14.22.667.667 0 0 0 0 .507c.032.082.08.157.14.22l2 2a.666.666 0 0 0 .947 0 .667.667 0 0 0 0-.947l-.867-.86h6.393a2 2 0 0 0 2-2V4.667A.667.667 0 0 0 12.667 4Z",
|
|
25108
25050
|
fill: "#3B444C"
|
|
25109
25051
|
})));
|
|
@@ -25509,15 +25451,15 @@ function Grid(_a) {
|
|
|
25509
25451
|
return (jsxRuntime.jsx("div", __assign({ className: "flex-wrap flexbox ".concat(container ? containerClass : ''), style: containerStyles }, containerDivProps, { children: children })));
|
|
25510
25452
|
}
|
|
25511
25453
|
|
|
25512
|
-
var _path$
|
|
25513
|
-
function _extends$
|
|
25454
|
+
var _path$5;
|
|
25455
|
+
function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
|
|
25514
25456
|
var SvgIcCopy = function SvgIcCopy(props) {
|
|
25515
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
25457
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
|
|
25516
25458
|
xmlns: "http://www.w3.org/2000/svg",
|
|
25517
25459
|
width: "1em",
|
|
25518
25460
|
height: "1em",
|
|
25519
25461
|
viewBox: "0 0 20 20"
|
|
25520
|
-
}, props), _path$
|
|
25462
|
+
}, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
25521
25463
|
fill: "#767D84",
|
|
25522
25464
|
fillRule: "evenodd",
|
|
25523
25465
|
d: "M15.833 6.917a2.5 2.5 0 0 1 2.5 2.5v6.416a2.5 2.5 0 0 1-2.5 2.5H9.417a2.5 2.5 0 0 1-2.5-2.5V9.417a2.5 2.5 0 0 1 2.5-2.5zm0 1.666H9.417a.833.833 0 0 0-.834.834v6.416c0 .46.373.834.834.834h6.416c.46 0 .834-.373.834-.834V9.417a.833.833 0 0 0-.834-.834zM10.75 1.667c1.24 0 2.256.968 2.33 2.19l.003.143v.75a.833.833 0 0 1-1.66.097l-.006-.097V4c0-.34-.255-.62-.583-.661l-.084-.006H4c-.34 0-.62.255-.661.583L3.333 4v6.75c0 .34.255.62.583.661l.084.006h.75a.833.833 0 0 1 .097 1.66l-.097.006H4a2.333 2.333 0 0 1-2.33-2.19l-.003-.143V4c0-1.24.968-2.256 2.19-2.33L4 1.668h6.75z"
|
|
@@ -25614,115 +25556,6 @@ var useWindowSize = function () {
|
|
|
25614
25556
|
return windowSize;
|
|
25615
25557
|
};
|
|
25616
25558
|
|
|
25617
|
-
var DEFAULT_PAGE_NUMBER = 1;
|
|
25618
|
-
var URL_FILTER_KEYS = {
|
|
25619
|
-
PAGE_SIZE: 'pageSize',
|
|
25620
|
-
PAGE_NUMBER: 'pageNumber',
|
|
25621
|
-
SEARCH_KEY: 'searchKey',
|
|
25622
|
-
SORT_BY: 'sortBy',
|
|
25623
|
-
SORT_ORDER: 'sortOrder',
|
|
25624
|
-
};
|
|
25625
|
-
|
|
25626
|
-
var PAGE_SIZE = URL_FILTER_KEYS.PAGE_SIZE, PAGE_NUMBER = URL_FILTER_KEYS.PAGE_NUMBER, SEARCH_KEY = URL_FILTER_KEYS.SEARCH_KEY, SORT_BY = URL_FILTER_KEYS.SORT_BY, SORT_ORDER = URL_FILTER_KEYS.SORT_ORDER;
|
|
25627
|
-
/**
|
|
25628
|
-
* Generic hook for implementing URL based filters.
|
|
25629
|
-
* eg: pagination, search, sort.
|
|
25630
|
-
*
|
|
25631
|
-
* The exposed handlers can be consumed directly without the need for explicit state management
|
|
25632
|
-
*
|
|
25633
|
-
* @example Default Usage:
|
|
25634
|
-
* ```tsx
|
|
25635
|
-
* const { pageSize, changePage, ...rest } = useUrlFilters()
|
|
25636
|
-
* ```
|
|
25637
|
-
*
|
|
25638
|
-
* @example Usage with custom type for sort keys and initial sort key:
|
|
25639
|
-
* ```tsx
|
|
25640
|
-
* const { sortBy, sortOrder } = useUrlFilters<'email' | 'name'>({ initialSortKey: 'email' })
|
|
25641
|
-
* ```
|
|
25642
|
-
*
|
|
25643
|
-
*/
|
|
25644
|
-
var useUrlFilters = function (_a) {
|
|
25645
|
-
var _b = _a === void 0 ? {} : _a, initialSortKey = _b.initialSortKey;
|
|
25646
|
-
var location = reactRouterDom.useLocation();
|
|
25647
|
-
var history = reactRouterDom.useHistory();
|
|
25648
|
-
var searchParams = new URLSearchParams(location.search);
|
|
25649
|
-
var _c = React.useMemo(function () {
|
|
25650
|
-
var _pageSize = searchParams.get(PAGE_SIZE);
|
|
25651
|
-
var _pageNumber = searchParams.get(PAGE_NUMBER);
|
|
25652
|
-
var _searchKey = searchParams.get(SEARCH_KEY);
|
|
25653
|
-
var _sortOrder = searchParams.get(SORT_ORDER);
|
|
25654
|
-
var _sortBy = searchParams.get(SORT_BY);
|
|
25655
|
-
var sortByKey = (_sortBy || initialSortKey || '');
|
|
25656
|
-
// Fallback to ascending order
|
|
25657
|
-
var sortByOrder = Object.values(exports.SortingOrder).includes(_sortOrder) ? _sortOrder : exports.SortingOrder.ASC;
|
|
25658
|
-
return {
|
|
25659
|
-
pageSize: Number(_pageSize) || DEFAULT_BASE_PAGE_SIZE,
|
|
25660
|
-
pageNumber: Number(_pageNumber) || DEFAULT_PAGE_NUMBER,
|
|
25661
|
-
searchKey: _searchKey || '',
|
|
25662
|
-
sortBy: sortByKey,
|
|
25663
|
-
// sort order should only be applied if the key is available
|
|
25664
|
-
sortOrder: (sortByKey ? sortByOrder : ''),
|
|
25665
|
-
};
|
|
25666
|
-
}, [searchParams]), pageSize = _c.pageSize, pageNumber = _c.pageNumber, searchKey = _c.searchKey, sortBy = _c.sortBy, sortOrder = _c.sortOrder;
|
|
25667
|
-
/**
|
|
25668
|
-
* Used for getting the required result from the API
|
|
25669
|
-
*/
|
|
25670
|
-
var offset = pageSize * (pageNumber - 1);
|
|
25671
|
-
/**
|
|
25672
|
-
* Update and replace the search params in the URL.
|
|
25673
|
-
*
|
|
25674
|
-
* Note: Currently only primitive data types are supported
|
|
25675
|
-
*/
|
|
25676
|
-
var _updateSearchParam = function (key, value) {
|
|
25677
|
-
searchParams.set(key, String(value));
|
|
25678
|
-
history.replace({ search: searchParams.toString() });
|
|
25679
|
-
};
|
|
25680
|
-
var _resetPageNumber = function () {
|
|
25681
|
-
_updateSearchParam(PAGE_NUMBER, DEFAULT_PAGE_NUMBER);
|
|
25682
|
-
};
|
|
25683
|
-
var changePage = function (page) {
|
|
25684
|
-
_updateSearchParam(PAGE_NUMBER, page);
|
|
25685
|
-
};
|
|
25686
|
-
var changePageSize = function (_pageSize) {
|
|
25687
|
-
_updateSearchParam(PAGE_SIZE, _pageSize);
|
|
25688
|
-
_resetPageNumber();
|
|
25689
|
-
};
|
|
25690
|
-
var handleSearch = function (searchTerm) {
|
|
25691
|
-
_updateSearchParam(SEARCH_KEY, searchTerm);
|
|
25692
|
-
};
|
|
25693
|
-
var handleSorting = function (_sortBy) {
|
|
25694
|
-
var order;
|
|
25695
|
-
if (_sortBy === sortBy && sortOrder === exports.SortingOrder.ASC) {
|
|
25696
|
-
order = exports.SortingOrder.DESC;
|
|
25697
|
-
}
|
|
25698
|
-
else {
|
|
25699
|
-
order = exports.SortingOrder.ASC;
|
|
25700
|
-
}
|
|
25701
|
-
_updateSearchParam(SORT_BY, _sortBy);
|
|
25702
|
-
_updateSearchParam(SORT_ORDER, order);
|
|
25703
|
-
// Reset page number on sorting change
|
|
25704
|
-
_resetPageNumber();
|
|
25705
|
-
};
|
|
25706
|
-
var clearFilters = function () {
|
|
25707
|
-
Object.values(URL_FILTER_KEYS).forEach(function (key) {
|
|
25708
|
-
searchParams.delete(key);
|
|
25709
|
-
});
|
|
25710
|
-
history.replace({ search: searchParams.toString() });
|
|
25711
|
-
};
|
|
25712
|
-
return {
|
|
25713
|
-
pageSize: pageSize,
|
|
25714
|
-
changePage: changePage,
|
|
25715
|
-
changePageSize: changePageSize,
|
|
25716
|
-
searchKey: searchKey,
|
|
25717
|
-
handleSearch: handleSearch,
|
|
25718
|
-
offset: offset,
|
|
25719
|
-
sortBy: sortBy,
|
|
25720
|
-
sortOrder: sortOrder,
|
|
25721
|
-
handleSorting: handleSorting,
|
|
25722
|
-
clearFilters: clearFilters,
|
|
25723
|
-
};
|
|
25724
|
-
};
|
|
25725
|
-
|
|
25726
25559
|
var StatusConstants = {
|
|
25727
25560
|
NOT_DEPLOYED: {
|
|
25728
25561
|
noSpaceLower: 'notdeployed',
|
|
@@ -28406,9 +28239,10 @@ var translateString = function (stringToTranslate, params) {
|
|
|
28406
28239
|
return utils.englishStringTranslator(stringToTranslate, params);
|
|
28407
28240
|
}
|
|
28408
28241
|
};
|
|
28409
|
-
|
|
28242
|
+
// NOTE: If you are changing this please make sure BuildInfra selects are also working fine
|
|
28243
|
+
var getCommonSelectStyle$1 = function (styleOverrides) {
|
|
28410
28244
|
if (styleOverrides === void 0) { styleOverrides = {}; }
|
|
28411
|
-
return __assign({ menuList: function (base) { return (__assign(__assign({}, base), { paddingTop: 0, paddingBottom: 0 })); }, control: function (base, state) { return (__assign(__assign({}, base), { minHeight: '32px', boxShadow: 'none', backgroundColor: 'var(--N50)', border: state.isFocused ? '1px solid var(--B500)' : '1px solid var(--N200)', cursor: 'pointer' })); }, option: function (base, state) { return (__assign(__assign({}, base), { color: 'var(--N900)', backgroundColor: state.isFocused ? 'var(--N100)' : 'white', padding: '10px 12px' })); }, dropdownIndicator: function (base, state) { return (__assign(__assign({}, base), { color: 'var(--N400)', padding: '0 8px', transition: 'all .2s ease', transform: state.selectProps.menuIsOpen ? 'rotate(180deg)' : 'rotate(0deg)' })); }, valueContainer: function (base, state) { return (__assign(__assign({}, base), { padding: '0 8px', fontWeight: '400', color: state.selectProps.menuIsOpen ? 'var(--N500)' : base.color })); }, loadingMessage: function (base) { return (__assign(__assign({}, base), { color: 'var(--N600)' })); }, noOptionsMessage: function (base) { return (__assign(__assign({}, base), { color: 'var(--N600)' })); }, multiValue: function (base, state) {
|
|
28245
|
+
return __assign({ menuList: function (base) { return (__assign(__assign({}, base), { paddingTop: 0, paddingBottom: 0, cursor: 'pointer' })); }, control: function (base, state) { return (__assign(__assign({}, base), { minHeight: '32px', boxShadow: 'none', backgroundColor: 'var(--N50)', border: state.isFocused ? '1px solid var(--B500)' : '1px solid var(--N200)', cursor: 'pointer' })); }, option: function (base, state) { return (__assign(__assign({}, base), { color: 'var(--N900)', backgroundColor: state.isFocused ? 'var(--N100)' : 'white', padding: '10px 12px', cursor: 'pointer' })); }, dropdownIndicator: function (base, state) { return (__assign(__assign({}, base), { color: 'var(--N400)', padding: '0 8px', transition: 'all .2s ease', transform: state.selectProps.menuIsOpen ? 'rotate(180deg)' : 'rotate(0deg)' })); }, valueContainer: function (base, state) { return (__assign(__assign({}, base), { padding: '0 8px', fontWeight: '400', color: state.selectProps.menuIsOpen ? 'var(--N500)' : base.color })); }, loadingMessage: function (base) { return (__assign(__assign({}, base), { color: 'var(--N600)' })); }, noOptionsMessage: function (base) { return (__assign(__assign({}, base), { color: 'var(--N600)' })); }, multiValue: function (base, state) {
|
|
28412
28246
|
return __assign(__assign({}, base), { border: "1px solid var(--N200)", borderRadius: "4px", background: 'white', height: '28px', marginRight: '8px', padding: '2px', fontSize: '12px' });
|
|
28413
28247
|
} }, styleOverrides);
|
|
28414
28248
|
};
|
|
@@ -28458,15 +28292,15 @@ var getInferredTypeFromValueType = function (value) {
|
|
|
28458
28292
|
}
|
|
28459
28293
|
};
|
|
28460
28294
|
|
|
28461
|
-
var _path$
|
|
28462
|
-
function _extends$
|
|
28295
|
+
var _path$4;
|
|
28296
|
+
function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
|
|
28463
28297
|
var SvgIcChevronDown = function SvgIcChevronDown(props) {
|
|
28464
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
28298
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
|
|
28465
28299
|
xmlns: "http://www.w3.org/2000/svg",
|
|
28466
28300
|
width: "1em",
|
|
28467
28301
|
height: "1em",
|
|
28468
28302
|
viewBox: "0 0 24 24"
|
|
28469
|
-
}, props), _path$
|
|
28303
|
+
}, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
28470
28304
|
fill: "#999",
|
|
28471
28305
|
className: "ic-chevron-down_svg__fill-color",
|
|
28472
28306
|
fillRule: "nonzero",
|
|
@@ -28474,7 +28308,7 @@ var SvgIcChevronDown = function SvgIcChevronDown(props) {
|
|
|
28474
28308
|
})));
|
|
28475
28309
|
};
|
|
28476
28310
|
|
|
28477
|
-
var commonStyles = getCommonSelectStyle();
|
|
28311
|
+
var commonStyles = getCommonSelectStyle$1();
|
|
28478
28312
|
var MenuList = function (_a) {
|
|
28479
28313
|
var children = _a.children, props = __rest(_a, ["children"]);
|
|
28480
28314
|
return (jsxRuntime.jsx(components.MenuList, __assign({}, props, { children: Array.isArray(children) ? children.slice(0, 20) : children })));
|
|
@@ -28526,9 +28360,9 @@ var validator = RJSFValidator.default;
|
|
|
28526
28360
|
var RJSFForm = function (props) { return (jsxRuntime.jsx(Form, __assign({ noHtml5Validate: true, showErrorList: false, autoComplete: "off" }, props, { validator: validator, templates: __assign(__assign({}, templates), props.templates), widgets: __assign(__assign({}, widgets), props.widgets), translateString: translateString }))); };
|
|
28527
28361
|
|
|
28528
28362
|
var _style, _rect;
|
|
28529
|
-
function _extends$
|
|
28363
|
+
function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
|
|
28530
28364
|
var SvgIcRotateDevtron = function SvgIcRotateDevtron(props) {
|
|
28531
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
28365
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
|
|
28532
28366
|
width: "1em",
|
|
28533
28367
|
height: "1em",
|
|
28534
28368
|
viewBox: "0 0 100 100",
|
|
@@ -28663,8 +28497,9 @@ var handleAddCD = function (_a) {
|
|
|
28663
28497
|
handleCDSelect(workflowId, ciPipelineId, pipelineType, startNode.id, isWebhookCD, endNodeId, addPipelineType);
|
|
28664
28498
|
};
|
|
28665
28499
|
|
|
28500
|
+
// TODO: label association with input
|
|
28666
28501
|
function CustomInput(_a) {
|
|
28667
|
-
var name = _a.name, value = _a.value, error = _a.error, onChange = _a.onChange, _b = _a.onFocus, onFocus = _b === void 0 ? function (e) { } : _b, label = _a.label, _c = _a.type, type = _c === void 0 ? 'text' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.labelClassName, labelClassName = _e === void 0 ? '' : _e, _f = _a.placeholder, placeholder = _f === void 0 ? '' : _f, _g = _a.tabIndex, tabIndex = _g === void 0 ?
|
|
28502
|
+
var name = _a.name, value = _a.value, error = _a.error, onChange = _a.onChange, _b = _a.onFocus, onFocus = _b === void 0 ? function (e) { } : _b, label = _a.label, _c = _a.type, type = _c === void 0 ? 'text' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.labelClassName, labelClassName = _e === void 0 ? '' : _e, _f = _a.placeholder, placeholder = _f === void 0 ? '' : _f, _g = _a.tabIndex, tabIndex = _g === void 0 ? 0 : _g, _h = _a.dataTestid, dataTestid = _h === void 0 ? '' : _h, _j = _a.isRequiredField, isRequiredField = _j === void 0 ? false : _j, _k = _a.autoFocus, autoFocus = _k === void 0 ? false : _k, _l = _a.rootClassName, rootClassName = _l === void 0 ? '' : _l, _m = _a.autoComplete, autoComplete = _m === void 0 ? 'off' : _m, _o = _a.helperText, helperText = _o === void 0 ? '' : _o, handleOnBlur = _a.handleOnBlur, _p = _a.readOnly, readOnly = _p === void 0 ? false : _p, _q = _a.noTrim, noTrim = _q === void 0 ? false : _q, ref = _a.ref, onKeyPress = _a.onKeyPress, defaultValue = _a.defaultValue, onKeyDown = _a.onKeyDown, required = _a.required, additionalErrorInfo = _a.additionalErrorInfo, _r = _a.inputWrapClassName, inputWrapClassName = _r === void 0 ? '' : _r;
|
|
28668
28503
|
function handleError(error) {
|
|
28669
28504
|
if (!Array.isArray(error)) {
|
|
28670
28505
|
return [error];
|
|
@@ -28795,23 +28630,26 @@ function DraggableWrapper(_a) {
|
|
|
28795
28630
|
y: data.y,
|
|
28796
28631
|
});
|
|
28797
28632
|
}
|
|
28798
|
-
return (
|
|
28633
|
+
return (
|
|
28634
|
+
// Since we are using position fixed so we need to disable click on the div so that it does not interfere with the click of other elements
|
|
28635
|
+
jsxRuntime.jsx("div", __assign({ className: "dc__position-fixed dc__disable-click", style: {
|
|
28799
28636
|
zIndex: zIndex,
|
|
28800
28637
|
} }, { children: jsxRuntime.jsx(Draggable, __assign({ handle: dragSelector, nodeRef: nodeRef, position: position, onDrag: handlePositionChange }, { children: jsxRuntime.jsx("div", __assign({ ref: nodeRef }, childDivProps, { style: {
|
|
28801
28638
|
zIndex: zIndex,
|
|
28639
|
+
pointerEvents: 'auto',
|
|
28802
28640
|
} }, { children: children })) })) })));
|
|
28803
28641
|
}
|
|
28804
28642
|
|
|
28805
|
-
var _path;
|
|
28806
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
28643
|
+
var _path$3;
|
|
28644
|
+
function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
|
|
28807
28645
|
var SvgIcDrag = function SvgIcDrag(props) {
|
|
28808
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
28646
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
|
|
28809
28647
|
width: "1em",
|
|
28810
28648
|
height: "1em",
|
|
28811
28649
|
viewBox: "0 0 16 16",
|
|
28812
28650
|
fill: "none",
|
|
28813
28651
|
xmlns: "http://www.w3.org/2000/svg"
|
|
28814
|
-
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
28652
|
+
}, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
28815
28653
|
d: "M10.334 9.333a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5.667 9.333a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM10.334 5.333a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5.667 5.333a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM10.334 13.333a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5.667 13.333a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
|
|
28816
28654
|
fill: "#596168"
|
|
28817
28655
|
})));
|
|
@@ -28933,12 +28771,944 @@ var Pagination = function (_a) {
|
|
|
28933
28771
|
jsxRuntime.jsxs("div", __assign({ className: rootClassName || '' }, { children: [jsxRuntime.jsxs("div", __assign({ className: "page-number" }, { children: [offset + 1, " - ", lastPageNo, " of ", size] })), jsxRuntime.jsxs("ul", __assign({ className: "pagination" }, { children: [jsxRuntime.jsx("li", __assign({ className: "page" }, { children: jsxRuntime.jsx("button", __assign({ className: "page__button page__button--icon", disabled: !pageNoIndex, onClick: selectPreviousPage, type: "button", "aria-label": "Previous page" }, { children: jsxRuntime.jsx("span", __assign({ className: "left-icon" }, { children: jsxRuntime.jsx("i", { className: "fa fa-chevron-left" }) })) })) })), visiblePages.map(function (page) { return (jsxRuntime.jsx(PageValueItem, { value: page.value, isSelected: page.selected, selectPage: selectPage }, page.value)); }), jsxRuntime.jsx("li", __assign({ className: "page" }, { children: jsxRuntime.jsx("button", __assign({ className: "page__button page__button--icon", disabled: pageNoIndex === pages.length - 1, onClick: selectNextPage, type: "button", "aria-label": "Next page" }, { children: jsxRuntime.jsx("span", __assign({ className: "left-icon" }, { children: jsxRuntime.jsx("i", { className: "fa fa-chevron-right" }) })) })) }))] })), !isPageSizeFix && (jsxRuntime.jsxs("div", __assign({ className: "select" }, { children: [jsxRuntime.jsx("span", __assign({ className: "select__placeholder" }, { children: "Rows per page" })), jsxRuntime.jsx(PageSizeSelector, { pageSizeOptions: pageSizeOptions, pageSize: pageSize, changePageSize: changePageSize })] })))] })));
|
|
28934
28772
|
};
|
|
28935
28773
|
|
|
28774
|
+
var _path$2, _path2;
|
|
28775
|
+
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
28776
|
+
var SvgIcCpu = function SvgIcCpu(props) {
|
|
28777
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
28778
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28779
|
+
width: "1em",
|
|
28780
|
+
height: "1em",
|
|
28781
|
+
viewBox: "0 0 20 20",
|
|
28782
|
+
fill: "none"
|
|
28783
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
28784
|
+
d: "M12.5 5.625h-5m5 2.5h-5m8.125-5v13.75c0 .345-.28.625-.625.625H5a.625.625 0 0 1-.625-.625V3.125c0-.345.28-.625.625-.625h10c.345 0 .625.28.625.625Z",
|
|
28785
|
+
stroke: "#596168",
|
|
28786
|
+
strokeWidth: 1.5,
|
|
28787
|
+
strokeLinecap: "round",
|
|
28788
|
+
strokeLinejoin: "round"
|
|
28789
|
+
})), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
28790
|
+
d: "M10 15a.937.937 0 1 0 0-1.875A.937.937 0 0 0 10 15Z",
|
|
28791
|
+
fill: "#596168"
|
|
28792
|
+
})));
|
|
28793
|
+
};
|
|
28794
|
+
|
|
28795
|
+
var _path$1;
|
|
28796
|
+
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
28797
|
+
var SvgIcMemory = function SvgIcMemory(props) {
|
|
28798
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
28799
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28800
|
+
width: "1em",
|
|
28801
|
+
height: "1em",
|
|
28802
|
+
viewBox: "0 0 20 20",
|
|
28803
|
+
fill: "none"
|
|
28804
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
28805
|
+
d: "M16.25 8.125h1.875m-1.875 3.75h1.875m-16.25-3.75H3.75m-1.875 3.75H3.75m8.125 4.375v1.875m-3.75-1.875v1.875m3.75-16.25V3.75m-3.75-1.875V3.75m-.313 4.063h4.375v4.375H7.814V7.811ZM4.376 3.75h11.25c.345 0 .625.28.625.625v11.25c0 .345-.28.625-.625.625H4.375a.625.625 0 0 1-.625-.625V4.375c0-.345.28-.625.625-.625Z",
|
|
28806
|
+
stroke: "#596168",
|
|
28807
|
+
strokeWidth: 1.5,
|
|
28808
|
+
strokeLinecap: "round",
|
|
28809
|
+
strokeLinejoin: "round"
|
|
28810
|
+
})));
|
|
28811
|
+
};
|
|
28812
|
+
|
|
28813
|
+
var _path;
|
|
28814
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
28815
|
+
var SvgIcTimer = function SvgIcTimer(props) {
|
|
28816
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
28817
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28818
|
+
width: "1em",
|
|
28819
|
+
height: "1em",
|
|
28820
|
+
viewBox: "0 0 20 20",
|
|
28821
|
+
fill: "none"
|
|
28822
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
28823
|
+
d: "m10 11.041 3.094-3.093M8.125 1.666h3.75m5 9.376a6.875 6.875 0 1 1-13.75 0 6.875 6.875 0 0 1 13.75 0Z",
|
|
28824
|
+
stroke: "#596168",
|
|
28825
|
+
strokeWidth: 1.5,
|
|
28826
|
+
strokeLinecap: "round",
|
|
28827
|
+
strokeLinejoin: "round"
|
|
28828
|
+
})));
|
|
28829
|
+
};
|
|
28830
|
+
|
|
28831
|
+
var _a$1;
|
|
28832
|
+
/**
|
|
28833
|
+
* Unique actions that will be dispatched and,
|
|
28834
|
+
* Keeping some values (cpu_limit, etc) in sync with backend
|
|
28835
|
+
*/
|
|
28836
|
+
exports.BuildInfraConfigTypes = void 0;
|
|
28837
|
+
(function (BuildInfraConfigTypes) {
|
|
28838
|
+
BuildInfraConfigTypes["CPU_LIMIT"] = "cpu_limit";
|
|
28839
|
+
BuildInfraConfigTypes["CPU_REQUEST"] = "cpu_request";
|
|
28840
|
+
BuildInfraConfigTypes["MEMORY_LIMIT"] = "memory_limit";
|
|
28841
|
+
BuildInfraConfigTypes["MEMORY_REQUEST"] = "memory_request";
|
|
28842
|
+
BuildInfraConfigTypes["BUILD_TIMEOUT"] = "timeout";
|
|
28843
|
+
})(exports.BuildInfraConfigTypes || (exports.BuildInfraConfigTypes = {}));
|
|
28844
|
+
/**
|
|
28845
|
+
* Combination of BuildInfraConfigTypes and BuildInfraMetaConfigTypes is going to derive error state and actions(actions will also be derived with BuildInfraInheritActions)
|
|
28846
|
+
*/
|
|
28847
|
+
exports.BuildInfraMetaConfigTypes = void 0;
|
|
28848
|
+
(function (BuildInfraMetaConfigTypes) {
|
|
28849
|
+
BuildInfraMetaConfigTypes["NAME"] = "name";
|
|
28850
|
+
BuildInfraMetaConfigTypes["DESCRIPTION"] = "description";
|
|
28851
|
+
})(exports.BuildInfraMetaConfigTypes || (exports.BuildInfraMetaConfigTypes = {}));
|
|
28852
|
+
/**
|
|
28853
|
+
* Would be used as key for few components and would be appending activate and de_activate actions to it
|
|
28854
|
+
*/
|
|
28855
|
+
exports.BuildInfraLocators = void 0;
|
|
28856
|
+
(function (BuildInfraLocators) {
|
|
28857
|
+
BuildInfraLocators["CPU"] = "cpu";
|
|
28858
|
+
BuildInfraLocators["MEMORY"] = "memory";
|
|
28859
|
+
// This name can be also different from BuildInfraConfigTypes[BUILD_TIMEOUT] in case we want to show different label
|
|
28860
|
+
BuildInfraLocators["BUILD_TIMEOUT"] = "timeout";
|
|
28861
|
+
})(exports.BuildInfraLocators || (exports.BuildInfraLocators = {}));
|
|
28862
|
+
// FIXME: Derive this from BuildInfraLocators
|
|
28863
|
+
// Appending the locators from above
|
|
28864
|
+
exports.BuildInfraInheritActions = void 0;
|
|
28865
|
+
(function (BuildInfraInheritActions) {
|
|
28866
|
+
BuildInfraInheritActions["ACTIVATE_CPU"] = "activate_cpu";
|
|
28867
|
+
BuildInfraInheritActions["DE_ACTIVATE_CPU"] = "de_activate_cpu";
|
|
28868
|
+
BuildInfraInheritActions["ACTIVATE_MEMORY"] = "activate_memory";
|
|
28869
|
+
BuildInfraInheritActions["DE_ACTIVATE_MEMORY"] = "de_activate_memory";
|
|
28870
|
+
BuildInfraInheritActions["ACTIVATE_BUILD_TIMEOUT"] = "activate_build_timeout";
|
|
28871
|
+
BuildInfraInheritActions["DE_ACTIVATE_BUILD_TIMEOUT"] = "de_activate_build_timeout";
|
|
28872
|
+
})(exports.BuildInfraInheritActions || (exports.BuildInfraInheritActions = {}));
|
|
28873
|
+
// TODO: Better name would be BuildInfraConfigActionMap
|
|
28874
|
+
var BuildInfraLocatorsActionMap = (_a$1 = {},
|
|
28875
|
+
_a$1[exports.BuildInfraConfigTypes.BUILD_TIMEOUT] = exports.BuildInfraLocators.BUILD_TIMEOUT,
|
|
28876
|
+
_a$1[exports.BuildInfraConfigTypes.CPU_LIMIT] = exports.BuildInfraLocators.CPU,
|
|
28877
|
+
_a$1[exports.BuildInfraConfigTypes.CPU_REQUEST] = exports.BuildInfraLocators.CPU,
|
|
28878
|
+
_a$1[exports.BuildInfraConfigTypes.MEMORY_LIMIT] = exports.BuildInfraLocators.MEMORY,
|
|
28879
|
+
_a$1[exports.BuildInfraConfigTypes.MEMORY_REQUEST] = exports.BuildInfraLocators.MEMORY,
|
|
28880
|
+
_a$1);
|
|
28881
|
+
exports.BuildInfraProfileVariants = void 0;
|
|
28882
|
+
(function (BuildInfraProfileVariants) {
|
|
28883
|
+
BuildInfraProfileVariants["DEFAULT"] = "DEFAULT";
|
|
28884
|
+
BuildInfraProfileVariants["NORMAL"] = "NORMAL";
|
|
28885
|
+
BuildInfraProfileVariants["CUSTOM"] = "CUSTOM";
|
|
28886
|
+
})(exports.BuildInfraProfileVariants || (exports.BuildInfraProfileVariants = {}));
|
|
28887
|
+
|
|
28888
|
+
var _a;
|
|
28889
|
+
var BUILD_INFRA_TEXT = {
|
|
28890
|
+
HEADING: 'Build Infra Configuration',
|
|
28891
|
+
EDIT_SUBMIT: 'Save changes',
|
|
28892
|
+
SAVE_SUBMIT: 'Save',
|
|
28893
|
+
EDIT_CANCEL: 'Cancel',
|
|
28894
|
+
EDIT_DEFAULT_TOOLTIP: 'Efficiently control infrastructure settings such as CPU, Memory, and Build timeout for your build pipelines. Streamline resource management to optimise build time and cost effortlessly.',
|
|
28895
|
+
DESCRIPTION_LABEL: 'Description',
|
|
28896
|
+
DESCRIPTION_PLACEHOLDER: 'Enter a description here',
|
|
28897
|
+
PROFILE_LABEL: 'Profile name',
|
|
28898
|
+
PROFILE_PLACEHOLDER: 'Eg. Java or Node',
|
|
28899
|
+
INHERITING_HEADING_DESCRIPTION: 'Inheriting from default',
|
|
28900
|
+
SUBMIT_BUTTON_TIPPY: {
|
|
28901
|
+
INVALID_INPUT: 'Valid input is required for all mandatory fields.',
|
|
28902
|
+
REQUEST_IN_PROGRESS: 'Request in progress.',
|
|
28903
|
+
},
|
|
28904
|
+
VALIDATE_REQUEST_LIMIT: {
|
|
28905
|
+
NEGATIVE_REQUEST: 'Request should be a positive number.',
|
|
28906
|
+
NEGATIVE_LIMIT: 'Limit should be a positive number.',
|
|
28907
|
+
REQUEST_LESS_THAN_LIMIT: 'Request should be less than or equal to limit.',
|
|
28908
|
+
CAN_NOT_COMPUTE: 'Request and limit value diff are too high to validate.',
|
|
28909
|
+
REQUEST_DECIMAL_PLACES: 'Request should be upto 2 decimal places.',
|
|
28910
|
+
LIMIT_DECIMAL_PLACES: 'Limit should be upto 2 decimal places.',
|
|
28911
|
+
},
|
|
28912
|
+
getInvalidActionMessage: function (action) { return "Invalid action type: ".concat(action); },
|
|
28913
|
+
getSubmitSuccessMessage: function (profileName, isEdited) {
|
|
28914
|
+
return "".concat(profileName, " is ").concat(isEdited ? 'updated' : 'created');
|
|
28915
|
+
},
|
|
28916
|
+
PROFILE_NOT_FOUND: {
|
|
28917
|
+
title: 'Profile not found',
|
|
28918
|
+
subTitle: 'The profile you are looking for does not exist.',
|
|
28919
|
+
},
|
|
28920
|
+
};
|
|
28921
|
+
var BUILD_INFRA_BREADCRUMB = {
|
|
28922
|
+
alias: {
|
|
28923
|
+
'global-config': null,
|
|
28924
|
+
'build-infra': {
|
|
28925
|
+
component: jsxRuntime.jsx("h2", __assign({ className: "m-0 cn-9 fs-16 fw-6 lh-32" }, { children: BUILD_INFRA_TEXT.HEADING })),
|
|
28926
|
+
linked: false,
|
|
28927
|
+
},
|
|
28928
|
+
},
|
|
28929
|
+
};
|
|
28930
|
+
var BUILD_INFRA_FORM_FIELDS = [
|
|
28931
|
+
{
|
|
28932
|
+
heading: jsxRuntime.jsx("h3", __assign({ className: "m-0 cn-9 fs-13 fw-6 lh-20" }, { children: "CPU (Request - Limit)" })),
|
|
28933
|
+
marker: SvgIcCpu,
|
|
28934
|
+
actions: [
|
|
28935
|
+
{
|
|
28936
|
+
actionType: exports.BuildInfraConfigTypes.CPU_REQUEST,
|
|
28937
|
+
label: 'Request',
|
|
28938
|
+
placeholder: 'Type CPU request',
|
|
28939
|
+
},
|
|
28940
|
+
{
|
|
28941
|
+
actionType: exports.BuildInfraConfigTypes.CPU_LIMIT,
|
|
28942
|
+
label: 'Limit',
|
|
28943
|
+
placeholder: 'Type CPU limit',
|
|
28944
|
+
},
|
|
28945
|
+
],
|
|
28946
|
+
locator: exports.BuildInfraLocators.CPU,
|
|
28947
|
+
},
|
|
28948
|
+
{
|
|
28949
|
+
heading: jsxRuntime.jsx("h3", __assign({ className: "m-0 cn-9 fs-13 fw-6 lh-20" }, { children: "Memory (Request - Limit)" })),
|
|
28950
|
+
marker: SvgIcMemory,
|
|
28951
|
+
actions: [
|
|
28952
|
+
{
|
|
28953
|
+
actionType: exports.BuildInfraConfigTypes.MEMORY_REQUEST,
|
|
28954
|
+
label: 'Request',
|
|
28955
|
+
placeholder: 'Type memory request',
|
|
28956
|
+
},
|
|
28957
|
+
{
|
|
28958
|
+
actionType: exports.BuildInfraConfigTypes.MEMORY_LIMIT,
|
|
28959
|
+
label: 'Limit',
|
|
28960
|
+
placeholder: 'Type memory limit',
|
|
28961
|
+
},
|
|
28962
|
+
],
|
|
28963
|
+
locator: exports.BuildInfraLocators.MEMORY,
|
|
28964
|
+
},
|
|
28965
|
+
{
|
|
28966
|
+
heading: jsxRuntime.jsx("h3", __assign({ className: "m-0 cn-9 fs-13 fw-6 lh-20" }, { children: "Build timeout" })),
|
|
28967
|
+
marker: SvgIcTimer,
|
|
28968
|
+
actions: [
|
|
28969
|
+
{
|
|
28970
|
+
actionType: exports.BuildInfraConfigTypes.BUILD_TIMEOUT,
|
|
28971
|
+
label: 'Timeout',
|
|
28972
|
+
placeholder: 'Type build timeout',
|
|
28973
|
+
},
|
|
28974
|
+
],
|
|
28975
|
+
locator: exports.BuildInfraLocators.BUILD_TIMEOUT,
|
|
28976
|
+
},
|
|
28977
|
+
];
|
|
28978
|
+
// TODO: Handle the case of create profile to disable save button initially and enable it when all the fields are filled
|
|
28979
|
+
var PROFILE_INPUT_ERROR_FIELDS = __assign({}, Object.fromEntries(Object.keys(__assign(__assign({}, exports.BuildInfraConfigTypes), exports.BuildInfraMetaConfigTypes)).map(function (key) { return [key, null]; })));
|
|
28980
|
+
// All fields in BuildInfraConfigTypes are required and name in BuildInfraMetaConfigTypes is required
|
|
28981
|
+
var REQUIRED_INPUT_FIELDS = __spreadArray(__spreadArray([], __read(Object.keys(exports.BuildInfraConfigTypes)), false), [exports.BuildInfraMetaConfigTypes.NAME], false);
|
|
28982
|
+
var DEFAULT_PROFILE_NAME = 'default';
|
|
28983
|
+
var CREATE_PROFILE_BASE_VALUE = {
|
|
28984
|
+
name: '',
|
|
28985
|
+
description: '',
|
|
28986
|
+
type: exports.BuildInfraProfileVariants.NORMAL,
|
|
28987
|
+
appCount: 0,
|
|
28988
|
+
};
|
|
28989
|
+
var CREATE_VIEW_CHECKED_CONFIGS = (_a = {},
|
|
28990
|
+
_a[exports.BuildInfraConfigTypes.CPU_REQUEST] = true,
|
|
28991
|
+
_a[exports.BuildInfraConfigTypes.CPU_LIMIT] = true,
|
|
28992
|
+
_a);
|
|
28993
|
+
var BUILD_INFRA_INPUT_CONSTRAINTS = {
|
|
28994
|
+
STEP: 0.01,
|
|
28995
|
+
MIN: 0,
|
|
28996
|
+
DECIMAL_PLACES: 2,
|
|
28997
|
+
};
|
|
28998
|
+
|
|
28999
|
+
var Descriptor = function (_a) {
|
|
29000
|
+
var additionalContainerClasses = _a.additionalContainerClasses, breadCrumbs = _a.breadCrumbs, children = _a.children;
|
|
29001
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "flexbox dc__content-space dc__align-items-center w-100 ".concat(additionalContainerClasses !== null && additionalContainerClasses !== void 0 ? additionalContainerClasses : '') }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flexbox dc__align-items-center dc__gap-4" }, { children: [jsxRuntime.jsx(BreadCrumb, { breadcrumbs: breadCrumbs }), jsxRuntime.jsx(TippyCustomized, __assign({ theme: exports.TippyTheme.white, className: "w-300 h-100 dc__align-left", placement: "right", Icon: SvgIcHelp, iconClass: "fcv-5", infoText: BUILD_INFRA_TEXT.EDIT_DEFAULT_TOOLTIP, heading: BUILD_INFRA_TEXT.HEADING, showCloseButton: true, trigger: "click", interactive: true }, { children: jsxRuntime.jsx("button", __assign({ className: "p-0 h-20 dc__no-background dc__no-border dc__tab-focus", type: "button", "aria-label": "build-infra-info" }, { children: jsxRuntime.jsx(SvgIcHelpOutline, { className: "icon-dim-20" }) })) }))] })), children] })));
|
|
29002
|
+
};
|
|
29003
|
+
|
|
29004
|
+
var Footer = function (_a) {
|
|
29005
|
+
var disabled = _a.disabled, hideCancelButton = _a.hideCancelButton, editProfile = _a.editProfile, loading = _a.loading;
|
|
29006
|
+
var disableMessage = disabled
|
|
29007
|
+
? BUILD_INFRA_TEXT.SUBMIT_BUTTON_TIPPY.INVALID_INPUT
|
|
29008
|
+
: BUILD_INFRA_TEXT.SUBMIT_BUTTON_TIPPY.REQUEST_IN_PROGRESS;
|
|
29009
|
+
var getButtonText = function () {
|
|
29010
|
+
if (editProfile) {
|
|
29011
|
+
return BUILD_INFRA_TEXT.EDIT_SUBMIT;
|
|
29012
|
+
}
|
|
29013
|
+
return BUILD_INFRA_TEXT.SAVE_SUBMIT;
|
|
29014
|
+
};
|
|
29015
|
+
var renderTippy = function (children) { return (jsxRuntime.jsx(Tippy, __assign({ content: disableMessage, placement: "top", className: "default-tt", arrow: false }, { children: children }))); };
|
|
29016
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "flex pl pr pb pt h-64 dc__gap-12 dc__border-top dc__content-start" }, { children: [jsxRuntime.jsx(ConditionalWrap, __assign({ condition: disabled || loading, wrap: renderTippy }, { children: jsxRuntime.jsx("div", __assign({ className: "flexbox dc__align-items-center" }, { children: jsxRuntime.jsx("button", __assign({ type: "submit", className: "cta submit h-32 flex", disabled: disabled || loading }, { children: loading ? jsxRuntime.jsx(Progressing, { size: 16 }) : getButtonText() })) })) })), !hideCancelButton && (jsxRuntime.jsx("button", __assign({ type: "button", className: "cta cancel h-32 flex" }, { children: BUILD_INFRA_TEXT.EDIT_CANCEL })))] })));
|
|
29017
|
+
};
|
|
29018
|
+
|
|
29019
|
+
var getBaseProfileObject = function (fromCreateView, profile) {
|
|
29020
|
+
if (fromCreateView) {
|
|
29021
|
+
return CREATE_PROFILE_BASE_VALUE;
|
|
29022
|
+
}
|
|
29023
|
+
return {
|
|
29024
|
+
id: profile.id,
|
|
29025
|
+
name: profile.name,
|
|
29026
|
+
description: profile.description,
|
|
29027
|
+
type: profile.type,
|
|
29028
|
+
appCount: profile.appCount,
|
|
29029
|
+
};
|
|
29030
|
+
};
|
|
29031
|
+
// Would receive a single profile and return transformed response
|
|
29032
|
+
var getTransformedBuildInfraProfileResponse = function (_a) {
|
|
29033
|
+
var _b, _c, _d;
|
|
29034
|
+
var configurationUnits = _a.configurationUnits, defaultConfigurations = _a.defaultConfigurations, profile = _a.profile, fromCreateView = _a.fromCreateView;
|
|
29035
|
+
// Assuming would contain all the keys
|
|
29036
|
+
var defaultConfigurationsMap = (_b = defaultConfigurations === null || defaultConfigurations === void 0 ? void 0 : defaultConfigurations.reduce(function (acc, configuration) {
|
|
29037
|
+
acc[configuration.key] = configuration;
|
|
29038
|
+
return acc;
|
|
29039
|
+
}, {})) !== null && _b !== void 0 ? _b : {};
|
|
29040
|
+
var profileConfigurations = (_d = (_c = profile === null || profile === void 0 ? void 0 : profile.configurations) === null || _c === void 0 ? void 0 : _c.reduce(function (acc, configuration) {
|
|
29041
|
+
acc[configuration.key] = configuration;
|
|
29042
|
+
return acc;
|
|
29043
|
+
}, {})) !== null && _d !== void 0 ? _d : {};
|
|
29044
|
+
// traversing defaultConfigurationsMap and if key is present in profileConfigurations then use that else use defaultConfigurationsMap
|
|
29045
|
+
var configurations = Object.keys(defaultConfigurationsMap).reduce(function (acc, key) {
|
|
29046
|
+
var _a;
|
|
29047
|
+
var defaultConfiguration = defaultConfigurationsMap[key];
|
|
29048
|
+
var profileConfiguration = profileConfigurations[key];
|
|
29049
|
+
if (fromCreateView) {
|
|
29050
|
+
acc[key] = {
|
|
29051
|
+
key: key,
|
|
29052
|
+
value: defaultConfiguration.value,
|
|
29053
|
+
unit: defaultConfiguration.unit,
|
|
29054
|
+
active: (_a = CREATE_VIEW_CHECKED_CONFIGS[key]) !== null && _a !== void 0 ? _a : false,
|
|
29055
|
+
};
|
|
29056
|
+
}
|
|
29057
|
+
else if (profileConfiguration) {
|
|
29058
|
+
acc[key] = profileConfiguration;
|
|
29059
|
+
}
|
|
29060
|
+
else {
|
|
29061
|
+
// Removing id from it since we do not have a configuration
|
|
29062
|
+
// While generating payload, we will check on the basis of id and active flag.
|
|
29063
|
+
acc[key] = {
|
|
29064
|
+
key: key,
|
|
29065
|
+
value: defaultConfiguration.value,
|
|
29066
|
+
// saving profile name as undefined and this would be a check, if we are deriving from default or not
|
|
29067
|
+
unit: defaultConfiguration.unit,
|
|
29068
|
+
active: false,
|
|
29069
|
+
};
|
|
29070
|
+
}
|
|
29071
|
+
acc[key].defaultValue = {
|
|
29072
|
+
value: defaultConfiguration.value,
|
|
29073
|
+
unit: defaultConfiguration.unit,
|
|
29074
|
+
};
|
|
29075
|
+
return acc;
|
|
29076
|
+
}, {});
|
|
29077
|
+
return {
|
|
29078
|
+
configurationUnits: configurationUnits,
|
|
29079
|
+
profile: __assign(__assign({}, (profile && getBaseProfileObject(fromCreateView, profile))), { configurations: configurations }),
|
|
29080
|
+
};
|
|
29081
|
+
};
|
|
29082
|
+
var getBuildInfraProfileByName = function (_a) {
|
|
29083
|
+
var name = _a.name, fromCreateView = _a.fromCreateView;
|
|
29084
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
29085
|
+
var response, _b, configurationUnits, defaultConfigurations, profile, error_1;
|
|
29086
|
+
return __generator(this, function (_c) {
|
|
29087
|
+
switch (_c.label) {
|
|
29088
|
+
case 0:
|
|
29089
|
+
_c.trys.push([0, 2, , 3]);
|
|
29090
|
+
return [4 /*yield*/, get("".concat(ROUTES.INFRA_CONFIG_PROFILE, "/").concat(name))];
|
|
29091
|
+
case 1:
|
|
29092
|
+
response = _c.sent();
|
|
29093
|
+
_b = response.result, configurationUnits = _b.configurationUnits, defaultConfigurations = _b.defaultConfigurations, profile = _b.profile;
|
|
29094
|
+
return [2 /*return*/, getTransformedBuildInfraProfileResponse({
|
|
29095
|
+
configurationUnits: configurationUnits,
|
|
29096
|
+
defaultConfigurations: defaultConfigurations,
|
|
29097
|
+
profile: profile,
|
|
29098
|
+
fromCreateView: fromCreateView,
|
|
29099
|
+
})];
|
|
29100
|
+
case 2:
|
|
29101
|
+
error_1 = _c.sent();
|
|
29102
|
+
showError(error_1);
|
|
29103
|
+
throw error_1;
|
|
29104
|
+
case 3: return [2 /*return*/];
|
|
29105
|
+
}
|
|
29106
|
+
});
|
|
29107
|
+
});
|
|
29108
|
+
};
|
|
29109
|
+
var getBuildInfraProfilePayload = function (profileInput) {
|
|
29110
|
+
var currentConfigurations = profileInput.configurations;
|
|
29111
|
+
var configurationKeys = Object.keys(currentConfigurations);
|
|
29112
|
+
// would only keep the configurations with id or active flag as true
|
|
29113
|
+
var configurations = configurationKeys.reduce(function (acc, key) {
|
|
29114
|
+
var configuration = currentConfigurations[key];
|
|
29115
|
+
if (configuration.id || configuration.active) {
|
|
29116
|
+
acc.push({
|
|
29117
|
+
id: configuration.id,
|
|
29118
|
+
key: key,
|
|
29119
|
+
value: Number(configuration.value),
|
|
29120
|
+
unit: configuration.unit,
|
|
29121
|
+
active: configuration.active,
|
|
29122
|
+
});
|
|
29123
|
+
}
|
|
29124
|
+
return acc;
|
|
29125
|
+
}, []);
|
|
29126
|
+
var payload = {
|
|
29127
|
+
name: profileInput.name,
|
|
29128
|
+
id: profileInput.id,
|
|
29129
|
+
description: profileInput.description,
|
|
29130
|
+
type: profileInput.type,
|
|
29131
|
+
configurations: configurations,
|
|
29132
|
+
};
|
|
29133
|
+
return payload;
|
|
29134
|
+
};
|
|
29135
|
+
var updateBuildInfraProfile = function (_a) {
|
|
29136
|
+
var name = _a.name, profileInput = _a.profileInput;
|
|
29137
|
+
var payload = getBuildInfraProfilePayload(profileInput);
|
|
29138
|
+
// TODO: Would remove this
|
|
29139
|
+
console.log(payload, 'edit payload');
|
|
29140
|
+
return put("".concat(ROUTES.INFRA_CONFIG_PROFILE, "/").concat(name), payload);
|
|
29141
|
+
};
|
|
29142
|
+
var createBuildInfraProfile = function (_a) {
|
|
29143
|
+
var profileInput = _a.profileInput;
|
|
29144
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
29145
|
+
var payload;
|
|
29146
|
+
return __generator(this, function (_b) {
|
|
29147
|
+
switch (_b.label) {
|
|
29148
|
+
case 0:
|
|
29149
|
+
// Adding a timeout to show the loader
|
|
29150
|
+
// eslint-disable-next-line no-promise-executor-return
|
|
29151
|
+
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 1000); })];
|
|
29152
|
+
case 1:
|
|
29153
|
+
// Adding a timeout to show the loader
|
|
29154
|
+
// eslint-disable-next-line no-promise-executor-return
|
|
29155
|
+
_b.sent();
|
|
29156
|
+
payload = getBuildInfraProfilePayload(profileInput);
|
|
29157
|
+
// TODO: Remove this
|
|
29158
|
+
console.log(payload, 'create payload');
|
|
29159
|
+
return [2 /*return*/, Promise.resolve({
|
|
29160
|
+
code: 200,
|
|
29161
|
+
result: profileInput,
|
|
29162
|
+
})
|
|
29163
|
+
// return post(`${ROUTES}/${name}`, payload)
|
|
29164
|
+
];
|
|
29165
|
+
}
|
|
29166
|
+
});
|
|
29167
|
+
});
|
|
29168
|
+
};
|
|
29169
|
+
var deleteBuildInfraProfileByName = function (name) { return __awaiter(void 0, void 0, void 0, function () {
|
|
29170
|
+
return __generator(this, function (_a) {
|
|
29171
|
+
switch (_a.label) {
|
|
29172
|
+
case 0:
|
|
29173
|
+
// Adding a timeout to show the loader
|
|
29174
|
+
// eslint-disable-next-line no-promise-executor-return
|
|
29175
|
+
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 1000); })];
|
|
29176
|
+
case 1:
|
|
29177
|
+
// Adding a timeout to show the loader
|
|
29178
|
+
// eslint-disable-next-line no-promise-executor-return
|
|
29179
|
+
_a.sent();
|
|
29180
|
+
return [2 /*return*/, Promise.resolve({
|
|
29181
|
+
code: 200,
|
|
29182
|
+
result: null,
|
|
29183
|
+
})
|
|
29184
|
+
// return trash(`${ROUTES}/${name}`)
|
|
29185
|
+
];
|
|
29186
|
+
}
|
|
29187
|
+
});
|
|
29188
|
+
}); };
|
|
29189
|
+
|
|
29190
|
+
var APIResponseHandler = function (_a) {
|
|
29191
|
+
var _b, _c;
|
|
29192
|
+
var isLoading = _a.isLoading, progressingProps = _a.progressingProps, error = _a.error, notAuthorized = _a.notAuthorized, notFoundText = _a.notFoundText, reloadProps = _a.reloadProps, children = _a.children;
|
|
29193
|
+
// keeping it above loading since, not expected to send a call if not authorized
|
|
29194
|
+
if (notAuthorized) {
|
|
29195
|
+
return jsxRuntime.jsx(ErrorScreenNotAuthorized, {});
|
|
29196
|
+
}
|
|
29197
|
+
if (isLoading) {
|
|
29198
|
+
return jsxRuntime.jsx(Progressing, __assign({}, progressingProps));
|
|
29199
|
+
}
|
|
29200
|
+
if (error) {
|
|
29201
|
+
if ((error === null || error === void 0 ? void 0 : error.code) === 404) {
|
|
29202
|
+
return (jsxRuntime.jsx(GenericEmptyState, { title: (_b = notFoundText === null || notFoundText === void 0 ? void 0 : notFoundText.title) !== null && _b !== void 0 ? _b : 'Data not found', subTitle: (_c = notFoundText === null || notFoundText === void 0 ? void 0 : notFoundText.subTitle) !== null && _c !== void 0 ? _c : 'The data you are looking for does not exist' }));
|
|
29203
|
+
}
|
|
29204
|
+
return jsxRuntime.jsx(Reload, __assign({}, reloadProps));
|
|
29205
|
+
}
|
|
29206
|
+
// Had to add this since while using it is throwing ts error
|
|
29207
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
29208
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: children });
|
|
29209
|
+
};
|
|
29210
|
+
|
|
29211
|
+
var getCommonSelectStyle = function (styleOverrides) {
|
|
29212
|
+
if (styleOverrides === void 0) { styleOverrides = {}; }
|
|
29213
|
+
return (__assign({ menuList: function (base) { return (__assign(__assign({}, base), { paddingTop: 0, paddingBottom: 0 })); }, control: function (base, state) { return (__assign(__assign({}, base), { minHeight: '32px', boxShadow: 'none', backgroundColor: 'var(--N50)', border: state.isFocused ? '1px solid var(--B500)' : '1px solid var(--N200)', cursor: 'pointer' })); }, option: function (base, state) { return (__assign(__assign({}, base), { color: 'var(--N900)', backgroundColor: state.isFocused ? 'var(--N100)' : 'white', padding: '10px 12px' })); }, dropdownIndicator: function (base, state) { return (__assign(__assign({}, base), { color: 'var(--N400)', padding: '0 8px', transition: 'all .2s ease', transform: state.selectProps.menuIsOpen ? 'rotate(180deg)' : 'rotate(0deg)' })); }, valueContainer: function (base) { return (__assign(__assign({}, base), { padding: '0 8px', fontWeight: '400' })); }, loadingMessage: function (base) { return (__assign(__assign({}, base), { color: 'var(--N600)' })); }, noOptionsMessage: function (base) { return (__assign(__assign({}, base), { color: 'var(--N600)' })); } }, styleOverrides));
|
|
29214
|
+
};
|
|
29215
|
+
var getCustomOptionBackgroundColor = function (isSelected, isFocused) {
|
|
29216
|
+
if (isSelected) {
|
|
29217
|
+
return 'var(--B100)';
|
|
29218
|
+
}
|
|
29219
|
+
if (isFocused) {
|
|
29220
|
+
return 'var(--N50)';
|
|
29221
|
+
}
|
|
29222
|
+
return 'var(--white)';
|
|
29223
|
+
};
|
|
29224
|
+
var getCustomOptionSelectionStyle = function (styleOverrides) {
|
|
29225
|
+
if (styleOverrides === void 0) { styleOverrides = {}; }
|
|
29226
|
+
return function (base, state) { return (__assign(__assign(__assign({}, base), { backgroundColor: getCustomOptionBackgroundColor(state.isSelected, state.isFocused), color: state.isSelected ? 'var(--B500)' : 'var(--N900)', textOverflow: 'ellipsis', fontWeight: '500', overflow: 'hidden', textAlign: 'left', whiteSpace: 'nowrap', cursor: 'pointer', fontSize: '13px' }), styleOverrides)); };
|
|
29227
|
+
};
|
|
29228
|
+
var SelectOption = function (props) {
|
|
29229
|
+
var selectProps = props.selectProps, data = props.data, showTippy = props.showTippy, style = props.style, placement = props.placement, tippyContent = props.tippyContent, tippyClass = props.tippyClass;
|
|
29230
|
+
selectProps.styles.option = getCustomOptionSelectionStyle(style);
|
|
29231
|
+
var getOption = function () { return (jsxRuntime.jsx("div", __assign({ onClick: stopPropagation }, { children: jsxRuntime.jsx(components.Option, __assign({}, props)) }))); };
|
|
29232
|
+
return showTippy ? (jsxRuntime.jsx(Tippy, __assign({ className: tippyClass || 'default-white', arrow: false, placement: placement || 'right', content: tippyContent || data.label }, { children: getOption() }))) : (getOption());
|
|
29233
|
+
};
|
|
29234
|
+
|
|
29235
|
+
var validateName = function (name) {
|
|
29236
|
+
if (!/^.{3,50}$/.test(name)) {
|
|
29237
|
+
return {
|
|
29238
|
+
isValid: false,
|
|
29239
|
+
message: 'Minimum 3 and maximum 50 characters allowed',
|
|
29240
|
+
};
|
|
29241
|
+
}
|
|
29242
|
+
if (!/^[a-z0-9-._]+$/.test(name)) {
|
|
29243
|
+
return {
|
|
29244
|
+
isValid: false,
|
|
29245
|
+
message: 'Only lowercase alphanumeric characters, -, _ or . allowed',
|
|
29246
|
+
};
|
|
29247
|
+
}
|
|
29248
|
+
if (!/^(?![-._]).*[^-._]$/.test(name)) {
|
|
29249
|
+
return {
|
|
29250
|
+
isValid: false,
|
|
29251
|
+
message: 'Cannot start/end with -, _ or .',
|
|
29252
|
+
};
|
|
29253
|
+
}
|
|
29254
|
+
return {
|
|
29255
|
+
isValid: true,
|
|
29256
|
+
};
|
|
29257
|
+
};
|
|
29258
|
+
var validateDescription = function (description) {
|
|
29259
|
+
if ((description === null || description === void 0 ? void 0 : description.length) > 300) {
|
|
29260
|
+
return {
|
|
29261
|
+
isValid: false,
|
|
29262
|
+
message: 'Maximum 300 characters are allowed',
|
|
29263
|
+
};
|
|
29264
|
+
}
|
|
29265
|
+
return {
|
|
29266
|
+
isValid: true,
|
|
29267
|
+
};
|
|
29268
|
+
};
|
|
29269
|
+
var validateRequiredPositiveNumber = function (value) {
|
|
29270
|
+
if (!value) {
|
|
29271
|
+
return {
|
|
29272
|
+
isValid: false,
|
|
29273
|
+
message: 'This field is required',
|
|
29274
|
+
};
|
|
29275
|
+
}
|
|
29276
|
+
// TODO: Look if regex is available for this, since 0002 is not a valid number
|
|
29277
|
+
if (!/^\d+(\.\d+)?$/.test(value.toString())) {
|
|
29278
|
+
return {
|
|
29279
|
+
isValid: false,
|
|
29280
|
+
message: 'This field should be a valid positive number',
|
|
29281
|
+
};
|
|
29282
|
+
}
|
|
29283
|
+
if (Number(value) <= 0) {
|
|
29284
|
+
return {
|
|
29285
|
+
isValid: false,
|
|
29286
|
+
message: 'Only positive numbers are allowed',
|
|
29287
|
+
};
|
|
29288
|
+
}
|
|
29289
|
+
return {
|
|
29290
|
+
isValid: true,
|
|
29291
|
+
};
|
|
29292
|
+
};
|
|
29293
|
+
|
|
29294
|
+
var validateRequestLimit = function (_a) {
|
|
29295
|
+
var _b, _c, _d, _e;
|
|
29296
|
+
var request = _a.request, limit = _a.limit, unitsMap = _a.unitsMap;
|
|
29297
|
+
// Request <= Limit
|
|
29298
|
+
// Request and Limit should be numbers can be decimals
|
|
29299
|
+
// Request and Limit should be positive numbers
|
|
29300
|
+
// Request and Limit should be less than Number.MAX_SAFE_INTEGER
|
|
29301
|
+
// Request and Limit should can have at most BUILD_INFRA_INPUT_CONSTRAINTS.DECIMAL_PLACES
|
|
29302
|
+
// Both request and limit should be there
|
|
29303
|
+
var requestNumber = Number(request.value);
|
|
29304
|
+
var limitNumber = Number(limit.value);
|
|
29305
|
+
var requestUnit = Number(unitsMap[request.unit].conversionFactor);
|
|
29306
|
+
var limitUnit = Number(unitsMap[limit.unit].conversionFactor);
|
|
29307
|
+
var requestLimitValidationResponse = {
|
|
29308
|
+
request: {
|
|
29309
|
+
isValid: true,
|
|
29310
|
+
},
|
|
29311
|
+
limit: {
|
|
29312
|
+
isValid: true,
|
|
29313
|
+
},
|
|
29314
|
+
};
|
|
29315
|
+
var isRequestValidNumber = validateRequiredPositiveNumber(request.value).isValid;
|
|
29316
|
+
var isLimitValidNumber = validateRequiredPositiveNumber(limit.value).isValid;
|
|
29317
|
+
if (!isRequestValidNumber) {
|
|
29318
|
+
requestLimitValidationResponse.request = {
|
|
29319
|
+
message: BUILD_INFRA_TEXT.VALIDATE_REQUEST_LIMIT.NEGATIVE_REQUEST,
|
|
29320
|
+
isValid: false,
|
|
29321
|
+
};
|
|
29322
|
+
}
|
|
29323
|
+
if (!isLimitValidNumber) {
|
|
29324
|
+
requestLimitValidationResponse.limit = {
|
|
29325
|
+
message: BUILD_INFRA_TEXT.VALIDATE_REQUEST_LIMIT.NEGATIVE_LIMIT,
|
|
29326
|
+
isValid: false,
|
|
29327
|
+
};
|
|
29328
|
+
}
|
|
29329
|
+
if (!isRequestValidNumber || !isLimitValidNumber) {
|
|
29330
|
+
return requestLimitValidationResponse;
|
|
29331
|
+
}
|
|
29332
|
+
// only two decimal places are allowed
|
|
29333
|
+
var requestDecimalPlaces = (_c = (_b = String(request.value).split('.')[1]) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0;
|
|
29334
|
+
var limitDecimalPlaces = (_e = (_d = String(limit.value).split('.')[1]) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0;
|
|
29335
|
+
if (requestDecimalPlaces > BUILD_INFRA_INPUT_CONSTRAINTS.DECIMAL_PLACES) {
|
|
29336
|
+
requestLimitValidationResponse.request = {
|
|
29337
|
+
message: BUILD_INFRA_TEXT.VALIDATE_REQUEST_LIMIT.REQUEST_DECIMAL_PLACES,
|
|
29338
|
+
isValid: false,
|
|
29339
|
+
};
|
|
29340
|
+
return requestLimitValidationResponse;
|
|
29341
|
+
}
|
|
29342
|
+
if (limitDecimalPlaces > BUILD_INFRA_INPUT_CONSTRAINTS.DECIMAL_PLACES) {
|
|
29343
|
+
requestLimitValidationResponse.limit = {
|
|
29344
|
+
message: BUILD_INFRA_TEXT.VALIDATE_REQUEST_LIMIT.LIMIT_DECIMAL_PLACES,
|
|
29345
|
+
isValid: false,
|
|
29346
|
+
};
|
|
29347
|
+
return requestLimitValidationResponse;
|
|
29348
|
+
}
|
|
29349
|
+
var limitRequestUnitFactor = limitUnit / requestUnit;
|
|
29350
|
+
var limitRequestFactor = limitNumber / requestNumber;
|
|
29351
|
+
var isProductSafe = limitRequestUnitFactor * limitRequestFactor <= Number.MAX_SAFE_INTEGER;
|
|
29352
|
+
if (!isProductSafe) {
|
|
29353
|
+
requestLimitValidationResponse.request = {
|
|
29354
|
+
message: BUILD_INFRA_TEXT.VALIDATE_REQUEST_LIMIT.CAN_NOT_COMPUTE,
|
|
29355
|
+
isValid: false,
|
|
29356
|
+
};
|
|
29357
|
+
return requestLimitValidationResponse;
|
|
29358
|
+
}
|
|
29359
|
+
if (limitRequestUnitFactor * limitRequestFactor < 1) {
|
|
29360
|
+
requestLimitValidationResponse.request = {
|
|
29361
|
+
message: BUILD_INFRA_TEXT.VALIDATE_REQUEST_LIMIT.REQUEST_LESS_THAN_LIMIT,
|
|
29362
|
+
isValid: false,
|
|
29363
|
+
};
|
|
29364
|
+
return requestLimitValidationResponse;
|
|
29365
|
+
}
|
|
29366
|
+
return requestLimitValidationResponse;
|
|
29367
|
+
};
|
|
29368
|
+
var getInitialProfileInputErrors = function (fromCreateView) {
|
|
29369
|
+
if (fromCreateView) {
|
|
29370
|
+
var initialProfileInputErrors_1 = __assign({}, PROFILE_INPUT_ERROR_FIELDS);
|
|
29371
|
+
REQUIRED_INPUT_FIELDS.forEach(function (field) {
|
|
29372
|
+
initialProfileInputErrors_1[field] = '';
|
|
29373
|
+
});
|
|
29374
|
+
return initialProfileInputErrors_1;
|
|
29375
|
+
}
|
|
29376
|
+
return __assign({}, PROFILE_INPUT_ERROR_FIELDS);
|
|
29377
|
+
};
|
|
29378
|
+
var useBuildInfraForm = function (_a) {
|
|
29379
|
+
var name = _a.name, editProfile = _a.editProfile, handleSuccessRedirection = _a.handleSuccessRedirection;
|
|
29380
|
+
var fromCreateView = !name;
|
|
29381
|
+
var _b = __read(useAsync(function () {
|
|
29382
|
+
return getBuildInfraProfileByName({
|
|
29383
|
+
name: name !== null && name !== void 0 ? name : DEFAULT_PROFILE_NAME,
|
|
29384
|
+
fromCreateView: fromCreateView,
|
|
29385
|
+
});
|
|
29386
|
+
}, [name]), 4), isLoading = _b[0], profileResponse = _b[1], responseError = _b[2], reloadRequest = _b[3];
|
|
29387
|
+
// If configuration is existing and is active then use it else use default from profileResponse
|
|
29388
|
+
var _c = __read(React.useState(null), 2), profileInput = _c[0], setProfileInput = _c[1];
|
|
29389
|
+
var _d = __read(React.useState(__assign({}, PROFILE_INPUT_ERROR_FIELDS)), 2), profileInputErrors = _d[0], setProfileInputErrors = _d[1];
|
|
29390
|
+
var _e = __read(React.useState(false), 2), loadingActionRequest = _e[0], setLoadingActionRequest = _e[1];
|
|
29391
|
+
React.useEffect(function () {
|
|
29392
|
+
if (!isLoading && (profileResponse === null || profileResponse === void 0 ? void 0 : profileResponse.configurationUnits) && (profileResponse === null || profileResponse === void 0 ? void 0 : profileResponse.profile)) {
|
|
29393
|
+
setProfileInput(__assign({}, profileResponse.profile));
|
|
29394
|
+
setProfileInputErrors(getInitialProfileInputErrors(fromCreateView));
|
|
29395
|
+
}
|
|
29396
|
+
}, [profileResponse, isLoading]);
|
|
29397
|
+
// NOTE: Currently sending and receiving values as string, but will parse it to number for payload
|
|
29398
|
+
var handleProfileInputChange = function (_a) {
|
|
29399
|
+
var action = _a.action, data = _a.data;
|
|
29400
|
+
var currentInput = __assign({}, profileInput);
|
|
29401
|
+
var currentInputErrors = __assign({}, profileInputErrors);
|
|
29402
|
+
var lastSavedConfiguration = profileResponse.profile.configurations;
|
|
29403
|
+
var currentConfiguration = currentInput.configurations;
|
|
29404
|
+
var _b = data !== null && data !== void 0 ? data : { value: null, unit: null }, value = _b.value, unit = _b.unit;
|
|
29405
|
+
switch (action) {
|
|
29406
|
+
case exports.BuildInfraMetaConfigTypes.DESCRIPTION:
|
|
29407
|
+
currentInput.description = value;
|
|
29408
|
+
currentInputErrors.description = validateDescription(value).message;
|
|
29409
|
+
break;
|
|
29410
|
+
case exports.BuildInfraMetaConfigTypes.NAME:
|
|
29411
|
+
currentInput.name = value;
|
|
29412
|
+
currentInputErrors.name = validateName(value).message;
|
|
29413
|
+
break;
|
|
29414
|
+
case exports.BuildInfraConfigTypes.CPU_LIMIT: {
|
|
29415
|
+
currentConfiguration[exports.BuildInfraConfigTypes.CPU_LIMIT] = __assign(__assign({}, currentConfiguration[exports.BuildInfraConfigTypes.CPU_LIMIT]), { value: value, unit: unit });
|
|
29416
|
+
var _c = validateRequestLimit({
|
|
29417
|
+
request: {
|
|
29418
|
+
value: currentConfiguration[exports.BuildInfraConfigTypes.CPU_REQUEST].value,
|
|
29419
|
+
unit: currentConfiguration[exports.BuildInfraConfigTypes.CPU_REQUEST].unit,
|
|
29420
|
+
},
|
|
29421
|
+
limit: {
|
|
29422
|
+
value: value,
|
|
29423
|
+
unit: unit,
|
|
29424
|
+
},
|
|
29425
|
+
unitsMap: profileResponse.configurationUnits[exports.BuildInfraConfigTypes.CPU_LIMIT],
|
|
29426
|
+
}), request = _c.request, limit = _c.limit;
|
|
29427
|
+
currentInputErrors[exports.BuildInfraConfigTypes.CPU_LIMIT] = limit.message;
|
|
29428
|
+
currentInputErrors[exports.BuildInfraConfigTypes.CPU_REQUEST] = request.message;
|
|
29429
|
+
break;
|
|
29430
|
+
}
|
|
29431
|
+
case exports.BuildInfraConfigTypes.CPU_REQUEST: {
|
|
29432
|
+
currentConfiguration[exports.BuildInfraConfigTypes.CPU_REQUEST] = __assign(__assign({}, currentConfiguration[exports.BuildInfraConfigTypes.CPU_REQUEST]), { value: value, unit: unit });
|
|
29433
|
+
var _d = validateRequestLimit({
|
|
29434
|
+
request: {
|
|
29435
|
+
value: value,
|
|
29436
|
+
unit: unit,
|
|
29437
|
+
},
|
|
29438
|
+
limit: {
|
|
29439
|
+
value: currentConfiguration[exports.BuildInfraConfigTypes.CPU_LIMIT].value,
|
|
29440
|
+
unit: currentConfiguration[exports.BuildInfraConfigTypes.CPU_LIMIT].unit,
|
|
29441
|
+
},
|
|
29442
|
+
unitsMap: profileResponse.configurationUnits[exports.BuildInfraConfigTypes.CPU_LIMIT],
|
|
29443
|
+
}), request = _d.request, limit = _d.limit;
|
|
29444
|
+
currentInputErrors[exports.BuildInfraConfigTypes.CPU_LIMIT] = limit.message;
|
|
29445
|
+
currentInputErrors[exports.BuildInfraConfigTypes.CPU_REQUEST] = request.message;
|
|
29446
|
+
break;
|
|
29447
|
+
}
|
|
29448
|
+
case exports.BuildInfraConfigTypes.MEMORY_LIMIT: {
|
|
29449
|
+
currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_LIMIT] = __assign(__assign({}, currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_LIMIT]), { value: value, unit: unit });
|
|
29450
|
+
var _e = validateRequestLimit({
|
|
29451
|
+
request: {
|
|
29452
|
+
value: currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_REQUEST].value,
|
|
29453
|
+
unit: currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_REQUEST].unit,
|
|
29454
|
+
},
|
|
29455
|
+
limit: {
|
|
29456
|
+
value: value,
|
|
29457
|
+
unit: unit,
|
|
29458
|
+
},
|
|
29459
|
+
unitsMap: profileResponse.configurationUnits[exports.BuildInfraConfigTypes.MEMORY_LIMIT],
|
|
29460
|
+
}), request = _e.request, limit = _e.limit;
|
|
29461
|
+
currentInputErrors[exports.BuildInfraConfigTypes.MEMORY_LIMIT] = limit.message;
|
|
29462
|
+
currentInputErrors[exports.BuildInfraConfigTypes.MEMORY_REQUEST] = request.message;
|
|
29463
|
+
break;
|
|
29464
|
+
}
|
|
29465
|
+
case exports.BuildInfraConfigTypes.MEMORY_REQUEST: {
|
|
29466
|
+
currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_REQUEST] = __assign(__assign({}, currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_REQUEST]), { value: value, unit: unit });
|
|
29467
|
+
var _f = validateRequestLimit({
|
|
29468
|
+
request: {
|
|
29469
|
+
value: value,
|
|
29470
|
+
unit: unit,
|
|
29471
|
+
},
|
|
29472
|
+
limit: {
|
|
29473
|
+
value: currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_LIMIT].value,
|
|
29474
|
+
unit: currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_LIMIT].unit,
|
|
29475
|
+
},
|
|
29476
|
+
unitsMap: profileResponse.configurationUnits[exports.BuildInfraConfigTypes.MEMORY_LIMIT],
|
|
29477
|
+
}), request = _f.request, limit = _f.limit;
|
|
29478
|
+
currentInputErrors[exports.BuildInfraConfigTypes.MEMORY_LIMIT] = limit.message;
|
|
29479
|
+
currentInputErrors[exports.BuildInfraConfigTypes.MEMORY_REQUEST] = request.message;
|
|
29480
|
+
break;
|
|
29481
|
+
}
|
|
29482
|
+
case exports.BuildInfraConfigTypes.BUILD_TIMEOUT: {
|
|
29483
|
+
currentConfiguration[exports.BuildInfraConfigTypes.BUILD_TIMEOUT] = __assign(__assign({}, currentConfiguration[exports.BuildInfraConfigTypes.BUILD_TIMEOUT]), { value: value, unit: unit });
|
|
29484
|
+
currentInputErrors[exports.BuildInfraConfigTypes.BUILD_TIMEOUT] = validateRequiredPositiveNumber(value).message;
|
|
29485
|
+
break;
|
|
29486
|
+
}
|
|
29487
|
+
case exports.BuildInfraInheritActions.ACTIVATE_CPU:
|
|
29488
|
+
currentConfiguration[exports.BuildInfraConfigTypes.CPU_LIMIT] = __assign(__assign({}, lastSavedConfiguration[exports.BuildInfraConfigTypes.CPU_LIMIT]), { value: lastSavedConfiguration[exports.BuildInfraConfigTypes.CPU_LIMIT].value, unit: lastSavedConfiguration[exports.BuildInfraConfigTypes.CPU_LIMIT].unit, active: true });
|
|
29489
|
+
currentConfiguration[exports.BuildInfraConfigTypes.CPU_REQUEST] = __assign(__assign({}, lastSavedConfiguration[exports.BuildInfraConfigTypes.CPU_REQUEST]), { value: lastSavedConfiguration[exports.BuildInfraConfigTypes.CPU_REQUEST].value, unit: lastSavedConfiguration[exports.BuildInfraConfigTypes.CPU_REQUEST].unit, active: true });
|
|
29490
|
+
currentInputErrors[exports.BuildInfraConfigTypes.CPU_LIMIT] = null;
|
|
29491
|
+
currentInputErrors[exports.BuildInfraConfigTypes.CPU_REQUEST] = null;
|
|
29492
|
+
break;
|
|
29493
|
+
case exports.BuildInfraInheritActions.ACTIVATE_MEMORY:
|
|
29494
|
+
currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_LIMIT] = __assign(__assign({}, lastSavedConfiguration[exports.BuildInfraConfigTypes.MEMORY_LIMIT]), { value: lastSavedConfiguration[exports.BuildInfraConfigTypes.MEMORY_LIMIT].value, unit: lastSavedConfiguration[exports.BuildInfraConfigTypes.MEMORY_LIMIT].unit, active: true });
|
|
29495
|
+
currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_REQUEST] = __assign(__assign({}, lastSavedConfiguration[exports.BuildInfraConfigTypes.MEMORY_REQUEST]), { value: lastSavedConfiguration[exports.BuildInfraConfigTypes.MEMORY_REQUEST].value, unit: lastSavedConfiguration[exports.BuildInfraConfigTypes.MEMORY_REQUEST].unit, active: true });
|
|
29496
|
+
currentInputErrors[exports.BuildInfraConfigTypes.MEMORY_LIMIT] = null;
|
|
29497
|
+
currentInputErrors[exports.BuildInfraConfigTypes.MEMORY_REQUEST] = null;
|
|
29498
|
+
break;
|
|
29499
|
+
case exports.BuildInfraInheritActions.ACTIVATE_BUILD_TIMEOUT:
|
|
29500
|
+
currentConfiguration[exports.BuildInfraConfigTypes.BUILD_TIMEOUT] = __assign(__assign({}, lastSavedConfiguration[exports.BuildInfraConfigTypes.BUILD_TIMEOUT]), { value: lastSavedConfiguration[exports.BuildInfraConfigTypes.BUILD_TIMEOUT].value, unit: lastSavedConfiguration[exports.BuildInfraConfigTypes.BUILD_TIMEOUT].unit, active: true });
|
|
29501
|
+
currentInputErrors[exports.BuildInfraConfigTypes.BUILD_TIMEOUT] = null;
|
|
29502
|
+
break;
|
|
29503
|
+
case exports.BuildInfraInheritActions.DE_ACTIVATE_BUILD_TIMEOUT:
|
|
29504
|
+
// Reverting the value and unit to defaultValues
|
|
29505
|
+
currentConfiguration[exports.BuildInfraConfigTypes.BUILD_TIMEOUT] = __assign(__assign({}, currentConfiguration[exports.BuildInfraConfigTypes.BUILD_TIMEOUT]), { value: lastSavedConfiguration[exports.BuildInfraConfigTypes.BUILD_TIMEOUT].defaultValue.value, unit: lastSavedConfiguration[exports.BuildInfraConfigTypes.BUILD_TIMEOUT].defaultValue.unit, active: false });
|
|
29506
|
+
currentInputErrors[exports.BuildInfraConfigTypes.BUILD_TIMEOUT] = null;
|
|
29507
|
+
break;
|
|
29508
|
+
case exports.BuildInfraInheritActions.DE_ACTIVATE_CPU:
|
|
29509
|
+
currentConfiguration[exports.BuildInfraConfigTypes.CPU_LIMIT] = __assign(__assign({}, currentConfiguration[exports.BuildInfraConfigTypes.CPU_LIMIT]), { value: lastSavedConfiguration[exports.BuildInfraConfigTypes.CPU_LIMIT].defaultValue.value, unit: lastSavedConfiguration[exports.BuildInfraConfigTypes.CPU_LIMIT].defaultValue.unit, active: false });
|
|
29510
|
+
currentConfiguration[exports.BuildInfraConfigTypes.CPU_REQUEST] = __assign(__assign({}, currentConfiguration[exports.BuildInfraConfigTypes.CPU_REQUEST]), { value: lastSavedConfiguration[exports.BuildInfraConfigTypes.CPU_REQUEST].defaultValue.value, unit: lastSavedConfiguration[exports.BuildInfraConfigTypes.CPU_REQUEST].defaultValue.unit, active: false });
|
|
29511
|
+
currentInputErrors[exports.BuildInfraConfigTypes.CPU_LIMIT] = null;
|
|
29512
|
+
currentInputErrors[exports.BuildInfraConfigTypes.CPU_REQUEST] = null;
|
|
29513
|
+
break;
|
|
29514
|
+
case exports.BuildInfraInheritActions.DE_ACTIVATE_MEMORY:
|
|
29515
|
+
currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_LIMIT] = __assign(__assign({}, currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_LIMIT]), { value: lastSavedConfiguration[exports.BuildInfraConfigTypes.MEMORY_LIMIT].defaultValue.value, unit: lastSavedConfiguration[exports.BuildInfraConfigTypes.MEMORY_LIMIT].defaultValue.unit, active: false });
|
|
29516
|
+
currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_REQUEST] = __assign(__assign({}, currentConfiguration[exports.BuildInfraConfigTypes.MEMORY_REQUEST]), { value: lastSavedConfiguration[exports.BuildInfraConfigTypes.MEMORY_REQUEST].defaultValue.value, unit: lastSavedConfiguration[exports.BuildInfraConfigTypes.MEMORY_REQUEST].defaultValue.unit, active: false });
|
|
29517
|
+
currentInputErrors[exports.BuildInfraConfigTypes.MEMORY_LIMIT] = null;
|
|
29518
|
+
currentInputErrors[exports.BuildInfraConfigTypes.MEMORY_REQUEST] = null;
|
|
29519
|
+
break;
|
|
29520
|
+
default:
|
|
29521
|
+
throw new Error(BUILD_INFRA_TEXT.getInvalidActionMessage(action));
|
|
29522
|
+
}
|
|
29523
|
+
setProfileInput(currentInput);
|
|
29524
|
+
setProfileInputErrors(currentInputErrors);
|
|
29525
|
+
};
|
|
29526
|
+
var handleSubmit = function (e) { return __awaiter(void 0, void 0, void 0, function () {
|
|
29527
|
+
var err_1;
|
|
29528
|
+
return __generator(this, function (_a) {
|
|
29529
|
+
switch (_a.label) {
|
|
29530
|
+
case 0:
|
|
29531
|
+
e.preventDefault();
|
|
29532
|
+
setLoadingActionRequest(true);
|
|
29533
|
+
_a.label = 1;
|
|
29534
|
+
case 1:
|
|
29535
|
+
_a.trys.push([1, 6, , 7]);
|
|
29536
|
+
if (!editProfile) return [3 /*break*/, 3];
|
|
29537
|
+
return [4 /*yield*/, updateBuildInfraProfile({ name: name, profileInput: profileInput })];
|
|
29538
|
+
case 2:
|
|
29539
|
+
_a.sent();
|
|
29540
|
+
return [3 /*break*/, 5];
|
|
29541
|
+
case 3: return [4 /*yield*/, createBuildInfraProfile({ profileInput: profileInput })];
|
|
29542
|
+
case 4:
|
|
29543
|
+
_a.sent();
|
|
29544
|
+
_a.label = 5;
|
|
29545
|
+
case 5:
|
|
29546
|
+
setLoadingActionRequest(false);
|
|
29547
|
+
toast.success(BUILD_INFRA_TEXT.getSubmitSuccessMessage(profileInput.name, editProfile));
|
|
29548
|
+
if (handleSuccessRedirection) {
|
|
29549
|
+
handleSuccessRedirection();
|
|
29550
|
+
}
|
|
29551
|
+
else {
|
|
29552
|
+
reloadRequest();
|
|
29553
|
+
}
|
|
29554
|
+
return [3 /*break*/, 7];
|
|
29555
|
+
case 6:
|
|
29556
|
+
err_1 = _a.sent();
|
|
29557
|
+
showError(err_1);
|
|
29558
|
+
setLoadingActionRequest(false);
|
|
29559
|
+
return [3 /*break*/, 7];
|
|
29560
|
+
case 7: return [2 /*return*/];
|
|
29561
|
+
}
|
|
29562
|
+
});
|
|
29563
|
+
}); };
|
|
29564
|
+
return {
|
|
29565
|
+
isLoading: isLoading,
|
|
29566
|
+
profileResponse: profileResponse,
|
|
29567
|
+
responseError: responseError,
|
|
29568
|
+
reloadRequest: reloadRequest,
|
|
29569
|
+
profileInput: profileInput,
|
|
29570
|
+
profileInputErrors: profileInputErrors,
|
|
29571
|
+
handleProfileInputChange: handleProfileInputChange,
|
|
29572
|
+
loadingActionRequest: loadingActionRequest,
|
|
29573
|
+
handleSubmit: handleSubmit,
|
|
29574
|
+
};
|
|
29575
|
+
};
|
|
29576
|
+
var getOptionBackgroundColor = function (isFocused, isSelected) {
|
|
29577
|
+
if (isSelected) {
|
|
29578
|
+
return 'var(--B100)';
|
|
29579
|
+
}
|
|
29580
|
+
if (isFocused) {
|
|
29581
|
+
return 'var(--N50)';
|
|
29582
|
+
}
|
|
29583
|
+
return 'var(--white)';
|
|
29584
|
+
};
|
|
29585
|
+
var unitSelectorStyles = function () {
|
|
29586
|
+
return getCommonSelectStyle({
|
|
29587
|
+
control: function (base, state) { return (__assign(__assign({}, base), { borderRadius: 0, backgroundColor: 'var(--N0)', border: state.isFocused ? '1px solid var(--B500) !important' : '1px solid var(--N200)', alignItems: 'center', cursor: 'pointer', borderTopRightRadius: '4px', borderBottomRightRadius: '4px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', outline: 'none', boxShadow: 'none', '&:hover': {
|
|
29588
|
+
border: '1px solid var(--N400)',
|
|
29589
|
+
} })); },
|
|
29590
|
+
indicatorContainer: function (base) { return (__assign(__assign({}, base), { padding: '0px' })); },
|
|
29591
|
+
dropdownIndicator: function (base, state) { return (__assign(__assign({}, base), { color: 'var(--N600)', transition: 'all .2s ease', transform: state.selectProps.menuIsOpen ? 'rotate(180deg)' : 'rotate(0deg)' })); },
|
|
29592
|
+
option: function (base, state) { return (__assign(__assign({}, base), { padding: '4px 12px', backgroundColor: getOptionBackgroundColor(state.isFocused, state.isSelected), color: 'var(--N900)', cursor: 'pointer', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', height: '36px' })); },
|
|
29593
|
+
valueContainer: function (base) { return (__assign(__assign({}, base), { color: 'var(--N900)', fontSize: '13px', fontWeight: '400', lineHeight: '20px' })); },
|
|
29594
|
+
menuList: function (base) { return (__assign(__assign({}, base), { maxHeight: '164px', height: '100%' })); },
|
|
29595
|
+
});
|
|
29596
|
+
};
|
|
29597
|
+
|
|
29598
|
+
/**
|
|
29599
|
+
* In case need arise for variants break this CustomInput and Select as a separate component
|
|
29600
|
+
*/
|
|
29601
|
+
var BuildInfraFormAction = function (_a) {
|
|
29602
|
+
var actionType = _a.actionType, label = _a.label, placeholder = _a.placeholder, error = _a.error, isRequired = _a.isRequired, profileUnitsMap = _a.profileUnitsMap, handleProfileInputChange = _a.handleProfileInputChange, currentUnitName = _a.currentUnitName, currentValue = _a.currentValue;
|
|
29603
|
+
var handleUnitChange = function (selectedUnit) {
|
|
29604
|
+
var data = {
|
|
29605
|
+
unit: selectedUnit.label,
|
|
29606
|
+
value: currentValue,
|
|
29607
|
+
};
|
|
29608
|
+
handleProfileInputChange({ action: actionType, data: data });
|
|
29609
|
+
};
|
|
29610
|
+
var handleInputChange = function (e) {
|
|
29611
|
+
var data = {
|
|
29612
|
+
unit: currentUnitName,
|
|
29613
|
+
value: e.currentTarget.value,
|
|
29614
|
+
};
|
|
29615
|
+
handleProfileInputChange({ action: actionType, data: data });
|
|
29616
|
+
};
|
|
29617
|
+
// would also sort the units in order of conversionFactor
|
|
29618
|
+
var _b = React.useMemo(function () {
|
|
29619
|
+
var _a, _b;
|
|
29620
|
+
var units = (_b = (_a = Object.values(profileUnitsMap)) === null || _a === void 0 ? void 0 : _a.map(function (unit) { return ({
|
|
29621
|
+
label: unit.name,
|
|
29622
|
+
value: String(unit.conversionFactor),
|
|
29623
|
+
}); })) !== null && _b !== void 0 ? _b : [];
|
|
29624
|
+
var _currentUnit = units.find(function (unit) { return unit.label === currentUnitName; });
|
|
29625
|
+
return { unitOptions: units.sort(function (a, b) { return Number(a.value) - Number(b.value); }), currentUnit: _currentUnit };
|
|
29626
|
+
}, [profileUnitsMap]), unitOptions = _b.unitOptions, currentUnit = _b.currentUnit;
|
|
29627
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "flexbox-col dc__gap-4 dc__mxw-420 w-100 dc__align-start" }, { children: [jsxRuntime.jsx("label", __assign({ htmlFor: "".concat(actionType, "-input"), className: "fs-13 fw-4 lh-20 cn-7 ".concat(isRequired ? 'dc__required-field' : '') }, { children: label })), jsxRuntime.jsxs("div", __assign({ className: "w-100 flexbox dc__align-items-center" }, { children: [jsxRuntime.jsx("div", __assign({ className: "flex-grow-1" }, { children: jsxRuntime.jsx("input", { "data-testid": actionType, name: actionType, type: "number", step: BUILD_INFRA_INPUT_CONSTRAINTS.STEP, min: BUILD_INFRA_INPUT_CONSTRAINTS.MIN, className: "form__input dc__no-right-border dc__no-right-radius", placeholder: placeholder, value: currentValue, onChange: handleInputChange, required: isRequired, autoComplete: "off", id: "".concat(actionType, "-input") }) })), profileUnitsMap && (jsxRuntime.jsx(ReactSelect, { name: "".concat(actionType, "-unit"), className: "bcn-0 dc__mxw-120", options: unitOptions, value: currentUnit, onChange: handleUnitChange, isSearchable: false, components: {
|
|
29628
|
+
IndicatorSeparator: null,
|
|
29629
|
+
ClearIndicator: null,
|
|
29630
|
+
}, styles: unitSelectorStyles() }))] })), error && (jsxRuntime.jsxs("div", __assign({ className: "form__error" }, { children: [jsxRuntime.jsx(SvgIcWarning, { className: "form__icon form__icon--error" }), error] })))] })));
|
|
29631
|
+
};
|
|
29632
|
+
|
|
29633
|
+
var BuildInfraFormItem = function (_a) {
|
|
29634
|
+
var heading = _a.heading, Marker = _a.marker, children = _a.children, isInheriting = _a.isInheriting, showDivider = _a.showDivider, handleProfileInputChange = _a.handleProfileInputChange, locator = _a.locator, isDefaultProfile = _a.isDefaultProfile;
|
|
29635
|
+
var handleActivationChange = function (e) {
|
|
29636
|
+
var checked = e.currentTarget.checked;
|
|
29637
|
+
var action = (checked ? "activate_".concat(locator) : "de_activate_".concat(locator));
|
|
29638
|
+
handleProfileInputChange({ action: action });
|
|
29639
|
+
};
|
|
29640
|
+
var renderMarker = function () {
|
|
29641
|
+
if (isDefaultProfile) {
|
|
29642
|
+
return jsxRuntime.jsx(Marker, { className: "icon-dim-20 dc__no-shrink" });
|
|
29643
|
+
}
|
|
29644
|
+
return (jsxRuntime.jsx(Checkbox$1, { onChange: handleActivationChange, isChecked: !isInheriting, value: exports.CHECKBOX_VALUE.CHECKED, dataTestId: "".concat(locator, "_marker") }));
|
|
29645
|
+
};
|
|
29646
|
+
// If in configuration active is false, means it is inheriting values from other profile
|
|
29647
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", __assign({ className: "flexbox-col dc__gap-8 w-100" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flexbox dc__gap-12 dc__align-start w-100" }, { children: [renderMarker(), jsxRuntime.jsxs("div", __assign({ className: "flexbox-col dc__gap-8 w-100" }, { children: [heading, !isInheriting && children] }))] })) })), showDivider && jsxRuntime.jsx("div", { className: "w-100 dc__border-bottom-n1" })] }));
|
|
29648
|
+
};
|
|
29649
|
+
|
|
29650
|
+
var BuildInfraProfileDescriptionField = function (_a) {
|
|
29651
|
+
var handleProfileInputChange = _a.handleProfileInputChange, currentValue = _a.currentValue, error = _a.error;
|
|
29652
|
+
var handleChange = function (e) {
|
|
29653
|
+
handleProfileInputChange({
|
|
29654
|
+
action: exports.BuildInfraMetaConfigTypes.DESCRIPTION,
|
|
29655
|
+
data: { value: e.currentTarget.value },
|
|
29656
|
+
});
|
|
29657
|
+
};
|
|
29658
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "flexbox-col dc__gap-4 w-100 dc__align-start" }, { children: [jsxRuntime.jsx("label", __assign({ htmlFor: "build-infra-profile-description", className: "m-0 fs-13 fw-4 lh-20 cn-7" }, { children: BUILD_INFRA_TEXT.DESCRIPTION_LABEL })), jsxRuntime.jsx("textarea", { "data-testid": "build-infra-profile-description", name: "profile-description", className: "form__textarea mxh-140 dc__hover-border-n300", id: "build-infra-profile-description", placeholder: BUILD_INFRA_TEXT.DESCRIPTION_PLACEHOLDER, value: currentValue, onChange: handleChange }), error && (jsxRuntime.jsxs("div", __assign({ className: "form__error" }, { children: [jsxRuntime.jsx(SvgIcWarning, { className: "form__icon form__icon--error" }), error] })))] })));
|
|
29659
|
+
};
|
|
29660
|
+
|
|
29661
|
+
var BuildInfraProfileNameField = function (_a) {
|
|
29662
|
+
var handleProfileInputChange = _a.handleProfileInputChange, currentValue = _a.currentValue, error = _a.error;
|
|
29663
|
+
var handleChange = function (e) {
|
|
29664
|
+
handleProfileInputChange({ action: exports.BuildInfraMetaConfigTypes.NAME, data: { value: e.currentTarget.value } });
|
|
29665
|
+
};
|
|
29666
|
+
return (jsxRuntime.jsx("div", __assign({ className: "flexbox-col dc__gap-4 w-100 dc__align-start" }, { children: jsxRuntime.jsx(CustomInput, { name: "profile-name", label: BUILD_INFRA_TEXT.PROFILE_LABEL, labelClassName: "m-0 dc__required-field fs-13 fw-4 lh-20 cn-7", placeholder: BUILD_INFRA_TEXT.PROFILE_PLACEHOLDER, value: currentValue, onChange: handleChange, error: error, required: true, inputWrapClassName: "w-100" }) })));
|
|
29667
|
+
};
|
|
29668
|
+
|
|
29669
|
+
var InheritingHeader = function (_a) {
|
|
29670
|
+
var defaultHeading = _a.defaultHeading, inheritingData = _a.inheritingData, isInheriting = _a.isInheriting, isDefaultProfile = _a.isDefaultProfile;
|
|
29671
|
+
var inheritingDataString = inheritingData.map(function (data) { var _a; return "".concat(data.value, " ").concat((_a = data.unit) !== null && _a !== void 0 ? _a : ''); }).join(' - ');
|
|
29672
|
+
if (isDefaultProfile || !isInheriting) {
|
|
29673
|
+
// For typing issues
|
|
29674
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
29675
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: defaultHeading });
|
|
29676
|
+
}
|
|
29677
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "flexbox dc__align-items-center dc__content-space w-100" }, { children: [defaultHeading, jsxRuntime.jsx("p", __assign({ className: "m-0 flexbox pt-0 pb-0 pl-4 pr-4 fs-13 lh-20 fw-4 cn-9" }, { children: inheritingDataString })), jsxRuntime.jsx("p", __assign({ className: "m-0 cn-7 fs-13 fw-4 lh-20" }, { children: BUILD_INFRA_TEXT.INHERITING_HEADING_DESCRIPTION }))] })));
|
|
29678
|
+
};
|
|
29679
|
+
var BuildInfraConfigForm = function (_a) {
|
|
29680
|
+
var profileInput = _a.profileInput, profileInputErrors = _a.profileInputErrors, handleProfileInputChange = _a.handleProfileInputChange, isDefaultProfile = _a.isDefaultProfile, unitsMap = _a.unitsMap, configurationContainerLabel = _a.configurationContainerLabel;
|
|
29681
|
+
var currentConfigurations = profileInput === null || profileInput === void 0 ? void 0 : profileInput.configurations;
|
|
29682
|
+
// will get the desired configuration from the currentConfigurations and then check if it is active or not
|
|
29683
|
+
var isInheritingProfileValues = function (actions) {
|
|
29684
|
+
return actions.some(function (action) { return !currentConfigurations[action.actionType].active; });
|
|
29685
|
+
};
|
|
29686
|
+
// Had to show loader for an instance due to batching of state updates not working as expected :/
|
|
29687
|
+
if (!currentConfigurations) {
|
|
29688
|
+
return jsxRuntime.jsx(Progressing, { pageLoader: true });
|
|
29689
|
+
}
|
|
29690
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "flexbox-col dc__mxw-920 dc__gap-16" }, { children: [!isDefaultProfile && (jsxRuntime.jsxs("div", __assign({ className: "flexbox-col dc__gap-12" }, { children: [jsxRuntime.jsx(BuildInfraProfileNameField, { handleProfileInputChange: handleProfileInputChange, currentValue: profileInput.name, error: profileInputErrors.name }), jsxRuntime.jsx(BuildInfraProfileDescriptionField, { handleProfileInputChange: handleProfileInputChange, currentValue: profileInput.description, error: profileInputErrors.description })] }))), jsxRuntime.jsxs("div", __assign({ className: "flexbox-col dc__gap-12" }, { children: [configurationContainerLabel, jsxRuntime.jsx("div", __assign({ className: "w-100 flexbox-col dc__gap-16 br-4 dc__border-n1 p-16" }, { children: BUILD_INFRA_FORM_FIELDS.map(function (field, index) { return (jsxRuntime.jsx(BuildInfraFormItem, __assign({ marker: field.marker, heading: jsxRuntime.jsx(InheritingHeader, { defaultHeading: field.heading, inheritingData: field.actions.map(function (action) { return currentConfigurations[action.actionType]; }), isInheriting: isInheritingProfileValues(field.actions), isDefaultProfile: isDefaultProfile }), showDivider: index !== BUILD_INFRA_FORM_FIELDS.length - 1, isInheriting: isInheritingProfileValues(field.actions), handleProfileInputChange: handleProfileInputChange, locator: field.locator, isDefaultProfile: isDefaultProfile }, { children: jsxRuntime.jsx("div", __assign({ className: "w-50 flexbox dc__gap-12 w-100 dc__align-start" }, { children: field.actions.map(function (action) { return (jsxRuntime.jsx(BuildInfraFormAction, { actionType: action.actionType, label: action.label, placeholder: action.placeholder, error: profileInputErrors[action.actionType],
|
|
29691
|
+
// Assumption is for default profiles all input fields are required
|
|
29692
|
+
isRequired: isDefaultProfile, profileUnitsMap: unitsMap[action.actionType], handleProfileInputChange: handleProfileInputChange, currentUnitName: currentConfigurations[action.actionType].unit, currentValue: currentConfigurations[action.actionType].value }, action.actionType)); }) })) }), field.locator)); }) }))] }))] })));
|
|
29693
|
+
};
|
|
29694
|
+
|
|
29695
|
+
exports.APIResponseHandler = APIResponseHandler;
|
|
28936
29696
|
exports.AddCDButton = AddCDButton;
|
|
28937
29697
|
exports.AppStatus = AppStatus;
|
|
29698
|
+
exports.BUILD_INFRA_BREADCRUMB = BUILD_INFRA_BREADCRUMB;
|
|
29699
|
+
exports.BUILD_INFRA_FORM_FIELDS = BUILD_INFRA_FORM_FIELDS;
|
|
29700
|
+
exports.BUILD_INFRA_INPUT_CONSTRAINTS = BUILD_INFRA_INPUT_CONSTRAINTS;
|
|
29701
|
+
exports.BUILD_INFRA_TEXT = BUILD_INFRA_TEXT;
|
|
28938
29702
|
exports.BreadCrumb = BreadCrumb;
|
|
28939
29703
|
exports.BreadcrumbStore = Store;
|
|
29704
|
+
exports.BuildInfraConfigForm = BuildInfraConfigForm;
|
|
29705
|
+
exports.BuildInfraDescriptor = Descriptor;
|
|
29706
|
+
exports.BuildInfraFooter = Footer;
|
|
29707
|
+
exports.BuildInfraLocatorsActionMap = BuildInfraLocatorsActionMap;
|
|
28940
29708
|
exports.BuildStageVariable = BuildStageVariable;
|
|
28941
29709
|
exports.CDModalTab = CDModalTab;
|
|
29710
|
+
exports.CREATE_PROFILE_BASE_VALUE = CREATE_PROFILE_BASE_VALUE;
|
|
29711
|
+
exports.CREATE_VIEW_CHECKED_CONFIGS = CREATE_VIEW_CHECKED_CONFIGS;
|
|
28942
29712
|
exports.ChartVersionAndTypeSelector = ChartVersionAndTypeSelector;
|
|
28943
29713
|
exports.Checkbox = Checkbox$1;
|
|
28944
29714
|
exports.ClearIndicator = ClearIndicator;
|
|
@@ -28947,7 +29717,7 @@ exports.ConditionalWrap = ConditionalWrap;
|
|
|
28947
29717
|
exports.ConfirmationDialog = ConfirmationDialog;
|
|
28948
29718
|
exports.CustomInput = CustomInput;
|
|
28949
29719
|
exports.CustomSelect = CustomSelect;
|
|
28950
|
-
exports.
|
|
29720
|
+
exports.DEFAULT_PROFILE_NAME = DEFAULT_PROFILE_NAME;
|
|
28951
29721
|
exports.DEFAULT_TAG_DATA = DEFAULT_TAG_DATA;
|
|
28952
29722
|
exports.DOCUMENTATION = DOCUMENTATION;
|
|
28953
29723
|
exports.DOCUMENTATION_HOME_PAGE = DOCUMENTATION_HOME_PAGE;
|
|
@@ -28981,11 +29751,13 @@ exports.MultiValueRemove = MultiValueRemove;
|
|
|
28981
29751
|
exports.OpaqueModal = OpaqueModal;
|
|
28982
29752
|
exports.Option = Option;
|
|
28983
29753
|
exports.PATTERNS = PATTERNS;
|
|
29754
|
+
exports.PROFILE_INPUT_ERROR_FIELDS = PROFILE_INPUT_ERROR_FIELDS;
|
|
28984
29755
|
exports.Pagination = Pagination;
|
|
28985
29756
|
exports.PopupMenu = PopupMenu;
|
|
28986
29757
|
exports.Progressing = Progressing;
|
|
28987
29758
|
exports.PropagateTagInfo = PropagateTagInfo;
|
|
28988
29759
|
exports.REGISTRY_TYPE_MAP = REGISTRY_TYPE_MAP;
|
|
29760
|
+
exports.REQUIRED_INPUT_FIELDS = REQUIRED_INPUT_FIELDS;
|
|
28989
29761
|
exports.RJSFForm = RJSFForm;
|
|
28990
29762
|
exports.ROUTES = ROUTES;
|
|
28991
29763
|
exports.RadioGroup = RadioGroup$1;
|
|
@@ -28997,10 +29769,10 @@ exports.ResizableTextarea = ResizableTextarea;
|
|
|
28997
29769
|
exports.SELECTED_APPROVAL_TAB_STATE = SELECTED_APPROVAL_TAB_STATE;
|
|
28998
29770
|
exports.ScanVulnerabilitiesTable = ScanVulnerabilitiesTable;
|
|
28999
29771
|
exports.SearchBar = SearchBar;
|
|
29772
|
+
exports.SelectOption = SelectOption;
|
|
29000
29773
|
exports.ServerError = ServerError;
|
|
29001
29774
|
exports.ServerErrors = ServerErrors;
|
|
29002
29775
|
exports.SingleSelectOption = SingleSelectOption;
|
|
29003
|
-
exports.SortableTableHeaderCell = SortableTableHeaderCell;
|
|
29004
29776
|
exports.SourceTypeMap = SourceTypeMap;
|
|
29005
29777
|
exports.StyledRadioGroup = RadioGroup;
|
|
29006
29778
|
exports.TOAST_ACCESS_DENIED = TOAST_ACCESS_DENIED;
|
|
@@ -29019,15 +29791,20 @@ exports.VisibleModal = VisibleModal;
|
|
|
29019
29791
|
exports.VisibleModal2 = VisibleModal2;
|
|
29020
29792
|
exports.closeOnEscKeyPressed = closeOnEscKeyPressed;
|
|
29021
29793
|
exports.copyToClipboard = copyToClipboard;
|
|
29794
|
+
exports.createBuildInfraProfile = createBuildInfraProfile;
|
|
29022
29795
|
exports.createGitCommitUrl = createGitCommitUrl;
|
|
29023
29796
|
exports.customStyles = customStyles;
|
|
29024
29797
|
exports.debounce = debounce$2;
|
|
29798
|
+
exports.deleteBuildInfraProfileByName = deleteBuildInfraProfileByName;
|
|
29025
29799
|
exports.extractImage = extractImage;
|
|
29026
29800
|
exports.fetchChartTemplateVersions = fetchChartTemplateVersions;
|
|
29027
29801
|
exports.genericCDMaterialsService = genericCDMaterialsService;
|
|
29028
29802
|
exports.get = get;
|
|
29029
29803
|
exports.getAlphabetIcon = getAlphabetIcon;
|
|
29804
|
+
exports.getBuildInfraProfileByName = getBuildInfraProfileByName;
|
|
29805
|
+
exports.getCommonSelectStyle = getCommonSelectStyle;
|
|
29030
29806
|
exports.getCookie = getCookie;
|
|
29807
|
+
exports.getCustomOptionSelectionStyle = getCustomOptionSelectionStyle;
|
|
29031
29808
|
exports.getEmptyArrayOfLength = getEmptyArrayOfLength;
|
|
29032
29809
|
exports.getFilteredChartVersions = getFilteredChartVersions;
|
|
29033
29810
|
exports.getInferredTypeFromValueType = getInferredTypeFromValueType;
|
|
@@ -29036,6 +29813,7 @@ exports.getLoginInfo = getLoginInfo;
|
|
|
29036
29813
|
exports.getRandomColor = getRandomColor;
|
|
29037
29814
|
exports.getRedirectionProps = getRedirectionProps;
|
|
29038
29815
|
exports.getTeamListMin = getTeamListMin;
|
|
29816
|
+
exports.getTransformedBuildInfraProfileResponse = getTransformedBuildInfraProfileResponse;
|
|
29039
29817
|
exports.getUnlockedJSON = getUnlockedJSON;
|
|
29040
29818
|
exports.getUrlWithSearchParams = getUrlWithSearchParams;
|
|
29041
29819
|
exports.getUserRole = getUserRole;
|
|
@@ -29054,13 +29832,19 @@ exports.sortCallback = sortCallback;
|
|
|
29054
29832
|
exports.stopPropagation = stopPropagation;
|
|
29055
29833
|
exports.toastAccessDenied = toastAccessDenied;
|
|
29056
29834
|
exports.trash = trash;
|
|
29835
|
+
exports.unitSelectorStyles = unitSelectorStyles;
|
|
29836
|
+
exports.updateBuildInfraProfile = updateBuildInfraProfile;
|
|
29057
29837
|
exports.useAsync = useAsync;
|
|
29058
29838
|
exports.useBreadcrumb = useBreadcrumb;
|
|
29839
|
+
exports.useBuildInfraForm = useBuildInfraForm;
|
|
29059
29840
|
exports.useClickOutside = useClickOutside;
|
|
29060
29841
|
exports.useEffectAfterMount = useEffectAfterMount;
|
|
29061
29842
|
exports.useForm = useForm;
|
|
29062
29843
|
exports.useSearchString = useSearchString;
|
|
29063
29844
|
exports.useSuperAdmin = useSuperAdmin;
|
|
29064
29845
|
exports.useThrottledEffect = useThrottledEffect;
|
|
29065
|
-
exports.useUrlFilters = useUrlFilters;
|
|
29066
29846
|
exports.useWindowSize = useWindowSize;
|
|
29847
|
+
exports.validateDescription = validateDescription;
|
|
29848
|
+
exports.validateName = validateName;
|
|
29849
|
+
exports.validateRequestLimit = validateRequestLimit;
|
|
29850
|
+
exports.validateRequiredPositiveNumber = validateRequiredPositiveNumber;
|