@devtron-labs/devtron-fe-common-lib 0.0.55-beta-2 → 0.0.55-beta-4
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.
- package/.eslintignore +96 -0
- package/.eslintrc.js +84 -16
- package/.github/pull_request_template.md +25 -0
- package/.github/workflows/ci.yml +31 -0
- package/.github/workflows/release-package.yml +2 -3
- package/.husky/pre-commit +5 -0
- package/.lintstagedrc +3 -0
- package/.nvmrc +1 -0
- package/dist/Common/Common.service.d.ts +2 -2
- package/dist/Common/Constants.d.ts +1 -0
- package/dist/Common/DebouncedSearch/DebouncedSearch.d.ts +2 -0
- package/dist/Common/DraggableWrapper/DraggableButton.d.ts +3 -0
- package/dist/Common/DraggableWrapper/DraggableWrapper.d.ts +9 -0
- package/dist/Common/DraggableWrapper/index.d.ts +3 -0
- package/dist/Common/DraggableWrapper/types.d.ts +23 -0
- package/dist/Common/Grid/Grid.d.ts +1 -1
- package/dist/Common/Grid/types.d.ts +2 -2
- package/dist/Common/Helper.d.ts +5 -4
- package/dist/Common/Hooks/UseWindowSize/UseWindowSize.d.ts +4 -0
- package/dist/Common/Hooks/index.d.ts +1 -0
- package/dist/Common/Pagination/PageSizeSelector.d.ts +4 -0
- package/dist/Common/Pagination/Pagination.d.ts +5 -0
- package/dist/Common/Pagination/constants.d.ts +5 -0
- package/dist/Common/Pagination/index.d.ts +1 -0
- package/dist/Common/Pagination/types.d.ts +51 -0
- package/dist/Common/Pagination/utils.d.ts +6 -0
- package/dist/Common/SearchBar/SearchBar.component.d.ts +39 -0
- package/dist/Common/SearchBar/index.d.ts +2 -0
- package/dist/Common/SearchBar/types.d.ts +35 -0
- package/dist/Common/Types.d.ts +16 -2
- package/dist/Common/index.d.ts +3 -0
- package/dist/index.js +594 -233
- package/package.json +21 -3
- package/src/Assets/Icon/ic-drag.svg +8 -0
- package/src/Assets/Icon/ic-search.svg +6 -0
- package/src/Common/Constants.ts +3 -1
- package/src/Common/DebouncedSearch/DebouncedSearch.tsx +2 -0
- package/src/Common/DraggableWrapper/DraggableButton.tsx +14 -0
- package/src/Common/DraggableWrapper/DraggableWrapper.tsx +116 -0
- package/src/Common/DraggableWrapper/index.ts +3 -0
- package/src/Common/DraggableWrapper/types.ts +27 -0
- package/src/Common/Grid/Grid.tsx +7 -2
- package/src/Common/Grid/types.ts +3 -1
- package/src/Common/Helper.tsx +31 -23
- package/src/Common/Hooks/UseWindowSize/UseWindowSize.tsx +31 -0
- package/src/Common/Hooks/index.ts +1 -0
- package/src/Common/Pagination/PageSizeSelector.tsx +78 -0
- package/src/Common/Pagination/Pagination.tsx +127 -0
- package/src/Common/Pagination/constants.ts +6 -0
- package/src/Common/Pagination/index.tsx +3 -0
- package/src/Common/Pagination/pagination.scss +123 -0
- package/src/Common/Pagination/types.ts +55 -0
- package/src/Common/Pagination/utils.tsx +24 -0
- package/src/Common/SearchBar/SearchBar.component.tsx +120 -0
- package/src/Common/SearchBar/index.ts +2 -0
- package/src/Common/SearchBar/searchBar.scss +31 -0
- package/src/Common/SearchBar/types.ts +36 -0
- package/src/Common/Types.ts +16 -2
- package/src/Common/index.ts +3 -0
package/.eslintignore
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
.eslintrc.js
|
|
2
|
+
|
|
3
|
+
# Files with ESLint errors/warnings
|
|
4
|
+
src/Common/AddCDButton/AddCDButton.tsx
|
|
5
|
+
src/Common/AddCDButton/utils.tsx
|
|
6
|
+
src/Common/Api.ts
|
|
7
|
+
src/Common/AppStatus/AppStatus.tsx
|
|
8
|
+
src/Common/AppStatus/index.ts
|
|
9
|
+
src/Common/AppStatus/utils.ts
|
|
10
|
+
src/Common/BreadCrumb/BreadCrumb.tsx
|
|
11
|
+
src/Common/BreadCrumb/BreadcrumbStore.tsx
|
|
12
|
+
src/Common/BreadCrumb/Types.ts
|
|
13
|
+
src/Common/CIPipeline.Types.ts
|
|
14
|
+
src/Common/ChartVersionAndTypeSelector.tsx
|
|
15
|
+
src/Common/Checkbox.tsx
|
|
16
|
+
src/Common/ClipboardButton/ClipboardButton.tsx
|
|
17
|
+
src/Common/ClipboardButton/__tests__/ClipboardButton.test.tsx
|
|
18
|
+
src/Common/Common.service.ts
|
|
19
|
+
src/Common/Constants.ts
|
|
20
|
+
src/Common/CustomInput/CustomInput.tsx
|
|
21
|
+
src/Common/CustomInput/Types.ts
|
|
22
|
+
src/Common/CustomInput/index.ts
|
|
23
|
+
src/Common/CustomTagSelector/PropagateTagInfo.tsx
|
|
24
|
+
src/Common/CustomTagSelector/ResizableTagTextArea.tsx
|
|
25
|
+
src/Common/CustomTagSelector/TagDetails.tsx
|
|
26
|
+
src/Common/CustomTagSelector/TagLabelSelect.tsx
|
|
27
|
+
src/Common/CustomTagSelector/TagLabelValueSelector.tsx
|
|
28
|
+
src/Common/CustomTagSelector/TagSelector.utils.ts
|
|
29
|
+
src/Common/CustomTagSelector/Types.ts
|
|
30
|
+
src/Common/CustomTagSelector/ValidationRules.ts
|
|
31
|
+
src/Common/CustomTagSelector/index.ts
|
|
32
|
+
src/Common/DebouncedSearch/DebouncedSearch.tsx
|
|
33
|
+
src/Common/DebouncedSearch/Utils.ts
|
|
34
|
+
src/Common/DebouncedSearch/__tests__/DebouncedSearch.test.tsx
|
|
35
|
+
src/Common/DeleteComponentModal/DeleteComponent.tsx
|
|
36
|
+
src/Common/DeleteComponentModal/types.ts
|
|
37
|
+
src/Common/DevtronProgressing/DevtronProgressing.tsx
|
|
38
|
+
src/Common/Dialogs/ConfirmationDialog.tsx
|
|
39
|
+
src/Common/Dialogs/DeleteDialog.tsx
|
|
40
|
+
src/Common/Dialogs/DialogForm.tsx
|
|
41
|
+
src/Common/Dialogs/ForceDeleteDialog.tsx
|
|
42
|
+
src/Common/Dialogs/Types.ts
|
|
43
|
+
src/Common/Dialogs/index.ts
|
|
44
|
+
src/Common/DraggableWrapper/DraggableButton.tsx
|
|
45
|
+
src/Common/DraggableWrapper/DraggableWrapper.tsx
|
|
46
|
+
src/Common/Drawer/Drawer.tsx
|
|
47
|
+
src/Common/EmptyState/EmptyState.tsx
|
|
48
|
+
src/Common/EmptyState/GenericEmptyState.tsx
|
|
49
|
+
src/Common/Error.tsx
|
|
50
|
+
src/Common/ErrorScreenNotFound.tsx
|
|
51
|
+
src/Common/Grid/Grid.tsx
|
|
52
|
+
src/Common/Helper.tsx
|
|
53
|
+
src/Common/Hooks/UseClickOutside/UseClickOutside.tsx
|
|
54
|
+
src/Common/Hooks/UseSuperAdmin/UseSuperAdmin.tsx
|
|
55
|
+
src/Common/Hooks/UseWindowSize/UseWindowSize.tsx
|
|
56
|
+
src/Common/ImageTags.Types.ts
|
|
57
|
+
src/Common/ImageTags.tsx
|
|
58
|
+
src/Common/InfoColorBar/InfoColourbar.tsx
|
|
59
|
+
src/Common/Modals/Modal.tsx
|
|
60
|
+
src/Common/Modals/OpaqueModal.tsx
|
|
61
|
+
src/Common/Modals/VisibleModal.tsx
|
|
62
|
+
src/Common/Modals/VisibleModal2.tsx
|
|
63
|
+
src/Common/MultiSelectCustomization.tsx
|
|
64
|
+
src/Common/Policy.Types.ts
|
|
65
|
+
src/Common/PopupMenu.tsx
|
|
66
|
+
src/Common/Progressing.tsx
|
|
67
|
+
src/Common/RJSF/Form.tsx
|
|
68
|
+
src/Common/RJSF/common/FieldRow.tsx
|
|
69
|
+
src/Common/RJSF/config.ts
|
|
70
|
+
src/Common/RJSF/templates/ArrayFieldItemTemplate.tsx
|
|
71
|
+
src/Common/RJSF/templates/ArrayFieldTemplate.tsx
|
|
72
|
+
src/Common/RJSF/templates/BaseInput.tsx
|
|
73
|
+
src/Common/RJSF/templates/ButtonTemplates/AddButton.tsx
|
|
74
|
+
src/Common/RJSF/templates/ButtonTemplates/RemoveButton.tsx
|
|
75
|
+
src/Common/RJSF/templates/ButtonTemplates/SubmitButton.tsx
|
|
76
|
+
src/Common/RJSF/templates/Description.tsx
|
|
77
|
+
src/Common/RJSF/templates/Field.tsx
|
|
78
|
+
src/Common/RJSF/templates/FieldErrorTemplate.tsx
|
|
79
|
+
src/Common/RJSF/templates/ObjectFieldTemplate.tsx
|
|
80
|
+
src/Common/RJSF/templates/TitleField.tsx
|
|
81
|
+
src/Common/RJSF/templates/WrapIfAdditionalTemplate.tsx
|
|
82
|
+
src/Common/RJSF/utils.ts
|
|
83
|
+
src/Common/RJSF/widgets/Checkbox.tsx
|
|
84
|
+
src/Common/RJSF/widgets/Select.tsx
|
|
85
|
+
src/Common/RadioGroup.tsx
|
|
86
|
+
src/Common/RadioGroup/RadioGroup.tsx
|
|
87
|
+
src/Common/Reload.tsx
|
|
88
|
+
src/Common/ResizableTextarea.tsx
|
|
89
|
+
src/Common/Security/ScanVulnerabilitiesTable.tsx
|
|
90
|
+
src/Common/ServerError.ts
|
|
91
|
+
src/Common/TippyCustomized.tsx
|
|
92
|
+
src/Common/ToastBody.tsx
|
|
93
|
+
src/Common/Toggle/Toggle.tsx
|
|
94
|
+
src/Common/Types.ts
|
|
95
|
+
src/custom.d.ts
|
|
96
|
+
src/index.ts
|
package/.eslintrc.js
CHANGED
|
@@ -1,41 +1,109 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
parser: '@typescript-eslint/parser',
|
|
3
|
-
plugins: ['@typescript-eslint'],
|
|
3
|
+
plugins: ['@typescript-eslint', 'react', 'prettier'],
|
|
4
4
|
env: {
|
|
5
|
-
commonjs: true,
|
|
6
5
|
browser: true,
|
|
7
|
-
|
|
6
|
+
es2021: true,
|
|
8
7
|
},
|
|
9
8
|
parserOptions: {
|
|
10
|
-
ecmaVersion:
|
|
9
|
+
ecmaVersion: 2021,
|
|
11
10
|
sourceType: 'module',
|
|
12
11
|
ecmaFeatures: {
|
|
13
12
|
jsx: true,
|
|
14
13
|
},
|
|
15
14
|
project: ['./tsconfig.json'],
|
|
16
15
|
},
|
|
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
|
+
],
|
|
17
28
|
rules: {
|
|
29
|
+
'prettier/prettier': ['error'],
|
|
30
|
+
'linebreak-style': ['error', 'unix'],
|
|
31
|
+
'no-console': 'warn',
|
|
18
32
|
'no-var': 'error',
|
|
19
33
|
'no-duplicate-imports': 'error',
|
|
34
|
+
'no-shadow': 'off',
|
|
35
|
+
'@typescript-eslint/no-shadow': 'warn',
|
|
20
36
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
21
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
22
|
-
'@typescript-eslint/no-use-before-define': 'off',
|
|
23
37
|
'@typescript-eslint/explicit-member-accessibility': 'off',
|
|
24
|
-
|
|
25
|
-
'
|
|
26
|
-
'
|
|
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
|
+
],
|
|
27
89
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
90
|
+
overrides: [
|
|
91
|
+
{
|
|
92
|
+
files: ['*.ts', '*.tsx'],
|
|
93
|
+
rules: {
|
|
94
|
+
'no-undef': 'off',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
35
97
|
],
|
|
36
98
|
settings: {
|
|
37
99
|
react: {
|
|
38
100
|
version: 'detect',
|
|
39
101
|
},
|
|
102
|
+
'import/resolver': {
|
|
103
|
+
node: {
|
|
104
|
+
moduleDirectory: ['src', 'node_modules'],
|
|
105
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
106
|
+
},
|
|
107
|
+
},
|
|
40
108
|
},
|
|
41
109
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Description
|
|
2
|
+
|
|
3
|
+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
|
|
4
|
+
|
|
5
|
+
## Type of change
|
|
6
|
+
|
|
7
|
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
8
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
|
9
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
10
|
+
- [ ] This change requires a documentation update
|
|
11
|
+
|
|
12
|
+
## How Has This Been Tested?
|
|
13
|
+
|
|
14
|
+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
|
|
15
|
+
|
|
16
|
+
- [ ] Test A
|
|
17
|
+
- [ ] Test B
|
|
18
|
+
|
|
19
|
+
## Checklist
|
|
20
|
+
|
|
21
|
+
- [ ] The title of the PR states what changed and the related issues number (used for the release note).
|
|
22
|
+
- [ ] Does this PR require documentation updates?
|
|
23
|
+
- [ ] I've updated documentation as required by this PR.
|
|
24
|
+
- [ ] I have performed a self-review of my own code
|
|
25
|
+
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Common Lib CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- synchronize
|
|
8
|
+
- edited
|
|
9
|
+
- reopened
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
ci:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout repository
|
|
16
|
+
uses: actions/checkout@v3
|
|
17
|
+
|
|
18
|
+
- name: Use Node.js
|
|
19
|
+
uses: actions/setup-node@v3
|
|
20
|
+
with:
|
|
21
|
+
node-version-file: '.nvmrc'
|
|
22
|
+
cache: 'npm'
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: npm ci
|
|
26
|
+
|
|
27
|
+
- name: Check linting issues
|
|
28
|
+
run: npm run lint
|
|
29
|
+
|
|
30
|
+
- name: Build Lib
|
|
31
|
+
run: npm run build-lib
|
|
@@ -11,7 +11,7 @@ jobs:
|
|
|
11
11
|
- uses: actions/checkout@v3
|
|
12
12
|
- uses: actions/setup-node@v3
|
|
13
13
|
with:
|
|
14
|
-
node-version:
|
|
14
|
+
node-version-file: '.nvmrc'
|
|
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:
|
|
28
|
+
node-version-file: '.nvmrc'
|
|
29
29
|
registry-url: https://npm.pkg.github.com/
|
|
30
30
|
- run: npm ci
|
|
31
31
|
- run: npm run build-lib
|
|
@@ -46,4 +46,3 @@ jobs:
|
|
|
46
46
|
- run: npm publish --access public
|
|
47
47
|
env:
|
|
48
48
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
49
|
-
|
package/.lintstagedrc
ADDED
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v16.13.0
|
|
@@ -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
|
|
15
|
+
export declare function setImageTags(request: any, pipelineId: number, artifactId: number): Promise<ResponseType<any>>;
|
|
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
|
|
19
|
+
export declare function fetchChartTemplateVersions(): Promise<ResponseType<any>>;
|
|
20
20
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DebouncedSearchProps } from './Types';
|
|
3
3
|
/**
|
|
4
|
+
* @deprecated Use `SearchBar` component instead.
|
|
5
|
+
*
|
|
4
6
|
* @param onSearch - Callback function to be called on search
|
|
5
7
|
* @param Icon - (Optional) Icon to be shown before the input
|
|
6
8
|
* @param iconClass - (Optional) Class for the icon
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DraggableWrapperProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* TODO: import it as lazy, after it is supported in common
|
|
5
|
+
* 1. If using react select please use menuPlacement='auto'
|
|
6
|
+
* 2. dragSelector will be used to identify the grabbable button that will grab the div to drag
|
|
7
|
+
* 3. parentRef is the reference point from which we will derive the base top:0 ,left: 0 position
|
|
8
|
+
*/
|
|
9
|
+
export default function DraggableWrapper({ children, zIndex, positionVariant, dragSelector, parentRef, boundaryGap, childDivProps, }: DraggableWrapperProps): JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode, RefObject } from 'react';
|
|
2
|
+
export declare enum DraggablePositionVariant {
|
|
3
|
+
PARENT_BOTTOM_CENTER = "PARENT_BOTTOM_CENTER",
|
|
4
|
+
SCREEN_BOTTOM_CENTER = "SCREEN_BOTTOM_CENTER"
|
|
5
|
+
}
|
|
6
|
+
export interface DraggableWrapperProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
zIndex?: number;
|
|
9
|
+
positionVariant?: DraggablePositionVariant;
|
|
10
|
+
/**
|
|
11
|
+
* dragSelector (class - (append with .), id, etc) will be used to identify the grabbable button that will grab the div to drag
|
|
12
|
+
*/
|
|
13
|
+
dragSelector: string;
|
|
14
|
+
parentRef?: RefObject<HTMLDivElement>;
|
|
15
|
+
boundaryGap?: number;
|
|
16
|
+
childDivProps?: HTMLAttributes<HTMLDivElement>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* dragClassName is the class that we feed to Draggable to identify dragging buttons
|
|
20
|
+
*/
|
|
21
|
+
export interface DraggableButtonProps {
|
|
22
|
+
dragClassName: string;
|
|
23
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { GridProps } from './types';
|
|
3
|
-
export default function Grid({ container, spacing, item, xs, containerClass, itemClass, children, }: GridProps): JSX.Element;
|
|
3
|
+
export default function Grid({ container, spacing, item, xs, containerClass, itemClass, children, ...containerDivProps }: GridProps): JSX.Element;
|
package/dist/Common/Helper.d.ts
CHANGED
|
@@ -55,9 +55,10 @@ export declare const customStyles: {
|
|
|
55
55
|
dropdownIndicator: (base: any, state: any) => any;
|
|
56
56
|
};
|
|
57
57
|
export declare const getFilteredChartVersions: (charts: any, selectedChartType: any) => any;
|
|
58
|
-
export declare function getUnlockedJSON(json: any, jsonPathArray: any
|
|
59
|
-
newDocument: any;
|
|
60
|
-
removedPatches: any[];
|
|
61
|
-
};
|
|
58
|
+
export declare function getUnlockedJSON(json: any, jsonPathArray: any): any;
|
|
62
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;
|
|
63
64
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PaginationProps } from './types';
|
|
3
|
+
import './pagination.scss';
|
|
4
|
+
declare const Pagination: ({ size, pageSize, offset, changePage, changePageSize, isPageSizeFix, pageSizeOptions, rootClassName, }: PaginationProps) => JSX.Element;
|
|
5
|
+
export default Pagination;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Pagination } from './Pagination';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface PageSizeOption {
|
|
3
|
+
value: number;
|
|
4
|
+
selected: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface PaginationProps {
|
|
7
|
+
/**
|
|
8
|
+
* number of items
|
|
9
|
+
*/
|
|
10
|
+
size: number;
|
|
11
|
+
/**
|
|
12
|
+
* pageSize
|
|
13
|
+
*/
|
|
14
|
+
pageSize: number;
|
|
15
|
+
offset: number;
|
|
16
|
+
changePage: (pageNo: number) => void;
|
|
17
|
+
changePageSize?: (pageSize: number) => void;
|
|
18
|
+
/**
|
|
19
|
+
* If true will not show page size selector
|
|
20
|
+
*/
|
|
21
|
+
isPageSizeFix?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* If given would show these options in page size selector else [20,40,50] with 20 as selected
|
|
24
|
+
*/
|
|
25
|
+
pageSizeOptions?: PageSizeOption[];
|
|
26
|
+
/**
|
|
27
|
+
* class for wrapper
|
|
28
|
+
*/
|
|
29
|
+
rootClassName?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface Page {
|
|
32
|
+
value: number;
|
|
33
|
+
selected: boolean;
|
|
34
|
+
isVisible: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface CreatePageArrType extends Pick<PaginationProps, 'size' | 'pageSize'> {
|
|
37
|
+
selectedPageNo: number;
|
|
38
|
+
}
|
|
39
|
+
export interface PageSizeSelectorProps extends Pick<PaginationProps, 'pageSizeOptions' | 'pageSize' | 'changePageSize'> {
|
|
40
|
+
}
|
|
41
|
+
export interface PageSizeItemsProps extends Pick<PageSizeSelectorProps, 'changePageSize'> {
|
|
42
|
+
optionValue: PageSizeOption['value'];
|
|
43
|
+
options: PageSizeOption[];
|
|
44
|
+
setOptions: React.Dispatch<React.SetStateAction<PageSizeOption[]>>;
|
|
45
|
+
handleCloseDropdown: () => void;
|
|
46
|
+
}
|
|
47
|
+
export interface PageValueItemProps {
|
|
48
|
+
value: PageSizeOption['value'];
|
|
49
|
+
isSelected: PageSizeOption['selected'];
|
|
50
|
+
selectPage: (selectedPageNo: number) => void;
|
|
51
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CreatePageArrType, Page, PageSizeOption } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns an array of pages numbers and whether they are selected, visible or not
|
|
4
|
+
*/
|
|
5
|
+
export declare const createPageArr: ({ size, pageSize, selectedPageNo }: CreatePageArrType) => Page[];
|
|
6
|
+
export declare const getDefaultPageValueOptions: (pageSizeOptions: PageSizeOption[]) => PageSizeOption[];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SearchBarProps } from './types';
|
|
3
|
+
import './searchBar.scss';
|
|
4
|
+
/**
|
|
5
|
+
* Generic search input component with support for enter based and debounced search
|
|
6
|
+
* Note: The component is uncontrolled
|
|
7
|
+
*
|
|
8
|
+
* @example Usage with default debounced search
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <SearchBar handleSearchChange={triggerSearchApi} shouldDebounce />
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @example Initial search text
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <SearchBar initialSearchText="Keyword" />
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @example Custom width
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <SearchBar containerClassName="w-300" />
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example Trigger search on enter key press
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <SearchBar handleEnter={triggerSearchApi} />
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example Custom timeout for debounced search
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <SearchBar handleSearchChange={triggerSearchApi} shouldDebounce debounceTimeout={500} />
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example Placeholder for the search
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <SearchBar inputProps={{ placeholder: 'Enter search text' }} />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare const SearchBar: ({ initialSearchText, handleSearchChange, handleEnter, inputProps, containerClassName, shouldDebounce, debounceTimeout, }: SearchBarProps) => JSX.Element;
|
|
39
|
+
export default SearchBar;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
export interface SearchBarProps {
|
|
3
|
+
/**
|
|
4
|
+
* Initial search text
|
|
5
|
+
*
|
|
6
|
+
* @default ''
|
|
7
|
+
*/
|
|
8
|
+
initialSearchText?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Search handler for the search input
|
|
11
|
+
*/
|
|
12
|
+
handleSearchChange?: (searchText: string) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Enter event handler for the search input
|
|
15
|
+
*/
|
|
16
|
+
handleEnter?: (searchText: string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Input props for the search input
|
|
19
|
+
*/
|
|
20
|
+
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
21
|
+
/**
|
|
22
|
+
* Class name for the container; can be used for handling width
|
|
23
|
+
*/
|
|
24
|
+
containerClassName?: string;
|
|
25
|
+
/**
|
|
26
|
+
* If true, the change handler would be triggered with debounce
|
|
27
|
+
*
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
shouldDebounce?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Timeout for the debounce handler to be triggered
|
|
33
|
+
*/
|
|
34
|
+
debounceTimeout?: number;
|
|
35
|
+
}
|
package/dist/Common/Types.d.ts
CHANGED
|
@@ -2,10 +2,23 @@ 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
|
-
|
|
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> {
|
|
6
19
|
code: number;
|
|
7
20
|
status: string;
|
|
8
|
-
result?:
|
|
21
|
+
result?: T;
|
|
9
22
|
errors?: any;
|
|
10
23
|
}
|
|
11
24
|
export interface APIOptions {
|
|
@@ -326,6 +339,7 @@ export interface CommonNodeAttr {
|
|
|
326
339
|
};
|
|
327
340
|
appReleaseTagNames?: string[];
|
|
328
341
|
tagsEditable?: boolean;
|
|
342
|
+
isGitOpsRepoNotConfigured?: boolean;
|
|
329
343
|
deploymentAppCreated?: boolean;
|
|
330
344
|
isLast?: boolean;
|
|
331
345
|
downstreamEnvironments?: DownstreamNodesEnvironmentsType[];
|
package/dist/Common/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ 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';
|
|
29
30
|
export { default as Toggle } from './Toggle/Toggle';
|
|
30
31
|
export { default as ScanVulnerabilitiesTable } from './Security/ScanVulnerabilitiesTable';
|
|
31
32
|
export { default as StyledRadioGroup } from './RadioGroup/RadioGroup';
|
|
@@ -45,3 +46,5 @@ export * from './DevtronProgressing';
|
|
|
45
46
|
export { default as ChartVersionAndTypeSelector } from './ChartVersionAndTypeSelector';
|
|
46
47
|
export * from './AddCDButton';
|
|
47
48
|
export * from './CustomInput';
|
|
49
|
+
export * from './DraggableWrapper';
|
|
50
|
+
export * from './Pagination';
|