From 3b0c48052b04767f90a5d639f006c2dbf6e8b8f0 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 26 Nov 2024 20:26:14 +0530 Subject: [PATCH 1/2] fix: frontend failing to give token back in cli login --- frontend/next.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/next.config.js b/frontend/next.config.js index e07695ed6..028000ed8 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -2,7 +2,7 @@ const path = require("path"); const ContentSecurityPolicy = ` default-src 'self'; - connect-src 'self' https://*.posthog.com; + connect-src 'self' https://*.posthog.com http://127.0.0.1:*; script-src 'self' https://*.posthog.com https://js.stripe.com https://api.stripe.com https://widget.intercom.io https://js.intercomcdn.com https://hcaptcha.com https://*.hcaptcha.com 'unsafe-inline' 'unsafe-eval'; style-src 'self' https://rsms.me 'unsafe-inline' https://hcaptcha.com https://*.hcaptcha.com; child-src https://api.stripe.com; From 5bcf07b32b4053617e096bb9fcf8a038721a4e33 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 26 Nov 2024 20:27:30 +0530 Subject: [PATCH 2/2] feat: resolved loading screen frozen on no environment and project switch causes forEach undefined error --- frontend/src/layouts/AppLayout/AppLayout.tsx | 5 ++++- frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/layouts/AppLayout/AppLayout.tsx b/frontend/src/layouts/AppLayout/AppLayout.tsx index d6164cba6..814117315 100644 --- a/frontend/src/layouts/AppLayout/AppLayout.tsx +++ b/frontend/src/layouts/AppLayout/AppLayout.tsx @@ -560,8 +560,11 @@ export const AppLayout = ({ children }: LayoutProps) => { value={currentWorkspace?.id} className="w-full bg-mineshaft-600 py-2.5 font-medium [&>*:first-child]:truncate" onValueChange={(value) => { - router.push(`/project/${value}/secrets/overview`); localStorage.setItem("projectData.id", value); + // this is not using react query because react query in overview is throwing error when envs are not exact same count + // to reproduce change this back to router.push and switch between two projects with different env count + // look into this on dashboard revamp + window.location.assign(`/project/${value}/secrets/overview`); }} position="popper" dropdownContainerClassName="text-bunker-200 bg-mineshaft-800 border border-mineshaft-600 z-50 max-h-96 border-gray-700" diff --git a/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx b/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx index be9ee77ad..cb49f8509 100644 --- a/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx +++ b/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx @@ -186,7 +186,7 @@ export const SecretOverviewPage = () => { useGetImportedSecretsAllEnvs({ projectId: workspaceId, path: secretPath, - environments: userAvailableEnvs.map(({ slug }) => slug) + environments: (userAvailableEnvs || []).map(({ slug }) => slug) }); const { isLoading: isOverviewLoading, data: overview } = useGetProjectSecretsOverview( @@ -618,7 +618,7 @@ export const SecretOverviewPage = () => { } }, [router.query.search]); - if (isWorkspaceLoading || (isProjectV3 && isOverviewLoading)) { + if (isWorkspaceLoading || (isProjectV3 && visibleEnvs.length > 0 && isOverviewLoading)) { return (