@devtron-labs/devtron-fe-common-lib 0.0.33 → 0.0.34

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.
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode, CSSProperties } from 'react';
2
2
  import { Placement } from 'tippy.js';
3
- import { ImageComment, ReleaseTag } from "./ImageTags.Types";
3
+ import { ImageComment, ReleaseTag } from './ImageTags.Types';
4
4
  export interface ResponseType {
5
5
  code: number;
6
6
  status: string;
@@ -315,6 +315,20 @@ export interface MaterialInfo {
315
315
  url?: string;
316
316
  type?: string;
317
317
  }
318
+ export declare enum FilterConditionType {
319
+ PASS = 1,
320
+ FAIL = 0
321
+ }
322
+ export interface FilterConditionsInfo {
323
+ conditionType: FilterConditionType;
324
+ expression: string;
325
+ }
326
+ export interface FilterConditionsListType {
327
+ id: number;
328
+ name: string;
329
+ description: string;
330
+ conditions: FilterConditionsInfo[];
331
+ }
318
332
  export interface CDMaterialResponseType {
319
333
  approvalUsers: string[];
320
334
  materials: any[];
@@ -323,6 +337,7 @@ export interface CDMaterialResponseType {
323
337
  tagsEditable: boolean;
324
338
  appReleaseTagNames: string[];
325
339
  hideImageTaggingHardDelete: boolean;
340
+ resourceFilters?: FilterConditionsListType[];
326
341
  }
327
342
  export interface InputDetailType {
328
343
  label: string;
package/dist/index.js CHANGED
@@ -436,7 +436,12 @@ exports.DeploymentAppTypes = void 0;
436
436
  DeploymentAppTypes["GITOPS"] = "argo_cd";
437
437
  DeploymentAppTypes["MANIFEST_DOWNLOAD"] = "manifest_download";
438
438
  DeploymentAppTypes["MANIFEST_PUSH"] = "manifest_push";
439
- })(exports.DeploymentAppTypes || (exports.DeploymentAppTypes = {}));
439
+ })(exports.DeploymentAppTypes || (exports.DeploymentAppTypes = {}));
440
+ exports.FilterConditionType = void 0;
441
+ (function (FilterConditionType) {
442
+ FilterConditionType[FilterConditionType["PASS"] = 1] = "PASS";
443
+ FilterConditionType[FilterConditionType["FAIL"] = 0] = "FAIL";
444
+ })(exports.FilterConditionType || (exports.FilterConditionType = {}));
440
445
 
441
446
  var responseMessages = {
442
447
  100: 'Continue',
@@ -10071,7 +10076,7 @@ function CustomInput(_a) {
10071
10076
  return (jsxRuntime.jsxs("div", __assign({ className: "flex column left top" }, { children: [jsxRuntime.jsx("label", __assign({ className: "form__label ".concat(labelClassName) }, { children: label })), jsxRuntime.jsx("input", { "data-testid": dataTestid, type: type, name: name, autoComplete: "off", className: "form__input", onChange: function (e) {
10072
10077
  e.persist();
10073
10078
  onChange(e);
10074
- }, onBlur: onBlur, onFocus: onFocus, placeholder: placeholder, value: value, disabled: disabled, tabIndex: tabIndex }), handleError(error).map(function (err) { return (jsxRuntime.jsxs("div", __assign({ className: "form__error" }, { children: [jsxRuntime.jsx(SvgIcWarning, { className: "form__icon form__icon--error" }), err] }))); })] })));
10079
+ }, onBlur: onBlur, onFocus: onFocus, placeholder: placeholder, value: value, disabled: disabled, tabIndex: tabIndex }), handleError(error).map(function (err) { return (jsxRuntime.jsxs("div", __assign({ className: "form__error" }, { children: [jsxRuntime.jsx(SvgIcWarning, { className: "form__icon form__icon--error" }), err] }), err)); })] })));
10075
10080
  }
10076
10081
  function handleUTCTime(ts, isRelativeTime) {
10077
10082
  if (isRelativeTime === void 0) { isRelativeTime = false; }
@@ -22683,7 +22688,7 @@ function getUserRole(appName) {
22683
22688
  function setImageTags(request, pipelineId, artifactId) {
22684
22689
  return post("".concat(ROUTES.IMAGE_TAGGING, "/").concat(pipelineId, "/").concat(artifactId), request);
22685
22690
  }
22686
- // TODO: Add enum for filterState as well
22691
+ // FIXME: This is only returning materials to cater the case of search in approval but it should be a common function service coming from dashboard.
22687
22692
  var getCDMaterials = function (cdMaterialId, stageType, abortSignal, isApprovalNode, imageTag) {
22688
22693
  var URL = (!imageTag) ? "app/cd-pipeline/".concat(cdMaterialId, "/material?stage=").concat(stageMap[stageType]) : "app/cd-pipeline/".concat(cdMaterialId, "/material?stage=").concat(stageMap[stageType], "&search=").concat(imageTag);
22689
22694
  return get(URL, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -51,7 +51,7 @@ export function setImageTags(request, pipelineId: number, artifactId: number){
51
51
  return post(`${ROUTES.IMAGE_TAGGING}/${pipelineId}/${artifactId}`,request )
52
52
  }
53
53
 
54
- // TODO: Add enum for filterState as well
54
+ // FIXME: This is only returning materials to cater the case of search in approval but it should be a common function service coming from dashboard.
55
55
  export const getCDMaterials = (
56
56
  cdMaterialId,
57
57
  stageType: DeploymentNodeType,
@@ -326,7 +326,7 @@ export function CustomInput({
326
326
  tabIndex={tabIndex}
327
327
  />
328
328
  {handleError(error).map((err) => (
329
- <div className="form__error">
329
+ <div className="form__error" key={err}>
330
330
  <FormError className="form__icon form__icon--error" />
331
331
  {err}
332
332
  </div>
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode, CSSProperties } from 'react'
2
2
  import { Placement } from 'tippy.js'
3
- import { ImageComment, ReleaseTag } from "./ImageTags.Types";
3
+ import { ImageComment, ReleaseTag } from './ImageTags.Types'
4
4
  export interface ResponseType {
5
5
  code: number
6
6
  status: string
@@ -218,7 +218,7 @@ export interface UserApprovalMetadataType {
218
218
  export enum FilterStates {
219
219
  ALLOWED = 0,
220
220
  BLOCKED = 1,
221
- ERROR = 2
221
+ ERROR = 2,
222
222
  }
223
223
 
224
224
  export interface CDMaterialType {
@@ -246,7 +246,7 @@ export interface CDMaterialType {
246
246
  imageComment?: ImageComment
247
247
  imageReleaseTags?: ReleaseTag[]
248
248
  artifactStatus?: string
249
- filterState: FilterStates;
249
+ filterState: FilterStates
250
250
  }
251
251
 
252
252
  export interface CommonNodeAttr {
@@ -304,7 +304,7 @@ export interface CommonNodeAttr {
304
304
  deploymentAppType?: DeploymentAppTypes
305
305
  isCITriggerBlocked?: boolean
306
306
  ciBlockState?: {
307
- action: any,
307
+ action: any
308
308
  metadataField: string
309
309
  }
310
310
  appReleaseTagNames?: string[]
@@ -315,7 +315,7 @@ export enum DeploymentAppTypes {
315
315
  HELM = 'helm',
316
316
  GITOPS = 'argo_cd',
317
317
  MANIFEST_DOWNLOAD = 'manifest_download',
318
- MANIFEST_PUSH='manifest_push'
318
+ MANIFEST_PUSH = 'manifest_push',
319
319
  }
320
320
 
321
321
  export interface VulnerabilityType {
@@ -345,6 +345,23 @@ export interface MaterialInfo {
345
345
  type?: string
346
346
  }
347
347
 
348
+ export enum FilterConditionType {
349
+ PASS = 1,
350
+ FAIL = 0,
351
+ }
352
+
353
+ export interface FilterConditionsInfo {
354
+ conditionType: FilterConditionType
355
+ expression: string
356
+ }
357
+
358
+ export interface FilterConditionsListType {
359
+ id: number
360
+ name: string
361
+ description: string
362
+ conditions: FilterConditionsInfo[]
363
+ }
364
+
348
365
  export interface CDMaterialResponseType {
349
366
  approvalUsers: string[]
350
367
  materials: any[]
@@ -353,9 +370,9 @@ export interface CDMaterialResponseType {
353
370
  tagsEditable: boolean
354
371
  appReleaseTagNames: string[]
355
372
  hideImageTaggingHardDelete: boolean
373
+ resourceFilters?: FilterConditionsListType[]
356
374
  }
357
375
 
358
-
359
376
  export interface InputDetailType {
360
377
  label: string
361
378
  defaultValue: string
@@ -404,7 +421,6 @@ export interface AsyncState<T> {
404
421
  dependencies: any[]
405
422
  }
406
423
 
407
-
408
424
  export interface AsyncOptions {
409
425
  resetOnChange: boolean
410
426
  }