@devtron-labs/devtron-fe-common-lib 0.0.40-beta-10 → 0.0.40-beta-11

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.
@@ -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, }: DebouncedSearchProps): JSX.Element;
15
+ export default function DebouncedSearch({ onSearch, Icon, children, placeholder, containerClass, iconClass, inputClass, debounceTimeout, clearSearch, showClearIcon, autoFocus, }: DebouncedSearchProps): JSX.Element;
@@ -10,4 +10,5 @@ export interface DebouncedSearchProps {
10
10
  debounceTimeout?: number;
11
11
  clearSearch?: boolean;
12
12
  showClearIcon?: boolean;
13
+ autoFocus?: boolean;
13
14
  }
@@ -231,9 +231,6 @@ export interface CDMaterialType {
231
231
  imageReleaseTags?: ReleaseTag[];
232
232
  artifactStatus?: string;
233
233
  filterState: FilterStates;
234
- registryType?: string;
235
- imagePath?: string;
236
- registryName?: string;
237
234
  scanToolId?: number;
238
235
  appliedFiltersTimestamp?: string;
239
236
  appliedFilters?: FilterConditionsListType[];
@@ -284,6 +281,7 @@ export interface CommonNodeAttr {
284
281
  colorCode?: string;
285
282
  isExternalCI?: boolean;
286
283
  isLinkedCI?: boolean;
284
+ isLinkedCD?: boolean;
287
285
  isJobCI?: boolean;
288
286
  environmentName?: string;
289
287
  environmentId?: number;
package/dist/index.js CHANGED
@@ -22740,7 +22740,7 @@ var cdMaterialListModal = function (artifacts, offset, artifactId, artifactStatu
22740
22740
  var startIndex = offset;
22741
22741
  var isImageMarked = false;
22742
22742
  var materials = artifacts.map(function (material, index) {
22743
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
22743
+ var _a, _b, _c, _d, _e, _f;
22744
22744
  var artifactStatusValue = '';
22745
22745
  var filterState = (_a = material.filterState) !== null && _a !== void 0 ? _a : exports.FilterStates.ALLOWED;
22746
22746
  if (artifactId && artifactStatus && material.id === artifactId) {
@@ -22806,9 +22806,6 @@ var cdMaterialListModal = function (artifacts, offset, artifactId, artifactStatu
22806
22806
  appliedFiltersState: (_d = material.appliedFiltersState) !== null && _d !== void 0 ? _d : exports.FilterStates.ALLOWED,
22807
22807
  createdTime: (_e = material.createdTime) !== null && _e !== void 0 ? _e : '',
22808
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 : '',
22812
22809
  };
22813
22810
  });
22814
22811
  return materials;
@@ -23638,8 +23635,8 @@ var SvgIcErrorCross = function SvgIcErrorCross(props) {
23638
23635
  * @param showClearIcon - (Optional) To show the clear icon default value is true
23639
23636
  */
23640
23637
  function DebouncedSearch(_a) {
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];
23638
+ 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, _g = _a.autoFocus, autoFocus = _g === void 0 ? true : _g;
23639
+ var _h = __read(React.useState(''), 2), searchText = _h[0], setSearchText = _h[1];
23643
23640
  React.useEffect(function () {
23644
23641
  setSearchText('');
23645
23642
  }, [clearSearch]);
@@ -23649,8 +23646,8 @@ function DebouncedSearch(_a) {
23649
23646
  var handleClearSearch = function () {
23650
23647
  setSearchText('');
23651
23648
  };
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] })));
23649
+ useDebouncedEffect(function () { return onSearch(searchText); }, debounceTimeout, [searchText]);
23650
+ 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: autoFocus, "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] })));
23654
23651
  }
23655
23652
 
23656
23653
  // 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.40-beta-10",
3
+ "version": "0.0.40-beta-11",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -162,9 +162,6 @@ 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 ?? '',
168
165
  }
169
166
  })
170
167
  return materials
@@ -26,6 +26,7 @@ export default function DebouncedSearch({
26
26
  debounceTimeout = 500,
27
27
  clearSearch,
28
28
  showClearIcon = true,
29
+ autoFocus = true,
29
30
  }: DebouncedSearchProps) {
30
31
  const [searchText, setSearchText] = useState<string>('')
31
32
 
@@ -41,7 +42,7 @@ export default function DebouncedSearch({
41
42
  setSearchText('')
42
43
  }
43
44
 
44
- useDebouncedEffect(() => onSearch(searchText), debounceTimeout, [searchText, onSearch])
45
+ useDebouncedEffect(() => onSearch(searchText), debounceTimeout, [searchText])
45
46
 
46
47
  return (
47
48
  <div className={containerClass}>
@@ -53,7 +54,7 @@ export default function DebouncedSearch({
53
54
  placeholder={placeholder ?? 'Search'}
54
55
  value={searchText}
55
56
  onChange={handleSearchTextChange}
56
- autoFocus
57
+ autoFocus={autoFocus}
57
58
  data-testid="debounced-search"
58
59
  />
59
60
 
@@ -9,4 +9,5 @@ export interface DebouncedSearchProps {
9
9
  debounceTimeout?: number
10
10
  clearSearch?: boolean
11
11
  showClearIcon?: boolean
12
+ autoFocus?: boolean
12
13
  }
@@ -256,9 +256,6 @@ export interface CDMaterialType {
256
256
  imageReleaseTags?: ReleaseTag[]
257
257
  artifactStatus?: string
258
258
  filterState: FilterStates
259
- registryType?: string;
260
- imagePath?: string
261
- registryName?: string
262
259
  // Not even coming from API but required in CDMaterials for Security which makes its own api call but stores data in CDMaterials
263
260
  scanToolId?: number
264
261
  appliedFiltersTimestamp?: string
@@ -315,6 +312,7 @@ export interface CommonNodeAttr {
315
312
  colorCode?: string
316
313
  isExternalCI?: boolean
317
314
  isLinkedCI?: boolean
315
+ isLinkedCD?: boolean
318
316
  isJobCI?: boolean // used for Job type CI in Devtron Apps
319
317
  environmentName?: string //used for CDs
320
318
  environmentId?: number