Skip to content

Commit

Permalink
fix(plugins): snyk issue fix
Browse files Browse the repository at this point in the history
snyk issue fix

ARC-149
  • Loading branch information
sadarunnisa-sf committed Jul 3, 2024
1 parent a760e93 commit 794ba38
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions patches/backstage-plugin-snyk+2.0.1.patch
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,16 @@ index 88d2fdb..96c6da8 100644
}
//# sourceMappingURL=index.js.map
diff --git a/node_modules/backstage-plugin-snyk/dist/components/SnykEntityComponent/SnykEntityComponent.js b/node_modules/backstage-plugin-snyk/dist/components/SnykEntityComponent/SnykEntityComponent.js
index 82bd75f..24a5788 100644
index 82bd75f..718ee60 100644
--- a/node_modules/backstage-plugin-snyk/dist/components/SnykEntityComponent/SnykEntityComponent.js
+++ b/node_modules/backstage-plugin-snyk/dist/components/SnykEntityComponent/SnykEntityComponent.js
@@ -60,19 +60,34 @@ export const SnykEntityComponent = () => {
@@ -60,19 +60,26 @@ export const SnykEntityComponent = () => {
}
const tabs = [];
const snykApi = useApi(snykApiRef);
- const orgId = ((_c = entity === null || entity === void 0 ? void 0 : entity.metadata.annotations) === null || _c === void 0 ? void 0 : _c[SNYK_ANNOTATION_ORG]) || "null";
+ let orgId = ((_c = entity === null || entity === void 0 ? void 0 : entity.metadata.annotations) === null || _c === void 0 ? void 0 : _c[SNYK_ANNOTATION_ORG]) || "null";
+ // const { value, loading, error } = useAsync(async () => {
+ // var _a, _b;
+ // orgId = await snykApi.GetSnykOrgId();
+ // const fullProjectList = await snykApi.ProjectsList(orgId, ((_a = entity.metadata.annotations) === null || _a === void 0 ? void 0 : _a[SNYK_ANNOTATION_TARGETNAME]) || ((_b = entity.metadata.annotations) === null || _b === void 0 ? void 0 : _b[SNYK_ANNOTATION_TARGETID]) || '');
+ // console.log("fullProjectList**************", orgId, fullProjectList, )
+ // const orgSlug = await snykApi.GetOrgSlug(orgId);
+ // console.log("orgSlug**************", orgId, orgSlug, )
+ // return { fullProjectList, orgSlug };
+ // });
+
const { value, loading, error } = useAsync(async () => {
- var _a, _b;
- const fullProjectList = await snykApi.ProjectsList(orgId, ((_a = entity.metadata.annotations) === null || _a === void 0 ? void 0 : _a[SNYK_ANNOTATION_TARGETNAME]) || ((_b = entity.metadata.annotations) === null || _b === void 0 ? void 0 : _b[SNYK_ANNOTATION_TARGETID]) || '');
Expand Down Expand Up @@ -89,7 +81,7 @@ index 82bd75f..24a5788 100644
return React.createElement(Alert, { severity: "error" }, error.message);
}
const projectList = value === null || value === void 0 ? void 0 : value.fullProjectList;
@@ -82,7 +97,7 @@ export const SnykEntityComponent = () => {
@@ -82,7 +89,7 @@ export const SnykEntityComponent = () => {
tabs.push({
name: utils.extractTargetShortname(project.attributes.name || "unknown"),
icon: getIconForProjectType(project.attributes.origin || ""),
Expand Down

0 comments on commit 794ba38

Please sign in to comment.