Przeglądaj źródła

fix bug where all services would show notifications (#4151)

Feroze Mohideen 2 lat temu
rodzic
commit
8d2255cbe5

+ 3 - 3
dashboard/src/main/home/app-dashboard/validate-apply/services-settings/ServiceContainer.tsx

@@ -199,7 +199,7 @@ const ServiceContainer: React.FC<ServiceProps> = ({
         )}
         )}
       </AnimatePresence>
       </AnimatePresence>
       {!isClientJobService(service) && status && (
       {!isClientJobService(service) && status && (
-        <ServiceStatusFooter status={status} />
+        <ServiceStatusFooter status={status} name={service.name.value} />
       )}
       )}
       {isClientJobService(service) &&
       {isClientJobService(service) &&
         // make sure that this service is in a created revision before showing the job footer - cannot view history / run jobs that are not deployed
         // make sure that this service is in a created revision before showing the job footer - cannot view history / run jobs that are not deployed
@@ -218,7 +218,7 @@ const ServiceTitle = styled.div`
   align-items: center;
   align-items: center;
 `;
 `;
 
 
-const StyledSourceBox = styled(motion.div) <{
+const StyledSourceBox = styled(motion.div)<{
   showExpanded?: boolean;
   showExpanded?: boolean;
   hasFooter?: boolean;
   hasFooter?: boolean;
 }>`
 }>`
@@ -281,7 +281,7 @@ const ServiceHeader = styled.div<{
     border-radius: 20px;
     border-radius: 20px;
     margin-left: -10px;
     margin-left: -10px;
     transform: ${(props: { showExpanded?: boolean }) =>
     transform: ${(props: { showExpanded?: boolean }) =>
-    props.showExpanded ? "" : "rotate(-90deg)"};
+      props.showExpanded ? "" : "rotate(-90deg)"};
   }
   }
 `;
 `;
 
 

+ 4 - 1
dashboard/src/main/home/app-dashboard/validate-apply/services-settings/footers/ServiceStatusFooter.tsx

@@ -18,9 +18,11 @@ import { useLatestRevision } from "../../../app-view/LatestRevisionContext";
 
 
 type ServiceStatusFooterProps = {
 type ServiceStatusFooterProps = {
   status: ClientServiceStatus[];
   status: ClientServiceStatus[];
+  name: string;
 };
 };
 const ServiceStatusFooter: React.FC<ServiceStatusFooterProps> = ({
 const ServiceStatusFooter: React.FC<ServiceStatusFooterProps> = ({
   status,
   status,
+  name,
 }) => {
 }) => {
   const [expanded, setExpanded] = useState<boolean>(false);
   const [expanded, setExpanded] = useState<boolean>(false);
   const { latestClientNotifications, tabUrlGenerator } = useLatestRevision();
   const { latestClientNotifications, tabUrlGenerator } = useLatestRevision();
@@ -31,7 +33,8 @@ const ServiceStatusFooter: React.FC<ServiceStatusFooterProps> = ({
       {status.map((versionStatus, i) => {
       {status.map((versionStatus, i) => {
         const versionNotifications = latestClientNotifications
         const versionNotifications = latestClientNotifications
           .filter(isClientServiceNotification)
           .filter(isClientServiceNotification)
-          .filter((n) => n.appRevisionId === versionStatus.revisionId);
+          .filter((n) => n.appRevisionId === versionStatus.revisionId)
+          .filter((n) => n.service.name.value === name);
         return (
         return (
           <div key={i}>
           <div key={i}>
             <StyledStatusFooterTop expanded={expanded}>
             <StyledStatusFooterTop expanded={expanded}>