Browse Source

handle whiteout

jusrhee 4 năm trước cách đây
mục cha
commit
2346f9088d

+ 1 - 1
dashboard/src/components/PageNotFound.tsx

@@ -147,7 +147,7 @@ const StyledPageNotFound = styled.div`
   color: #6f6f6f;
   font-size: 16px;
   user-select: none;
-  padding-bottom: 20px;
+  margin-top: -80px;
   width: 100%;
   height: 100%;
   display: flex;

+ 1 - 0
dashboard/src/components/form-refactor/field-components/KeyValueArray.tsx

@@ -130,6 +130,7 @@ const KeyValueArray: React.FC<Props> = (props) => {
   };
 
   const renderEnvModal = () => {
+    console.log(variables.namespace);
     if (state.showEnvModal) {
       return (
         <Modal

+ 1 - 1
dashboard/src/main/home/cluster-dashboard/chart/ChartList.tsx

@@ -260,7 +260,7 @@ const Placeholder = styled.div`
   color: #ffffff44;
   background: #26282f;
   border-radius: 5px;
-  height: 320px;
+  height: 370px;
   display: flex;
   align-items: center;
   justify-content: center;

+ 1 - 1
dashboard/src/main/home/cluster-dashboard/env-groups/EnvGroupList.tsx

@@ -144,7 +144,7 @@ const Placeholder = styled.div`
   color: #ffffff44;
   background: #26282f;
   border-radius: 5px;
-  height: 320px;
+  height: 370px;
   display: flex;
   align-items: center;
   justify-content: center;

+ 7 - 8
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedChart.tsx

@@ -179,7 +179,7 @@ const ExpandedChart: React.FC<Props> = (props) => {
         setControllers((oldControllers) => {
           switch (event.event_type) {
             case "DELETE":
-              delete oldControllers[object.metadata.uid];
+              typeof oldControllers !== "undefined" && delete oldControllers[object.metadata.uid];
             case "UPDATE":
               if (
                 oldControllers &&
@@ -651,14 +651,9 @@ const ExpandedChart: React.FC<Props> = (props) => {
     return () => (isSubscribed = false);
   }, [components, currentCluster, currentProject, currentChart]);
 
-  console.log(currentChart.form)
   return (
     <>
       <StyledExpandedChart>
-        <BackButton onClick={props.closeChart}>
-          <BackButtonImg src={backArrow} />
-        </BackButton>
-
         <ConfirmOverlay
           show={showDeleteOverlay}
           message={`Are you sure you want to delete ${currentChart.name}?`}
@@ -671,6 +666,9 @@ const ExpandedChart: React.FC<Props> = (props) => {
           </DeleteOverlay>
         )}
         <HeaderWrapper>
+          <BackButton onClick={props.closeChart}>
+            <BackButtonImg src={backArrow} />
+          </BackButton>
           <TitleSection
             icon={currentChart.chart.metadata.icon}
             iconWidth="33px"
@@ -895,7 +893,9 @@ const TabButton = styled.div`
   }
 `;
 
-const HeaderWrapper = styled.div``;
+const HeaderWrapper = styled.div`
+  position: relative;
+`;
 
 const Dot = styled.div`
   margin-right: 9px;
@@ -972,7 +972,6 @@ const IconWrapper = styled.div`
 const StyledExpandedChart = styled.div`
   width: 100%;
   z-index: 0;
-  position: relative;
   animation: fadeIn 0.3s;
   animation-timing-function: ease-out;
   animation-fill-mode: forwards;

+ 11 - 1
dashboard/src/main/home/launch/launch-flow/SettingsPage.tsx

@@ -146,10 +146,20 @@ class SettingsPage extends Component<PropsType, StateType> {
           <PorterFormWrapper
             formData={form}
             saveValuesStatus={saveValuesStatus}
+            valuesToOverride={{
+              ...valuesToOverride,
+              namespace: selectedNamespace,
+              clusterId: this.context.currentCluster.id,
+            }}
+            externalValues={{
+              isLaunch: true,
+            }}
             isReadOnly={
               !this.props.isAuthorized("namespace", "", ["get", "create"])
             }
-            onSubmit={(val) => onSubmit(val)}
+            onSubmit={(val) => {
+              onSubmit(val)
+            }}
           />
         </>
       );