@devtron-labs/devtron-fe-common-lib 0.0.7-beta-49 → 0.0.7-beta-51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6,20 +6,20 @@ var ReactDOM = require('react-dom');
6
6
  var reactRouterDom = require('react-router-dom');
7
7
 
8
8
  function _interopNamespaceDefault(e) {
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
19
17
  });
20
- }
21
- n.default = e;
22
- return Object.freeze(n);
18
+ }
19
+ });
20
+ }
21
+ n.default = e;
22
+ return Object.freeze(n);
23
23
  }
24
24
 
25
25
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
@@ -75,6 +75,11 @@ var TOKEN_COOKIE_NAME = 'argocd.token';
75
75
  var TriggerTypeMap = {
76
76
  automatic: 'Auto',
77
77
  manual: 'Manual',
78
+ };
79
+ var BuildStageVariable = {
80
+ PreBuild: 'preBuildStage',
81
+ Build: 'buildStage',
82
+ PostBuild: 'postBuildStage',
78
83
  };
79
84
 
80
85
  /******************************************************************************
@@ -248,7 +253,19 @@ exports.DeploymentNodeType = void 0;
248
253
  DeploymentNodeType["CD"] = "CD";
249
254
  DeploymentNodeType["POSTCD"] = "POSTCD";
250
255
  DeploymentNodeType["APPROVAL"] = "APPROVAL";
251
- })(exports.DeploymentNodeType || (exports.DeploymentNodeType = {}));
256
+ })(exports.DeploymentNodeType || (exports.DeploymentNodeType = {}));
257
+ exports.PluginRequiredStageKeys = void 0;
258
+ (function (PluginRequiredStageKeys) {
259
+ PluginRequiredStageKeys["PRE_CI"] = "PRE_CI";
260
+ PluginRequiredStageKeys["POST_CI"] = "POST_CI";
261
+ PluginRequiredStageKeys["PRE_OR_POST_CI"] = "PRE_OR_POST_CI";
262
+ })(exports.PluginRequiredStageKeys || (exports.PluginRequiredStageKeys = {}));
263
+ exports.PluginRequiredStage = void 0;
264
+ (function (PluginRequiredStage) {
265
+ PluginRequiredStage["PRE_CI"] = "preBuildStage";
266
+ PluginRequiredStage["POST_CI"] = "postBuildStage";
267
+ PluginRequiredStage["PRE_OR_POST_CI"] = "PRE_OR_POST_CI";
268
+ })(exports.PluginRequiredStage || (exports.PluginRequiredStage = {}));
252
269
 
253
270
  var responseMessages = {
254
271
  100: 'Continue',
@@ -503,7 +520,7 @@ function styleInject(css, ref) {
503
520
  var css_248z$6 = ".empty-state {\n height: 100%;\n}\n.empty-state img {\n height: 40%;\n max-height: 200px;\n width: auto;\n max-width: 250px;\n}\n.empty-state svg {\n height: 40%;\n max-height: 200px;\n width: auto;\n}\n.empty-state h1,\n.empty-state h2,\n.empty-state h3,\n.empty-state h4,\n.empty-state h5,\n.empty-state h6 {\n color: var(--N900);\n}\n.empty-state .subtitle {\n font-size: 13px;\n width: 300px;\n font-weight: 400;\n text-align: center;\n line-height: 1.5;\n margin-bottom: 20px;\n}\n.empty-state .cta {\n height: 36px;\n}\n.empty-state p {\n width: 300px;\n text-align: center;\n font-size: 13px;\n color: var(--N700);\n}\n.empty-state strong {\n font-size: 16px;\n margin-bottom: 4px;\n color: var(--N900);\n font-weight: normal;\n}\n.empty-state .select-popup {\n height: min-content;\n max-height: 250px;\n overflow: auto;\n padding: 8px 0;\n}\n.empty-state .empty-state__loader {\n width: 34px;\n height: 34px;\n margin-bottom: 16px;\n}\n.empty-state .empty-state__loading-text {\n font-size: 12px;\n width: 200px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n text-align: center;\n color: var(--N900);\n}\n.empty-state .button__icon {\n width: 16px;\n height: 16px;\n margin-left: 8px;\n}";
504
521
  styleInject(css_248z$6);
505
522
 
506
- var _g$3;
523
+ var _g$2;
507
524
  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); }
508
525
  var SvgIcProgressing = function SvgIcProgressing(props) {
509
526
  return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
@@ -511,7 +528,7 @@ var SvgIcProgressing = function SvgIcProgressing(props) {
511
528
  viewBox: "0 0 24 24",
512
529
  width: "1em",
513
530
  height: "1em"
514
- }, props), _g$3 || (_g$3 = /*#__PURE__*/React__namespace.createElement("g", {
531
+ }, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
515
532
  fill: "none"
516
533
  }, /*#__PURE__*/React__namespace.createElement("animateTransform", {
517
534
  attributeName: "transform",
@@ -3927,28 +3944,6 @@ function captureException(exception, captureContext) {
3927
3944
  return getCurrentHub().captureException(exception, { captureContext });
3928
3945
  }
3929
3946
 
3930
- var _g$2;
3931
- 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); }
3932
- var SvgIcWarning = function SvgIcWarning(props) {
3933
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
3934
- xmlns: "http://www.w3.org/2000/svg",
3935
- width: "1em",
3936
- height: "1em",
3937
- viewBox: "0 0 32 32"
3938
- }, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
3939
- fill: "none",
3940
- fillRule: "evenodd"
3941
- }, /*#__PURE__*/React__namespace.createElement("path", {
3942
- d: "M0 0h32v32H0z"
3943
- }), /*#__PURE__*/React__namespace.createElement("path", {
3944
- fill: "#FFCB5D",
3945
- d: "M18.315 5.052 29.72 25.01A2.667 2.667 0 0 1 27.405 29H4.595a2.667 2.667 0 0 1-2.315-3.99L13.685 5.052a2.667 2.667 0 0 1 4.63 0z"
3946
- }), /*#__PURE__*/React__namespace.createElement("path", {
3947
- fill: "#FFF",
3948
- d: "M16 22.667a1.333 1.333 0 1 1 0 2.666 1.333 1.333 0 0 1 0-2.666zM16 12c.736 0 1.333.597 1.333 1.333v6.334a1.333 1.333 0 1 1-2.666 0v-6.334c0-.736.597-1.333 1.333-1.333z"
3949
- }))));
3950
- };
3951
-
3952
3947
  toast.configure({
3953
3948
  autoClose: 3000,
3954
3949
  hideProgressBar: true,
@@ -4087,110 +4082,6 @@ function getLoginInfo() {
4087
4082
  return null;
4088
4083
  }
4089
4084
  }
4090
- }
4091
- function useForm(stateSchema, validationSchema, callback) {
4092
- if (validationSchema === void 0) { validationSchema = {}; }
4093
- var _a = __read(React.useState(stateSchema), 2), state = _a[0], setState = _a[1];
4094
- var _b = __read(React.useState(true), 2), disable = _b[0], setDisable = _b[1];
4095
- var _c = __read(React.useState(false), 2), isDirty = _c[0], setIsDirty = _c[1];
4096
- // Disable button in initial render.
4097
- React.useEffect(function () {
4098
- setDisable(true);
4099
- }, []);
4100
- // For every changed in our state this will be fired
4101
- // To be able to disable the button
4102
- React.useEffect(function () {
4103
- if (isDirty) {
4104
- setDisable(validateState(state));
4105
- }
4106
- }, [state, isDirty]);
4107
- // Used to disable submit button if there's an error in state
4108
- // or the required field in state has no value.
4109
- // Wrapped in useCallback to cached the function to avoid intensive memory leaked
4110
- // in every re-render in component
4111
- var validateState = React.useCallback(function (state) {
4112
- //check errors in all fields
4113
- var hasErrorInState = Object.keys(validationSchema).some(function (key) {
4114
- var isInputFieldRequired = validationSchema[key].required;
4115
- var stateValue = state[key].value; // state value
4116
- var stateError = state[key].error; // state error
4117
- return (isInputFieldRequired && !stateValue) || stateError;
4118
- });
4119
- return hasErrorInState;
4120
- }, [state, validationSchema]);
4121
- function validateField(name, value) {
4122
- if (validationSchema[name].required) {
4123
- if (!value) {
4124
- return 'This is a required field.';
4125
- }
4126
- }
4127
- function _validateSingleValidator(validator, value) {
4128
- if (value && !validator.regex.test(value)) {
4129
- return false;
4130
- }
4131
- return true;
4132
- }
4133
- // single validator
4134
- var _validator = validationSchema[name].validator;
4135
- if (_validator && typeof _validator === 'object') {
4136
- if (!_validateSingleValidator(_validator, value)) {
4137
- return _validator.error;
4138
- }
4139
- }
4140
- // multiple validators
4141
- var _validators = validationSchema[name].validators;
4142
- if (_validators && typeof _validators === 'object' && Array.isArray(_validators)) {
4143
- var errors_1 = [];
4144
- _validators.forEach(function (_validator) {
4145
- if (!_validateSingleValidator(_validator, value)) {
4146
- errors_1.push(_validator.error);
4147
- }
4148
- });
4149
- if (errors_1.length > 0) {
4150
- return errors_1;
4151
- }
4152
- }
4153
- return '';
4154
- }
4155
- var handleOnChange = React.useCallback(function (event) {
4156
- setIsDirty(true);
4157
- var _a = event.target, name = _a.name, value = _a.value;
4158
- var error = validateField(name, value);
4159
- setState(function (prevState) {
4160
- var _a;
4161
- return (__assign(__assign({}, prevState), (_a = {}, _a[name] = { value: value, error: error }, _a)));
4162
- });
4163
- }, [validationSchema]);
4164
- var handleOnSubmit = function (event) {
4165
- event.preventDefault();
4166
- var newState = Object.keys(validationSchema).reduce(function (agg, curr) {
4167
- agg[curr] = __assign(__assign({}, state[curr]), { error: validateField(curr, state[curr].value) });
4168
- return agg;
4169
- }, state);
4170
- if (!validateState(newState)) {
4171
- callback(state);
4172
- }
4173
- else {
4174
- setState(__assign({}, newState));
4175
- }
4176
- };
4177
- return { state: state, disable: disable, handleOnChange: handleOnChange, handleOnSubmit: handleOnSubmit };
4178
- }
4179
- function handleError(error) {
4180
- if (!error) {
4181
- return [];
4182
- }
4183
- if (!Array.isArray(error)) {
4184
- return [error];
4185
- }
4186
- return error;
4187
- }
4188
- function CustomInput(_a) {
4189
- var name = _a.name, value = _a.value, error = _a.error, onChange = _a.onChange, _b = _a.onBlur, onBlur = _b === void 0 ? function (e) { } : _b, _c = _a.onFocus, onFocus = _c === void 0 ? function (e) { } : _c, label = _a.label, _d = _a.type, type = _d === void 0 ? 'text' : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e; _a.autoComplete; var _g = _a.labelClassName, labelClassName = _g === void 0 ? '' : _g, _h = _a.placeholder, placeholder = _h === void 0 ? '' : _h, _j = _a.tabIndex, tabIndex = _j === void 0 ? 1 : _j, _k = _a.dataTestid, dataTestid = _k === void 0 ? '' : _k;
4190
- return (jsxRuntime.jsxs("div", __assign({ className: "flex column left top" }, { children: [jsxRuntime.jsx("label", __assign({ className: "form__label ".concat(labelClassName) }, { children: label })), jsxRuntime.jsx("input", { "data-testid": dataTestid, type: type, name: name, autoComplete: "off", className: "form__input", onChange: function (e) {
4191
- e.persist();
4192
- onChange(e);
4193
- }, onBlur: onBlur, onFocus: onFocus, placeholder: placeholder, value: value, disabled: disabled, tabIndex: tabIndex }), handleError(error).map(function (err) { return (jsxRuntime.jsxs("div", __assign({ className: "form__error" }, { children: [jsxRuntime.jsx(SvgIcWarning, { className: "form__icon form__icon--error" }), err] }))); })] })));
4194
4085
  }
4195
4086
 
4196
4087
  function Progressing(_a) {
@@ -4318,16 +4209,16 @@ var Modal = function (_a) {
4318
4209
  }, id: "popup", className: "".concat(rootClassName, " popup ").concat(modal ? 'modal' : ''), style: __assign({}, style) }, { children: children })), document.getElementById('visible-modal'));
4319
4210
  };
4320
4211
 
4321
- var _path$5;
4322
- 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); }
4212
+ var _path$6;
4213
+ 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); }
4323
4214
  var SvgIcCross = function SvgIcCross(props) {
4324
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
4215
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
4325
4216
  width: "1em",
4326
4217
  height: "1em",
4327
4218
  viewBox: "0 0 24 24",
4328
4219
  fill: "none",
4329
4220
  xmlns: "http://www.w3.org/2000/svg"
4330
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
4221
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
4331
4222
  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",
4332
4223
  fill: "#596168"
4333
4224
  })));
@@ -8626,6 +8517,21 @@ var index = /*#__PURE__*/forwardRef( /*#__PURE__*/TippyGenerator(tippy));
8626
8517
 
8627
8518
  var Tippy = index;
8628
8519
 
8520
+ var _path$5;
8521
+ 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); }
8522
+ var SvgIcHelp = function SvgIcHelp(props) {
8523
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
8524
+ xmlns: "http://www.w3.org/2000/svg",
8525
+ width: "1em",
8526
+ height: "1em",
8527
+ viewBox: "0 0 24 24"
8528
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
8529
+ fill: "#767D84",
8530
+ fillRule: "evenodd",
8531
+ 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"
8532
+ })));
8533
+ };
8534
+
8629
8535
  var css_248z$4 = ".tippy-box[data-animation=shift-toward-subtle][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=top][data-state=hidden]{transform:translateY(-5px)}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=bottom][data-state=hidden]{transform:translateY(5px)}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=left][data-state=hidden]{transform:translateX(-5px)}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=right][data-state=hidden]{transform:translateX(5px)}";
8630
8536
  styleInject(css_248z$4);
8631
8537
 
@@ -8633,6 +8539,7 @@ styleInject(css_248z$4);
8633
8539
  // So this can be updated to support further for new features or interactions
8634
8540
  function TippyCustomized(props) {
8635
8541
  var tippyRef = React.useRef(null);
8542
+ var _a = __read(React.useState(false), 2), showHeadingInfo = _a[0], setShowHeadingInfo = _a[1];
8636
8543
  var isWhiteTheme = props.theme === exports.TippyTheme.white;
8637
8544
  var onTippyMount = function (tippyInstance) {
8638
8545
  tippyRef.current = tippyInstance;
@@ -8647,15 +8554,19 @@ function TippyCustomized(props) {
8647
8554
  props.onClose();
8648
8555
  }
8649
8556
  }
8557
+ setShowHeadingInfo(false);
8650
8558
  };
8651
8559
  var closeOnEsc = function (e) {
8652
8560
  if (e.keyCode === 27) {
8653
8561
  closeTippy();
8654
8562
  }
8655
8563
  };
8564
+ var toggleHeadingInfo = function (e) {
8565
+ setShowHeadingInfo(not);
8566
+ };
8656
8567
  var getTippyContent = function () {
8657
- var Icon = props.Icon, iconPath = props.iconPath, iconClass = props.iconClass, iconSize = props.iconSize, onImageLoadError = props.onImageLoadError, heading = props.heading, infoTextHeading = props.infoTextHeading, infoText = props.infoText, showCloseButton = props.showCloseButton, additionalContent = props.additionalContent, documentationLink = props.documentationLink, documentationLinkText = props.documentationLinkText;
8658
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "dc__word-break dc__hyphens-auto flex left ".concat(isWhiteTheme ? 'p-12 dc__border-bottom-n1 cn-9' : 'pt-20 pb-12 pr-20 pl-20 cn-0 top') }, { children: [iconPath ? (jsxRuntime.jsx("img", { className: "icon-dim-".concat(iconSize || 20, " mr-6 ").concat(iconClass || ''), src: iconPath, alt: 'Heading', onError: onImageLoadError })) : (Icon && (jsxRuntime.jsx("div", __assign({ className: "icon-dim-".concat(iconSize || 20, " mr-6") }, { children: jsxRuntime.jsx(Icon, { className: "icon-dim-".concat(iconSize || 20, " ").concat(iconClass || '') }) })))), heading && jsxRuntime.jsx("span", __assign({ className: "fs-14 fw-6 lh-20 ".concat(showCloseButton ? 'mr-6' : '') }, { children: heading })), showCloseButton && (jsxRuntime.jsx("div", __assign({ className: "icon-dim-16 ml-auto" }, { children: jsxRuntime.jsx(SvgIcCross, { className: "icon-dim-16 cursor ".concat(isWhiteTheme ? 'fcn-9' : 'fcn-0'), onClick: closeTippy }) })))] })), infoTextHeading && (jsxRuntime.jsx("div", __assign({ className: "dc__word-break dc__hyphens-auto fs-14 fw-6 lh-20 ".concat(isWhiteTheme ? 'pl-12 pr-12' : 'pl-20 pr-20') }, { children: infoTextHeading }))), infoText && (jsxRuntime.jsx("div", __assign({ className: "dc__word-break dc__hyphens-auto fs-13 fw-4 lh-20 ".concat(isWhiteTheme
8568
+ var Icon = props.Icon, iconPath = props.iconPath, iconClass = props.iconClass, iconSize = props.iconSize, onImageLoadError = props.onImageLoadError, heading = props.heading, headingInfo = props.headingInfo, infoTextHeading = props.infoTextHeading, infoText = props.infoText, showCloseButton = props.showCloseButton, additionalContent = props.additionalContent, documentationLink = props.documentationLink, documentationLinkText = props.documentationLinkText;
8569
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "dc__word-break dc__hyphens-auto flex left ".concat(isWhiteTheme ? 'p-12 dc__border-bottom-n1 cn-9' : 'pt-20 pb-12 pr-20 pl-20 cn-0 top') }, { children: [iconPath ? (jsxRuntime.jsx("img", { className: "icon-dim-".concat(iconSize || 20, " mr-6 ").concat(iconClass || ''), src: iconPath, alt: heading, onError: onImageLoadError })) : (Icon && (jsxRuntime.jsx("div", __assign({ className: "icon-dim-".concat(iconSize || 20, " mr-6") }, { children: jsxRuntime.jsx(Icon, { className: "icon-dim-".concat(iconSize || 20, " ").concat(iconClass || '') }) })))), heading && jsxRuntime.jsx("span", __assign({ className: "fs-14 fw-6 lh-20 ".concat(showCloseButton ? 'mr-6' : '') }, { children: heading })), headingInfo && (jsxRuntime.jsx("div", __assign({ className: "icon-dim-20 cursor", onClick: toggleHeadingInfo }, { children: jsxRuntime.jsx(SvgIcHelp, { className: "icon-dim-20" }) }))), showCloseButton && (jsxRuntime.jsx("div", __assign({ className: "icon-dim-16 ml-auto" }, { children: jsxRuntime.jsx(SvgIcCross, { className: "icon-dim-16 cursor ".concat(isWhiteTheme ? 'fcn-9' : 'fcn-0'), onClick: closeTippy }) })))] })), showHeadingInfo && (jsxRuntime.jsxs("div", __assign({ className: "flex left bcv-1 fs-13 fw-4 lh-20 pt-8 pb-8 ".concat(isWhiteTheme ? 'pl-12 pr-12' : 'pl-20 pr-20') }, { children: [jsxRuntime.jsx("div", __assign({ className: "icon-dim-20 mr-8" }, { children: jsxRuntime.jsx(SvgIcHelp, { className: "icon-dim-20 fcv-5" }) })), jsxRuntime.jsx("div", __assign({ className: "dc__word-break dc__hyphens-auto" }, { children: headingInfo }))] }))), infoTextHeading && (jsxRuntime.jsx("div", __assign({ className: "dc__word-break dc__hyphens-auto fs-14 fw-6 lh-20 ".concat(isWhiteTheme ? 'pl-12 pr-12' : 'pl-20 pr-20') }, { children: infoTextHeading }))), infoText && (jsxRuntime.jsx("div", __assign({ className: "dc__word-break dc__hyphens-auto fs-13 fw-4 lh-20 ".concat(isWhiteTheme
8659
8570
  ? 'p-12'
8660
8571
  : "pl-20 pr-20 pt-4 ".concat(additionalContent && documentationLink ? 'pb-12' : 'pb-20')) }, { children: infoText }))), additionalContent, documentationLink && (jsxRuntime.jsx("div", __assign({ className: "pl-12 pb-12" }, { children: jsxRuntime.jsx("a", __assign({ href: documentationLink, target: "_blank", rel: "noreferrer noopener", className: "fs-13 cb-5", onClick: closeTippy }, { children: documentationLinkText || 'Learn more' })) })))] }));
8661
8572
  };
@@ -9013,7 +8924,7 @@ ConfirmationDialog.ButtonGroup = ButtonGroup;
9013
8924
  var warn = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2248%22%20height%3D%2248%22%20viewBox%3D%220%200%2048%2048%22%3E%20%20%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%200h48v48H0z%22%2F%3E%20%20%20%20%20%20%20%20%3Cg%20fill%3D%22%23FFEBEB%22%20stroke%3D%22%23F33E3E%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M7%2024h24v17a4%204%200%200%201-4%204H11a4%204%200%200%201-4-4V24z%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20stroke-linecap%3D%22round%22%20d%3D%22M19%2029.5v10M24%2029.5v10M14%2029.5v10%22%2F%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3Cpath%20stroke%3D%22%23F33E3E%22%20stroke-dasharray%3D%2217%2C3%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22M42%2010a3%203%200%200%201%200%206H31M38%2023a3%203%200%200%200-3-3h-8%22%2F%3E%20%20%20%20%20%20%20%20%3Cg%20stroke%3D%22%23F33E3E%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20transform%3D%22rotate%28-10%2036.29%20-8.86%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20width%3D%2230%22%20height%3D%225%22%20y%3D%226%22%20fill%3D%22%23FFEBEB%22%20rx%3D%221%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M11%200h8a2%202%200%200%201%202%202v4H9V2a2%202%200%200%201%202-2z%22%2F%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";
9014
8925
 
9015
8926
  var DeleteDialog = function (props) {
9016
- return jsxRuntime.jsxs(ConfirmationDialog, __assign({ className: "confirmation-dialog__body--w-400" }, { children: [jsxRuntime.jsx(ConfirmationDialog.Icon, { src: warn }), jsxRuntime.jsx(ConfirmationDialog.Body, __assign({ title: props.title }, { children: jsxRuntime.jsxs("div", __assign({ className: "fs-13 cn-7 lh-1-54 w-100" }, { children: [props.description ? props.description : null, props.children] })) })), jsxRuntime.jsx(ConfirmationDialog.ButtonGroup, { children: jsxRuntime.jsxs("div", __assign({ className: "flex right" }, { children: [jsxRuntime.jsx("button", __assign({ type: "button", className: "cta cancel cta-cd-delete-modal ml-16", onClick: props.closeDelete, disabled: props.apiCallInProgress, "data-testid": "dialog-cancel" }, { children: "Cancel" })), jsxRuntime.jsx("button", __assign({ type: "button", className: "cta delete cta-cd-delete-modal ml-16", onClick: function () { return props.delete(); }, disabled: props.apiCallInProgress, "data-testid": "dialog-delete" }, { children: props.apiCallInProgress ? jsxRuntime.jsx(Progressing, {}) : "".concat(props.deletePrefix || '', "Delete").concat(props.deletePostfix || '') }))] })) })] }));
8927
+ return (jsxRuntime.jsxs(ConfirmationDialog, __assign({ className: "confirmation-dialog__body--w-400" }, { children: [jsxRuntime.jsx(ConfirmationDialog.Icon, { src: warn }), jsxRuntime.jsx(ConfirmationDialog.Body, __assign({ title: props.title }, { children: jsxRuntime.jsxs("div", __assign({ className: "fs-13 cn-7 lh-1-54 w-100" }, { children: [props.description ? props.description : null, props.children] })) })), jsxRuntime.jsx(ConfirmationDialog.ButtonGroup, { children: jsxRuntime.jsxs("div", __assign({ className: "flex right" }, { children: [jsxRuntime.jsx("button", __assign({ type: "button", className: "cta cancel cta-cd-delete-modal ml-16", onClick: props.closeDelete, disabled: props.apiCallInProgress, "data-testid": "dialog-cancel" }, { children: "Cancel" })), jsxRuntime.jsx("button", __assign({ type: "button", className: "cta delete cta-cd-delete-modal ml-16", onClick: function () { return props.delete(); }, disabled: props.apiCallInProgress, "data-testid": "dialog-delete" }, { children: props.apiCallInProgress ? (jsxRuntime.jsx(Progressing, {})) : ("".concat(props.deletePrefix || '').concat(props.buttonPrimaryText ? props.buttonPrimaryText : 'Delete').concat(props.deletePostfix || '')) }))] })) })] })));
9017
8928
  };
9018
8929
  function DeleteDialogDescription(props) {
9019
8930
  return jsxRuntime.jsx(jsxRuntime.Fragment, { children: props.children });
@@ -16712,80 +16623,59 @@ function Radio(_a) {
16712
16623
  }
16713
16624
  RadioGroup.Radio = Radio;
16714
16625
 
16715
- var info = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2032%2032%22%3E%20%20%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%200h32v32H0z%22%2F%3E%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%2306C%22%20d%3D%22M16%202.667C8.64%202.667%202.667%208.64%202.667%2016S8.64%2029.333%2016%2029.333%2029.333%2023.36%2029.333%2016%2023.36%202.667%2016%202.667z%22%2F%3E%20%20%20%20%20%20%20%20%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M16%2014.667c.736%200%201.333.597%201.333%201.333v5.333a1.333%201.333%200%201%201-2.666%200V16c0-.736.597-1.333%201.333-1.333zm0-5.334A1.333%201.333%200%201%201%2016%2012a1.333%201.333%200%200%201%200-2.667z%22%2F%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";
16716
-
16717
- function DeleteComponent(_a) {
16718
- var setDeleting = _a.setDeleting, toggleConfirmation = _a.toggleConfirmation, deleteComponent = _a.deleteComponent, title = _a.title, component = _a.component, payload = _a.payload, _b = _a.confirmationDialogDescription, confirmationDialogDescription = _b === void 0 ? '' : _b, _c = _a.redirectTo, redirectTo = _c === void 0 ? false : _c, _d = _a.url, url = _d === void 0 ? '' : _d, reload = _a.reload, _e = _a.configuration, configuration = _e === void 0 ? '' : _e, closeCustomComponent = _a.closeCustomComponent;
16719
- var _f = __read(React.useState(false), 2), showCannotDeleteDialogModal = _f[0], setCannotDeleteDialogModal = _f[1];
16720
- var push = reactRouterDom.useHistory().push;
16721
- function handleDelete() {
16722
- return __awaiter(this, void 0, void 0, function () {
16723
- var serverError_1;
16724
- return __generator(this, function (_a) {
16725
- switch (_a.label) {
16726
- case 0:
16727
- setDeleting(true);
16728
- _a.label = 1;
16729
- case 1:
16730
- _a.trys.push([1, 3, 4, 5]);
16731
- return [4 /*yield*/, deleteComponent(payload)];
16732
- case 2:
16733
- _a.sent();
16734
- toast.success('Successfully deleted');
16735
- toggleConfirmation(false);
16736
- if (redirectTo) {
16737
- push(url);
16738
- }
16739
- else {
16740
- reload();
16741
- }
16742
- if (typeof closeCustomComponent === 'function') {
16743
- closeCustomComponent();
16744
- }
16745
- return [3 /*break*/, 5];
16746
- case 3:
16747
- serverError_1 = _a.sent();
16748
- if (serverError_1 instanceof ServerErrors && serverError_1.code === 500) {
16749
- setCannotDeleteDialogModal(true);
16750
- }
16751
- return [3 /*break*/, 5];
16752
- case 4:
16753
- setDeleting(false);
16754
- return [7 /*endfinally*/];
16755
- case 5: return [2 /*return*/];
16756
- }
16757
- });
16758
- });
16759
- }
16760
- var handleConfirmation = function () {
16761
- setCannotDeleteDialogModal(false);
16762
- toggleConfirmation(false);
16763
- if (typeof closeCustomComponent === 'function') {
16764
- closeCustomComponent();
16765
- }
16766
- };
16767
- var renderCannotDeleteDialogModal = function () {
16768
- return (jsxRuntime.jsxs(ConfirmationDialog, __assign({ className: "confirmation-dialog__body--w-360" }, { children: [jsxRuntime.jsx(ConfirmationDialog.Icon, { src: info }), jsxRuntime.jsx(ConfirmationDialog.Body, { title: "Cannot delete ".concat(component, " '").concat(title, "'") }), jsxRuntime.jsx("p", __assign({ className: "fs-13 cn-7 " }, { children: confirmationDialogDescription })), jsxRuntime.jsx(ConfirmationDialog.ButtonGroup, { children: jsxRuntime.jsx("button", __assign({ type: "button", className: "cta", onClick: handleConfirmation }, { children: "Okay" })) })] })));
16769
- };
16770
- var renderDeleteDialog = function () {
16771
- return (jsxRuntime.jsx(DeleteDialog, __assign({ title: "Delete ".concat(component, " '").concat(title, "'"), delete: handleDelete, closeDelete: function () { return toggleConfirmation(false); }, dataTestId: "delete-dialog" }, { children: jsxRuntime.jsx(DeleteDialog.Description, { children: jsxRuntime.jsxs("p", { children: ["Are you sure you want to delete this ", configuration ? configuration : component, "? "] }) }) })));
16772
- };
16773
- return (jsxRuntime.jsxs("div", { children: [!showCannotDeleteDialogModal && renderDeleteDialog(), showCannotDeleteDialogModal && renderCannotDeleteDialogModal()] }));
16774
- }
16626
+ exports.RefVariableType = void 0;
16627
+ (function (RefVariableType) {
16628
+ RefVariableType["GLOBAL"] = "GLOBAL";
16629
+ RefVariableType["FROM_PREVIOUS_STEP"] = "FROM_PREVIOUS_STEP";
16630
+ RefVariableType["NEW"] = "NEW";
16631
+ })(exports.RefVariableType || (exports.RefVariableType = {}));
16632
+ exports.PluginType = void 0;
16633
+ (function (PluginType) {
16634
+ PluginType["INLINE"] = "INLINE";
16635
+ PluginType["PLUGIN_REF"] = "REF_PLUGIN";
16636
+ })(exports.PluginType || (exports.PluginType = {}));
16637
+ exports.ScriptType = void 0;
16638
+ (function (ScriptType) {
16639
+ ScriptType["SHELL"] = "SHELL";
16640
+ ScriptType["DOCKERFILE"] = "DOCKERFILE";
16641
+ ScriptType["CONTAINERIMAGE"] = "CONTAINER_IMAGE";
16642
+ })(exports.ScriptType || (exports.ScriptType = {}));
16643
+ exports.MountPath = void 0;
16644
+ (function (MountPath) {
16645
+ MountPath["TRUE"] = "Yes";
16646
+ MountPath["FALSE"] = "No";
16647
+ })(exports.MountPath || (exports.MountPath = {}));
16648
+ exports.ConditionType = void 0;
16649
+ (function (ConditionType) {
16650
+ ConditionType["SKIP"] = "SKIP";
16651
+ ConditionType["TRIGGER"] = "TRIGGER";
16652
+ ConditionType["PASS"] = "PASS";
16653
+ ConditionType["FAIL"] = "FAIL";
16654
+ })(exports.ConditionType || (exports.ConditionType = {}));
16655
+ exports.RefVariableStageType = void 0;
16656
+ (function (RefVariableStageType) {
16657
+ RefVariableStageType["PRE_CI"] = "PRE_CI";
16658
+ RefVariableStageType["POST_CI"] = "POST_CI";
16659
+ })(exports.RefVariableStageType || (exports.RefVariableStageType = {}));
16660
+ exports.CIBuildType = void 0;
16661
+ (function (CIBuildType) {
16662
+ CIBuildType["SELF_DOCKERFILE_BUILD_TYPE"] = "self-dockerfile-build";
16663
+ CIBuildType["MANAGED_DOCKERFILE_BUILD_TYPE"] = "managed-dockerfile-build";
16664
+ CIBuildType["BUILDPACK_BUILD_TYPE"] = "buildpack-build";
16665
+ })(exports.CIBuildType || (exports.CIBuildType = {}));
16775
16666
 
16776
16667
  exports.BreadCrumb = BreadCrumb;
16777
16668
  exports.BreadcrumbStore = Store;
16669
+ exports.BuildStageVariable = BuildStageVariable;
16778
16670
  exports.CDModalTab = CDModalTab;
16779
16671
  exports.Checkbox = Checkbox;
16780
16672
  exports.ClearIndicator = ClearIndicator;
16781
16673
  exports.ConditionalWrap = ConditionalWrap;
16782
16674
  exports.ConfirmationDialog = ConfirmationDialog;
16783
- exports.CustomInput = CustomInput;
16784
16675
  exports.CustomSelect = CustomSelect;
16785
16676
  exports.DEFAULT_TAG_DATA = DEFAULT_TAG_DATA;
16786
16677
  exports.DOCUMENTATION = DOCUMENTATION;
16787
16678
  exports.DOCUMENTATION_HOME_PAGE = DOCUMENTATION_HOME_PAGE;
16788
- exports.DeleteComponent = DeleteComponent;
16789
16679
  exports.DeleteDialog = DeleteDialog;
16790
16680
  exports.DetailsProgressing = DetailsProgressing;
16791
16681
  exports.DialogForm = DialogForm;
@@ -16853,5 +16743,4 @@ exports.toastAccessDenied = toastAccessDenied;
16853
16743
  exports.trash = trash;
16854
16744
  exports.useBreadcrumb = useBreadcrumb;
16855
16745
  exports.useEffectAfterMount = useEffectAfterMount;
16856
- exports.useForm = useForm;
16857
16746
  exports.useThrottledEffect = useThrottledEffect;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.7-beta-49",
3
+ "version": "0.0.7-beta-51",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <path fill="#767D84" fill-rule="evenodd" 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"/>
3
+ </svg>