@devtron-labs/devtron-fe-common-lib 1.2.7 → 1.2.8-beta-1

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.
Files changed (54) hide show
  1. package/dist/{@code-editor-DNKnnjou.js → @code-editor-BEceVER4.js} +5543 -5412
  2. package/dist/{@common-rjsf-DG46ATXL.js → @common-rjsf--SfC2_Jn.js} +2 -2
  3. package/dist/{@framer-motion-DHY98qq3.js → @framer-motion-DHzxZlAx.js} +1 -1
  4. package/dist/@monaco-editor-CVagbUeH.js +138960 -0
  5. package/dist/{@react-dates-WNnwjI5S.js → @react-dates-BZU5RIqe.js} +1 -1
  6. package/dist/{@react-select-BbR996pa.js → @react-select-Dx53b3Wk.js} +50 -50
  7. package/dist/{@vendor-RU8AW1bK.js → @vendor-BG3OpQCq.js} +8756 -7936
  8. package/dist/Common/CodeEditor/CodeEditor.reducer.d.ts +2 -1
  9. package/dist/Common/CodeEditor/types.d.ts +2 -1
  10. package/dist/Common/Constants.d.ts +3 -0
  11. package/dist/Common/Helper.d.ts +3 -2
  12. package/dist/Common/Markdown/MarkDown.d.ts +1 -1
  13. package/dist/Common/RJSF/index.d.ts +1 -1
  14. package/dist/Common/SegmentedControl/SegmentedControl.component.d.ts +3 -0
  15. package/dist/Common/SegmentedControl/index.d.ts +2 -0
  16. package/dist/Common/SegmentedControl/types.d.ts +15 -0
  17. package/dist/Common/index.d.ts +1 -0
  18. package/dist/Pages/App/AppConfiguration/DeploymentTemplate/GUIView/index.d.ts +2 -0
  19. package/dist/Pages/App/AppConfiguration/DeploymentTemplate/GUIView/types.d.ts +2 -0
  20. package/dist/Pages/App/AppConfiguration/DeploymentTemplate/GUIView/utils.d.ts +6 -0
  21. package/dist/Pages/App/AppConfiguration/DeploymentTemplate/index.d.ts +1 -0
  22. package/dist/Pages/App/AppConfiguration/index.d.ts +1 -0
  23. package/dist/Pages/App/index.d.ts +1 -0
  24. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/ConfigMapSecret/index.d.ts +1 -0
  25. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/ConfigMapSecret/utils.d.ts +3 -0
  26. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/types.d.ts +21 -3
  27. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/OverrideStrategyTippyContent.d.ts +2 -1
  28. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/index.d.ts +1 -0
  29. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/types.d.ts +7 -0
  30. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/utils.d.ts +1 -1
  31. package/dist/Pages/index.d.ts +1 -0
  32. package/dist/Shared/Components/CollapsibleList/CollapsibleList.types.d.ts +6 -0
  33. package/dist/Shared/Components/EnterpriseTag/EnterpriseTag.component.d.ts +2 -0
  34. package/dist/Shared/Components/EnterpriseTag/index.d.ts +1 -0
  35. package/dist/Shared/Components/InvalidYAMLTippy/index.d.ts +1 -0
  36. package/dist/Shared/Components/InvalidYAMLTippy/types.d.ts +7 -0
  37. package/dist/Shared/Components/InvalidYAMLTippy/utils.d.ts +2 -2
  38. package/dist/Shared/Components/index.d.ts +1 -0
  39. package/dist/Shared/Helpers.d.ts +5 -3
  40. package/dist/Shared/Hooks/useForm/useForm.d.ts +4 -0
  41. package/dist/Shared/Services/app.types.d.ts +4 -0
  42. package/dist/Shared/types.d.ts +1 -0
  43. package/dist/assets/@monaco-editor.css +1 -1
  44. package/dist/assets/codicon.ecfbfe4b.ttf +0 -0
  45. package/dist/assets/ic-file-code.80000c9b.svg +7 -0
  46. package/dist/assets/ic-medal.4a7e5cbc.svg +3 -0
  47. package/dist/assets/ic-stamp.526499d2.svg +7 -0
  48. package/dist/index.d.ts +2 -0
  49. package/dist/index.js +572 -561
  50. package/package.json +4 -4
  51. package/dist/@monaco-editor-34kqzg3G.js +0 -70451
  52. package/dist/assets/ic-file-code.21a1f748.svg +0 -7
  53. package/dist/assets/ic-stamp.8689f42d.svg +0 -9
  54. package/dist/yaml.worker.d.ts +0 -0
@@ -32,4 +32,5 @@ export declare const CodeEditorReducer: (state: CodeEditorState, action: Action)
32
32
  code: string;
33
33
  noParsing: boolean;
34
34
  };
35
- export declare const initialState: ({ mode, theme, value, diffView, noParsing, }: CodeEditorInitialValueType) => CodeEditorState;
35
+ export declare const parseValueToCode: (value: string, mode: string, tabSize: number) => string;
36
+ export declare const initialState: ({ mode, theme, value, diffView, noParsing, tabSize, }: CodeEditorInitialValueType) => CodeEditorState;
@@ -28,7 +28,7 @@ interface CodeEditorBaseInterface {
28
28
  validatorSchema?: any;
29
29
  isKubernetes?: boolean;
30
30
  cleanData?: boolean;
31
- chartVersion?: any;
31
+ schemaURI?: string;
32
32
  /**
33
33
  * If true, disable the in-built search of monaco editor
34
34
  * @default false
@@ -81,6 +81,7 @@ export interface CodeEditorInitialValueType {
81
81
  theme?: string;
82
82
  value: string;
83
83
  noParsing?: boolean;
84
+ tabSize: number;
84
85
  }
85
86
  export interface CodeEditorState {
86
87
  mode: MODES;
@@ -4,6 +4,7 @@ export declare const Host: string;
4
4
  export declare const DOCUMENTATION_HOME_PAGE = "https://docs.devtron.ai";
5
5
  export declare const DOCUMENTATION_VERSION = "/v/v0.7";
6
6
  export declare const DISCORD_LINK = "https://discord.devtron.ai/";
7
+ export declare const DEFAULT_JSON_SCHEMA_URI = "https://json-schema.org/draft/2020-12/schema";
7
8
  export declare const DOCUMENTATION: {
8
9
  APP_METRICS: string;
9
10
  APP_TAGS: string;
@@ -259,6 +260,7 @@ export declare const API_STATUS_CODES: {
259
260
  EXPECTATION_FAILED: number;
260
261
  UNPROCESSABLE_ENTITY: number;
261
262
  LOCKED: number;
263
+ UNPROCESSABLE_CONTENT: number;
262
264
  };
263
265
  export declare enum SERVER_MODE {
264
266
  EA_ONLY = "EA_ONLY",
@@ -310,3 +312,4 @@ export declare enum GitProviderType {
310
312
  * Formats the schema removing any irregularity in the existing schema
311
313
  */
312
314
  export declare const getFormattedSchema: (schema?: string) => string;
315
+ export declare const UNCHANGED_ARRAY_ELEMENT_SYMBOL: unique symbol;
@@ -59,9 +59,10 @@ export declare const getFilteredChartVersions: (charts: any, selectedChartType:
59
59
  * @param {object} object from which we need to delete nulls in its arrays
60
60
  * @returns object after removing (in-place) the null items in arrays
61
61
  */
62
- export declare const recursivelyRemoveNullsFromArraysInObject: (object: object) => object;
62
+ export declare const recursivelyRemoveSymbolFromArraysInObject: (object: object, symbol: symbol) => object;
63
63
  /**
64
64
  * Merges the objects into one object
65
+ * Works more like Object.assign; that doesn't deep copy
65
66
  * @param {object[]} objects list of js objects
66
67
  * @returns object after the merge
67
68
  */
@@ -90,7 +91,7 @@ export declare const getRegexMatchPositions: (string: string, regex: RegExp) =>
90
91
  export declare const powerSetOfSubstringsFromStart: (strings: string[], regex: RegExp) => string[];
91
92
  export declare const convertJSONPointerToJSONPath: (pointer: string) => string;
92
93
  export declare const flatMapOfJSONPaths: (paths: string[], json: object, resultType?: JSONPathOptions["resultType"]) => string[];
93
- export declare const applyCompareDiffOnUneditedDocument: (uneditedDocument: object, editedDocument: object) => object;
94
+ export declare const applyCompareDiffOnUneditedDocument: (uneditedDocument: object, editedDocument: object) => any;
94
95
  /**
95
96
  * Returns a debounced variant of the function
96
97
  */
@@ -1,3 +1,3 @@
1
1
  import { MarkDownProps } from './Types';
2
- declare const MarkDown: ({ setExpandableIcon, markdown, className, breaks, disableEscapedText, ...props }: MarkDownProps) => JSX.Element;
2
+ declare const MarkDown: ({ setExpandableIcon, markdown: markdownProp, className, breaks, disableEscapedText, ...props }: MarkDownProps) => JSX.Element;
3
3
  export default MarkDown;
@@ -1,4 +1,4 @@
1
1
  export { RJSFForm } from './Form';
2
- export * from './types';
2
+ export type * from './types';
3
3
  export { getInferredTypeFromValueType, getRedirectionProps } from './utils';
4
4
  export { HIDE_SUBMIT_BUTTON_UI_SCHEMA } from './constants';
@@ -0,0 +1,3 @@
1
+ import { SegmentedControlProps } from './types';
2
+ declare const SegmentedControl: ({ tabs, initialTab, onChange, tooltips, disabled, rootClassName, name, variant, }: SegmentedControlProps) => JSX.Element;
3
+ export default SegmentedControl;
@@ -0,0 +1,2 @@
1
+ export { type SegmentedControlProps, SegmentedControlVariant } from './types';
2
+ export { default as SegmentedControl } from './SegmentedControl.component';
@@ -0,0 +1,15 @@
1
+ import { OptionType } from '../Types';
2
+ export declare enum SegmentedControlVariant {
3
+ GRAY_ON_WHITE = "gui-yaml-switch",
4
+ WHITE_ON_GRAY = "gui-yaml-switch-window-bg"
5
+ }
6
+ export interface SegmentedControlProps {
7
+ tabs: OptionType[];
8
+ initialTab: string;
9
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
10
+ name: string;
11
+ tooltips?: string[];
12
+ disabled?: boolean;
13
+ rootClassName?: string;
14
+ variant?: SegmentedControlVariant;
15
+ }
@@ -53,3 +53,4 @@ export * from './SegmentedBarChart';
53
53
  export * from './CodeEditor';
54
54
  export * from './AppStatus';
55
55
  export * from './Tooltip';
56
+ export * from './SegmentedControl';
@@ -0,0 +1,2 @@
1
+ export { ViewError as GUIViewError } from './utils';
2
+ export type { ViewErrorType as GUIViewErrorType } from './types';
@@ -0,0 +1,2 @@
1
+ export interface ViewErrorType extends Record<'title' | 'subTitle', string> {
2
+ }
@@ -0,0 +1,6 @@
1
+ import { ViewErrorType } from './types';
2
+ export declare class ViewError implements ViewErrorType {
3
+ title: string;
4
+ subTitle: string;
5
+ constructor(title: string, subTitle: string);
6
+ }
@@ -0,0 +1 @@
1
+ export * from './GUIView';
@@ -0,0 +1 @@
1
+ export * from './DeploymentTemplate';
@@ -0,0 +1 @@
1
+ export * from './AppConfiguration';
@@ -0,0 +1,3 @@
1
+ import { CMSecretExternalType } from '../../../../../../Shared/index';
2
+ export declare const hasHashiOrAWS: (externalType: CMSecretExternalType) => boolean;
3
+ export declare const hasESO: (externalType: CMSecretExternalType) => boolean;
@@ -1,4 +1,5 @@
1
1
  import { DraftMetadataDTO, TemplateListType } from '../../../../../../Shared/Services';
2
+ import { ServerErrors } from '../../../../../../Common/ServerError';
2
3
  import { OverrideMergeStrategyType } from '../types';
3
4
  export type DeploymentChartOptionkind = 'base' | 'env' | 'chartVersion' | 'deployment';
4
5
  export interface DeploymentChartVersionType {
@@ -108,15 +109,15 @@ interface BaseDeploymentTemplateConfigState {
108
109
  environmentConfig?: never;
109
110
  mergeStrategy?: never;
110
111
  }
111
- interface EnvironmentOverrideDeploymentTemplateConfigState {
112
+ type EnvironmentOverrideDeploymentTemplateConfigState = {
112
113
  chartConfig?: never;
113
114
  isOverridden: boolean;
114
115
  environmentConfig: EnvironmentConfigType;
115
116
  mergeStrategy: OverrideMergeStrategyType;
116
- }
117
+ };
117
118
  export interface DeploymentTemplateConfigCommonState extends SelectedChartDetailsType {
118
119
  /**
119
- * The first ever state of the deployment template
120
+ * The first ever state of the deployment template on editor
120
121
  */
121
122
  originalTemplate: Record<string, string>;
122
123
  isAppMetricsEnabled: boolean;
@@ -126,6 +127,23 @@ export interface DeploymentTemplateConfigCommonState extends SelectedChartDetail
126
127
  latestDraft?: DraftMetadataDTO;
127
128
  editorTemplate: string;
128
129
  editorTemplateWithoutLockedKeys: string;
130
+ /**
131
+ * This final template to be applied on the deployment in string format
132
+ * In current editor, this may be null initially
133
+ */
134
+ mergedTemplate: string | null;
135
+ /**
136
+ * This final template to be applied on the deployment without locked keys in string format
137
+ * In current editor, this may be null initially
138
+ */
139
+ mergedTemplateWithoutLockedKeys: string | null;
140
+ /**
141
+ * This final template to be applied on the deployment in object format
142
+ * In current editor, this may be null initially
143
+ */
144
+ mergedTemplateObject: Record<string, string> | null;
145
+ isLoadingMergedTemplate: boolean;
146
+ mergedTemplateError: ServerErrors | null;
129
147
  }
130
148
  export type DeploymentTemplateConfigState = DeploymentTemplateConfigCommonState & (BaseDeploymentTemplateConfigState | EnvironmentOverrideDeploymentTemplateConfigState);
131
149
  type DTApplicationMetricsReadOnlyProps = {
@@ -1,2 +1,3 @@
1
- declare const OverrideStrategyTippyContent: () => JSX.Element;
1
+ import { OverrideStrategyTippyContentProps } from './types';
2
+ declare const OverrideStrategyTippyContent: ({ children }: OverrideStrategyTippyContentProps) => JSX.Element;
2
3
  export default OverrideStrategyTippyContent;
@@ -3,3 +3,4 @@ export * from './types';
3
3
  export * from './constants';
4
4
  export { default as OverrideStrategyTippyContent } from './OverrideStrategyTippyContent';
5
5
  export { getDeploymentStageTitle } from './utils';
6
+ export * from './ConfigMapSecret';
@@ -20,8 +20,15 @@ export interface ConfigToolbarPopupMenuConfigType {
20
20
  disabled?: boolean;
21
21
  icon?: ReactNode | null;
22
22
  variant?: 'default' | 'negative';
23
+ tooltipText?: string;
23
24
  }
24
25
  export declare enum ConfigToolbarPopupNodeType {
25
26
  DISCARD_DRAFT = "discardDraft",
26
27
  EDIT_HISTORY = "editHistory"
27
28
  }
29
+ export interface OverrideStrategyTippyContentProps {
30
+ /**
31
+ * Would be rendered as li conveying the information about the merge strategy
32
+ */
33
+ children?: ReactNode;
34
+ }
@@ -1,2 +1,2 @@
1
1
  import { DeploymentStageType } from '../../../../../Shared/constants';
2
- export declare const getDeploymentStageTitle: (stage: DeploymentStageType) => "deployment" | "pre-deployment" | "post-deployment" | "-";
2
+ export declare const getDeploymentStageTitle: (stage: DeploymentStageType) => "-" | "pre-deployment" | "post-deployment" | "deployment";
@@ -1,3 +1,4 @@
1
1
  export * from './GlobalConfigurations';
2
2
  export * from './ResourceBrowser';
3
3
  export * from './Applications';
4
+ export * from './App';
@@ -54,6 +54,12 @@ export type CollapsibleListItem<TabType extends TabOptions = 'navLink'> = Condit
54
54
  */
55
55
  tooltipProps?: TippyProps;
56
56
  };
57
+ /**
58
+ * If `true`, clears query parameters during navigation.
59
+ *
60
+ * @default false
61
+ */
62
+ clearQueryParamsOnNavigation?: boolean;
57
63
  };
58
64
  export interface CollapsibleListConfig<TabType extends TabOptions = 'navLink'> {
59
65
  /**
@@ -0,0 +1,2 @@
1
+ declare const EnterpriseTag: () => JSX.Element;
2
+ export default EnterpriseTag;
@@ -0,0 +1 @@
1
+ export { default as EnterpriseTag } from './EnterpriseTag.component';
@@ -1,2 +1,3 @@
1
1
  export { default as InvalidYAMLTippyWrapper } from './InvalidYAMLTippyWrapper';
2
2
  export { getInvalidTippyContent } from './utils';
3
+ export { InvalidTippyTypeEnum } from './types';
@@ -4,3 +4,10 @@ export interface InvalidYAMLTippyWrapperProps {
4
4
  restoreLastSavedYAML?: () => void;
5
5
  children: TooltipProps['children'];
6
6
  }
7
+ export declare enum InvalidTippyTypeEnum {
8
+ YAML = "yaml",
9
+ JSON = "json"
10
+ }
11
+ export interface InvalidTippyProps extends Pick<InvalidYAMLTippyWrapperProps, 'parsingError' | 'restoreLastSavedYAML'> {
12
+ type?: InvalidTippyTypeEnum;
13
+ }
@@ -1,2 +1,2 @@
1
- import { InvalidYAMLTippyWrapperProps } from './types';
2
- export declare const getInvalidTippyContent: ({ parsingError, restoreLastSavedYAML, }: Pick<InvalidYAMLTippyWrapperProps, "parsingError" | "restoreLastSavedYAML">) => JSX.Element;
1
+ import { InvalidTippyProps } from './types';
2
+ export declare const getInvalidTippyContent: ({ type, parsingError, restoreLastSavedYAML, }: InvalidTippyProps) => JSX.Element;
@@ -41,6 +41,7 @@ export * from './Collapse';
41
41
  export * from './Security';
42
42
  export * from './Button';
43
43
  export * from './InvalidYAMLTippy';
44
+ export * from './EnterpriseTag';
44
45
  export * from './ConfirmationModal';
45
46
  export * from './DiffViewer';
46
47
  export * from './DynamicDataTable';
@@ -1,5 +1,6 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { Pair } from 'yaml';
3
+ import { StrictRJSFSchema } from '@rjsf/utils';
3
4
  import { MaterialHistoryType } from '@Shared/Services/app.types';
4
5
  import { MaterialInfo, SortingOrder, UserApprovalConfigType } from '../Common';
5
6
  import { GitTriggers, IntersectionChangeHandler, IntersectionOptions, PreventOutsideFocusProps, WebhookEventNameType } from './types';
@@ -66,10 +67,11 @@ export declare const getDefaultValueFromType: (value: unknown) => {};
66
67
  */
67
68
  export declare const groupArrayByObjectKey: <T extends Record<string, any>, K extends keyof T>(array: T[], key: K) => Record<string, T[]>;
68
69
  /**
69
- * @description - Function to get the lower case object
70
- * @param input - The input object
71
- * @returns Record<string, any>
70
+ * This function returns a null/zero value corresponding to @type
71
+ *
72
+ * @param type - a RJSF supported type
72
73
  */
74
+ export declare const getNullValueFromType: (type: StrictRJSFSchema["type"]) => any;
73
75
  export declare const getLowerCaseObject: (input: any) => Record<string, any>;
74
76
  /**
75
77
  * @description - Function to get the webhook date
@@ -61,6 +61,10 @@ export declare const useForm: <T extends Record<keyof T, any> = {}>(options?: {
61
61
  keepTouched?: boolean;
62
62
  /** A boolean indicating whether to retain the current error state of the form fields. */
63
63
  keepErrors?: boolean;
64
+ /** A boolean indicating whether the form should check for dirty state upon reset. */
65
+ triggerDirty?: boolean;
66
+ /** A boolean indicating whether the initial values of the form should be retained after reset. If false, provided formData will become initial data. */
67
+ keepInitialValues?: boolean;
64
68
  }) => void;
65
69
  /** An object representing additional form state. */
66
70
  formState: {
@@ -1,3 +1,4 @@
1
+ import { OverrideMergeStrategyType } from '../../Pages/Applications';
1
2
  import { ReleaseTag } from '../../Common';
2
3
  interface WebhookDataType {
3
4
  id: number;
@@ -147,9 +148,11 @@ export declare enum CMSecretExternalType {
147
148
  }
148
149
  export interface ConfigDatum {
149
150
  name: string;
151
+ mergeStrategy: OverrideMergeStrategyType;
150
152
  type: string;
151
153
  external: boolean;
152
154
  data: Record<string, any>;
155
+ patchData: Record<string, any>;
153
156
  defaultData: Record<string, any>;
154
157
  global: boolean;
155
158
  externalType: CMSecretExternalType;
@@ -172,6 +175,7 @@ export interface ConfigMapSecretDataType {
172
175
  id: number;
173
176
  appId: number;
174
177
  configData: ConfigMapSecretDataConfigDatumDTO[];
178
+ isDeletable: boolean;
175
179
  }
176
180
  export declare enum ConfigResourceType {
177
181
  ConfigMap = "ConfigMap",
@@ -585,6 +585,7 @@ export declare enum ConfigurationType {
585
585
  GUI = "GUI",
586
586
  YAML = "YAML"
587
587
  }
588
+ export declare const CONFIGURATION_TYPE_OPTIONS: OptionType<ConfigurationType, ConfigurationType>[];
588
589
  export interface BaseURLParams {
589
590
  appId: string;
590
591
  envId: string;