From 788a57da0fc879f6a4ed25315342d6e94f59c01c Mon Sep 17 00:00:00 2001 From: Sven Urbanski Date: Tue, 5 Nov 2024 16:06:24 +0100 Subject: [PATCH] fix(ui): do not list app locks for each env Previously it repeated an app lock for multiple environments. Ref: SRX-8PS60H --- .../src/ui/components/ReleaseDialog/ReleaseDialog.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/frontend-service/src/ui/components/ReleaseDialog/ReleaseDialog.tsx b/services/frontend-service/src/ui/components/ReleaseDialog/ReleaseDialog.tsx index 8bd271239..b0b35a46c 100644 --- a/services/frontend-service/src/ui/components/ReleaseDialog/ReleaseDialog.tsx +++ b/services/frontend-service/src/ui/components/ReleaseDialog/ReleaseDialog.tsx @@ -18,6 +18,7 @@ import React, { ReactElement, useCallback } from 'react'; import { Deployment, Environment, EnvironmentGroup, Lock, LockBehavior, Release } from '../../../api/api'; import { addAction, + DisplayLock, getPriorityClassName, useAppDetailsForApp, useApplications, @@ -215,6 +216,7 @@ export const EnvironmentListItem: React.FC = ({ const apps = useApplications().filter((application) => application.name === app); const teamLocks = useTeamLocks(apps); const appLocks = useAppLocks(apps); + const appEnvLocks = appLocks.filter((value: DisplayLock) => value.environment === env.name); const allowDeployment: boolean = ((): boolean => { if (release.isPrepublish) { @@ -261,10 +263,10 @@ export const EnvironmentListItem: React.FC = ({ useEnvColor={false} />
- {appLocks.length > 0 && ( + {appEnvLocks.length > 0 && (
App: - {Object.values(appLocks).map((lock) => ( + {Object.values(appEnvLocks).map((lock) => ( ))}