@devtron-labs/devtron-fe-common-lib 0.0.91-beta-1 → 0.0.91-beta-5

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 (50) hide show
  1. package/dist/Common/Dialogs/Types.d.ts +17 -2
  2. package/dist/Common/EmptyState/GenericFilterEmptyState.d.ts +5 -2
  3. package/dist/Common/EmptyState/types.d.ts +13 -0
  4. package/dist/Common/Hooks/useStateFilters/types.d.ts +1 -1
  5. package/dist/Common/Modals/Modal.d.ts +3 -0
  6. package/dist/Common/Modals/VisibleModal.d.ts +2 -1
  7. package/dist/Common/Modals/VisibleModal2.d.ts +2 -1
  8. package/dist/Common/PopupMenu.d.ts +1 -1
  9. package/dist/Common/Types.d.ts +3 -1
  10. package/dist/Shared/Components/FeatureDescription/FeatureDescriptionModal.d.ts +3 -0
  11. package/dist/Shared/Components/FeatureDescription/FeatureTitleWithInfo.d.ts +4 -0
  12. package/dist/Shared/Components/FeatureDescription/constant.d.ts +8 -0
  13. package/dist/Shared/Components/FeatureDescription/index.d.ts +2 -0
  14. package/dist/Shared/Components/FeatureDescription/types.d.ts +19 -0
  15. package/dist/Shared/Components/FeatureDescription/utils.d.ts +6 -0
  16. package/dist/Shared/Components/ImageWithFallback/ImageWithFallback.component.d.ts +4 -0
  17. package/dist/Shared/Components/ImageWithFallback/index.d.ts +2 -0
  18. package/dist/Shared/Components/ImageWithFallback/types.d.ts +12 -0
  19. package/dist/Shared/Components/ModalSidebarPanel/ModalSidebarPanel.component.d.ts +4 -0
  20. package/dist/Shared/Components/ModalSidebarPanel/index.d.ts +2 -0
  21. package/dist/Shared/Components/ModalSidebarPanel/types.d.ts +9 -0
  22. package/dist/Shared/Components/index.d.ts +3 -0
  23. package/dist/Shared/Helpers.d.ts +2 -0
  24. package/dist/Shared/Services/common.service.d.ts +3 -0
  25. package/dist/Shared/Services/index.d.ts +2 -0
  26. package/dist/Shared/Services/types.d.ts +17 -0
  27. package/dist/Shared/constants.d.ts +4 -0
  28. package/dist/Shared/index.d.ts +1 -0
  29. package/dist/Shared/types.d.ts +44 -1
  30. package/dist/Shared/validations.d.ts +4 -0
  31. package/dist/assets/index.css +1 -1
  32. package/dist/{cssMode-9727a0fd.js → cssMode-ca30972b.js} +1 -1
  33. package/dist/{freemarker2-cfb11288.js → freemarker2-8efb5f10.js} +1 -1
  34. package/dist/{handlebars-83c4c79e.js → handlebars-881fb06c.js} +1 -1
  35. package/dist/{html-dc49fd50.js → html-2f2c6515.js} +1 -1
  36. package/dist/{htmlMode-19c03119.js → htmlMode-7fb13d77.js} +1 -1
  37. package/dist/{index-f1b5774e.js → index-27a11224.js} +18049 -17793
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.js +345 -334
  40. package/dist/{javascript-318d84c2.js → javascript-3ee0a858.js} +1 -1
  41. package/dist/{jsonMode-61cb9867.js → jsonMode-dee25418.js} +1 -1
  42. package/dist/{liquid-f383a9fb.js → liquid-90634c1b.js} +1 -1
  43. package/dist/{mdx-4a3b251d.js → mdx-bfccab0e.js} +1 -1
  44. package/dist/{python-8a6af790.js → python-655432b2.js} +1 -1
  45. package/dist/{razor-1412de81.js → razor-3a0b59c1.js} +1 -1
  46. package/dist/{tsMode-b9637688.js → tsMode-f220e0c7.js} +1 -1
  47. package/dist/{typescript-49d0fdfe.js → typescript-901a82e2.js} +1 -1
  48. package/dist/{xml-f4cb6baf.js → xml-d92ad752.js} +1 -1
  49. package/dist/{yaml-7533723e.js → yaml-68e1d484.js} +1 -1
  50. package/package.json +5 -5
@@ -1,6 +1,19 @@
1
1
  import { ReactNode } from 'react';
2
2
 
3
- export interface DeleteDialogProps {
3
+ type WithOrWithoutDeleteConfirmationType = {
4
+ showDeleteConfirmation: true;
5
+ /**
6
+ * If added, confirmation input is shown
7
+ */
8
+ deleteConfirmationText: string;
9
+ } | {
10
+ showDeleteConfirmation?: never;
11
+ /**
12
+ * If added, confirmation input is shown
13
+ */
14
+ deleteConfirmationText?: never;
15
+ };
16
+ export type DeleteDialogProps = {
4
17
  title: string;
5
18
  description?: string;
6
19
  closeDelete: () => void;
@@ -12,7 +25,8 @@ export interface DeleteDialogProps {
12
25
  buttonPrimaryText?: string;
13
26
  shouldStopPropagation?: boolean;
14
27
  disabled?: boolean;
15
- }
28
+ children?: ReactNode;
29
+ } & WithOrWithoutDeleteConfirmationType;
16
30
  export interface ForceDeleteDialogType {
17
31
  onClickDelete: () => void;
18
32
  closeDeleteModal: () => void;
@@ -44,3 +58,4 @@ export interface DialogFormProps {
44
58
  onSave: (event: any) => void;
45
59
  headerClassName?: string;
46
60
  }
61
+ export {};
@@ -1,4 +1,7 @@
1
- import { GenericEmptyStateType } from '../Types';
1
+ import { GenericFilterEmptyStateProps } from './types';
2
2
 
3
- declare const GenericFilterEmptyState: (props: Omit<GenericEmptyStateType, 'image' | 'title' | 'subTitle'> & Partial<Pick<GenericEmptyStateType, 'title' | 'subTitle'>>) => JSX.Element;
3
+ /**
4
+ * Empty state when no filters are applied
5
+ */
6
+ declare const GenericFilterEmptyState: ({ handleClearFilters, isButtonAvailable, renderButton, ...props }: GenericFilterEmptyStateProps) => JSX.Element;
4
7
  export default GenericFilterEmptyState;
@@ -0,0 +1,13 @@
1
+ import { GenericEmptyStateType } from '../Types';
2
+
3
+ export type GenericFilterEmptyStateProps = Omit<GenericEmptyStateType, 'image' | 'title' | 'subTitle' | 'isButtonAvailable' | 'renderButton'> & Partial<Pick<GenericEmptyStateType, 'title' | 'subTitle'>> & ({
4
+ /**
5
+ * If provided, it will have priority over the isButtonAvailable prop
6
+ * and render clear filter button
7
+ */
8
+ handleClearFilters?: () => void;
9
+ isButtonAvailable?: never;
10
+ renderButton?: never;
11
+ } | (Pick<GenericEmptyStateType, 'isButtonAvailable' | 'renderButton'> & {
12
+ handleClearFilters?: never;
13
+ }));
@@ -2,5 +2,5 @@ import { UseUrlFiltersProps, UseUrlFiltersReturnType } from '../useUrlFilters';
2
2
 
3
3
  export interface UseStateFiltersProps<T> extends Pick<UseUrlFiltersProps<T, never>, 'initialSortKey'> {
4
4
  }
5
- export interface UseStateFiltersReturnType<T> extends Pick<UseUrlFiltersReturnType<T>, 'sortBy' | 'sortOrder' | 'handleSorting' | 'clearFilters'> {
5
+ export interface UseStateFiltersReturnType<T> extends Pick<UseUrlFiltersReturnType<T>, 'sortBy' | 'sortOrder' | 'handleSorting' | 'clearFilters' | 'searchKey' | 'handleSearch'> {
6
6
  }
@@ -1,4 +1,7 @@
1
1
  import { ModalType } from '../Types';
2
2
  import { default as React } from 'react';
3
3
 
4
+ /**
5
+ * @deprecated Use VisibleModal instead
6
+ */
4
7
  export declare const Modal: ({ style, children, modal, rootClassName, onClick, callbackRef, preventWheelDisable, noBackDrop, }: ModalType) => React.ReactPortal;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { default as React, SyntheticEvent } from 'react';
2
2
 
3
3
  export declare class VisibleModal extends React.Component<{
4
4
  className: string;
@@ -12,5 +12,6 @@ export declare class VisibleModal extends React.Component<{
12
12
  escFunction(event: any): void;
13
13
  componentDidMount(): void;
14
14
  componentWillUnmount(): void;
15
+ handleBodyClick: (e: SyntheticEvent) => void;
15
16
  render(): React.ReactPortal;
16
17
  }
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { default as React, SyntheticEvent } from 'react';
2
2
 
3
3
  export declare class VisibleModal2 extends React.Component<{
4
4
  className: string;
@@ -9,5 +9,6 @@ export declare class VisibleModal2 extends React.Component<{
9
9
  escFunction(event: any): void;
10
10
  componentDidMount(): void;
11
11
  componentWillUnmount(): void;
12
+ handleBodyClick: (e: SyntheticEvent) => void;
12
13
  render(): React.ReactPortal;
13
14
  }
@@ -1,7 +1,7 @@
1
1
  import { PopupMenuBodyType, PopupMenuButtonType, PopupMenuType } from './Types';
2
2
 
3
3
  declare const PopupMenu: {
4
- ({ children, onToggleCallback, autoClose, autoPosition, }: PopupMenuType): any;
4
+ ({ children, onToggleCallback, autoClose, autoPosition, shouldPreventDefault }: PopupMenuType): any;
5
5
  Button: ({ children, disabled, rootClassName, tabIndex, onHover, isKebab, dataTestId, }: PopupMenuButtonType) => JSX.Element;
6
6
  Body: ({ children, rootClassName, style, autoWidth, preventWheelDisable, noBackDrop, }: PopupMenuBodyType) => JSX.Element;
7
7
  };
@@ -140,7 +140,8 @@ export interface ErrorScreenNotAuthorizedProps {
140
140
  }
141
141
  export declare enum ImageType {
142
142
  Large = "large",
143
- Medium = "medium"
143
+ Medium = "medium",
144
+ SMALL = "small"
144
145
  }
145
146
  export interface InfoColourBarType {
146
147
  message: React.ReactNode;
@@ -213,6 +214,7 @@ export interface PopupMenuType {
213
214
  onToggleCallback?: (isOpen: boolean) => void;
214
215
  autoClose?: boolean;
215
216
  autoPosition?: boolean;
217
+ shouldPreventDefault?: boolean;
216
218
  }
217
219
  export interface PopupMenuButtonType {
218
220
  children?: ReactNode;
@@ -0,0 +1,3 @@
1
+ import { FeatureDescriptionModalProps } from './types';
2
+
3
+ export declare const FeatureDescriptionModal: ({ title, renderDescriptionContent, closeModalText, docLink, closeModal, imageVariant, SVGImage, imageStyles, }: FeatureDescriptionModalProps) => JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { DescriptorProps } from './types';
2
+
3
+ declare const FeatureTitleWithInfo: ({ additionalContainerClasses, breadCrumbs, children, iconClassName, title, renderDescriptionContent, closeModalText, docLink, SVGImage, }: DescriptorProps) => JSX.Element;
4
+ export default FeatureTitleWithInfo;
@@ -0,0 +1,8 @@
1
+ export declare enum BUTTON_TEXT {
2
+ GOT_IT = "Got it",
3
+ VIEW_DOCUMENTATION = "View Documentation"
4
+ }
5
+ export declare enum IMAGE_VARIANT {
6
+ SMALL = "small",
7
+ LARGE = "large"
8
+ }
@@ -0,0 +1,2 @@
1
+ export * from './FeatureDescriptionModal';
2
+ export { default as FeatureTitleWithInfo } from './FeatureTitleWithInfo';
@@ -0,0 +1,19 @@
1
+ import { Breadcrumb } from '../../../Common/BreadCrumb/Types';
2
+ import { ImageType } from '../../../Common';
3
+
4
+ export interface FeatureDescriptionModalProps {
5
+ title: string;
6
+ renderDescriptionContent?: () => JSX.Element;
7
+ closeModalText?: string;
8
+ docLink?: string;
9
+ closeModal?: () => void;
10
+ imageVariant?: ImageType;
11
+ SVGImage?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
12
+ imageStyles?: React.CSSProperties;
13
+ }
14
+ export interface DescriptorProps extends FeatureDescriptionModalProps {
15
+ breadCrumbs: Breadcrumb[];
16
+ additionalContainerClasses?: string;
17
+ iconClassName?: string;
18
+ children?: React.ReactNode;
19
+ }
@@ -0,0 +1,6 @@
1
+ import { ImageType } from '../../../Common';
2
+
3
+ export declare const getImageSize: (imageType: ImageType) => {
4
+ width: string;
5
+ height: string;
6
+ };
@@ -0,0 +1,4 @@
1
+ import { ImageWithFallbackProps } from './types';
2
+
3
+ declare const ImageWithFallback: ({ imageProps, fallbackImage }: ImageWithFallbackProps) => JSX.Element;
4
+ export default ImageWithFallback;
@@ -0,0 +1,2 @@
1
+ export { default as ImageWithFallback } from './ImageWithFallback.component';
2
+ export type { ImageWithFallbackProps } from './types';
@@ -0,0 +1,12 @@
1
+ import { ImgHTMLAttributes } from 'react';
2
+
3
+ export interface ImageWithFallbackProps {
4
+ /**
5
+ * Props for the image
6
+ */
7
+ imageProps: ImgHTMLAttributes<HTMLImageElement>;
8
+ /**
9
+ * Fallback image; can be a url or a jsx element
10
+ */
11
+ fallbackImage: string | JSX.Element;
12
+ }
@@ -0,0 +1,4 @@
1
+ import { ModalSidebarPanelProps } from './types';
2
+
3
+ declare const ModalSidebarPanel: ({ rootClassName, heading, icon, children, documentationLink, }: ModalSidebarPanelProps) => JSX.Element;
4
+ export default ModalSidebarPanel;
@@ -0,0 +1,2 @@
1
+ export { default as ModalSidebarPanel } from './ModalSidebarPanel.component';
2
+ export type { ModalSidebarPanelProps } from './types';
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export interface ModalSidebarPanelProps {
4
+ rootClassName?: string;
5
+ heading: string;
6
+ icon?: JSX.Element;
7
+ children?: ReactNode;
8
+ documentationLink: string;
9
+ }
@@ -17,6 +17,9 @@ export * from './Header';
17
17
  export * from './AnnouncementBanner';
18
18
  export * from './ButtonWithLoader';
19
19
  export * from './ButtonWithSelector';
20
+ export * from './ModalSidebarPanel';
21
+ export * from './ImageWithFallback';
22
+ export * from './FeatureDescription';
20
23
  export * from './CICDHistory';
21
24
  export * from './GitCommitInfoGeneric';
22
25
  export * from './Error';
@@ -1,6 +1,7 @@
1
1
  import { AggregatedNodes, DeploymentStatusDetailsBreakdownDataType, DeploymentStatusDetailsType, PodMetadatum } from './Components';
2
2
  import { GitTriggers, IntersectionChangeHandler, IntersectionOptions, WebhookEventNameType } from './types';
3
3
  import { MaterialInfo, SortingOrder } from '../Common';
4
+ import { ReactElement } from 'react';
4
5
 
5
6
  interface HighlightSearchTextProps {
6
7
  /**
@@ -26,6 +27,7 @@ export declare const getWebhookEventIcon: (eventName: WebhookEventNameType) => J
26
27
  export declare const useIntersection: (target: React.RefObject<Element> | Element | null, options?: IntersectionOptions, callback?: IntersectionChangeHandler) => boolean;
27
28
  export declare const isNullOrUndefined: (value: unknown) => boolean;
28
29
  export declare const getKeyToBooleanMapFromArray: <T extends string | number>(arr?: T[]) => Record<T, boolean>;
30
+ export declare const renderValidInputButtonTippy: (children: ReactElement) => JSX.Element;
29
31
  export declare const processDeploymentStatusDetailsData: (data?: DeploymentStatusDetailsType) => DeploymentStatusDetailsBreakdownDataType;
30
32
  export declare function aggregateNodes(nodes: any[], podMetadata: PodMetadatum[]): AggregatedNodes;
31
33
  export declare const decode: (data: any, isEncoded?: boolean) => {};
@@ -0,0 +1,3 @@
1
+ import { GetResourceApiUrlProps } from './types';
2
+
3
+ export declare const getResourceApiUrl: <T>({ baseUrl, kind, version, queryParams }: GetResourceApiUrlProps<T>) => string;
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './common.service';
@@ -0,0 +1,17 @@
1
+ import { ResourceKindType, ResourceVersionType } from '../types';
2
+ import { getUrlWithSearchParams } from '../../Common';
3
+
4
+ export interface ClusterType {
5
+ id: number;
6
+ name: string;
7
+ /**
8
+ * If true, denotes virtual cluster
9
+ */
10
+ isVirtual: boolean;
11
+ }
12
+ export interface GetResourceApiUrlProps<T> {
13
+ baseUrl: string;
14
+ kind: ResourceKindType;
15
+ version: ResourceVersionType;
16
+ queryParams?: T extends Parameters<typeof getUrlWithSearchParams>[1] ? T : never;
17
+ }
@@ -43,6 +43,10 @@ export declare enum DeploymentWithConfigType {
43
43
  LATEST_TRIGGER_CONFIG = "LATEST_TRIGGER_CONFIG",
44
44
  SPECIFIC_TRIGGER_CONFIG = "SPECIFIC_TRIGGER_CONFIG"
45
45
  }
46
+ export declare enum EnvironmentTypeEnum {
47
+ production = "Production",
48
+ nonProduction = "Non-Production"
49
+ }
46
50
  export declare enum TIMELINE_STATUS {
47
51
  DEPLOYMENT_INITIATED = "DEPLOYMENT_INITIATED",
48
52
  GIT_COMMIT = "GIT_COMMIT",
@@ -4,5 +4,6 @@ export * from './Helpers';
4
4
  export * from './types';
5
5
  export * from './Providers';
6
6
  export * from './constants';
7
+ export * from './Services';
7
8
  export * from './Store';
8
9
  export * from './Hooks';
@@ -1,4 +1,4 @@
1
- import { PatchOperationType } from './constants';
1
+ import { EnvironmentTypeEnum, PatchOperationType } from './constants';
2
2
  import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes } from '../Common';
3
3
 
4
4
  export declare enum EnvType {
@@ -351,6 +351,9 @@ export declare enum ResourceKindType {
351
351
  cluster = "cluster",
352
352
  release = "release",
353
353
  releaseTrack = "release-track",
354
+ tenant = "tenant",
355
+ installation = "installation",
356
+ environment = "environment",
354
357
  cdPipeline = "cd-pipeline"
355
358
  }
356
359
  /**
@@ -399,6 +402,10 @@ export type IntersectionOptions = {
399
402
  defaultIntersecting?: boolean;
400
403
  };
401
404
  export type IntersectionChangeHandler = (entry: IntersectionObserverEntry) => void;
405
+ export interface InputFieldState<T = string> {
406
+ value: T;
407
+ error: string;
408
+ }
402
409
  export declare enum AggregationKeys {
403
410
  Workloads = "Workloads",
404
411
  Networking = "Networking",
@@ -411,6 +418,42 @@ export declare enum AggregationKeys {
411
418
  Namespaces = "Namespaces"
412
419
  }
413
420
  export type AggregationKeysType = keyof typeof AggregationKeys;
421
+ export interface EnvironmentType {
422
+ /**
423
+ * Unique identifier for the environment
424
+ */
425
+ id: number;
426
+ /**
427
+ * Name of the environment
428
+ */
429
+ name: string;
430
+ /**
431
+ * Associated namespace for the environment
432
+ */
433
+ namespace: string;
434
+ /**
435
+ * Type of the environment
436
+ */
437
+ environmentType: EnvironmentTypeEnum;
438
+ /**
439
+ * Associated cluster for the environment
440
+ */
441
+ cluster: string;
442
+ /**
443
+ * If true, denotes virtual environment
444
+ */
445
+ isVirtual: boolean;
446
+ }
447
+ export interface CreatedByDTO {
448
+ icon: boolean;
449
+ id: number;
450
+ name: string;
451
+ }
452
+ export declare enum DependencyType {
453
+ UPSTREAM = "upstream",
454
+ DOWNSTREAM = "downstream",
455
+ LEVEL = "level"
456
+ }
414
457
  export interface scrollableInterface {
415
458
  autoBottomScroll: boolean;
416
459
  }
@@ -8,6 +8,7 @@ export declare const MESSAGES: {
8
8
  CAN_NOT_START_END_WITH_SEPARATORS: string;
9
9
  getMinMaxCharMessage: (min: number, max: number) => string;
10
10
  getMaxCharMessage: (max: number) => string;
11
+ getMinCharMessage: (min: number) => string;
11
12
  VALID_POSITIVE_NUMBER: string;
12
13
  VALID_POSITIVE_INTEGER: string;
13
14
  MAX_SAFE_INTEGER: string;
@@ -15,5 +16,8 @@ export declare const MESSAGES: {
15
16
  export declare const requiredField: (value: string) => ValidationResponseType;
16
17
  export declare const validateName: (name: string) => ValidationResponseType;
17
18
  export declare const validateDescription: (description: string) => ValidationResponseType;
19
+ export declare const validateStringLength: (value: string, maxLimit: number, minLimit: number) => ValidationResponseType;
18
20
  export declare const validateRequiredPositiveNumber: (value: string | number) => ValidationResponseType;
19
21
  export declare const validateRequiredPositiveInteger: (value: string | number) => ValidationResponseType;
22
+ export declare const validateURL: (url: string, allowBase64Url?: boolean) => ValidationResponseType;
23
+ export declare const validateIfImageExist: (url: string) => Promise<ValidationResponseType>;