Soham Dessai пре 3 година
родитељ
комит
bb1ec02d90

+ 18 - 2
dashboard/src/main/home/app-dashboard/expanded-app/ExpandedApp.tsx

@@ -26,6 +26,7 @@ const ExpandedApp: React.FC<Props> = ({
   const { currentCluster, currentProject } = useContext(Context);
   const [isLoading, setIsLoading] = useState(true);
   const [appData, setAppData] = useState(null);
+  const [error, setError] = useState(null);
   const [tab, setTab] = useState("events");
   const [isExpanded, setIsExpanded] = useState(false);
 
@@ -33,7 +34,7 @@ const ExpandedApp: React.FC<Props> = ({
     setIsLoading(true);
     const { appName } = props.match.params as any;
     try {
-      const res = await api.getPorterApp(
+      const resPorterApp = await api.getPorterApp(
         "<token>",
         {},
         {
@@ -42,9 +43,24 @@ const ExpandedApp: React.FC<Props> = ({
           name: appName,
         }
       );
-      setAppData(res.data);
+      const resChartData = await api.getChart(
+        "<token>",
+        {},
+        {
+          id: currentProject.id,
+          namespace: `porter-stack-${appName}`,
+          cluster_id: currentCluster.id,
+          name: appName,
+          revision: 0,
+        }
+      );
+      setAppData({
+        app: resPorterApp?.data,
+        chart: resChartData?.data,
+      });
       setIsLoading(false);
     } catch (err) {
+      setError(err);
       setIsLoading(false);
     }
   }

+ 3 - 4
dashboard/src/main/home/app-dashboard/new-app-flow/NewAppFlow.tsx

@@ -171,8 +171,7 @@ const NewAppFlow: React.FC<Props> = ({ ...props }) => {
   };
   const deployPorterApp = async () => {
     try {
-      //Write build settings to the DB
-      console.log(buildConfig);
+      // Write build settings to the DB
       const res = await api.createPorterApp(
         "<token>",
         {
@@ -180,8 +179,8 @@ const NewAppFlow: React.FC<Props> = ({ ...props }) => {
           repo_name: actionConfig.git_repo,
           git_branch: branch,
           build_context: folderPath,
-          builder: buildConfig?.builder,
-          buildpacks: buildConfig?.buildpacks,
+          builder: (buildConfig as any)?.builder,
+          buildpacks: (buildConfig as any)?.buildpacks,
           dockerfile: dockerfilePath,
         },
         {