@devtron-labs/devtron-fe-common-lib 0.0.55 → 0.0.56

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 (48) hide show
  1. package/.eslintrc.js +16 -84
  2. package/.github/workflows/release-package.yml +3 -2
  3. package/dist/Common/Common.service.d.ts +2 -2
  4. package/dist/Common/Constants.d.ts +8 -0
  5. package/dist/Common/CustomInput/CustomInput.d.ts +1 -1
  6. package/dist/Common/CustomInput/Types.d.ts +1 -0
  7. package/dist/Common/DebouncedSearch/DebouncedSearch.d.ts +0 -2
  8. package/dist/Common/EmptyState/GenericEmptyState.d.ts +1 -1
  9. package/dist/Common/Helper.d.ts +0 -4
  10. package/dist/Common/Types.d.ts +3 -15
  11. package/dist/Common/index.d.ts +0 -2
  12. package/dist/index.js +214 -430
  13. package/package.json +2 -19
  14. package/src/Common/Constants.ts +9 -0
  15. package/src/Common/CustomInput/CustomInput.tsx +3 -2
  16. package/src/Common/CustomInput/Types.ts +1 -0
  17. package/src/Common/DebouncedSearch/DebouncedSearch.tsx +0 -2
  18. package/src/Common/EmptyState/GenericEmptyState.tsx +45 -13
  19. package/src/Common/Helper.tsx +0 -15
  20. package/src/Common/Types.ts +3 -15
  21. package/src/Common/index.ts +0 -2
  22. package/.eslintignore +0 -96
  23. package/.github/pull_request_template.md +0 -25
  24. package/.github/workflows/ci.yml +0 -31
  25. package/.husky/pre-commit +0 -5
  26. package/.lintstagedrc +0 -3
  27. package/.nvmrc +0 -1
  28. package/dist/Common/Pagination/PageSizeSelector.d.ts +0 -4
  29. package/dist/Common/Pagination/Pagination.d.ts +0 -5
  30. package/dist/Common/Pagination/constants.d.ts +0 -5
  31. package/dist/Common/Pagination/index.d.ts +0 -1
  32. package/dist/Common/Pagination/types.d.ts +0 -51
  33. package/dist/Common/Pagination/utils.d.ts +0 -6
  34. package/dist/Common/SearchBar/SearchBar.component.d.ts +0 -39
  35. package/dist/Common/SearchBar/index.d.ts +0 -2
  36. package/dist/Common/SearchBar/types.d.ts +0 -35
  37. package/src/Assets/Icon/ic-search.svg +0 -6
  38. package/src/Common/Pagination/PageSizeSelector.tsx +0 -78
  39. package/src/Common/Pagination/Pagination.tsx +0 -127
  40. package/src/Common/Pagination/constants.ts +0 -6
  41. package/src/Common/Pagination/index.tsx +0 -3
  42. package/src/Common/Pagination/pagination.scss +0 -123
  43. package/src/Common/Pagination/types.ts +0 -55
  44. package/src/Common/Pagination/utils.tsx +0 -24
  45. package/src/Common/SearchBar/SearchBar.component.tsx +0 -120
  46. package/src/Common/SearchBar/index.ts +0 -2
  47. package/src/Common/SearchBar/searchBar.scss +0 -31
  48. package/src/Common/SearchBar/types.ts +0 -36
package/.eslintrc.js CHANGED
@@ -1,109 +1,41 @@
1
1
  module.exports = {
2
2
  parser: '@typescript-eslint/parser',
3
- plugins: ['@typescript-eslint', 'react', 'prettier'],
3
+ plugins: ['@typescript-eslint'],
4
4
  env: {
5
+ commonjs: true,
5
6
  browser: true,
6
- es2021: true,
7
+ es6: true,
7
8
  },
8
9
  parserOptions: {
9
- ecmaVersion: 2021,
10
+ ecmaVersion: 2018,
10
11
  sourceType: 'module',
11
12
  ecmaFeatures: {
12
13
  jsx: true,
13
14
  },
14
15
  project: ['./tsconfig.json'],
15
16
  },
16
- globals: {
17
- JSX: true,
18
- },
19
- extends: [
20
- 'eslint:recommended',
21
- 'plugin:react/recommended',
22
- 'plugin:react/jsx-runtime',
23
- 'plugin:@typescript-eslint/eslint-recommended',
24
- 'airbnb',
25
- 'airbnb/hooks',
26
- 'prettier',
27
- ],
28
17
  rules: {
29
- 'prettier/prettier': ['error'],
30
- 'linebreak-style': ['error', 'unix'],
31
- 'no-console': 'warn',
32
18
  'no-var': 'error',
33
19
  'no-duplicate-imports': 'error',
34
- 'no-shadow': 'off',
35
- '@typescript-eslint/no-shadow': 'warn',
36
20
  '@typescript-eslint/explicit-function-return-type': 'off',
21
+ '@typescript-eslint/no-explicit-any': 'off',
22
+ '@typescript-eslint/no-use-before-define': 'off',
37
23
  '@typescript-eslint/explicit-member-accessibility': 'off',
38
- // Since we are using typescript, we can disable the no-unused-vars rule for enum,etc
39
- 'no-unused-vars': 'off',
40
- '@typescript-eslint/no-unused-vars': 'error',
41
- 'react/jsx-filename-extension': [
42
- 'error',
43
- {
44
- extensions: ['tsx'],
45
- },
46
- ],
47
- 'react/jsx-props-no-spreading': 'off',
48
- 'react/prefer-stateless-function': 'off',
49
- 'jsx-a11y/click-events-have-key-events': 'off',
50
- 'jsx-a11y/no-static-element-interactions': 'off',
51
- 'jsx-a11y/no-noninteractive-element-interactions': 'off',
52
- 'no-underscore-dangle': 'off',
53
- 'import/no-extraneous-dependencies': [
54
- 'warn',
55
- {
56
- devDependencies: true,
57
- },
58
- ],
59
- 'no-plusplus': [
60
- 'error',
61
- {
62
- allowForLoopAfterthoughts: true,
63
- },
64
- ],
65
- // Since we dont use prop-types, we can disable this rule
66
- 'react/require-default-props': 'off',
67
- 'react-hooks/exhaustive-deps': 'off',
68
- 'react/function-component-definition': [
69
- 'warn',
70
- {
71
- namedComponents: 'arrow-function',
72
- unnamedComponents: 'arrow-function',
73
- },
74
- ],
75
- 'react/jsx-uses-react': 'off',
76
- 'react/react-in-jsx-scope': 'off',
77
- // additional rules:
78
- '@typescript-eslint/no-floating-promises': 'error',
79
- 'import/extensions': [
80
- 'warn',
81
- 'ignorePackages',
82
- {
83
- js: 'never',
84
- jsx: 'never',
85
- ts: 'never',
86
- tsx: 'never',
87
- },
88
- ],
24
+ curly: [2, 'all'],
25
+ 'keyword-spacing': 'error',
26
+ 'prettier/prettier': ['error', { semi: false }],
89
27
  },
90
- overrides: [
91
- {
92
- files: ['*.ts', '*.tsx'],
93
- rules: {
94
- 'no-undef': 'off',
95
- },
96
- },
28
+ extends: [
29
+ 'eslint:recommended',
30
+ 'plugin:@typescript-eslint/eslint-recommended',
31
+ 'plugin:@typescript-eslint/recommended',
32
+ 'prettier/@typescript-eslint',
33
+ 'plugin:prettier/recommended',
34
+ 'plugin:react/recommended',
97
35
  ],
98
36
  settings: {
99
37
  react: {
100
38
  version: 'detect',
101
39
  },
102
- 'import/resolver': {
103
- node: {
104
- moduleDirectory: ['src', 'node_modules'],
105
- extensions: ['.js', '.jsx', '.ts', '.tsx'],
106
- },
107
- },
108
40
  },
109
41
  }
@@ -11,7 +11,7 @@ jobs:
11
11
  - uses: actions/checkout@v3
12
12
  - uses: actions/setup-node@v3
13
13
  with:
14
- node-version-file: '.nvmrc'
14
+ node-version: 16
15
15
  - run: npm ci
16
16
  - run: npm test
17
17
 
@@ -25,7 +25,7 @@ jobs:
25
25
  - uses: actions/checkout@v3
26
26
  - uses: actions/setup-node@v3
27
27
  with:
28
- node-version-file: '.nvmrc'
28
+ node-version: 16
29
29
  registry-url: https://npm.pkg.github.com/
30
30
  - run: npm ci
31
31
  - run: npm run build-lib
@@ -46,3 +46,4 @@ jobs:
46
46
  - run: npm publish --access public
47
47
  env:
48
48
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
49
+
@@ -12,9 +12,9 @@ export declare const SourceTypeMap: {
12
12
  BranchRegex: string;
13
13
  };
14
14
  export declare function getUserRole(appName?: string): Promise<UserRole>;
15
- export declare function setImageTags(request: any, pipelineId: number, artifactId: number): Promise<ResponseType<any>>;
15
+ export declare function setImageTags(request: any, pipelineId: number, artifactId: number): Promise<ResponseType>;
16
16
  export declare const genericCDMaterialsService: (serviceType: CDMaterialServiceEnum, cdMaterialID: number, stage: DeploymentNodeType, signal: AbortSignal, queryParams?: CDMaterialServiceQueryParams) => Promise<CDMaterialResponseType>;
17
17
  export declare function extractImage(image: string): string;
18
18
  export declare function createGitCommitUrl(url: string, revision: string): string;
19
- export declare function fetchChartTemplateVersions(): Promise<ResponseType<any>>;
19
+ export declare function fetchChartTemplateVersions(): Promise<ResponseType>;
20
20
  export {};
@@ -64,4 +64,12 @@ export declare const RepositoryAction: {
64
64
  CHART_PULL: string;
65
65
  CHART_PUSH: string;
66
66
  };
67
+ export declare enum APPROVAL_MODAL_TYPE {
68
+ CONFIG = "CONFIG",
69
+ DEPLOYMENT = "DEPLOYMENT"
70
+ }
67
71
  export declare const MAX_Z_INDEX = 2147483647;
72
+ export declare const SELECTED_APPROVAL_TAB_STATE: {
73
+ APPROVAL: string;
74
+ PENDING: string;
75
+ };
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { CustomInputProps } from './Types';
3
- export declare function CustomInput({ name, value, error, onChange, onFocus, label, type, disabled, labelClassName, placeholder, tabIndex, dataTestid, isRequiredField, autoFocus, rootClassName, autoComplete, helperText, handleOnBlur, readOnly, noTrim, ref, onKeyPress, defaultValue, onKeyDown, required, additionalErrorInfo }: CustomInputProps): JSX.Element;
3
+ export declare function CustomInput({ name, value, error, onChange, onFocus, label, type, disabled, labelClassName, placeholder, tabIndex, dataTestid, isRequiredField, autoFocus, rootClassName, autoComplete, helperText, handleOnBlur, readOnly, noTrim, ref, onKeyPress, defaultValue, onKeyDown, required, additionalErrorInfo, inputWrapClassName, }: CustomInputProps): JSX.Element;
@@ -26,4 +26,5 @@ export interface CustomInputProps {
26
26
  onKeyDown?: (e: any) => void;
27
27
  required?: boolean;
28
28
  additionalErrorInfo?: React.ReactNode;
29
+ inputWrapClassName?: string;
29
30
  }
@@ -1,8 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { DebouncedSearchProps } from './Types';
3
3
  /**
4
- * @deprecated Use `SearchBar` component instead.
5
- *
6
4
  * @param onSearch - Callback function to be called on search
7
5
  * @param Icon - (Optional) Icon to be shown before the input
8
6
  * @param iconClass - (Optional) Class for the icon
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { GenericEmptyStateType } from '../Types';
3
3
  import './emptyState.scss';
4
- declare function GenericEmptyState({ title, image, subTitle, isButtonAvailable, classname, styles, heightToDeduct, imageType, renderButton, imageClassName, children, SvgImage, noImage, layout, contentClassName }: GenericEmptyStateType): JSX.Element;
4
+ declare function GenericEmptyState({ title, image, subTitle, isButtonAvailable, classname, styles, heightToDeduct, imageType, renderButton, imageClassName, children, SvgImage, noImage, layout, contentClassName, imageStyles, }: GenericEmptyStateType): JSX.Element;
5
5
  export default GenericEmptyState;
@@ -57,8 +57,4 @@ export declare const customStyles: {
57
57
  export declare const getFilteredChartVersions: (charts: any, selectedChartType: any) => any;
58
58
  export declare function getUnlockedJSON(json: any, jsonPathArray: any): any;
59
59
  export declare function getLockedJSON(json: any, jsonPathArray: string[]): any;
60
- /**
61
- * Returns a debounced variant of the function
62
- */
63
- export declare const debounce: (func: any, timeout?: number) => (this: any, ...args: any[]) => void;
64
60
  export {};
@@ -2,23 +2,10 @@ import React, { ReactNode, CSSProperties } from 'react';
2
2
  import { Placement } from 'tippy.js';
3
3
  import { ImageComment, ReleaseTag } from './ImageTags.Types';
4
4
  import { DockerConfigOverrideType, TaskErrorObj } from '.';
5
- /**
6
- * Generic response type object with support for overriding the result type
7
- *
8
- * @example Default usage:
9
- * ```ts
10
- * interface UserResponse extends ResponseType {}
11
- * ```
12
- *
13
- * @example Override the response type:
14
- * ```ts
15
- * interface UserResponse extends ResponseType<Record<string, string>> {}
16
- * ```
17
- */
18
- export interface ResponseType<T = any> {
5
+ export interface ResponseType {
19
6
  code: number;
20
7
  status: string;
21
- result?: T;
8
+ result?: any;
22
9
  errors?: any;
23
10
  }
24
11
  export interface APIOptions {
@@ -100,6 +87,7 @@ export interface GenericEmptyStateType {
100
87
  imageClassName?: string;
101
88
  children?: ReactNode;
102
89
  noImage?: boolean;
90
+ imageStyles?: CSSProperties;
103
91
  /**
104
92
  * @default 'column'
105
93
  */
@@ -26,7 +26,6 @@ export * from './Common.service';
26
26
  export * from './Checkbox';
27
27
  export { default as EmptyState } from './EmptyState/EmptyState';
28
28
  export { default as GenericEmptyState } from './EmptyState/GenericEmptyState';
29
- export * from './SearchBar';
30
29
  export { default as Toggle } from './Toggle/Toggle';
31
30
  export { default as ScanVulnerabilitiesTable } from './Security/ScanVulnerabilitiesTable';
32
31
  export { default as StyledRadioGroup } from './RadioGroup/RadioGroup';
@@ -47,4 +46,3 @@ export { default as ChartVersionAndTypeSelector } from './ChartVersionAndTypeSel
47
46
  export * from './AddCDButton';
48
47
  export * from './CustomInput';
49
48
  export * from './DraggableWrapper';
50
- export * from './Pagination';