@devtron-labs/devtron-fe-common-lib 0.0.32 → 0.0.33-beta-1

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;
@@ -193,8 +193,8 @@ export interface UserApprovalMetadataType {
193
193
  requestedUserData: ApprovalUserDataType;
194
194
  }
195
195
  export declare enum FilterStates {
196
- BLOCKED = 0,
197
- ALLOWED = 1,
196
+ ALLOWED = 0,
197
+ BLOCKED = 1,
198
198
  ERROR = 2
199
199
  }
200
200
  export interface CDMaterialType {
@@ -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
@@ -426,8 +426,8 @@ exports.DeploymentNodeType = void 0;
426
426
  })(exports.DeploymentNodeType || (exports.DeploymentNodeType = {}));
427
427
  exports.FilterStates = void 0;
428
428
  (function (FilterStates) {
429
- FilterStates[FilterStates["BLOCKED"] = 0] = "BLOCKED";
430
- FilterStates[FilterStates["ALLOWED"] = 1] = "ALLOWED";
429
+ FilterStates[FilterStates["ALLOWED"] = 0] = "ALLOWED";
430
+ FilterStates[FilterStates["BLOCKED"] = 1] = "BLOCKED";
431
431
  FilterStates[FilterStates["ERROR"] = 2] = "ERROR";
432
432
  })(exports.FilterStates || (exports.FilterStates = {}));
433
433
  exports.DeploymentAppTypes = void 0;
@@ -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',
@@ -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": "v0.0.32",
3
+ "version": "0.0.33-beta-1",
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,
@@ -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
@@ -216,9 +216,9 @@ export interface UserApprovalMetadataType {
216
216
  }
217
217
 
218
218
  export enum FilterStates {
219
- BLOCKED = 0,
220
- ALLOWED = 1,
221
- ERROR = 2
219
+ ALLOWED = 0,
220
+ BLOCKED = 1,
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
  }