Parcourir la source

reenable porter.yaml detection modal (#3814)

ianedwards il y a 2 ans
Parent
commit
0ec8c55a76
1 fichiers modifiés avec 12 ajouts et 7 suppressions
  1. 12 7
      dashboard/src/main/home/app-dashboard/create-app/CreateApp.tsx

+ 12 - 7
dashboard/src/main/home/app-dashboard/create-app/CreateApp.tsx

@@ -48,6 +48,7 @@ import {
 import EnvSettings from "../validate-apply/app-settings/EnvSettings";
 import ImageSettings from "../image-settings/ImageSettings";
 import { useClusterResources } from "shared/ClusterResourcesContext";
+import PorterYamlModal from "./PorterYamlModal";
 
 type CreateAppProps = {} & RouteComponentProps;
 
@@ -178,7 +179,12 @@ const CreateApp: React.FC<CreateAppProps> = ({ history }) => {
   const image = watch("source.image");
   const services = watch("app.services");
 
-  const { detectedServices: servicesFromYaml, detectedName } = usePorterYaml({
+  const {
+    detectedServices: servicesFromYaml,
+    detectedName,
+    porterYamlFound,
+    loading: isLoadingPorterYaml,
+  } = usePorterYaml({
     source: source?.type === "github" ? source : null,
     appName: "", // only want to know if porter.yaml has name set, otherwise use name from input
   });
@@ -188,7 +194,7 @@ const CreateApp: React.FC<CreateAppProps> = ({ history }) => {
     deploymentTargetID: deploymentTarget?.deployment_target_id,
     creating: true,
   });
-  const { currentClusterResources} = useClusterResources();
+  const { currentClusterResources } = useClusterResources();
 
   const onSubmit = handleSubmit(async (data) => {
     try {
@@ -388,11 +394,11 @@ const CreateApp: React.FC<CreateAppProps> = ({ history }) => {
     // TODO: create a more unified way of parsing form/apply errors, unified with the logic in AppDataContainer
     const errorKeys = Object.keys(errors);
     if (errorKeys.length > 0) {
-      let errorMessage = "App could not be deployed as defined."
+      let errorMessage = "App could not be deployed as defined.";
       if (errorKeys.includes("app")) {
         const appErrors = Object.keys(errors.app ?? {});
         if (appErrors.includes("build")) {
-          errorMessage = "Build settings are not properly configured."
+          errorMessage = "Build settings are not properly configured.";
         }
 
         if (appErrors.includes("services")) {
@@ -564,8 +570,7 @@ const CreateApp: React.FC<CreateAppProps> = ({ history }) => {
                               source={source}
                               projectId={currentProject.id}
                             />
-                            {/* todo(ianedwards): re-enable porter.yaml modal after validate/apply v2 is rolled out and proven to be stable */}
-                            {/* {!userHasSeenNoPorterYamlFoundModal &&
+                            {!userHasSeenNoPorterYamlFoundModal &&
                               !porterYamlFound &&
                               !isLoadingPorterYaml && (
                                 <Controller
@@ -585,7 +590,7 @@ const CreateApp: React.FC<CreateAppProps> = ({ history }) => {
                                     />
                                   )}
                                 />
-                              )} */}
+                              )}
                           </>
                         ) : (
                           <ImageSettings