@devtron-labs/devtron-fe-common-lib 0.3.5 → 0.3.6-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 (30) hide show
  1. package/dist/Common/Drawer/Drawer.d.ts +1 -1
  2. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.d.ts +2 -2
  3. package/dist/Shared/Components/DeploymentConfigDiff/{types.d.ts → DeploymentConfigDiff.types.d.ts} +25 -3
  4. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.d.ts +9 -8
  5. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffAccordion.d.ts +1 -1
  6. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.d.ts +2 -2
  7. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.d.ts +2 -2
  8. package/dist/Shared/Components/DeploymentConfigDiff/index.d.ts +1 -1
  9. package/dist/Shared/Components/TabGroup/TabGroup.types.d.ts +24 -5
  10. package/dist/Shared/Components/TabGroup/TabGroup.utils.d.ts +1 -0
  11. package/dist/Shared/Services/app.types.d.ts +7 -1
  12. package/dist/assets/index.css +1 -1
  13. package/dist/{cssMode-CN5-cGVD.js → cssMode-DyAvOBkY.js} +1 -1
  14. package/dist/{freemarker2-av-K_X4G.js → freemarker2-tPNqkUTQ.js} +1 -1
  15. package/dist/{handlebars-DVE6oT9q.js → handlebars-C1mESqod.js} +1 -1
  16. package/dist/{html-C49T7Yb9.js → html-Cv3tbe3V.js} +1 -1
  17. package/dist/{htmlMode-BVKztJcB.js → htmlMode-D9FROfxJ.js} +1 -1
  18. package/dist/{index-HRdgMKUt.js → index-6HckNOg7.js} +21182 -21095
  19. package/dist/index.js +1 -1
  20. package/dist/{javascript-CS9j3mJC.js → javascript-D-S0ZH6k.js} +1 -1
  21. package/dist/{jsonMode-BNWTvEPF.js → jsonMode-BCOgENbK.js} +1 -1
  22. package/dist/{liquid-LlesyAR1.js → liquid-BHU4NPDq.js} +1 -1
  23. package/dist/{mdx-DfElZ-0e.js → mdx-CgZj4bIA.js} +1 -1
  24. package/dist/{python-WSdw2DS1.js → python-Dtb925za.js} +1 -1
  25. package/dist/{razor-B5hQqKaI.js → razor-Bx48A-N3.js} +1 -1
  26. package/dist/{tsMode-BA7e2LV7.js → tsMode-nB_hYIwB.js} +1 -1
  27. package/dist/{typescript-DJeoUXmQ.js → typescript-Cr3j4nqE.js} +1 -1
  28. package/dist/{xml-UtPnTCcH.js → xml-D0QNf3dP.js} +1 -1
  29. package/dist/{yaml-TJpxN_9W.js → yaml-9jPH8omw.js} +1 -1
  30. package/package.json +1 -1
@@ -10,5 +10,5 @@ interface drawerInterface {
10
10
  parentClassName?: string;
11
11
  onEscape?: (e?: any) => void;
12
12
  }
13
- export declare const Drawer: ({ children, position, height, width, minWidth, maxWidth, parentClassName, onEscape, }: drawerInterface) => JSX.Element;
13
+ export declare const Drawer: ({ children, position, height, width, minWidth, maxWidth, parentClassName, onEscape, onClose, }: drawerInterface) => JSX.Element;
14
14
  export {};
@@ -1,2 +1,2 @@
1
- import { DeploymentConfigDiffProps } from './types';
2
- export declare const DeploymentConfigDiff: ({ isLoading, configList, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, ...resProps }: DeploymentConfigDiffProps) => JSX.Element;
1
+ import { DeploymentConfigDiffProps } from './DeploymentConfigDiff.types';
2
+ export declare const DeploymentConfigDiff: ({ isLoading, configList, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, tabConfig, ...resProps }: DeploymentConfigDiffProps) => JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { SortingOrder } from '../../../Common/Constants';
2
- import { ConfigMapSecretDataConfigDatumDTO, DeploymentTemplateDTO } from '../../Services';
2
+ import { AppEnvDeploymentConfigDTO, ConfigMapSecretDataConfigDatumDTO, DeploymentTemplateDTO, EnvResourceType, ManifestTemplateDTO } from '../../Services';
3
3
  import { DeploymentHistoryDetail } from '../CICDHistory';
4
4
  import { CollapsibleListConfig, CollapsibleListItem } from '../CollapsibleList';
5
5
  import { SelectPickerProps } from '../SelectPicker';
@@ -35,6 +35,11 @@ export interface DeploymentConfigDiffNavigationCollapsibleItem extends Pick<Coll
35
35
  }
36
36
  export interface DeploymentConfigDiffProps {
37
37
  isLoading?: boolean;
38
+ errorConfig?: {
39
+ error: boolean;
40
+ code: number;
41
+ reload: () => void;
42
+ };
38
43
  configList: DeploymentConfigListItem[];
39
44
  headerText?: string;
40
45
  scrollIntoViewId?: string;
@@ -52,10 +57,15 @@ export interface DeploymentConfigDiffProps {
52
57
  goBackURL?: string;
53
58
  navHeading: string;
54
59
  navHelpText?: string;
60
+ tabConfig?: {
61
+ tabs: string[];
62
+ activeTab: string;
63
+ onClick: (tab: string) => void;
64
+ };
55
65
  }
56
- export interface DeploymentConfigDiffNavigationProps extends Pick<DeploymentConfigDiffProps, 'isLoading' | 'navList' | 'collapsibleNavList' | 'goBackURL' | 'navHeading' | 'navHelpText'> {
66
+ export interface DeploymentConfigDiffNavigationProps extends Pick<DeploymentConfigDiffProps, 'isLoading' | 'navList' | 'collapsibleNavList' | 'goBackURL' | 'navHeading' | 'navHelpText' | 'tabConfig'> {
57
67
  }
58
- export interface DeploymentConfigDiffMainProps extends Pick<DeploymentConfigDiffProps, 'isLoading' | 'headerText' | 'configList' | 'scrollIntoViewId' | 'selectorsConfig' | 'sortingConfig'> {
68
+ export interface DeploymentConfigDiffMainProps extends Pick<DeploymentConfigDiffProps, 'isLoading' | 'errorConfig' | 'headerText' | 'configList' | 'scrollIntoViewId' | 'selectorsConfig' | 'sortingConfig'> {
59
69
  }
60
70
  export interface DeploymentConfigDiffAccordionProps extends Pick<CollapseProps, 'onTransitionEnd'> {
61
71
  id: string;
@@ -66,3 +76,15 @@ export interface DeploymentConfigDiffAccordionProps extends Pick<CollapseProps,
66
76
  onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
67
77
  }
68
78
  export type DiffHeadingDataType<DeploymentTemplate> = DeploymentTemplate extends true ? DeploymentTemplateDTO : ConfigMapSecretDataConfigDatumDTO;
79
+ export type AppEnvDeploymentConfigListParams<IsManifestView> = (IsManifestView extends true ? {
80
+ currentList: ManifestTemplateDTO;
81
+ compareList: ManifestTemplateDTO;
82
+ sortOrder?: never;
83
+ } : {
84
+ currentList: AppEnvDeploymentConfigDTO;
85
+ compareList: AppEnvDeploymentConfigDTO;
86
+ sortOrder?: SortingOrder;
87
+ }) & {
88
+ getNavItemHref: (resourceType: EnvResourceType, resourceName: string) => string;
89
+ isManifestView?: IsManifestView;
90
+ };
@@ -1,6 +1,5 @@
1
- import { SortingOrder } from '../../../Common/Constants';
2
- import { DeploymentConfigDiffProps } from '..';
3
- import { AppEnvDeploymentConfigDTO, ConfigMapSecretDataConfigDatumDTO, EnvResourceType, TemplateListDTO } from '../../Services/app.types';
1
+ import { AppEnvDeploymentConfigListParams, DeploymentConfigDiffProps } from '..';
2
+ import { ConfigMapSecretDataConfigDatumDTO, TemplateListDTO } from '../../Services/app.types';
4
3
  /**
5
4
  * Retrieves the draft data from the given configuration data object.
6
5
  *
@@ -19,14 +18,16 @@ export declare const mergeConfigDataArraysByName: (primaryArray: ConfigMapSecret
19
18
  /**
20
19
  * Generates a list of deployment configurations for application environments and identifies changes between the current and compare lists.
21
20
  *
22
- * @param currentList - The current deployment configuration list.
23
- * @param compareList - The deployment configuration list to compare against.
24
- * @param getNavItemHref - A function to generate navigation item URLs based on the resource type and resource name.
25
- * @param sortOrder - (Optional) The order in which to sort the deployment templates.
21
+ * @param params - An object containing the following properties:
22
+ * @param params.currentList - The current deployment configuration list.
23
+ * @param params.compareList - The deployment configuration list to compare against.
24
+ * @param params.getNavItemHref - A function to generate navigation item URLs based on the resource type and resource name.
25
+ * @param params.isManifestView - A boolean that, when true, modifies the output for a manifest view.
26
+ * @param params.sortOrder - (Optional) The order in which to sort the deployment templates.
26
27
  *
27
28
  * @returns An object containing the combined deployment configuration list, a collapsible navigation list, and a navigation list.
28
29
  */
29
- export declare const getAppEnvDeploymentConfigList: (currentList: AppEnvDeploymentConfigDTO, compareList: AppEnvDeploymentConfigDTO, getNavItemHref: (resourceType: EnvResourceType, resourceName: string) => string, sortOrder?: SortingOrder) => {
30
+ export declare const getAppEnvDeploymentConfigList: <ManifestView extends boolean = false>({ currentList, compareList, getNavItemHref, isManifestView, sortOrder, }: AppEnvDeploymentConfigListParams<ManifestView>) => {
30
31
  configList: DeploymentConfigDiffProps["configList"];
31
32
  navList: DeploymentConfigDiffProps["navList"];
32
33
  collapsibleNavList: DeploymentConfigDiffProps["collapsibleNavList"];
@@ -1,2 +1,2 @@
1
- import { DeploymentConfigDiffAccordionProps } from './types';
1
+ import { DeploymentConfigDiffAccordionProps } from './DeploymentConfigDiff.types';
2
2
  export declare const DeploymentConfigDiffAccordion: import('react').ForwardRefExoticComponent<DeploymentConfigDiffAccordionProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,2 +1,2 @@
1
- import { DeploymentConfigDiffMainProps } from './types';
2
- export declare const DeploymentConfigDiffMain: ({ isLoading, headerText, configList, selectorsConfig, sortingConfig, scrollIntoViewId, }: DeploymentConfigDiffMainProps) => JSX.Element;
1
+ import { DeploymentConfigDiffMainProps } from './DeploymentConfigDiff.types';
2
+ export declare const DeploymentConfigDiffMain: ({ isLoading, errorConfig, headerText, configList, selectorsConfig, sortingConfig, scrollIntoViewId, }: DeploymentConfigDiffMainProps) => JSX.Element;
@@ -1,2 +1,2 @@
1
- import { DeploymentConfigDiffNavigationProps } from './types';
2
- export declare const DeploymentConfigDiffNavigation: ({ isLoading, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, }: DeploymentConfigDiffNavigationProps) => JSX.Element;
1
+ import { DeploymentConfigDiffNavigationProps } from './DeploymentConfigDiff.types';
2
+ export declare const DeploymentConfigDiffNavigation: ({ isLoading, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, tabConfig, }: DeploymentConfigDiffNavigationProps) => JSX.Element;
@@ -1,3 +1,3 @@
1
1
  export * from './DeploymentConfigDiff.component';
2
- export * from './types';
2
+ export * from './DeploymentConfigDiff.types';
3
3
  export * from './DeploymentConfigDiff.utils';
@@ -4,7 +4,7 @@ import { DataAttributes } from '../../types';
4
4
  type TabComponentProps<TabTypeProps> = TabTypeProps & DataAttributes;
5
5
  type ConditionalTabType = {
6
6
  /**
7
- * Type of the tab, either `button`, `link` or `navLink`.
7
+ * Type of the tab, either `button`, `link`, `navLink` or `block`.
8
8
  */
9
9
  tabType: 'button';
10
10
  /**
@@ -17,7 +17,7 @@ type ConditionalTabType = {
17
17
  active?: boolean;
18
18
  } | {
19
19
  /**
20
- * Type of the tab, either `button`, `link` or `navLink`.
20
+ * Type of the tab, either `button`, `link`, `navLink` or `block`.
21
21
  */
22
22
  tabType: 'navLink';
23
23
  /**
@@ -27,10 +27,10 @@ type ConditionalTabType = {
27
27
  /**
28
28
  * Active state is determined by matching the URL.
29
29
  */
30
- active?: false;
30
+ active?: never | false;
31
31
  } | {
32
32
  /**
33
- * Type of the tab, either `button`, `link` or `navLink`.
33
+ * Type of the tab, either `button`, `link`, `navLink` or `block`.
34
34
  */
35
35
  tabType: 'link';
36
36
  /**
@@ -41,6 +41,20 @@ type ConditionalTabType = {
41
41
  * Indicates if the tab is currently active.
42
42
  */
43
43
  active?: boolean;
44
+ } | {
45
+ /**
46
+ * Type of the tab, either `button`, `link`, `navLink` or `block`.
47
+ * @note When `tabType` is set to `block`, the tab becomes non-interactive. It won't be active and will not have hover states.
48
+ */
49
+ tabType: 'block';
50
+ /**
51
+ * Props passed to div component.
52
+ */
53
+ props?: TabComponentProps<Omit<React.ComponentProps<'div'>, 'className' | 'style'>>;
54
+ /**
55
+ * Indicates if the tab is currently active.
56
+ */
57
+ active?: never | false;
44
58
  };
45
59
  export type TabProps = {
46
60
  /**
@@ -51,6 +65,11 @@ export type TabProps = {
51
65
  * Text label for the tab.
52
66
  */
53
67
  label: string;
68
+ /**
69
+ * Description for the tab.
70
+ * @note - If passed as a `string[]`, it will be rendered with a bullet in-between strings.
71
+ */
72
+ description?: string | string[];
54
73
  /**
55
74
  * Icon component to be displayed in the tab.
56
75
  * This should be a functional component that renders an SVG.
@@ -92,7 +111,7 @@ export interface TabGroupProps {
92
111
  * Size of the tabs.
93
112
  * @default ComponentSizeType.large
94
113
  */
95
- size?: ComponentSizeType.large | ComponentSizeType.medium;
114
+ size?: ComponentSizeType.large | ComponentSizeType.medium | ComponentSizeType.xl;
96
115
  /**
97
116
  * Optional component to be rendered on the right side of the tab list.
98
117
  */
@@ -5,3 +5,4 @@ export declare const getClassNameBySizeMap: ({ hideTopPadding, alignActiveBorder
5
5
  badgeClassName: string;
6
6
  }>;
7
7
  export declare const getIconColorClassMap: ({ active }: Pick<TabProps, "active">) => Record<TabProps["iconType"], string>;
8
+ export declare const tabGroupClassMap: Record<TabGroupProps['size'], string>;
@@ -197,6 +197,11 @@ export interface TemplateListDTO {
197
197
  status?: string;
198
198
  pipelineId?: number;
199
199
  }
200
+ export interface ManifestTemplateDTO {
201
+ data: string;
202
+ resolvedData: string;
203
+ variableSnapshot: null;
204
+ }
200
205
  export declare enum DraftState {
201
206
  Init = 1,
202
207
  Discarded = 2,
@@ -206,6 +211,7 @@ export declare enum DraftState {
206
211
  export declare enum EnvResourceType {
207
212
  ConfigMap = "configmap",
208
213
  Secret = "secrets",
209
- DeploymentTemplate = "deployment-template"
214
+ DeploymentTemplate = "deployment-template",
215
+ Manifest = "manifest"
210
216
  }
211
217
  export {};