From b61682dd20b2aff845022a16c222457ed72f456f Mon Sep 17 00:00:00 2001 From: nabarun Date: Tue, 12 Nov 2024 15:18:07 +0000 Subject: [PATCH] Fix fetching build logs for redeployments (#39) Part of [Service provider auctions for web deployments](https://www.notion.so/Service-provider-auctions-for-web-deployments-104a6b22d47280dbad51d28aa3a91d75) Co-authored-by: IshaVenikar Reviewed-on: https://git.vdb.to/cerc-io/snowballtools-base/pulls/39 --- .../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 = () => {