@devtron-labs/devtron-fe-common-lib 0.0.17-beta-7 → 0.0.17-beta-8

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/index.js CHANGED
@@ -22539,6 +22539,12 @@ var getTeamListMin = function () {
22539
22539
  };
22540
22540
  });
22541
22541
  };
22542
+ var stageMap = {
22543
+ PRECD: 'PRE',
22544
+ CD: 'DEPLOY',
22545
+ POSTCD: 'POST',
22546
+ APPROVAL: 'APPROVAL',
22547
+ };
22542
22548
  function getUserRole(appName) {
22543
22549
  return get("".concat(ROUTES.USER_CHECK_ROLE).concat(appName ? "?appName=".concat(appName) : ''));
22544
22550
  }
@@ -22546,7 +22552,7 @@ function setImageTags(request, pipelineId, artifactId) {
22546
22552
  return post("".concat(ROUTES.IMAGE_TAGGING, "/").concat(pipelineId, "/").concat(artifactId), request);
22547
22553
  }
22548
22554
  var getCDMaterials = function (cdMaterialId, stageType, abortSignal, isApprovalNode, imageTag) {
22549
- var URL = (!imageTag) ? "app/cd-pipeline/".concat(cdMaterialId, "/material?stage=").concat(stageType) : "app/cd-pipeline/".concat(cdMaterialId, "/material?stage=").concat(stageType, "&search=").concat(imageTag);
22555
+ 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);
22550
22556
  return get(URL, {
22551
22557
  signal: abortSignal,
22552
22558
  }).then(function (response) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.17-beta-7",
3
+ "version": "0.0.17-beta-8",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -30,6 +30,13 @@ interface UserRole extends ResponseType {
30
30
  }
31
31
  }
32
32
 
33
+ let stageMap = {
34
+ PRECD: 'PRE',
35
+ CD: 'DEPLOY',
36
+ POSTCD: 'POST',
37
+ APPROVAL: 'APPROVAL',
38
+ }
39
+
33
40
  export function getUserRole(appName?: string): Promise<UserRole> {
34
41
  return get(`${ROUTES.USER_CHECK_ROLE}${appName ? `?appName=${appName}` : ''}`)
35
42
  }
@@ -44,7 +51,7 @@ export const getCDMaterials = (
44
51
  abortSignal: AbortSignal,
45
52
  isApprovalNode?: boolean,
46
53
  imageTag?: string): Promise<any> => {
47
- const URL = (!imageTag) ? `app/cd-pipeline/${cdMaterialId}/material?stage=${stageType}` : `app/cd-pipeline/${cdMaterialId}/material?stage=${stageType}&search=${imageTag}`
54
+ const URL = (!imageTag) ? `app/cd-pipeline/${cdMaterialId}/material?stage=${stageMap[stageType]}` : `app/cd-pipeline/${cdMaterialId}/material?stage=${stageMap[stageType]}&search=${imageTag}`
48
55
 
49
56
  return get(URL, {
50
57
  signal: abortSignal,