From 67cfca064879581824c2bea0943715579d63b7cd Mon Sep 17 00:00:00 2001 From: Kim Tsao <84398375+kim-tsao@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:49:45 -0500 Subject: [PATCH] chore(release): 1.2.x rebase/backport argocd (#2527) * chore(release): 1.1.7 [skip ci] ## [1.1.7](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.1.6...@janus-idp/backstage-plugin-argocd@1.1.7) (2024-06-04) ### Features * **rbac:** add audit log for RBAC backend ([#1726](https://github.com/janus-idp/backstage-plugins/issues/1726)) ([e50464b](https://github.com/janus-idp/backstage-plugins/commit/e50464bcb38e9897ddfe208fdeef699e4bfeda3a)) ### Bug Fixes * **audit-log:** deep copy objects passed into audit logger so redactor will not modify objects and remove `auditErrorLog` function ([#1730](https://github.com/janus-idp/backstage-plugins/issues/1730)) ([379c241](https://github.com/janus-idp/backstage-plugins/commit/379c2413f03b44579e9899653ac5336190ccba06)) * **deps:** update kiali dependencies (minor) ([#1779](https://github.com/janus-idp/backstage-plugins/issues/1779)) ([ff2b421](https://github.com/janus-idp/backstage-plugins/commit/ff2b421be9206d395805f497d4e2821ca4d6edc1)) * **rbac:** add support for scaling ([#1757](https://github.com/janus-idp/backstage-plugins/issues/1757)) ([caddc83](https://github.com/janus-idp/backstage-plugins/commit/caddc832e0df5199a455539d3538635448691c2d)) * **rbac:** fix handling condition action conflicts ([#1781](https://github.com/janus-idp/backstage-plugins/issues/1781)) ([966b2b2](https://github.com/janus-idp/backstage-plugins/commit/966b2b200e0ade0ce600901a7853a4a94751df22)) * **rbac:** fix role list view permission policies column value ([#1714](https://github.com/janus-idp/backstage-plugins/issues/1714)) ([07200e4](https://github.com/janus-idp/backstage-plugins/commit/07200e42d62c51c2ff59e812521ad0c82cb62ea8)) * chore(release): 1.1.8 [skip ci] * switch defaults of the `--embed-as-dependencies` and `in-place` options. ([#1787](https://github.com/janus-idp/backstage-plugins/issues/1787)) ([049e675](https://github.com/janus-idp/backstage-plugins/commit/049e67502e7b4f9f00c8c6b01d112a27bc09ca9c)) Signed-off-by: Kim Tsao * chore(release): 1.1.9 [skip ci] ## @janus-idp/backstage-plugin-argocd [1.1.9](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.1.8...@janus-idp/backstage-plugin-argocd@1.1.9) (2024-06-10) * chore(release): 1.1.10 [skip ci] ## [1.1.10](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.1.9...@janus-idp/backstage-plugin-argocd@1.1.10) (2024-06-13) ### Bug Fixes * **cli:** fix the removal of type definitions by `export-dynamic`. ([#1810](https://github.com/janus-idp/backstage-plugins/issues/1810)) ([8472d91](https://github.com/janus-idp/backstage-plugins/commit/8472d914a2f9107c08a9a30ab1ea8ed8d10bc43a)) * **feedback:** fixed feedback backend plugin crashing ([#1809](https://github.com/janus-idp/backstage-plugins/issues/1809)) ([e4a571e](https://github.com/janus-idp/backstage-plugins/commit/e4a571e737b7697a5ad96a4a43aacf29b2a2179e)) * missing postversion script is several plugins and missing turbo dependency ([#1811](https://github.com/janus-idp/backstage-plugins/issues/1811)) ([4dfe4f5](https://github.com/janus-idp/backstage-plugins/commit/4dfe4f533e21e79c928c66bfd68684243912be2c)) * **orchestrator:** fix error handling in case data index failed to start ([#1804](https://github.com/janus-idp/backstage-plugins/issues/1804)) ([27affb7](https://github.com/janus-idp/backstage-plugins/commit/27affb7815e02127721fd854f7903dca3525dede)) * chore(deps): manual backstage 1.27 bump from PR 1683 Signed-off-by: Kim Tsao * chore(release): 1.2.0 [skip ci] ## [1.2.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.1.10...@janus-idp/backstage-plugin-argocd@1.2.0) (2024-06-13) ### Features * **deps:** update to backstage 1.27 ([#1683](https://github.com/janus-idp/backstage-plugins/issues/1683)) ([a14869c](https://github.com/janus-idp/backstage-plugins/commit/a14869c3f4177049cb8d6552b36c3ffd17e7997d)) * **feedback:** add support for jira component ([#1813](https://github.com/janus-idp/backstage-plugins/issues/1813)) ([4afbc17](https://github.com/janus-idp/backstage-plugins/commit/4afbc171801c1351cb4a89b1884861abe531b2dc)) * fix(deps): update dependency react-use to v17.5.0 (#1780) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(release): 1.2.1 [skip ci] ## @janus-idp/backstage-plugin-argocd [1.2.1](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.2.0...@janus-idp/backstage-plugin-argocd@1.2.1) (2024-06-14) ### Bug Fixes * **deps:** update dependency react-use to v17.5.0 ([#1780](https://github.com/janus-idp/backstage-plugins/issues/1780)) ([a25bf15](https://github.com/janus-idp/backstage-plugins/commit/a25bf15e14e9fa5a946551c5626c92f6b1f83d2f)) * fix(argocd): hide commit section for helm based applications (#1834) * chore(release): 1.2.2 [skip ci] ## [1.2.2](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.2.1...@janus-idp/backstage-plugin-argocd@1.2.2) (2024-06-19) ### Bug Fixes * **matomo:** add default export for new backend system ([#1822](https://github.com/janus-idp/backstage-plugins/issues/1822)) ([5e72920](https://github.com/janus-idp/backstage-plugins/commit/5e72920209589535d503bb28e77f54175a0bd946)) * **orchestrator:** change log level of cache messages to be debug ([#1824](https://github.com/janus-idp/backstage-plugins/issues/1824)) ([4224612](https://github.com/janus-idp/backstage-plugins/commit/422461224e31b419cd8394e2432af71ed10a986e)) * chore(release): 1.2.3 [skip ci] ## @janus-idp/backstage-plugin-argocd [1.2.3](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.2.2...@janus-idp/backstage-plugin-argocd@1.2.3) (2024-06-21) ### Bug Fixes * **argocd:** hide commit section for helm based applications ([#1834](https://github.com/janus-idp/backstage-plugins/issues/1834)) ([a86ce1e](https://github.com/janus-idp/backstage-plugins/commit/a86ce1e5237ac419eb93a9766cb8e2736ba9b8d7)) * fix(argocd): fix argocd commit message visibility (#1874) * chore(release): 1.2.4 [skip ci] ## @janus-idp/backstage-plugin-argocd [1.2.4](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.2.3...@janus-idp/backstage-plugin-argocd@1.2.4) (2024-07-17) ### Bug Fixes * **argocd:** fix argocd commit message visibility ([#1874](https://github.com/janus-idp/backstage-plugins/issues/1874)) ([e558d75](https://github.com/janus-idp/backstage-plugins/commit/e558d7549c49a1821eafc9424f174c6d457ce414)) * chore(release): add empty changeset Signed-off-by: Kim Tsao --------- Signed-off-by: Kim Tsao Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: semantic-release-bot Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Karthik Jeeyar Co-authored-by: Eswaraiahsapram --- .changeset/thirty-years-battle.md | 2 + plugins/argocd/CHANGELOG.md | 62 ++++++++++ plugins/argocd/package.json | 22 ++-- .../DeploymentLifecycle.tsx | 8 +- .../DeploymentLifecycleCard.tsx | 105 ++++++++++------- .../DeploymentLifecycleDrawer.tsx | 108 ++++++++++-------- .../__tests__/DeploymentLifecycle.test.tsx | 19 +++ .../DeploymentLifecycleCard.test.tsx | 22 ++++ .../DeploymentLifecycleDrawer.test.tsx | 22 ++++ plugins/argocd/src/types.ts | 1 + yarn.lock | 24 +--- 11 files changed, 273 insertions(+), 122 deletions(-) create mode 100644 .changeset/thirty-years-battle.md diff --git a/.changeset/thirty-years-battle.md b/.changeset/thirty-years-battle.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/thirty-years-battle.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/plugins/argocd/CHANGELOG.md b/plugins/argocd/CHANGELOG.md index 9b8f667461..27d138f2a5 100644 --- a/plugins/argocd/CHANGELOG.md +++ b/plugins/argocd/CHANGELOG.md @@ -1,3 +1,65 @@ +## @janus-idp/backstage-plugin-argocd [1.2.4](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.2.3...@janus-idp/backstage-plugin-argocd@1.2.4) (2024-07-17) + + +### Bug Fixes + +* **argocd:** fix argocd commit message visibility ([#1874](https://github.com/janus-idp/backstage-plugins/issues/1874)) ([e558d75](https://github.com/janus-idp/backstage-plugins/commit/e558d7549c49a1821eafc9424f174c6d457ce414)) + +## @janus-idp/backstage-plugin-argocd [1.2.3](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.2.2...@janus-idp/backstage-plugin-argocd@1.2.3) (2024-06-21) + + +### Bug Fixes + +* **argocd:** hide commit section for helm based applications ([#1834](https://github.com/janus-idp/backstage-plugins/issues/1834)) ([a86ce1e](https://github.com/janus-idp/backstage-plugins/commit/a86ce1e5237ac419eb93a9766cb8e2736ba9b8d7)) + +## @janus-idp/backstage-plugin-argocd [1.2.2](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.2.1...@janus-idp/backstage-plugin-argocd@1.2.2) (2024-06-19) + + + +### Dependencies + +* **@janus-idp/cli:** upgraded to 1.11.1 + +## @janus-idp/backstage-plugin-argocd [1.2.1](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.2.0...@janus-idp/backstage-plugin-argocd@1.2.1) (2024-06-14) + + +### Bug Fixes + +* **deps:** update dependency react-use to v17.5.0 ([#1780](https://github.com/janus-idp/backstage-plugins/issues/1780)) ([a25bf15](https://github.com/janus-idp/backstage-plugins/commit/a25bf15e14e9fa5a946551c5626c92f6b1f83d2f)) + +## @janus-idp/backstage-plugin-argocd [1.2.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.1.10...@janus-idp/backstage-plugin-argocd@1.2.0) (2024-06-13) + + +### Features + +* **deps:** update to backstage 1.27 ([#1683](https://github.com/janus-idp/backstage-plugins/issues/1683)) ([a14869c](https://github.com/janus-idp/backstage-plugins/commit/a14869c3f4177049cb8d6552b36c3ffd17e7997d)) + + + +### Dependencies + +* **@janus-idp/cli:** upgraded to 1.11.0 + +## @janus-idp/backstage-plugin-argocd [1.1.10](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.1.9...@janus-idp/backstage-plugin-argocd@1.1.10) (2024-06-13) + + + +### Dependencies + +* **@janus-idp/cli:** upgraded to 1.10.1 + +## @janus-idp/backstage-plugin-argocd [1.1.9](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.1.8...@janus-idp/backstage-plugin-argocd@1.1.9) (2024-06-10) + +## @janus-idp/backstage-plugin-argocd [1.1.8](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.1.7...@janus-idp/backstage-plugin-argocd@1.1.8) (2024-06-05) + + + +### Dependencies + +* **@janus-idp/cli:** upgraded to 1.10.0 + +## @janus-idp/backstage-plugin-argocd [1.1.7](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.1.6...@janus-idp/backstage-plugin-argocd@1.1.7) (2024-06-04) + ## @janus-idp/backstage-plugin-argocd [1.1.6](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-argocd@1.1.5...@janus-idp/backstage-plugin-argocd@1.1.6) (2024-06-03) diff --git a/plugins/argocd/package.json b/plugins/argocd/package.json index 4fea37afd9..a15e75bfa6 100644 --- a/plugins/argocd/package.json +++ b/plugins/argocd/package.json @@ -1,6 +1,6 @@ { "name": "@janus-idp/backstage-plugin-argocd", - "version": "1.1.6", + "version": "1.2.4", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -32,11 +32,11 @@ "prettier:fix": "prettier --ignore-unknown --write ." }, "dependencies": { - "@backstage/catalog-model": "^1.4.5", - "@backstage/core-components": "^0.14.6", + "@backstage/catalog-model": "^1.5.0", + "@backstage/core-components": "^0.14.7", "@backstage/core-plugin-api": "^1.9.2", - "@backstage/plugin-catalog-react": "^1.11.3", - "@backstage/theme": "^0.5.3", + "@backstage/plugin-catalog-react": "^1.12.0", + "@backstage/theme": "^0.5.5", "@kubernetes/client-node": "^0.20.0", "@material-ui/core": "^4.9.13", "@material-ui/icons": "^4.9.1", @@ -47,20 +47,20 @@ "@patternfly/react-icons": "^5.1.1", "@patternfly/react-tokens": "^5.1.2", "moment": "^2.30.1", - "react-use": "17.4.0" + "react-use": "17.5.0" }, "peerDependencies": { "react": "^16.13.1 || ^17.0.0 || ^18.0.0", "react-router-dom": "^6.3.0" }, "devDependencies": { - "@backstage/cli": "0.26.4", + "@backstage/cli": "0.26.6", "prettier": "3.3.3", "@backstage/config": "1.2.0", - "@backstage/core-app-api": "1.12.4", - "@backstage/dev-utils": "1.0.31", - "@backstage/test-utils": "1.5.4", - "@janus-idp/cli": "1.10.0", + "@backstage/core-app-api": "1.12.5", + "@backstage/dev-utils": "1.0.32", + "@backstage/test-utils": "1.5.5", + "@janus-idp/cli": "1.11.1", "@playwright/test": "1.44.1", "@redhat-developer/red-hat-developer-hub-theme": "0.0.54", "@testing-library/jest-dom": "6.4.5", diff --git a/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycle.tsx b/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycle.tsx index 97ba095c88..e95e4066c2 100644 --- a/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycle.tsx +++ b/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycle.tsx @@ -87,14 +87,18 @@ const DeploymentLifecycle = () => { const activeApp = apps.find(a => a.metadata.name === activeItem); + if (error) { + return ; + } + if (loading) { return (
); - } else if (error) { - return ; + } else if (apps?.length === 0) { + return null; } return ( diff --git a/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycleCard.tsx b/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycleCard.tsx index 86f10a3f61..a8b3d34713 100644 --- a/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycleCard.tsx +++ b/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycleCard.tsx @@ -33,6 +33,11 @@ const useCardStyles = makeStyles(theme => marginRight: theme.spacing(2.5), maxWidth: '300px', }, + commitMessage: { + textOverflow: 'ellipsis', + whiteSpace: 'nowrap', + overflow: 'hidden', + }, }), ); @@ -117,47 +122,65 @@ const DeploymentLifecycleCard: React.FC = ({ - - Commit - {revisionsMap && latestRevision ? ( - <> - { - e.stopPropagation(); - const repoUrl = app?.spec?.source?.repoURL ?? ''; - if (repoUrl.length) { - window.open( - getCommitUrl( - repoUrl, - latestRevision?.revision, - entity?.metadata?.annotations ?? {}, - ), - '_blank', - ); - } - }} - icon={} - color="primary" - label={latestRevision?.revision.slice(0, 7)} - /> - - {revisionsMap?.[latestRevision?.revision] ? ( - <>{revisionsMap?.[latestRevision?.revision]?.message} - ) : ( - - )} - - - ) : ( - <>- - )} - + {!app?.spec?.source?.chart && ( + + Commit + {revisionsMap && latestRevision ? ( + <> + { + e.stopPropagation(); + const repoUrl = app?.spec?.source?.repoURL ?? ''; + if (repoUrl.length) { + window.open( + getCommitUrl( + repoUrl, + latestRevision?.revision, + entity?.metadata?.annotations ?? {}, + ), + '_blank', + ); + } + }} + icon={} + color="primary" + label={latestRevision?.revision.slice(0, 7)} + /> + + {revisionsMap?.[latestRevision?.revision] ? ( + + + {revisionsMap?.[latestRevision?.revision]?.message} + + + ) : ( + + )} + + + ) : ( + <>- + )} + + )} diff --git a/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycleDrawer.tsx b/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycleDrawer.tsx index d6f07e288f..895f12d029 100644 --- a/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycleDrawer.tsx +++ b/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycleDrawer.tsx @@ -51,6 +51,9 @@ const useDrawerStyles = makeStyles(theme => justifyContent: 'space-between', alignItems: 'baseline', }, + commitMessage: { + wordBreak: 'break-word', + }, }), ); const DeploymentLifecycleDrawer: React.FC = ({ @@ -136,51 +139,56 @@ const DeploymentLifecycleDrawer: React.FC = ({ - - Commit - {latestRevision ? ( - <> - } - color="primary" - onClick={e => { - e.stopPropagation(); + {!app?.spec?.source?.chart && ( + + Commit + {latestRevision ? ( + <> + } + color="primary" + onClick={e => { + e.stopPropagation(); - const repoUrl = app?.spec?.source?.repoURL ?? ''; - if (repoUrl) { - window.open( - getCommitUrl( - repoUrl, - latestRevision?.revision, - entity?.metadata?.annotations ?? {}, - ), - '_blank', - ); - } - }} - label={latestRevision?.revision.slice(0, 7)} - /> - - {revisionsMap?.[latestRevision?.revision] ? ( - <> - {revisionsMap?.[latestRevision?.revision]?.message} by{' '} - {revisionsMap?.[latestRevision?.revision]?.author} - - ) : ( - - )} - - - ) : ( - <>- - )} - + const repoUrl = app?.spec?.source?.repoURL ?? ''; + if (repoUrl) { + window.open( + getCommitUrl( + repoUrl, + latestRevision?.revision, + entity?.metadata?.annotations ?? {}, + ), + '_blank', + ); + } + }} + label={latestRevision?.revision.slice(0, 7)} + /> + + {revisionsMap?.[latestRevision?.revision] ? ( + <> + {revisionsMap?.[latestRevision?.revision]?.message} by{' '} + {revisionsMap?.[latestRevision?.revision]?.author} + + ) : ( + + )} + + + ) : ( + <>- + )} + + )} {appHistory.length >= 1 && ( Latest deployment @@ -191,7 +199,11 @@ const DeploymentLifecycleDrawer: React.FC = ({ Deployment - + Image{' '} = ({ Deployment - + {revisionsMap[dep.revision]?.message}{' '} { }); }); + test('should not render the component if there are no applications matching the selector', async () => { + (useApi as any).mockReturnValue({ + listApps: async () => { + return Promise.resolve({ items: [] }); + }, + getRevisionDetailsList: async () => { + return Promise.resolve({}); + }, + }); + render(); + + await waitFor(() => { + expect(screen.queryByTestId('argocd-loader')).not.toBeInTheDocument(); + expect( + screen.queryByText('Deployment lifecycle'), + ).not.toBeInTheDocument(); + }); + }); + test('should open and close the sidebar', async () => { render(); diff --git a/plugins/argocd/src/components/DeploymentLifeCycle/__tests__/DeploymentLifecycleCard.test.tsx b/plugins/argocd/src/components/DeploymentLifeCycle/__tests__/DeploymentLifecycleCard.test.tsx index 7ad3e61832..1bcc6b52bc 100644 --- a/plugins/argocd/src/components/DeploymentLifeCycle/__tests__/DeploymentLifecycleCard.test.tsx +++ b/plugins/argocd/src/components/DeploymentLifeCycle/__tests__/DeploymentLifecycleCard.test.tsx @@ -148,3 +148,25 @@ describe('DeploymentLifecylceCard', () => { screen.getByText('commit message'); }); }); + +test('application card should not contain commit section for helm based applications', () => { + (useArgocdConfig as any).mockReturnValue({ + baseUrl: 'https://baseUrl.com', + instances: [{ name: 'main', url: 'https://main-instance-url.com' }], + intervalMs: 10000, + instanceName: 'main', + }); + + const helmApplication = { + ...mockApplication, + spec: { + ...mockApplication.spec, + source: { ...mockApplication.spec.source, chart: 'redhat-charts' }, + }, + }; + + render(); + + const commitLink = screen.queryByText('Commit'); + expect(commitLink).not.toBeInTheDocument(); +}); diff --git a/plugins/argocd/src/components/DeploymentLifeCycle/__tests__/DeploymentLifecycleDrawer.test.tsx b/plugins/argocd/src/components/DeploymentLifeCycle/__tests__/DeploymentLifecycleDrawer.test.tsx index 8250f86158..74a028f7d0 100644 --- a/plugins/argocd/src/components/DeploymentLifeCycle/__tests__/DeploymentLifecycleDrawer.test.tsx +++ b/plugins/argocd/src/components/DeploymentLifeCycle/__tests__/DeploymentLifecycleDrawer.test.tsx @@ -80,6 +80,28 @@ describe('DeploymentLifecycleDrawer', () => { expect(screen.getByTestId('quarkus-app-dev-drawer')).toBeInTheDocument(); }); + test('should not render the commit section for helm based applications in drawer component', () => { + const helmApplication = { + ...mockApplication, + spec: { + ...mockApplication.spec, + source: { ...mockApplication.spec.source, chart: 'redhat-charts' }, + }, + }; + render( + jest.fn()} + revisionsMap={{}} + />, + { wrapper }, + ); + + const commitLink = screen.queryByText('Commit'); + expect(commitLink).not.toBeInTheDocument(); + }); + test('should render the commit link in drawer component', () => { global.open = jest.fn(); diff --git a/plugins/argocd/src/types.ts b/plugins/argocd/src/types.ts index a8e53969dc..e58a402f1a 100644 --- a/plugins/argocd/src/types.ts +++ b/plugins/argocd/src/types.ts @@ -26,6 +26,7 @@ export interface Destination { } export interface Source { + chart?: string; repoURL: string; path: string; helm?: { diff --git a/yarn.lock b/yarn.lock index 8826e94f13..ab2a57b652 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26632,7 +26632,7 @@ nan@^2.14.0, nan@^2.17.0, nan@^2.18.0, nan@^2.19.0: resolved "https://registry.yarnpkg.com/nan/-/nan-2.19.0.tgz#bb58122ad55a6c5bc973303908d5b16cfdd5a8c0" integrity sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw== -nano-css@^5.3.1, nano-css@^5.6.1: +nano-css@^5.6.1: version "5.6.1" resolved "https://registry.yarnpkg.com/nano-css/-/nano-css-5.6.1.tgz#964120cb1af6cccaa6d0717a473ccd876b34c197" integrity sha512-T2Mhc//CepkTa3X4pUhKgbEheJHYAxD0VptuqFhDbGMUWVV2m+lkNiW/Ieuj35wrfC8Zm0l7HvssQh7zcEttSw== @@ -29963,27 +29963,7 @@ react-universal-interface@^0.6.2: resolved "https://registry.yarnpkg.com/react-universal-interface/-/react-universal-interface-0.6.2.tgz#5e8d438a01729a4dbbcbeeceb0b86be146fe2b3b" integrity sha512-dg8yXdcQmvgR13RIlZbTRQOoUrDciFVoSBZILwjE2LFISxZZ8loVJKAkuzswl5js8BHda79bIb2b84ehU8IjXw== -react-use@17.4.0: - version "17.4.0" - resolved "https://registry.yarnpkg.com/react-use/-/react-use-17.4.0.tgz#cefef258b0a6c534a5c8021c2528ac6e1a4cdc6d" - integrity sha512-TgbNTCA33Wl7xzIJegn1HndB4qTS9u03QUwyNycUnXaweZkE4Kq2SB+Yoxx8qbshkZGYBDvUXbXWRUmQDcZZ/Q== - dependencies: - "@types/js-cookie" "^2.2.6" - "@xobotyi/scrollbar-width" "^1.9.5" - copy-to-clipboard "^3.3.1" - fast-deep-equal "^3.1.3" - fast-shallow-equal "^1.0.0" - js-cookie "^2.2.1" - nano-css "^5.3.1" - react-universal-interface "^0.6.2" - resize-observer-polyfill "^1.5.1" - screenfull "^5.1.0" - set-harmonic-interval "^1.0.1" - throttle-debounce "^3.0.1" - ts-easing "^0.2.0" - tslib "^2.1.0" - -react-use@^17.2.4, react-use@^17.3.2, react-use@^17.4.0: +react-use@17.5.0, react-use@^17.2.4, react-use@^17.3.2, react-use@^17.4.0: version "17.5.0" resolved "https://registry.yarnpkg.com/react-use/-/react-use-17.5.0.tgz#1fae45638828a338291efa0f0c61862db7ee6442" integrity sha512-PbfwSPMwp/hoL847rLnm/qkjg3sTRCvn6YhUZiHaUa3FA6/aNoFX79ul5Xt70O1rK+9GxSVqkY0eTwMdsR/bWg==