@devtron-labs/devtron-fe-common-lib 0.0.7-beta-40 → 0.0.7-beta-50

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.
@@ -0,0 +1,263 @@
1
+ export interface MaterialType {
2
+ name: string;
3
+ type: string;
4
+ value: string;
5
+ gitMaterialId: number;
6
+ id: number;
7
+ isSelected: boolean;
8
+ gitHostId: number;
9
+ gitProviderId: number;
10
+ regex?: string;
11
+ isRegex: boolean;
12
+ }
13
+ export interface Githost {
14
+ id: number;
15
+ name: string;
16
+ active: boolean;
17
+ webhookSecret: string;
18
+ webhookUrl: string;
19
+ }
20
+ export interface WebhookEvent {
21
+ id: number;
22
+ gitHostId: number;
23
+ name: string;
24
+ isActive: boolean;
25
+ selectors: WebhookEventSelectors[];
26
+ }
27
+ interface WebhookEventSelectors {
28
+ id: number;
29
+ eventId: number;
30
+ name: string;
31
+ selector: string;
32
+ toShowInCiFilter: boolean;
33
+ fixValue: string;
34
+ toShow: boolean;
35
+ possibleValues: string;
36
+ isActive: boolean;
37
+ }
38
+ export interface CiPipelineSourceTypeOption {
39
+ label: string;
40
+ value: string;
41
+ isDisabled: boolean;
42
+ isSelected: boolean;
43
+ isWebhook: boolean;
44
+ }
45
+ export declare enum RefVariableType {
46
+ GLOBAL = "GLOBAL",
47
+ FROM_PREVIOUS_STEP = "FROM_PREVIOUS_STEP",
48
+ NEW = "NEW"
49
+ }
50
+ export declare enum PluginType {
51
+ INLINE = "INLINE",
52
+ PLUGIN_REF = "REF_PLUGIN"
53
+ }
54
+ export declare enum ScriptType {
55
+ SHELL = "SHELL",
56
+ DOCKERFILE = "DOCKERFILE",
57
+ CONTAINERIMAGE = "CONTAINER_IMAGE"
58
+ }
59
+ export declare enum MountPath {
60
+ TRUE = "Yes",
61
+ FALSE = "No"
62
+ }
63
+ export declare enum ConditionType {
64
+ SKIP = "SKIP",
65
+ TRIGGER = "TRIGGER",
66
+ PASS = "PASS",
67
+ FAIL = "FAIL"
68
+ }
69
+ export declare enum RefVariableStageType {
70
+ PRE_CI = "PRE_CI",
71
+ POST_CI = "POST_CI"
72
+ }
73
+ export interface VariableType {
74
+ id: number;
75
+ name: string;
76
+ value: string;
77
+ format: string;
78
+ description: string;
79
+ defaultValue: string;
80
+ variableType: RefVariableType;
81
+ refVariableStepIndex: number;
82
+ refVariableName: string;
83
+ refVariableStage?: RefVariableStageType;
84
+ variableStepIndexInPlugin?: number;
85
+ }
86
+ interface CommandArgsMap {
87
+ command: string;
88
+ args: string[];
89
+ }
90
+ export interface PortMapType {
91
+ portOnLocal: number;
92
+ portOnContainer: number;
93
+ }
94
+ interface ConditionDetails {
95
+ id: number;
96
+ conditionOnVariable: string;
97
+ conditionOperator: string;
98
+ conditionType: ConditionType;
99
+ conditionalValue: string;
100
+ }
101
+ interface InlineStepDetailType {
102
+ scriptType: ScriptType;
103
+ isMountCustomScript?: boolean;
104
+ script?: string;
105
+ dockerFileExists?: boolean;
106
+ mountPath?: string;
107
+ mountCodeToContainer?: boolean;
108
+ mountDirectoryFromHost?: boolean;
109
+ containerImagePath?: string;
110
+ imagePullSecret?: string;
111
+ commandArgsMap?: CommandArgsMap[];
112
+ portMap?: PortMapType[];
113
+ mountPathMap?: {
114
+ filePathOnDisk: string;
115
+ filePathOnContainer: string;
116
+ }[];
117
+ inputVariables?: VariableType[];
118
+ outputVariables?: VariableType[];
119
+ conditionDetails: ConditionDetails[];
120
+ }
121
+ interface PluginRefStepDetailType {
122
+ id: number;
123
+ pluginId: number;
124
+ inputVariables?: VariableType[];
125
+ outputVariables?: VariableType[];
126
+ conditionDetails?: ConditionDetails[];
127
+ }
128
+ export interface StepType {
129
+ id: number;
130
+ index: number;
131
+ name: string;
132
+ description: string;
133
+ stepType: PluginType;
134
+ outputDirectoryPath: string[];
135
+ inlineStepDetail?: InlineStepDetailType;
136
+ pluginRefStepDetail?: PluginRefStepDetailType;
137
+ triggerIfParentStageFail: boolean;
138
+ isMandatory?: boolean;
139
+ }
140
+ export interface BuildStageType {
141
+ id: number;
142
+ steps: StepType[];
143
+ }
144
+ export declare enum CIBuildType {
145
+ SELF_DOCKERFILE_BUILD_TYPE = "self-dockerfile-build",
146
+ MANAGED_DOCKERFILE_BUILD_TYPE = "managed-dockerfile-build",
147
+ BUILDPACK_BUILD_TYPE = "buildpack-build"
148
+ }
149
+ export interface BuildPackConfigType {
150
+ builderId: string;
151
+ language: string;
152
+ languageVersion: string;
153
+ projectPath: string;
154
+ builderLangEnvParam?: string;
155
+ currentBuilderLangEnvParam?: string;
156
+ buildPacks?: any;
157
+ args?: Record<string, string>;
158
+ }
159
+ export interface DockerBuildConfigType {
160
+ dockerfileContent: string;
161
+ dockerfileRelativePath: string;
162
+ buildContext: string;
163
+ dockerfilePath?: string;
164
+ dockerfileRepository?: string;
165
+ args?: Record<string, string>;
166
+ targetPlatform?: any;
167
+ language?: string;
168
+ languageFramework?: string;
169
+ }
170
+ export interface CIBuildConfigType {
171
+ buildPackConfig: BuildPackConfigType;
172
+ ciBuildType: CIBuildType;
173
+ dockerBuildConfig: DockerBuildConfigType;
174
+ gitMaterialId: number;
175
+ buildContextGitMaterialId: number;
176
+ id?: number;
177
+ }
178
+ export interface DockerConfigOverrideType {
179
+ dockerRegistry: string;
180
+ dockerRepository: string;
181
+ ciBuildConfig: CIBuildConfigType;
182
+ }
183
+ export interface FormType {
184
+ name: string;
185
+ args: {
186
+ key: string;
187
+ value: string;
188
+ }[];
189
+ materials: MaterialType[];
190
+ gitHost: Githost;
191
+ webhookEvents: WebhookEvent[];
192
+ ciPipelineSourceTypeOptions: CiPipelineSourceTypeOption[];
193
+ webhookConditionList: {
194
+ selectorId: number;
195
+ value: string;
196
+ }[];
197
+ triggerType: string;
198
+ scanEnabled?: boolean;
199
+ beforeDockerBuildScripts?: {
200
+ id: number;
201
+ name: string;
202
+ outputLocation: string;
203
+ script: string;
204
+ isCollapsed: boolean;
205
+ index: number;
206
+ }[];
207
+ afterDockerBuildScripts?: {
208
+ id: number;
209
+ name: string;
210
+ outputLocation: string;
211
+ script: string;
212
+ isCollapsed: boolean;
213
+ index: number;
214
+ }[];
215
+ ciPipelineEditable: true;
216
+ preBuildStage?: BuildStageType;
217
+ postBuildStage?: BuildStageType;
218
+ isDockerConfigOverridden?: boolean;
219
+ dockerConfigOverride?: DockerConfigOverrideType;
220
+ }
221
+ export interface ErrorObj {
222
+ isValid: boolean;
223
+ message: string | null;
224
+ }
225
+ export interface TaskErrorObj {
226
+ isValid: boolean;
227
+ name: ErrorObj;
228
+ inlineStepDetail?: {
229
+ inputVariables?: ErrorObj[];
230
+ outputVariables?: ErrorObj[];
231
+ };
232
+ pluginRefStepDetail?: {
233
+ inputVariables?: ErrorObj[];
234
+ outputVariables?: ErrorObj[];
235
+ };
236
+ }
237
+ export interface FormErrorObjectType {
238
+ name: ErrorObj;
239
+ materials?: MaterialType[];
240
+ preBuildStage?: {
241
+ isValid: boolean;
242
+ steps: TaskErrorObj[];
243
+ };
244
+ buildStage?: {
245
+ isValid: boolean;
246
+ name: ErrorObj;
247
+ };
248
+ postBuildStage?: {
249
+ isValid: boolean;
250
+ steps: TaskErrorObj[];
251
+ };
252
+ }
253
+ export interface PluginDetailType {
254
+ id: number;
255
+ name: string;
256
+ type: string;
257
+ description: string;
258
+ icon: string;
259
+ tags: string[];
260
+ inputVariables?: VariableType[];
261
+ outputVariables?: VariableType[];
262
+ }
263
+ export {};
@@ -48,3 +48,8 @@ export declare const TriggerTypeMap: {
48
48
  automatic: string;
49
49
  manual: string;
50
50
  };
51
+ export declare const BuildStageVariable: {
52
+ PreBuild: string;
53
+ Build: string;
54
+ PostBuild: string;
55
+ };
@@ -3,7 +3,7 @@ export declare class ValidationRules {
3
3
  isValid: boolean;
4
4
  messages: string[];
5
5
  };
6
- propagateTagValue: (value: string, key: string) => {
6
+ propagateTagValue: (value: string) => {
7
7
  isValid: boolean;
8
8
  messages: string[];
9
9
  };
@@ -1,5 +1,6 @@
1
1
  import { ReactNode, CSSProperties } from 'react';
2
2
  import { Placement } from 'tippy.js';
3
+ import { VariableType } from './CIPipeline.Types';
3
4
  export interface ResponseType {
4
5
  code: number;
5
6
  status: string;
@@ -46,6 +47,7 @@ export interface TippyCustomizedProps {
46
47
  theme: TippyTheme;
47
48
  visible?: boolean;
48
49
  heading?: string;
50
+ headingInfo?: string;
49
51
  infoTextHeading?: string;
50
52
  placement: Placement;
51
53
  className?: string;
@@ -234,6 +236,7 @@ export interface CommonNodeAttr {
234
236
  approvalUsers?: string[];
235
237
  userApprovalConfig?: UserApprovalConfigType;
236
238
  requestedUserId?: number;
239
+ showPluginWarning?: boolean;
237
240
  }
238
241
  export interface VulnerabilityType {
239
242
  name: string;
@@ -288,4 +291,28 @@ export interface CDMaterialResponseType {
288
291
  userApprovalConfig: UserApprovalConfigType;
289
292
  requestedUserId: number;
290
293
  }
294
+ export declare enum PluginRequiredStageKeys {
295
+ PRE_CI = "PRE_CI",
296
+ POST_CI = "POST_CI",
297
+ PRE_OR_POST_CI = "PRE_OR_POST_CI"
298
+ }
299
+ export declare enum PluginRequiredStage {
300
+ PRE_CI = "preBuildStage",
301
+ POST_CI = "postBuildStage",
302
+ PRE_OR_POST_CI = "PRE_OR_POST_CI"
303
+ }
304
+ export interface MandatoryPluginDetailType {
305
+ id: number;
306
+ name: string;
307
+ description?: string;
308
+ requiredIn: PluginRequiredStage;
309
+ applied?: boolean;
310
+ inputVariables?: VariableType[];
311
+ outputVariables?: VariableType[];
312
+ }
313
+ export interface MandatoryPluginDataType {
314
+ pluginData: MandatoryPluginDetailType[];
315
+ isValidPre: boolean;
316
+ isValidPost: boolean;
317
+ }
291
318
  export {};
@@ -29,3 +29,4 @@ export { default as GenericEmptyState } from './EmptyState/GenericEmptyState';
29
29
  export { default as Toggle } from './Toggle/Toggle';
30
30
  export { default as ScanVulnerabilitiesTable } from './Security/ScanVulnerabilitiesTable';
31
31
  export { default as StyledRadioGroup } from './RadioGroup/RadioGroup';
32
+ export * from './CIPipeline.Types';
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',
@@ -504,9 +521,9 @@ var css_248z$6 = ".empty-state {\n height: 100%;\n}\n.empty-state img {\n heig
504
521
  styleInject(css_248z$6);
505
522
 
506
523
  var _g$2;
507
- 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); }
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
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
526
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
510
527
  xmlns: "http://www.w3.org/2000/svg",
511
528
  viewBox: "0 0 24 24",
512
529
  width: "1em",
@@ -558,8 +575,8 @@ EmptyState.Loading = Loading;
558
575
 
559
576
  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}
560
577
 
561
- function _extends$9() {
562
- _extends$9 = Object.assign || function (target) {
578
+ function _extends$a() {
579
+ _extends$a = Object.assign || function (target) {
563
580
  for (var i = 1; i < arguments.length; i++) {
564
581
  var source = arguments[i];
565
582
 
@@ -573,7 +590,7 @@ function _extends$9() {
573
590
  return target;
574
591
  };
575
592
 
576
- return _extends$9.apply(this, arguments);
593
+ return _extends$a.apply(this, arguments);
577
594
  }
578
595
 
579
596
  function _objectWithoutPropertiesLoose$2(source, excluded) {
@@ -1299,7 +1316,7 @@ function ProgressBar(_ref) {
1299
1316
  isIn = _ref.isIn,
1300
1317
  theme = _ref.theme;
1301
1318
 
1302
- var style = _extends$9({}, userStyle, {
1319
+ var style = _extends$a({}, userStyle, {
1303
1320
  animationDuration: delay + "ms",
1304
1321
  animationPlayState: isRunning ? 'running' : 'paused',
1305
1322
  opacity: hide ? 0 : 1
@@ -1576,9 +1593,9 @@ var ToastContainer = function ToastContainer(props) {
1576
1593
  ,
1577
1594
  id: containerId
1578
1595
  }, getToastToRender(function (position, toastList) {
1579
- var containerStyle = !toastList.length ? _extends$9({}, style, {
1596
+ var containerStyle = !toastList.length ? _extends$a({}, style, {
1580
1597
  pointerEvents: 'none'
1581
- }) : _extends$9({}, style);
1598
+ }) : _extends$a({}, style);
1582
1599
  return React.createElement("div", {
1583
1600
  className: getClassName(position),
1584
1601
  style: containerStyle,
@@ -1685,7 +1702,7 @@ function dispatchToast(content, options) {
1685
1702
 
1686
1703
 
1687
1704
  function mergeOptions(type, options) {
1688
- return _extends$9({}, options, {
1705
+ return _extends$a({}, options, {
1689
1706
  type: options && options.type || type,
1690
1707
  toastId: getToastId(options)
1691
1708
  });
@@ -1702,7 +1719,7 @@ function toast(content, options) {
1702
1719
  }
1703
1720
 
1704
1721
  toast.loading = function (content, options) {
1705
- return dispatchToast(content, mergeOptions(TYPE.DEFAULT, _extends$9({
1722
+ return dispatchToast(content, mergeOptions(TYPE.DEFAULT, _extends$a({
1706
1723
  isLoading: true,
1707
1724
  autoClose: false,
1708
1725
  closeOnClick: false,
@@ -1718,7 +1735,7 @@ function handlePromise(promise, _ref2, options) {
1718
1735
  var id;
1719
1736
 
1720
1737
  if (pending) {
1721
- id = isStr(pending) ? toast.loading(pending, options) : toast.loading(pending.render, _extends$9({}, options, pending));
1738
+ id = isStr(pending) ? toast.loading(pending, options) : toast.loading(pending.render, _extends$a({}, options, pending));
1722
1739
  }
1723
1740
 
1724
1741
  var resetParams = {
@@ -1737,7 +1754,7 @@ function handlePromise(promise, _ref2, options) {
1737
1754
  return;
1738
1755
  }
1739
1756
 
1740
- var baseParams = _extends$9({
1757
+ var baseParams = _extends$a({
1741
1758
  type: type
1742
1759
  }, resetParams, options, {
1743
1760
  data: result
@@ -1748,10 +1765,10 @@ function handlePromise(promise, _ref2, options) {
1748
1765
  } : input; // if the id is set we know that it's an update
1749
1766
 
1750
1767
  if (id) {
1751
- toast.update(id, _extends$9({}, baseParams, params));
1768
+ toast.update(id, _extends$a({}, baseParams, params));
1752
1769
  } else {
1753
1770
  // using toast.promise without loading
1754
- toast(params.render, _extends$9({}, baseParams, params));
1771
+ toast(params.render, _extends$a({}, baseParams, params));
1755
1772
  }
1756
1773
 
1757
1774
  return result;
@@ -1775,7 +1792,7 @@ toast.warning = /*#__PURE__*/createToastByType(TYPE.WARNING);
1775
1792
  toast.warn = toast.warning;
1776
1793
 
1777
1794
  toast.dark = function (content, options) {
1778
- return dispatchToast(content, mergeOptions(TYPE.DEFAULT, _extends$9({
1795
+ return dispatchToast(content, mergeOptions(TYPE.DEFAULT, _extends$a({
1779
1796
  theme: 'dark'
1780
1797
  }, options)));
1781
1798
  };
@@ -1832,7 +1849,7 @@ toast.update = function (toastId, options) {
1832
1849
  var oldOptions = toast.props,
1833
1850
  oldContent = toast.content;
1834
1851
 
1835
- var nextOptions = _extends$9({}, oldOptions, options, {
1852
+ var nextOptions = _extends$a({}, oldOptions, options, {
1836
1853
  toastId: options.toastId || toastId,
1837
1854
  updateId: generateToastId()
1838
1855
  });
@@ -4192,16 +4209,16 @@ var Modal = function (_a) {
4192
4209
  }, id: "popup", className: "".concat(rootClassName, " popup ").concat(modal ? 'modal' : ''), style: __assign({}, style) }, { children: children })), document.getElementById('visible-modal'));
4193
4210
  };
4194
4211
 
4195
- var _path$5;
4196
- 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); }
4197
4214
  var SvgIcCross = function SvgIcCross(props) {
4198
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
4215
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
4199
4216
  width: "1em",
4200
4217
  height: "1em",
4201
4218
  viewBox: "0 0 24 24",
4202
4219
  fill: "none",
4203
4220
  xmlns: "http://www.w3.org/2000/svg"
4204
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
4221
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
4205
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",
4206
4223
  fill: "#596168"
4207
4224
  })));
@@ -8500,6 +8517,21 @@ var index = /*#__PURE__*/forwardRef( /*#__PURE__*/TippyGenerator(tippy));
8500
8517
 
8501
8518
  var Tippy = index;
8502
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
+
8503
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)}";
8504
8536
  styleInject(css_248z$4);
8505
8537
 
@@ -8507,6 +8539,7 @@ styleInject(css_248z$4);
8507
8539
  // So this can be updated to support further for new features or interactions
8508
8540
  function TippyCustomized(props) {
8509
8541
  var tippyRef = React.useRef(null);
8542
+ var _a = __read(React.useState(false), 2), showHeadingInfo = _a[0], setShowHeadingInfo = _a[1];
8510
8543
  var isWhiteTheme = props.theme === exports.TippyTheme.white;
8511
8544
  var onTippyMount = function (tippyInstance) {
8512
8545
  tippyRef.current = tippyInstance;
@@ -8521,15 +8554,19 @@ function TippyCustomized(props) {
8521
8554
  props.onClose();
8522
8555
  }
8523
8556
  }
8557
+ setShowHeadingInfo(false);
8524
8558
  };
8525
8559
  var closeOnEsc = function (e) {
8526
8560
  if (e.keyCode === 27) {
8527
8561
  closeTippy();
8528
8562
  }
8529
8563
  };
8564
+ var toggleHeadingInfo = function (e) {
8565
+ setShowHeadingInfo(not);
8566
+ };
8530
8567
  var getTippyContent = function () {
8531
- 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;
8532
- 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
8533
8570
  ? 'p-12'
8534
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' })) })))] }));
8535
8572
  };
@@ -8669,39 +8706,35 @@ var ValidationRules = /** @class */ (function () {
8669
8706
  errorList.push('Key is required');
8670
8707
  }
8671
8708
  else {
8672
- if (!key.startsWith("devtron.ai/")) {
8673
- var re = new RegExp('/', 'g');
8674
- var noOfSlashInKey = (_a = key.match(re)) === null || _a === void 0 ? void 0 : _a.length;
8675
- if (noOfSlashInKey > 1) {
8676
- errorList.push('Key: Max 1 ( / ) allowed');
8677
- }
8678
- else if (noOfSlashInKey === 1) {
8679
- var _b = __read(key.split('/'), 2), prefix = _b[0], name_1 = _b[1];
8680
- errorList.push.apply(errorList, __spreadArray([], __read(validateTagValue(name_1).map(function (error) { return "Name: ".concat(error); })), false));
8681
- if (prefix.length > 253) {
8682
- errorList.push('Prefix: Can be max 253 characters');
8683
- }
8684
- var validPrefix = PATTERNS.KUBERNETES_KEY_PREFIX.test(prefix);
8685
- if (!validPrefix) {
8686
- errorList.push('Prefix: Must be a DNS subdomain (a series of DNS labels separated by dots (.)');
8687
- }
8709
+ var re = new RegExp('/', 'g');
8710
+ var noOfSlashInKey = (_a = key.match(re)) === null || _a === void 0 ? void 0 : _a.length;
8711
+ if (noOfSlashInKey > 1) {
8712
+ errorList.push('Key: Max 1 ( / ) allowed');
8713
+ }
8714
+ else if (noOfSlashInKey === 1) {
8715
+ var _b = __read(key.split('/'), 2), prefix = _b[0], name_1 = _b[1];
8716
+ errorList.push.apply(errorList, __spreadArray([], __read(validateTagValue(name_1).map(function (error) { return "Name: ".concat(error); })), false));
8717
+ if (prefix.length > 253) {
8718
+ errorList.push('Prefix: Can be max 253 characters');
8688
8719
  }
8689
- else {
8690
- errorList.push.apply(errorList, __spreadArray([], __read(validateTagValue(key).map(function (error) { return "Name: ".concat(error); })), false));
8720
+ var validPrefix = PATTERNS.KUBERNETES_KEY_PREFIX.test(prefix);
8721
+ if (!validPrefix) {
8722
+ errorList.push('Prefix: Must be a DNS subdomain (a series of DNS labels separated by dots (.)');
8691
8723
  }
8692
8724
  }
8725
+ else {
8726
+ errorList.push.apply(errorList, __spreadArray([], __read(validateTagValue(key).map(function (error) { return "Name: ".concat(error); })), false));
8727
+ }
8693
8728
  }
8694
8729
  return { isValid: errorList.length === 0, messages: errorList };
8695
8730
  };
8696
- this.propagateTagValue = function (value, key) {
8731
+ this.propagateTagValue = function (value) {
8697
8732
  var errorList = [];
8698
8733
  if (!value) {
8699
8734
  errorList.push('Value is required');
8700
8735
  }
8701
8736
  else {
8702
- if (!key.startsWith("devtron.ai/")) {
8703
- errorList.push.apply(errorList, __spreadArray([], __read(validateTagValue(value)), false));
8704
- }
8737
+ errorList.push.apply(errorList, __spreadArray([], __read(validateTagValue(value)), false));
8705
8738
  }
8706
8739
  return { isValid: errorList.length === 0, messages: errorList };
8707
8740
  };
@@ -8736,7 +8769,7 @@ var TagLabelValueSelector = function (_a) {
8736
8769
  : _tagData.value !== '';
8737
8770
  }
8738
8771
  else if (selectedValue || isRequired || _tagData.propagate) {
8739
- _tagData.isInvalidValue = !validationRules.propagateTagValue(selectedValue, _tagData.key).isValid;
8772
+ _tagData.isInvalidValue = !validationRules.propagateTagValue(selectedValue).isValid;
8740
8773
  _tagData.isInvalidKey = !_tagData.key || _tagData.isInvalidKey;
8741
8774
  }
8742
8775
  else {
@@ -8765,7 +8798,7 @@ var TagLabelValueSelector = function (_a) {
8765
8798
  }
8766
8799
  }
8767
8800
  else if (isRequired || selectedValue || tagData.propagate) {
8768
- field = validationRules.propagateTagValue(selectedValue, tagData.key);
8801
+ field = validationRules.propagateTagValue(selectedValue);
8769
8802
  }
8770
8803
  if (!field.isValid) {
8771
8804
  return (jsxRuntime.jsxs("div", __assign({ className: "p-4", onClick: stopPropagation, "data-testid": "tag-label-cross-stop-propagation" }, { children: [field.messages.map(function (error) { return (jsxRuntime.jsxs("div", __assign({ className: "flexbox pr-4 pl-4" }, { children: [jsxRuntime.jsx("span", { children: jsxRuntime.jsx(SvgIcCross, { className: "icon-dim-14 scr-5 mt-3 mr-4" }) }), jsxRuntime.jsx("span", { children: error })] }), error)); }), tagInputType === exports.KEY_VALUE.KEY && (jsxRuntime.jsxs("div", __assign({ className: "flexbox pr-4 pl-4" }, { children: [jsxRuntime.jsx("span", { children: jsxRuntime.jsx(SvgIcInfoOutlined, { className: "icon-dim-14 mt-3 mr-4" }) }), jsxRuntime.jsx("span", __assign({ className: "dc__italic-font-style" }, { children: "Key format: prefix/name or name" }))] })))] })));
@@ -8817,12 +8850,12 @@ var TagDetails = function (_a) {
8817
8850
  _tagData.isInvalidKey =
8818
8851
  _tagData.key || _tagData.value ? !validationRules.propagateTagKey(_tagData.key).isValid : false;
8819
8852
  _tagData.isInvalidValue = _tagData.value
8820
- ? !validationRules.propagateTagValue(_tagData.value, _tagData.key).isValid
8853
+ ? !validationRules.propagateTagValue(_tagData.value).isValid
8821
8854
  : false;
8822
8855
  }
8823
8856
  setTagData(index, _tagData);
8824
8857
  };
8825
- 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" }) }))] })));
8858
+ 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' : ''), 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" }) }))] })));
8826
8859
  };
8827
8860
 
8828
8861
  var _path$1;
@@ -8844,11 +8877,7 @@ var TagLabelSelect = function (_a) {
8844
8877
  var isCreateApp = _a.isCreateApp, labelTags = _a.labelTags, setLabelTags = _a.setLabelTags, _b = _a.tabIndex, tabIndex = _b === void 0 ? 0 : _b;
8845
8878
  var setTagData = function (index, tagValue) {
8846
8879
  var _tags = __spreadArray([], __read(labelTags), false);
8847
- var _tagValue = tagValue;
8848
- if (_tagValue.key.startsWith("devtron.ai/")) {
8849
- _tagValue.propagate = false;
8850
- }
8851
- _tags[index] = _tagValue;
8880
+ _tags[index] = tagValue;
8852
8881
  setLabelTags(_tags);
8853
8882
  };
8854
8883
  var addNewTag = function () {
@@ -16586,8 +16615,50 @@ function Radio(_a) {
16586
16615
  }
16587
16616
  RadioGroup.Radio = Radio;
16588
16617
 
16618
+ exports.RefVariableType = void 0;
16619
+ (function (RefVariableType) {
16620
+ RefVariableType["GLOBAL"] = "GLOBAL";
16621
+ RefVariableType["FROM_PREVIOUS_STEP"] = "FROM_PREVIOUS_STEP";
16622
+ RefVariableType["NEW"] = "NEW";
16623
+ })(exports.RefVariableType || (exports.RefVariableType = {}));
16624
+ exports.PluginType = void 0;
16625
+ (function (PluginType) {
16626
+ PluginType["INLINE"] = "INLINE";
16627
+ PluginType["PLUGIN_REF"] = "REF_PLUGIN";
16628
+ })(exports.PluginType || (exports.PluginType = {}));
16629
+ exports.ScriptType = void 0;
16630
+ (function (ScriptType) {
16631
+ ScriptType["SHELL"] = "SHELL";
16632
+ ScriptType["DOCKERFILE"] = "DOCKERFILE";
16633
+ ScriptType["CONTAINERIMAGE"] = "CONTAINER_IMAGE";
16634
+ })(exports.ScriptType || (exports.ScriptType = {}));
16635
+ exports.MountPath = void 0;
16636
+ (function (MountPath) {
16637
+ MountPath["TRUE"] = "Yes";
16638
+ MountPath["FALSE"] = "No";
16639
+ })(exports.MountPath || (exports.MountPath = {}));
16640
+ exports.ConditionType = void 0;
16641
+ (function (ConditionType) {
16642
+ ConditionType["SKIP"] = "SKIP";
16643
+ ConditionType["TRIGGER"] = "TRIGGER";
16644
+ ConditionType["PASS"] = "PASS";
16645
+ ConditionType["FAIL"] = "FAIL";
16646
+ })(exports.ConditionType || (exports.ConditionType = {}));
16647
+ exports.RefVariableStageType = void 0;
16648
+ (function (RefVariableStageType) {
16649
+ RefVariableStageType["PRE_CI"] = "PRE_CI";
16650
+ RefVariableStageType["POST_CI"] = "POST_CI";
16651
+ })(exports.RefVariableStageType || (exports.RefVariableStageType = {}));
16652
+ exports.CIBuildType = void 0;
16653
+ (function (CIBuildType) {
16654
+ CIBuildType["SELF_DOCKERFILE_BUILD_TYPE"] = "self-dockerfile-build";
16655
+ CIBuildType["MANAGED_DOCKERFILE_BUILD_TYPE"] = "managed-dockerfile-build";
16656
+ CIBuildType["BUILDPACK_BUILD_TYPE"] = "buildpack-build";
16657
+ })(exports.CIBuildType || (exports.CIBuildType = {}));
16658
+
16589
16659
  exports.BreadCrumb = BreadCrumb;
16590
16660
  exports.BreadcrumbStore = Store;
16661
+ exports.BuildStageVariable = BuildStageVariable;
16591
16662
  exports.CDModalTab = CDModalTab;
16592
16663
  exports.Checkbox = Checkbox;
16593
16664
  exports.ClearIndicator = ClearIndicator;
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-40",
3
+ "version": "0.0.7-beta-50",
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>
@@ -0,0 +1,275 @@
1
+ export interface MaterialType {
2
+ name: string
3
+ type: string
4
+ value: string
5
+ gitMaterialId: number
6
+ id: number
7
+ isSelected: boolean
8
+ gitHostId: number
9
+ gitProviderId: number
10
+ regex?: string
11
+ isRegex: boolean
12
+ }
13
+
14
+ export interface Githost {
15
+ id: number
16
+ name: string
17
+ active: boolean
18
+ webhookSecret: string
19
+ webhookUrl: string
20
+ }
21
+
22
+ export interface WebhookEvent {
23
+ id: number
24
+ gitHostId: number
25
+ name: string
26
+ isActive: boolean
27
+ selectors: WebhookEventSelectors[]
28
+ }
29
+
30
+ interface WebhookEventSelectors {
31
+ id: number
32
+ eventId: number
33
+ name: string
34
+ selector: string
35
+ toShowInCiFilter: boolean
36
+ fixValue: string
37
+ toShow: boolean
38
+ possibleValues: string
39
+ isActive: boolean
40
+ }
41
+
42
+ export interface CiPipelineSourceTypeOption {
43
+ label: string
44
+ value: string
45
+ isDisabled: boolean
46
+ isSelected: boolean
47
+ isWebhook: boolean
48
+ }
49
+
50
+ export enum RefVariableType {
51
+ GLOBAL = 'GLOBAL',
52
+ FROM_PREVIOUS_STEP = 'FROM_PREVIOUS_STEP',
53
+ NEW = 'NEW',
54
+ }
55
+
56
+ export enum PluginType {
57
+ INLINE = 'INLINE',
58
+ PLUGIN_REF = 'REF_PLUGIN',
59
+ }
60
+
61
+ export enum ScriptType {
62
+ SHELL = 'SHELL',
63
+ DOCKERFILE = 'DOCKERFILE',
64
+ CONTAINERIMAGE = 'CONTAINER_IMAGE',
65
+ }
66
+
67
+ export enum MountPath {
68
+ TRUE = 'Yes',
69
+ FALSE = 'No',
70
+ }
71
+
72
+ export enum ConditionType {
73
+ SKIP = 'SKIP',
74
+ TRIGGER = 'TRIGGER',
75
+ PASS = 'PASS',
76
+ FAIL = 'FAIL',
77
+ }
78
+
79
+ export enum RefVariableStageType {
80
+ PRE_CI = 'PRE_CI',
81
+ POST_CI = 'POST_CI',
82
+ }
83
+
84
+ export interface VariableType {
85
+ id: number
86
+ name: string
87
+ value: string
88
+ format: string
89
+ description: string
90
+ defaultValue: string
91
+ variableType: RefVariableType
92
+ refVariableStepIndex: number
93
+ refVariableName: string
94
+ refVariableStage?: RefVariableStageType
95
+ variableStepIndexInPlugin?: number
96
+ }
97
+
98
+ interface CommandArgsMap {
99
+ command: string
100
+ args: string[]
101
+ }
102
+
103
+ export interface PortMapType {
104
+ portOnLocal: number
105
+ portOnContainer: number
106
+ }
107
+ interface ConditionDetails {
108
+ id: number
109
+ conditionOnVariable: string
110
+ conditionOperator: string
111
+ conditionType: ConditionType
112
+ conditionalValue: string
113
+ }
114
+
115
+ interface InlineStepDetailType {
116
+ scriptType: ScriptType
117
+ isMountCustomScript?: boolean
118
+ script?: string
119
+ dockerFileExists?: boolean
120
+ mountPath?: string
121
+ mountCodeToContainer?: boolean
122
+ mountDirectoryFromHost?: boolean
123
+ containerImagePath?: string
124
+ imagePullSecret?: string
125
+ commandArgsMap?: CommandArgsMap[]
126
+ portMap?: PortMapType[]
127
+ mountPathMap?: {
128
+ filePathOnDisk: string
129
+ filePathOnContainer: string
130
+ }[]
131
+ inputVariables?: VariableType[]
132
+ outputVariables?: VariableType[]
133
+ conditionDetails: ConditionDetails[]
134
+ }
135
+
136
+ interface PluginRefStepDetailType {
137
+ id: number
138
+ pluginId: number
139
+ inputVariables?: VariableType[]
140
+ outputVariables?: VariableType[]
141
+ conditionDetails?: ConditionDetails[]
142
+ }
143
+
144
+ export interface StepType {
145
+ id: number
146
+ index: number
147
+ name: string
148
+ description: string
149
+ stepType: PluginType
150
+ outputDirectoryPath: string[]
151
+ inlineStepDetail?: InlineStepDetailType
152
+ pluginRefStepDetail?: PluginRefStepDetailType
153
+ triggerIfParentStageFail: boolean
154
+ isMandatory?: boolean
155
+ }
156
+
157
+ export interface BuildStageType {
158
+ id: number
159
+ steps: StepType[]
160
+ }
161
+
162
+ export enum CIBuildType {
163
+ SELF_DOCKERFILE_BUILD_TYPE = 'self-dockerfile-build',
164
+ MANAGED_DOCKERFILE_BUILD_TYPE = 'managed-dockerfile-build',
165
+ BUILDPACK_BUILD_TYPE = 'buildpack-build',
166
+ }
167
+
168
+ export interface BuildPackConfigType {
169
+ builderId: string
170
+ language: string
171
+ languageVersion: string
172
+ projectPath: string
173
+ builderLangEnvParam?: string
174
+ currentBuilderLangEnvParam?: string
175
+ buildPacks?: any
176
+ args?: Record<string, string>
177
+ }
178
+
179
+ export interface DockerBuildConfigType {
180
+ dockerfileContent: string
181
+ dockerfileRelativePath: string
182
+ buildContext: string
183
+ dockerfilePath?: string
184
+ dockerfileRepository?: string
185
+ args?: Record<string, string>
186
+ targetPlatform?: any
187
+ language?: string
188
+ languageFramework?: string
189
+ }
190
+
191
+ export interface CIBuildConfigType {
192
+ buildPackConfig: BuildPackConfigType
193
+ ciBuildType: CIBuildType
194
+ dockerBuildConfig: DockerBuildConfigType
195
+ gitMaterialId: number
196
+ buildContextGitMaterialId: number
197
+ id?: number
198
+ }
199
+
200
+ export interface DockerConfigOverrideType {
201
+ dockerRegistry: string
202
+ dockerRepository: string
203
+ ciBuildConfig: CIBuildConfigType
204
+ }
205
+
206
+ export interface FormType {
207
+ name: string
208
+ args: { key: string; value: string }[]
209
+ materials: MaterialType[]
210
+ gitHost: Githost
211
+ webhookEvents: WebhookEvent[]
212
+ ciPipelineSourceTypeOptions: CiPipelineSourceTypeOption[]
213
+ webhookConditionList: { selectorId: number; value: string }[]
214
+ triggerType: string
215
+ scanEnabled?: boolean
216
+ beforeDockerBuildScripts?: {
217
+ id: number
218
+ name: string
219
+ outputLocation: string
220
+ script: string
221
+ isCollapsed: boolean
222
+ index: number
223
+ }[]
224
+ afterDockerBuildScripts?: {
225
+ id: number
226
+ name: string
227
+ outputLocation: string
228
+ script: string
229
+ isCollapsed: boolean
230
+ index: number
231
+ }[]
232
+ ciPipelineEditable: true
233
+ preBuildStage?: BuildStageType
234
+ postBuildStage?: BuildStageType
235
+ isDockerConfigOverridden?: boolean
236
+ dockerConfigOverride?: DockerConfigOverrideType
237
+ }
238
+
239
+ export interface ErrorObj {
240
+ isValid: boolean
241
+ message: string | null
242
+ }
243
+ export interface TaskErrorObj {
244
+ isValid: boolean
245
+ name: ErrorObj
246
+ inlineStepDetail?: { inputVariables?: ErrorObj[]; outputVariables?: ErrorObj[] }
247
+ pluginRefStepDetail?: { inputVariables?: ErrorObj[]; outputVariables?: ErrorObj[] }
248
+ }
249
+ export interface FormErrorObjectType {
250
+ name: ErrorObj
251
+ materials?: MaterialType[]
252
+ preBuildStage?: {
253
+ isValid: boolean
254
+ steps: TaskErrorObj[]
255
+ }
256
+ buildStage?: {
257
+ isValid: boolean
258
+ name: ErrorObj
259
+ }
260
+ postBuildStage?: {
261
+ isValid: boolean
262
+ steps: TaskErrorObj[]
263
+ }
264
+ }
265
+
266
+ export interface PluginDetailType {
267
+ id: number
268
+ name: string
269
+ type: string
270
+ description: string
271
+ icon: string
272
+ tags: string[]
273
+ inputVariables?: VariableType[]
274
+ outputVariables?: VariableType[]
275
+ }
@@ -57,4 +57,10 @@ export const TOKEN_COOKIE_NAME = 'argocd.token'
57
57
  export const TriggerTypeMap = {
58
58
  automatic: 'Auto',
59
59
  manual: 'Manual',
60
+ }
61
+
62
+ export const BuildStageVariable = {
63
+ PreBuild: 'preBuildStage',
64
+ Build: 'buildStage',
65
+ PostBuild: 'postBuildStage',
60
66
  }
@@ -33,7 +33,7 @@ export const TagDetails = ({
33
33
  _tagData.isInvalidKey =
34
34
  _tagData.key || _tagData.value ? !validationRules.propagateTagKey(_tagData.key).isValid : false
35
35
  _tagData.isInvalidValue = _tagData.value
36
- ? !validationRules.propagateTagValue(_tagData.value, _tagData.key).isValid
36
+ ? !validationRules.propagateTagValue(_tagData.value).isValid
37
37
  : false
38
38
  }
39
39
  setTagData(index, _tagData)
@@ -41,7 +41,7 @@ export const TagDetails = ({
41
41
  return (
42
42
  <div className="flexbox mb-8">
43
43
  <div
44
- className={`dc__border h-30 pl-4 pr-4 br-4 mr-8 pointer ${tagData.propagate ? 'bcn-7' : ''} ${tagData.key.startsWith("devtron.ai/") ? 'cursor-not-allowed bcn-1' : ''}`}
44
+ className={`dc__border h-30 pl-4 pr-4 br-4 mr-8 pointer ${tagData.propagate ? 'bcn-7' : ''}`}
45
45
  onClick={propagateTagToResource}
46
46
  data-testid={`propagate-tag-${index}`}
47
47
  >
@@ -13,11 +13,7 @@ export const TagLabelSelect = ({
13
13
  }: TagLabelSelectType) => {
14
14
  const setTagData = (index, tagValue): void => {
15
15
  const _tags = [...labelTags]
16
- const _tagValue = tagValue
17
- if(_tagValue.key.startsWith("devtron.ai/")){
18
- _tagValue.propagate = false
19
- }
20
- _tags[index] = _tagValue
16
+ _tags[index] = tagValue
21
17
  setLabelTags(_tags)
22
18
  }
23
19
 
@@ -50,7 +50,7 @@ export const TagLabelValueSelector = ({
50
50
  ? !validationRules.propagateTagKey(selectedValue).isValid
51
51
  : _tagData.value !== ''
52
52
  } else if (selectedValue || isRequired || _tagData.propagate) {
53
- _tagData.isInvalidValue = !validationRules.propagateTagValue(selectedValue, _tagData.key).isValid
53
+ _tagData.isInvalidValue = !validationRules.propagateTagValue(selectedValue).isValid
54
54
  _tagData.isInvalidKey = !_tagData.key || _tagData.isInvalidKey
55
55
  } else {
56
56
  _tagData.isInvalidValue = false
@@ -80,7 +80,7 @@ export const TagLabelValueSelector = ({
80
80
  field = validationRules.propagateTagKey(selectedValue)
81
81
  }
82
82
  } else if (isRequired || selectedValue || tagData.propagate) {
83
- field = validationRules.propagateTagValue(selectedValue, tagData.key)
83
+ field = validationRules.propagateTagValue(selectedValue)
84
84
  }
85
85
  if (!field.isValid) {
86
86
  return (
@@ -21,37 +21,33 @@ export class ValidationRules {
21
21
  if (!key) {
22
22
  errorList.push('Key is required')
23
23
  } else {
24
- if(!key.startsWith("devtron.ai/")){
25
- const re = new RegExp('/', 'g')
26
- const noOfSlashInKey = key.match(re)?.length
27
- if (noOfSlashInKey > 1) {
28
- errorList.push('Key: Max 1 ( / ) allowed')
29
- } else if (noOfSlashInKey === 1) {
30
- const [prefix, name] = key.split('/')
31
- errorList.push(...validateTagValue(name).map((error) => `Name: ${error}`))
32
- if (prefix.length > 253) {
33
- errorList.push('Prefix: Can be max 253 characters')
34
- }
35
- const validPrefix = PATTERNS.KUBERNETES_KEY_PREFIX.test(prefix)
36
- if (!validPrefix) {
37
- errorList.push('Prefix: Must be a DNS subdomain (a series of DNS labels separated by dots (.)')
38
- }
39
- } else {
40
- errorList.push(...validateTagValue(key).map((error) => `Name: ${error}`))
24
+ const re = new RegExp('/', 'g')
25
+ const noOfSlashInKey = key.match(re)?.length
26
+ if (noOfSlashInKey > 1) {
27
+ errorList.push('Key: Max 1 ( / ) allowed')
28
+ } else if (noOfSlashInKey === 1) {
29
+ const [prefix, name] = key.split('/')
30
+ errorList.push(...validateTagValue(name).map((error) => `Name: ${error}`))
31
+ if (prefix.length > 253) {
32
+ errorList.push('Prefix: Can be max 253 characters')
41
33
  }
34
+ const validPrefix = PATTERNS.KUBERNETES_KEY_PREFIX.test(prefix)
35
+ if (!validPrefix) {
36
+ errorList.push('Prefix: Must be a DNS subdomain (a series of DNS labels separated by dots (.)')
37
+ }
38
+ } else {
39
+ errorList.push(...validateTagValue(key).map((error) => `Name: ${error}`))
42
40
  }
43
41
  }
44
42
  return { isValid: errorList.length === 0, messages: errorList }
45
43
  }
46
44
 
47
- propagateTagValue = (value: string, key: string): { isValid: boolean; messages: string[] } => {
45
+ propagateTagValue = (value: string): { isValid: boolean; messages: string[] } => {
48
46
  const errorList = []
49
47
  if (!value) {
50
48
  errorList.push('Value is required')
51
49
  } else {
52
- if(!key.startsWith("devtron.ai/")){
53
- errorList.push(...validateTagValue(value))
54
- }
50
+ errorList.push(...validateTagValue(value))
55
51
  }
56
52
  return { isValid: errorList.length === 0, messages: errorList }
57
53
  }
@@ -1,13 +1,16 @@
1
- import React, { useRef } from 'react'
1
+ import React, { useRef, useState } from 'react'
2
2
  import Tippy from '@tippyjs/react'
3
3
  import { ReactComponent as CloseIcon } from '../Assets/Icon/ic-cross.svg'
4
+ import { ReactComponent as QuestionFilled } from '../Assets/Icon/ic-help.svg'
4
5
  import 'tippy.js/animations/shift-toward-subtle.css'
5
6
  import { TippyCustomizedProps, TippyTheme } from './Types'
7
+ import { not } from './Helper'
6
8
 
7
9
  // This component will handle some of the new tippy designs and interactions
8
10
  // So this can be updated to support further for new features or interactions
9
11
  export function TippyCustomized(props: TippyCustomizedProps) {
10
12
  const tippyRef = useRef(null)
13
+ const [showHeadingInfo, setShowHeadingInfo] = useState(false)
11
14
  const isWhiteTheme = props.theme === TippyTheme.white
12
15
 
13
16
  const onTippyMount = (tippyInstance) => {
@@ -24,6 +27,7 @@ export function TippyCustomized(props: TippyCustomizedProps) {
24
27
  props.onClose()
25
28
  }
26
29
  }
30
+ setShowHeadingInfo(false)
27
31
  }
28
32
 
29
33
  const closeOnEsc = (e) => {
@@ -32,6 +36,10 @@ export function TippyCustomized(props: TippyCustomizedProps) {
32
36
  }
33
37
  }
34
38
 
39
+ const toggleHeadingInfo = (e) => {
40
+ setShowHeadingInfo(not)
41
+ }
42
+
35
43
  const getTippyContent = () => {
36
44
  const {
37
45
  Icon,
@@ -40,6 +48,7 @@ export function TippyCustomized(props: TippyCustomizedProps) {
40
48
  iconSize,
41
49
  onImageLoadError,
42
50
  heading,
51
+ headingInfo,
43
52
  infoTextHeading,
44
53
  infoText,
45
54
  showCloseButton,
@@ -69,6 +78,11 @@ export function TippyCustomized(props: TippyCustomizedProps) {
69
78
  )
70
79
  )}
71
80
  {heading && <span className={`fs-14 fw-6 lh-20 ${showCloseButton ? 'mr-6' : ''}`}>{heading}</span>}
81
+ {headingInfo && (
82
+ <div className="icon-dim-20 cursor" onClick={toggleHeadingInfo}>
83
+ <QuestionFilled className="icon-dim-20" />
84
+ </div>
85
+ )}
72
86
  {showCloseButton && (
73
87
  <div className="icon-dim-16 ml-auto">
74
88
  <CloseIcon
@@ -78,6 +92,18 @@ export function TippyCustomized(props: TippyCustomizedProps) {
78
92
  </div>
79
93
  )}
80
94
  </div>
95
+ {showHeadingInfo && (
96
+ <div
97
+ className={`flex left bcv-1 fs-13 fw-4 lh-20 pt-8 pb-8 ${
98
+ isWhiteTheme ? 'pl-12 pr-12' : 'pl-20 pr-20'
99
+ }`}
100
+ >
101
+ <div className="icon-dim-20 mr-8">
102
+ <QuestionFilled className="icon-dim-20 fcv-5" />
103
+ </div>
104
+ <div className="dc__word-break dc__hyphens-auto">{headingInfo}</div>
105
+ </div>
106
+ )}
81
107
  {infoTextHeading && (
82
108
  <div
83
109
  className={`dc__word-break dc__hyphens-auto fs-14 fw-6 lh-20 ${
@@ -1,5 +1,6 @@
1
1
  import { ReactNode, CSSProperties } from 'react'
2
2
  import { Placement } from 'tippy.js'
3
+ import { VariableType } from './CIPipeline.Types'
3
4
  export interface ResponseType {
4
5
  code: number
5
6
  status: string
@@ -52,6 +53,7 @@ export interface TippyCustomizedProps {
52
53
  theme: TippyTheme
53
54
  visible?: boolean
54
55
  heading?: string
56
+ headingInfo?: string
55
57
  infoTextHeading?: string
56
58
  placement: Placement
57
59
  className?: string
@@ -257,6 +259,7 @@ export interface CommonNodeAttr {
257
259
  approvalUsers?: string[]
258
260
  userApprovalConfig?: UserApprovalConfigType
259
261
  requestedUserId?: number
262
+ showPluginWarning?: boolean
260
263
  }
261
264
 
262
265
 
@@ -317,3 +320,29 @@ export interface CDMaterialResponseType {
317
320
  userApprovalConfig: UserApprovalConfigType
318
321
  requestedUserId: number
319
322
  }
323
+
324
+ export enum PluginRequiredStageKeys {
325
+ PRE_CI = 'PRE_CI',
326
+ POST_CI = 'POST_CI',
327
+ PRE_OR_POST_CI = 'PRE_OR_POST_CI'
328
+ }
329
+
330
+ export enum PluginRequiredStage {
331
+ PRE_CI = 'preBuildStage',
332
+ POST_CI = 'postBuildStage',
333
+ PRE_OR_POST_CI = 'PRE_OR_POST_CI'
334
+ }
335
+ export interface MandatoryPluginDetailType {
336
+ id: number
337
+ name: string
338
+ description?: string;
339
+ requiredIn: PluginRequiredStage
340
+ applied?: boolean
341
+ inputVariables?: VariableType[]
342
+ outputVariables?: VariableType[]
343
+ }
344
+ export interface MandatoryPluginDataType {
345
+ pluginData: MandatoryPluginDetailType[]
346
+ isValidPre: boolean
347
+ isValidPost: boolean
348
+ }
@@ -29,3 +29,4 @@ export { default as GenericEmptyState } from './EmptyState/GenericEmptyState'
29
29
  export { default as Toggle } from './Toggle/Toggle'
30
30
  export { default as ScanVulnerabilitiesTable } from './Security/ScanVulnerabilitiesTable'
31
31
  export { default as StyledRadioGroup } from './RadioGroup/RadioGroup'
32
+ export * from './CIPipeline.Types'