@devtron-labs/devtron-fe-common-lib 0.0.58-beta-5 → 0.0.58-beta-6
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/dist/Common/Constants.d.ts +14 -1
- package/dist/Common/Hooks/index.d.ts +1 -0
- package/dist/Common/Hooks/useUrlFilters/constants.d.ts +8 -0
- package/dist/Common/Hooks/useUrlFilters/index.d.ts +2 -0
- package/dist/Common/Hooks/useUrlFilters/types.d.ts +6 -0
- package/dist/Common/Hooks/useUrlFilters/useUrlFilters.d.ts +32 -0
- package/dist/Common/SortableTableHeaderCell/SortableTableHeaderCell.d.ts +18 -0
- package/dist/Common/SortableTableHeaderCell/index.d.ts +2 -0
- package/dist/Common/SortableTableHeaderCell/types.d.ts +8 -0
- package/dist/Common/Types.d.ts +2 -3
- package/dist/Common/index.d.ts +1 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.js +339 -1124
- package/package.json +1 -1
- package/src/Assets/Icon/ic-arrow-up-down.svg +3 -0
- package/src/Assets/Icon/ic-sort-arrow-down.svg +3 -0
- package/src/Common/BreadCrumb/Types.ts +1 -0
- package/src/Common/Checkbox.tsx +0 -1
- package/src/Common/Constants.ts +18 -3
- package/src/Common/CustomInput/CustomInput.tsx +1 -2
- package/src/Common/DraggableWrapper/DraggableWrapper.tsx +1 -3
- package/src/Common/Hooks/index.ts +1 -0
- package/src/Common/Hooks/useUrlFilters/constants.ts +9 -0
- package/src/Common/Hooks/useUrlFilters/index.ts +2 -0
- package/src/Common/Hooks/useUrlFilters/types.ts +6 -0
- package/src/Common/Hooks/useUrlFilters/useUrlFilters.ts +120 -0
- package/src/Common/RJSF/utils.ts +0 -3
- package/src/Common/SearchBar/SearchBar.component.tsx +13 -26
- package/src/Common/SearchBar/searchBar.scss +1 -1
- package/src/Common/SortableTableHeaderCell/SortableTableHeaderCell.tsx +44 -0
- package/src/Common/SortableTableHeaderCell/index.ts +2 -0
- package/src/Common/SortableTableHeaderCell/types.ts +9 -0
- package/src/Common/Types.ts +1 -2
- package/src/Common/index.ts +1 -0
- package/src/index.ts +1 -3
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.d.ts +0 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.d.ts +0 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.d.ts +0 -7
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.d.ts +0 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.d.ts +0 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/Descriptor.d.ts +0 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/Footer.d.ts +0 -4
- package/dist/Pages/GlobalConfigurations/BuildInfra/constants.d.ts +0 -48
- package/dist/Pages/GlobalConfigurations/BuildInfra/index.d.ts +0 -7
- package/dist/Pages/GlobalConfigurations/BuildInfra/services.d.ts +0 -13
- package/dist/Pages/GlobalConfigurations/BuildInfra/types.d.ts +0 -281
- package/dist/Pages/GlobalConfigurations/BuildInfra/utils.d.ts +0 -12
- package/dist/Pages/GlobalConfigurations/index.d.ts +0 -1
- package/dist/Pages/index.d.ts +0 -1
- package/dist/Shared/Components/APIResponseHandler/APIResponseHandler.d.ts +0 -4
- package/dist/Shared/Components/APIResponseHandler/index.d.ts +0 -2
- package/dist/Shared/Components/APIResponseHandler/types.d.ts +0 -37
- package/dist/Shared/Components/ReactSelect/index.d.ts +0 -1
- package/dist/Shared/Components/ReactSelect/utils.d.ts +0 -12
- package/dist/Shared/Components/index.d.ts +0 -2
- package/dist/Shared/index.d.ts +0 -2
- package/dist/Shared/validations.d.ts +0 -7
- package/src/Assets/Icon/ic-cpu.svg +0 -4
- package/src/Assets/Icon/ic-memory.svg +0 -3
- package/src/Assets/Icon/ic-timer.svg +0 -3
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.tsx +0 -121
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.tsx +0 -44
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.tsx +0 -99
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.tsx +0 -55
- package/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.tsx +0 -32
- package/src/Pages/GlobalConfigurations/BuildInfra/Descriptor.tsx +0 -38
- package/src/Pages/GlobalConfigurations/BuildInfra/Footer.tsx +0 -45
- package/src/Pages/GlobalConfigurations/BuildInfra/Readme.md +0 -4
- package/src/Pages/GlobalConfigurations/BuildInfra/constants.tsx +0 -137
- package/src/Pages/GlobalConfigurations/BuildInfra/index.ts +0 -7
- package/src/Pages/GlobalConfigurations/BuildInfra/services.tsx +0 -183
- package/src/Pages/GlobalConfigurations/BuildInfra/types.tsx +0 -334
- package/src/Pages/GlobalConfigurations/BuildInfra/utils.tsx +0 -490
- package/src/Pages/GlobalConfigurations/index.ts +0 -1
- package/src/Pages/index.ts +0 -1
- package/src/Shared/Components/APIResponseHandler/APIResponseHandler.tsx +0 -39
- package/src/Shared/Components/APIResponseHandler/index.ts +0 -2
- package/src/Shared/Components/APIResponseHandler/types.tsx +0 -39
- package/src/Shared/Components/ReactSelect/index.ts +0 -1
- package/src/Shared/Components/ReactSelect/utils.tsx +0 -97
- package/src/Shared/Components/index.ts +0 -2
- package/src/Shared/index.ts +0 -2
- package/src/Shared/validations.tsx +0 -72
|
@@ -21,7 +21,6 @@ export declare const ROUTES: {
|
|
|
21
21
|
IMAGE_TAGGING: string;
|
|
22
22
|
CD_MATERIAL_GET: string;
|
|
23
23
|
DEPLOYMENT_TEMPLATE_LIST: string;
|
|
24
|
-
INFRA_CONFIG_PROFILE: string;
|
|
25
24
|
};
|
|
26
25
|
export declare enum KEY_VALUE {
|
|
27
26
|
KEY = "key",
|
|
@@ -74,3 +73,17 @@ export declare const SELECTED_APPROVAL_TAB_STATE: {
|
|
|
74
73
|
APPROVAL: string;
|
|
75
74
|
PENDING: string;
|
|
76
75
|
};
|
|
76
|
+
export declare enum SortingOrder {
|
|
77
|
+
/**
|
|
78
|
+
* Ascending order
|
|
79
|
+
*/
|
|
80
|
+
ASC = "ASC",
|
|
81
|
+
/**
|
|
82
|
+
* Descending order
|
|
83
|
+
*/
|
|
84
|
+
DESC = "DESC"
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Base page size for pagination
|
|
88
|
+
*/
|
|
89
|
+
export declare const DEFAULT_BASE_PAGE_SIZE = 20;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const DEFAULT_PAGE_NUMBER = 1;
|
|
2
|
+
export declare const URL_FILTER_KEYS: {
|
|
3
|
+
readonly PAGE_SIZE: "pageSize";
|
|
4
|
+
readonly PAGE_NUMBER: "pageNumber";
|
|
5
|
+
readonly SEARCH_KEY: "searchKey";
|
|
6
|
+
readonly SORT_BY: "sortBy";
|
|
7
|
+
readonly SORT_ORDER: "sortOrder";
|
|
8
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SortingOrder } from '../../Constants';
|
|
2
|
+
import { UseUrlFiltersProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Generic hook for implementing URL based filters.
|
|
5
|
+
* eg: pagination, search, sort.
|
|
6
|
+
*
|
|
7
|
+
* The exposed handlers can be consumed directly without the need for explicit state management
|
|
8
|
+
*
|
|
9
|
+
* @example Default Usage:
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const { pageSize, changePage, ...rest } = useUrlFilters()
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @example Usage with custom type for sort keys and initial sort key:
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const { sortBy, sortOrder } = useUrlFilters<'email' | 'name'>({ initialSortKey: 'email' })
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
declare const useUrlFilters: <T = string>({ initialSortKey }?: UseUrlFiltersProps<T>) => {
|
|
21
|
+
pageSize: number;
|
|
22
|
+
changePage: (page: number) => void;
|
|
23
|
+
changePageSize: (_pageSize: number) => void;
|
|
24
|
+
searchKey: string;
|
|
25
|
+
handleSearch: (searchTerm: string) => void;
|
|
26
|
+
offset: number;
|
|
27
|
+
sortBy: T;
|
|
28
|
+
sortOrder: SortingOrder;
|
|
29
|
+
handleSorting: (_sortBy: T) => void;
|
|
30
|
+
clearFilters: () => void;
|
|
31
|
+
};
|
|
32
|
+
export default useUrlFilters;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SortableTableHeaderCellProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Reusable component for the table header cell with support for sorting icons
|
|
5
|
+
*
|
|
6
|
+
* @example Usage
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <SortableTableHeaderCell
|
|
9
|
+
* isSorted={currentSortedCell === 'cell'}
|
|
10
|
+
* triggerSorting={() => {}}
|
|
11
|
+
* sortOrder={SortingOrder.ASC}
|
|
12
|
+
* title="Header Cell"
|
|
13
|
+
* disabled={isDisabled}
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
declare const SortableTableHeaderCell: ({ isSorted, triggerSorting, sortOrder, title, disabled, }: SortableTableHeaderCellProps) => JSX.Element;
|
|
18
|
+
export default SortableTableHeaderCell;
|
package/dist/Common/Types.d.ts
CHANGED
|
@@ -44,13 +44,12 @@ export interface Teams {
|
|
|
44
44
|
}
|
|
45
45
|
export declare enum CHECKBOX_VALUE {
|
|
46
46
|
CHECKED = "CHECKED",
|
|
47
|
-
INTERMEDIATE = "INTERMEDIATE"
|
|
48
|
-
BULK_CHECKED = "BULK_CHECKED"
|
|
47
|
+
INTERMEDIATE = "INTERMEDIATE"
|
|
49
48
|
}
|
|
50
49
|
export interface CheckboxProps {
|
|
51
50
|
onChange: (event: any) => void;
|
|
52
51
|
isChecked: boolean;
|
|
53
|
-
value: 'CHECKED' | 'INTERMEDIATE'
|
|
52
|
+
value: 'CHECKED' | 'INTERMEDIATE';
|
|
54
53
|
disabled?: boolean;
|
|
55
54
|
tabIndex?: number;
|
|
56
55
|
rootClassName?: string;
|
package/dist/Common/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export * from './Checkbox';
|
|
|
27
27
|
export { default as EmptyState } from './EmptyState/EmptyState';
|
|
28
28
|
export { default as GenericEmptyState } from './EmptyState/GenericEmptyState';
|
|
29
29
|
export * from './SearchBar';
|
|
30
|
+
export * from './SortableTableHeaderCell';
|
|
30
31
|
export { default as Toggle } from './Toggle/Toggle';
|
|
31
32
|
export { default as ScanVulnerabilitiesTable } from './Security/ScanVulnerabilitiesTable';
|
|
32
33
|
export { default as StyledRadioGroup } from './RadioGroup/RadioGroup';
|
package/dist/index.d.ts
CHANGED