From 8ea91bbce16539e2d0d24c0b9babb52a74fc3763 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Tue, 12 Nov 2024 15:32:53 +0530 Subject: [PATCH] Fix request id null issue when fetching deploy logs --- .../projects/project/deployments/DeploymentDetailsCard.tsx | 6 +++--- .../components/shared/CustomIcon/templates/TemplateIcon.tsx | 5 +---- .../projects/id/settings/EnvironmentVariablesForm.tsx | 6 +++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx index bbf31076..7e733992 100644 --- a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx +++ b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx @@ -92,7 +92,7 @@ const DeploymentDetailsCard = ({ } }; - const fetchDeploymentLogs = async () => { + const fetchDeploymentLogs = useCallback(async () => { setDeploymentLogs('Loading logs...'); handleOpenDialog(); const statusUrl = `${deployment.deployer.deployerApiUrl}/${deployment.applicationDeploymentRequestId}`; @@ -108,7 +108,7 @@ const DeploymentDetailsCard = ({ ); setDeploymentLogs(logsRes); } - }; + }, [deployment.deployer, deployment.applicationDeploymentRequestId]); const renderDeploymentStatus = useCallback( (className?: string) => { @@ -127,7 +127,7 @@ const DeploymentDetailsCard = ({ ); }, - [deployment.status, deployment.commitHash], + [deployment.status, deployment.commitHash, fetchDeploymentLogs], ); return ( diff --git a/packages/frontend/src/components/shared/CustomIcon/templates/TemplateIcon.tsx b/packages/frontend/src/components/shared/CustomIcon/templates/TemplateIcon.tsx index 43879fcf..9cf799c2 100644 --- a/packages/frontend/src/components/shared/CustomIcon/templates/TemplateIcon.tsx +++ b/packages/frontend/src/components/shared/CustomIcon/templates/TemplateIcon.tsx @@ -4,10 +4,7 @@ import { cloneIcon } from 'utils/cloneIcon'; import { PWAIcon } from './PWAIcon'; import { WebAppIcon } from './WebAppIcon'; -const TEMPLATE_ICONS = [ - 'pwa', - 'web' -] as const; +const TEMPLATE_ICONS = ['pwa', 'web'] as const; export type TemplateIconType = (typeof TEMPLATE_ICONS)[number]; export interface TemplateIconProps extends CustomIconProps { diff --git a/packages/frontend/src/pages/org-slug/projects/id/settings/EnvironmentVariablesForm.tsx b/packages/frontend/src/pages/org-slug/projects/id/settings/EnvironmentVariablesForm.tsx index aeaaedda..8cf0f26d 100644 --- a/packages/frontend/src/pages/org-slug/projects/id/settings/EnvironmentVariablesForm.tsx +++ b/packages/frontend/src/pages/org-slug/projects/id/settings/EnvironmentVariablesForm.tsx @@ -73,17 +73,17 @@ const EnvironmentVariablesForm = () => {