Sfoglia il codice sorgente

Merge pull request #2721 from porter-dev/capi-provisioner-fe

Capi provisioner fe
jusrhee 3 anni fa
parent
commit
7be4cb5f92

+ 6 - 1
dashboard/src/components/ExpandableSection.tsx

@@ -1,16 +1,21 @@
-import React, { useState } from "react";
+import React, { useEffect, useState } from "react";
 import styled from "styled-components";
 
 type Props = {
+  isInitiallyExpanded?: boolean;
   Header: any;
   ExpandedSection: any;
 };
 
 const ExpandableSection: React.FC<Props> = ({
+  isInitiallyExpanded,
   Header,
   ExpandedSection,
 }) => {
   const [isExpanded, setIsExpanded] = useState(false);
+  useEffect(() => {
+    setIsExpanded(isInitiallyExpanded);
+  }, [isInitiallyExpanded]);
 
   return (
     <StyledExpandableSection isExpanded={isExpanded}>

+ 1 - 0
dashboard/src/main/home/cluster-dashboard/dashboard/ProvisionerStatus.tsx

@@ -16,6 +16,7 @@ const ProvisionerStatus: React.FC<Props> = ({}) => {
   return (
     <StyledProvisionerStatus>
       <ExpandableSection
+        isInitiallyExpanded={true}
         Header={(
           <>
             <Icon src="https://img.stackshare.io/service/7991/amazon-eks.png" />