Bladeren bron

do not autodropdown service status list if too many services exist, it makes the UI look clunky (#4143)

Feroze Mohideen 2 jaren geleden
bovenliggende
commit
6aa7fa41d4

+ 5 - 1
dashboard/src/main/home/app-dashboard/app-view/tabs/activity-feed/events/cards/DeployEventCard.tsx

@@ -30,6 +30,8 @@ import { RevertModal } from "./RevertModal";
 import RollbackEventCard from "./RollbackEventCard";
 import ServiceStatusDetail from "./ServiceStatusDetail";
 
+const MAX_DISPLAYED_SERVICE_STATUSES = 10;
+
 type Props = {
   event: PorterAppDeployEvent;
   appName: string;
@@ -69,7 +71,9 @@ const DeployEventCard: React.FC<Props> = ({
   ]);
 
   const [serviceStatusVisible, setServiceStatusVisible] = useState(
-    showServiceStatusDetail || deployEventIncludesRollback
+    (showServiceStatusDetail || deployEventIncludesRollback) &&
+      Object.keys(event.metadata.service_deployment_metadata ?? {}).length <=
+        MAX_DISPLAYED_SERVICE_STATUSES
   );
 
   const { revisionIdToNumber, numberToRevisionId } = useRevisionList({