@devtron-labs/devtron-fe-common-lib 0.0.40-beta-15 → 0.0.41
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/DebouncedSearch/DebouncedSearch.d.ts +1 -1
- package/dist/Common/DebouncedSearch/Types.d.ts +0 -1
- package/dist/Common/Dialogs/Types.d.ts +0 -1
- package/dist/Common/Types.d.ts +3 -1
- package/dist/index.js +9 -18
- package/package.json +1 -1
- package/src/Common/Common.service.ts +3 -0
- package/src/Common/DebouncedSearch/DebouncedSearch.tsx +2 -3
- package/src/Common/DebouncedSearch/Types.ts +0 -1
- package/src/Common/Dialogs/DeleteDialog.tsx +2 -18
- package/src/Common/Dialogs/Types.ts +0 -1
- package/src/Common/Types.ts +3 -1
|
@@ -12,4 +12,4 @@ import { DebouncedSearchProps } from './Types';
|
|
|
12
12
|
* @param clearSearch - (Optional) To clear the search text
|
|
13
13
|
* @param showClearIcon - (Optional) To show the clear icon default value is true
|
|
14
14
|
*/
|
|
15
|
-
export default function DebouncedSearch({ onSearch, Icon, children, placeholder, containerClass, iconClass, inputClass, debounceTimeout, clearSearch, showClearIcon,
|
|
15
|
+
export default function DebouncedSearch({ onSearch, Icon, children, placeholder, containerClass, iconClass, inputClass, debounceTimeout, clearSearch, showClearIcon, }: DebouncedSearchProps): JSX.Element;
|
package/dist/Common/Types.d.ts
CHANGED
|
@@ -231,6 +231,9 @@ export interface CDMaterialType {
|
|
|
231
231
|
imageReleaseTags?: ReleaseTag[];
|
|
232
232
|
artifactStatus?: string;
|
|
233
233
|
filterState: FilterStates;
|
|
234
|
+
registryType?: string;
|
|
235
|
+
imagePath?: string;
|
|
236
|
+
registryName?: string;
|
|
234
237
|
scanToolId?: number;
|
|
235
238
|
appliedFiltersTimestamp?: string;
|
|
236
239
|
appliedFilters?: FilterConditionsListType[];
|
|
@@ -281,7 +284,6 @@ export interface CommonNodeAttr {
|
|
|
281
284
|
colorCode?: string;
|
|
282
285
|
isExternalCI?: boolean;
|
|
283
286
|
isLinkedCI?: boolean;
|
|
284
|
-
isLinkedCD?: boolean;
|
|
285
287
|
isJobCI?: boolean;
|
|
286
288
|
environmentName?: string;
|
|
287
289
|
environmentId?: number;
|
package/dist/index.js
CHANGED
|
@@ -15098,19 +15098,7 @@ ConfirmationDialog.ButtonGroup = ButtonGroup;
|
|
|
15098
15098
|
var warn = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2248%22%20height%3D%2248%22%20viewBox%3D%220%200%2048%2048%22%3E%20%20%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%200h48v48H0z%22%2F%3E%20%20%20%20%20%20%20%20%3Cg%20fill%3D%22%23FFEBEB%22%20stroke%3D%22%23F33E3E%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M7%2024h24v17a4%204%200%200%201-4%204H11a4%204%200%200%201-4-4V24z%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20stroke-linecap%3D%22round%22%20d%3D%22M19%2029.5v10M24%2029.5v10M14%2029.5v10%22%2F%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3Cpath%20stroke%3D%22%23F33E3E%22%20stroke-dasharray%3D%2217%2C3%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22M42%2010a3%203%200%200%201%200%206H31M38%2023a3%203%200%200%200-3-3h-8%22%2F%3E%20%20%20%20%20%20%20%20%3Cg%20stroke%3D%22%23F33E3E%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20transform%3D%22rotate%28-10%2036.29%20-8.86%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20width%3D%2230%22%20height%3D%225%22%20y%3D%226%22%20fill%3D%22%23FFEBEB%22%20rx%3D%221%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M11%200h8a2%202%200%200%201%202%202v4H9V2a2%202%200%200%201%202-2z%22%2F%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";
|
|
15099
15099
|
|
|
15100
15100
|
var DeleteDialog = function (props) {
|
|
15101
|
-
|
|
15102
|
-
if (props.shouldStopPropagation) {
|
|
15103
|
-
e.stopPropagation();
|
|
15104
|
-
}
|
|
15105
|
-
props.delete();
|
|
15106
|
-
};
|
|
15107
|
-
var handleModalClose = function (e) {
|
|
15108
|
-
if (props.shouldStopPropagation) {
|
|
15109
|
-
e.stopPropagation();
|
|
15110
|
-
}
|
|
15111
|
-
props.closeDelete();
|
|
15112
|
-
};
|
|
15113
|
-
return (jsxRuntime.jsxs(ConfirmationDialog, __assign({ className: "confirmation-dialog__body--w-400" }, { children: [jsxRuntime.jsx(ConfirmationDialog.Icon, { src: warn }), jsxRuntime.jsx(ConfirmationDialog.Body, __assign({ title: props.title }, { children: jsxRuntime.jsxs("div", __assign({ className: "fs-13 cn-7 lh-1-54 w-100" }, { children: [props.description ? props.description : null, props.children] })) })), jsxRuntime.jsx(ConfirmationDialog.ButtonGroup, { children: jsxRuntime.jsxs("div", __assign({ className: "flex right" }, { children: [jsxRuntime.jsx("button", __assign({ type: "button", className: "cta cancel cta-cd-delete-modal ml-16", onClick: handleModalClose, disabled: props.apiCallInProgress, "data-testid": "dialog-cancel" }, { children: "Cancel" })), jsxRuntime.jsx("button", __assign({ type: "button", className: "cta delete cta-cd-delete-modal ml-16", onClick: handleDelete, disabled: props.apiCallInProgress, "data-testid": "dialog-delete" }, { children: props.apiCallInProgress ? (jsxRuntime.jsx(Progressing, {})) : ("".concat(props.deletePrefix || '').concat(props.buttonPrimaryText ? props.buttonPrimaryText : 'Delete').concat(props.deletePostfix || '')) }))] })) })] })));
|
|
15101
|
+
return (jsxRuntime.jsxs(ConfirmationDialog, __assign({ className: "confirmation-dialog__body--w-400" }, { children: [jsxRuntime.jsx(ConfirmationDialog.Icon, { src: warn }), jsxRuntime.jsx(ConfirmationDialog.Body, __assign({ title: props.title }, { children: jsxRuntime.jsxs("div", __assign({ className: "fs-13 cn-7 lh-1-54 w-100" }, { children: [props.description ? props.description : null, props.children] })) })), jsxRuntime.jsx(ConfirmationDialog.ButtonGroup, { children: jsxRuntime.jsxs("div", __assign({ className: "flex right" }, { children: [jsxRuntime.jsx("button", __assign({ type: "button", className: "cta cancel cta-cd-delete-modal ml-16", onClick: props.closeDelete, disabled: props.apiCallInProgress, "data-testid": "dialog-cancel" }, { children: "Cancel" })), jsxRuntime.jsx("button", __assign({ type: "button", className: "cta delete cta-cd-delete-modal ml-16", onClick: function () { return props.delete(); }, disabled: props.apiCallInProgress, "data-testid": "dialog-delete" }, { children: props.apiCallInProgress ? (jsxRuntime.jsx(Progressing, {})) : ("".concat(props.deletePrefix || '').concat(props.buttonPrimaryText ? props.buttonPrimaryText : 'Delete').concat(props.deletePostfix || '')) }))] })) })] })));
|
|
15114
15102
|
};
|
|
15115
15103
|
function DeleteDialogDescription(props) {
|
|
15116
15104
|
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: props.children });
|
|
@@ -22752,7 +22740,7 @@ var cdMaterialListModal = function (artifacts, offset, artifactId, artifactStatu
|
|
|
22752
22740
|
var startIndex = offset;
|
|
22753
22741
|
var isImageMarked = false;
|
|
22754
22742
|
var materials = artifacts.map(function (material, index) {
|
|
22755
|
-
var _a, _b, _c, _d, _e, _f;
|
|
22743
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
22756
22744
|
var artifactStatusValue = '';
|
|
22757
22745
|
var filterState = (_a = material.filterState) !== null && _a !== void 0 ? _a : exports.FilterStates.ALLOWED;
|
|
22758
22746
|
if (artifactId && artifactStatus && material.id === artifactId) {
|
|
@@ -22818,6 +22806,9 @@ var cdMaterialListModal = function (artifacts, offset, artifactId, artifactStatu
|
|
|
22818
22806
|
appliedFiltersState: (_d = material.appliedFiltersState) !== null && _d !== void 0 ? _d : exports.FilterStates.ALLOWED,
|
|
22819
22807
|
createdTime: (_e = material.createdTime) !== null && _e !== void 0 ? _e : '',
|
|
22820
22808
|
dataSource: (_f = material.data_source) !== null && _f !== void 0 ? _f : '',
|
|
22809
|
+
registryType: (_g = material.registryType) !== null && _g !== void 0 ? _g : '',
|
|
22810
|
+
imagePath: (_h = material.image) !== null && _h !== void 0 ? _h : '',
|
|
22811
|
+
registryName: (_j = material.registryName) !== null && _j !== void 0 ? _j : '',
|
|
22821
22812
|
};
|
|
22822
22813
|
});
|
|
22823
22814
|
return materials;
|
|
@@ -23647,8 +23638,8 @@ var SvgIcErrorCross = function SvgIcErrorCross(props) {
|
|
|
23647
23638
|
* @param showClearIcon - (Optional) To show the clear icon default value is true
|
|
23648
23639
|
*/
|
|
23649
23640
|
function DebouncedSearch(_a) {
|
|
23650
|
-
var onSearch = _a.onSearch, Icon = _a.Icon, children = _a.children, placeholder = _a.placeholder, _b = _a.containerClass, containerClass = _b === void 0 ? '' : _b, _c = _a.iconClass, iconClass = _c === void 0 ? '' : _c, _d = _a.inputClass, inputClass = _d === void 0 ? '' : _d, _e = _a.debounceTimeout, debounceTimeout = _e === void 0 ? 500 : _e, clearSearch = _a.clearSearch, _f = _a.showClearIcon, showClearIcon = _f === void 0 ? true : _f
|
|
23651
|
-
var
|
|
23641
|
+
var onSearch = _a.onSearch, Icon = _a.Icon, children = _a.children, placeholder = _a.placeholder, _b = _a.containerClass, containerClass = _b === void 0 ? '' : _b, _c = _a.iconClass, iconClass = _c === void 0 ? '' : _c, _d = _a.inputClass, inputClass = _d === void 0 ? '' : _d, _e = _a.debounceTimeout, debounceTimeout = _e === void 0 ? 500 : _e, clearSearch = _a.clearSearch, _f = _a.showClearIcon, showClearIcon = _f === void 0 ? true : _f;
|
|
23642
|
+
var _g = __read(React.useState(''), 2), searchText = _g[0], setSearchText = _g[1];
|
|
23652
23643
|
React.useEffect(function () {
|
|
23653
23644
|
setSearchText('');
|
|
23654
23645
|
}, [clearSearch]);
|
|
@@ -23658,8 +23649,8 @@ function DebouncedSearch(_a) {
|
|
|
23658
23649
|
var handleClearSearch = function () {
|
|
23659
23650
|
setSearchText('');
|
|
23660
23651
|
};
|
|
23661
|
-
useDebouncedEffect(function () { return onSearch(searchText); }, debounceTimeout, [searchText]);
|
|
23662
|
-
return (jsxRuntime.jsxs("div", __assign({ className: containerClass }, { children: [Icon && jsxRuntime.jsx(Icon, { className: iconClass }), jsxRuntime.jsx("input", { type: "text", className: inputClass, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Search', value: searchText, onChange: handleSearchTextChange, autoFocus:
|
|
23652
|
+
useDebouncedEffect(function () { return onSearch(searchText); }, debounceTimeout, [searchText, onSearch]);
|
|
23653
|
+
return (jsxRuntime.jsxs("div", __assign({ className: containerClass }, { children: [Icon && jsxRuntime.jsx(Icon, { className: iconClass }), jsxRuntime.jsx("input", { type: "text", className: inputClass, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Search', value: searchText, onChange: handleSearchTextChange, autoFocus: true, "data-testid": "debounced-search" }), showClearIcon && !!searchText && (jsxRuntime.jsx("button", __assign({ type: "button", className: "dc__outline-none-imp dc__no-border p-0 bc-n50 flex", onClick: handleClearSearch, "data-testid": "clear-search" }, { children: jsxRuntime.jsx(SvgIcErrorCross, { className: "icon-dim-20 icon-n6" }) }))), children] })));
|
|
23663
23654
|
}
|
|
23664
23655
|
|
|
23665
23656
|
// This is meant to be a reusable component that will provide a grid like dynamic layout where xs is the number of columns out of 12 that the item will take up
|
package/package.json
CHANGED
|
@@ -162,6 +162,9 @@ const cdMaterialListModal = (artifacts: any[], offset: number, artifactId?: numb
|
|
|
162
162
|
appliedFiltersState: material.appliedFiltersState ?? FilterStates.ALLOWED,
|
|
163
163
|
createdTime: material.createdTime ?? '',
|
|
164
164
|
dataSource: material.data_source ?? '',
|
|
165
|
+
registryType: material.registryType ?? '',
|
|
166
|
+
imagePath: material.image ?? '',
|
|
167
|
+
registryName: material.registryName ?? '',
|
|
165
168
|
}
|
|
166
169
|
})
|
|
167
170
|
return materials
|
|
@@ -26,7 +26,6 @@ export default function DebouncedSearch({
|
|
|
26
26
|
debounceTimeout = 500,
|
|
27
27
|
clearSearch,
|
|
28
28
|
showClearIcon = true,
|
|
29
|
-
autoFocus = true,
|
|
30
29
|
}: DebouncedSearchProps) {
|
|
31
30
|
const [searchText, setSearchText] = useState<string>('')
|
|
32
31
|
|
|
@@ -42,7 +41,7 @@ export default function DebouncedSearch({
|
|
|
42
41
|
setSearchText('')
|
|
43
42
|
}
|
|
44
43
|
|
|
45
|
-
useDebouncedEffect(() => onSearch(searchText), debounceTimeout, [searchText])
|
|
44
|
+
useDebouncedEffect(() => onSearch(searchText), debounceTimeout, [searchText, onSearch])
|
|
46
45
|
|
|
47
46
|
return (
|
|
48
47
|
<div className={containerClass}>
|
|
@@ -54,7 +53,7 @@ export default function DebouncedSearch({
|
|
|
54
53
|
placeholder={placeholder ?? 'Search'}
|
|
55
54
|
value={searchText}
|
|
56
55
|
onChange={handleSearchTextChange}
|
|
57
|
-
autoFocus
|
|
56
|
+
autoFocus
|
|
58
57
|
data-testid="debounced-search"
|
|
59
58
|
/>
|
|
60
59
|
|
|
@@ -5,22 +5,6 @@ import ConfirmationDialog from './ConfirmationDialog'
|
|
|
5
5
|
import { DeleteDialogProps } from './Types'
|
|
6
6
|
|
|
7
7
|
export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.FC<any> } = function (props) {
|
|
8
|
-
const handleDelete = (e: React.MouseEvent) => {
|
|
9
|
-
if (props.shouldStopPropagation) {
|
|
10
|
-
e.stopPropagation()
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
props.delete()
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const handleModalClose = (e: React.MouseEvent) => {
|
|
17
|
-
if (props.shouldStopPropagation) {
|
|
18
|
-
e.stopPropagation()
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
props.closeDelete()
|
|
22
|
-
}
|
|
23
|
-
|
|
24
8
|
return (
|
|
25
9
|
<ConfirmationDialog className="confirmation-dialog__body--w-400">
|
|
26
10
|
<ConfirmationDialog.Icon src={warn} />
|
|
@@ -35,7 +19,7 @@ export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.F
|
|
|
35
19
|
<button
|
|
36
20
|
type="button"
|
|
37
21
|
className="cta cancel cta-cd-delete-modal ml-16"
|
|
38
|
-
onClick={
|
|
22
|
+
onClick={props.closeDelete}
|
|
39
23
|
disabled={props.apiCallInProgress}
|
|
40
24
|
data-testid="dialog-cancel"
|
|
41
25
|
>
|
|
@@ -44,7 +28,7 @@ export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.F
|
|
|
44
28
|
<button
|
|
45
29
|
type="button"
|
|
46
30
|
className="cta delete cta-cd-delete-modal ml-16"
|
|
47
|
-
onClick={
|
|
31
|
+
onClick={() => props.delete()}
|
|
48
32
|
disabled={props.apiCallInProgress}
|
|
49
33
|
data-testid="dialog-delete"
|
|
50
34
|
>
|
package/src/Common/Types.ts
CHANGED
|
@@ -256,6 +256,9 @@ export interface CDMaterialType {
|
|
|
256
256
|
imageReleaseTags?: ReleaseTag[]
|
|
257
257
|
artifactStatus?: string
|
|
258
258
|
filterState: FilterStates
|
|
259
|
+
registryType?: string;
|
|
260
|
+
imagePath?: string
|
|
261
|
+
registryName?: string
|
|
259
262
|
// Not even coming from API but required in CDMaterials for Security which makes its own api call but stores data in CDMaterials
|
|
260
263
|
scanToolId?: number
|
|
261
264
|
appliedFiltersTimestamp?: string
|
|
@@ -312,7 +315,6 @@ export interface CommonNodeAttr {
|
|
|
312
315
|
colorCode?: string
|
|
313
316
|
isExternalCI?: boolean
|
|
314
317
|
isLinkedCI?: boolean
|
|
315
|
-
isLinkedCD?: boolean
|
|
316
318
|
isJobCI?: boolean // used for Job type CI in Devtron Apps
|
|
317
319
|
environmentName?: string //used for CDs
|
|
318
320
|
environmentId?: number
|