Justin Rhee 3 лет назад
Родитель
Сommit
a86ec6643a

+ 1 - 0
api/server/handlers/stacks/create_porter_app.go

@@ -43,6 +43,7 @@ func (c *CreatePorterAppHandler) ServeHTTP(w http.ResponseWriter, r *http.Reques
 		ClusterID: cluster.ID,
 		ProjectID: project.ID,
 		RepoName:  request.RepoName,
+		GitRepoID: request.GitRepoID,
 		GitBranch: request.GitBranch,
 
 		BuildContext: request.BuildContext,

+ 1 - 0
api/types/porter_app.go

@@ -28,6 +28,7 @@ type CreatePorterAppRequest struct {
 	ProjectID    uint   `json:"project_id"`
 	RepoName     string `json:"repo_name"`
 	GitBranch    string `json:"git_branch"`
+	GitRepoID    uint   `json:"git_repo_id"`
 	BuildContext string `json:"build_context"`
 	Builder      string `json:"builder"`
 	Buildpacks   string `json:"buildpacks"`

+ 17 - 1
dashboard/src/main/home/app-dashboard/expanded-app/ExpandedApp.tsx

@@ -272,7 +272,23 @@ const ExpandedApp: React.FC<Props> = ({ ...props }) => {
           <BuildSettingsTabStack appData={appData} setAppData={setAppData} />
         );
       case "settings":
-        return <div>TODO: stack deletion</div>;
+        return (
+          <>
+            <Text size={16}>
+              Delete app "{appData.app.name}"
+            </Text>
+            <Spacer y={1} />
+            <Text color="helper">
+              Delete this application and all of its resources.
+            </Text>
+            <Spacer y={1} />
+            <Button onClick={() => {
+              // set delete overlay
+            }} color="#b91133">
+              Delete {appData.app.name}
+            </Button>
+          </>
+        );
       default:
         return <div>dream on</div>;
     }

+ 2 - 0
dashboard/src/main/home/app-dashboard/new-app-flow/NewAppFlow.tsx

@@ -218,12 +218,14 @@ const NewAppFlow: React.FC<Props> = ({ ...props }) => {
         : {};
 
       // write to the db
+      console.log("what is it", actionConfig.git_repo_id)
       await api.createPorterApp(
         "<token>",
         {
           name: formState.applicationName,
           repo_name: actionConfig.git_repo,
           git_branch: branch,
+          git_repo_id: actionConfig?.git_repo_id,
           build_context: folderPath,
           builder: (buildConfig as any)?.builder,
           buildpacks: (buildConfig as any)?.buildpacks?.join(",") ?? "",

+ 1 - 0
dashboard/src/shared/api.tsx

@@ -192,6 +192,7 @@ const createPorterApp = baseApi<
     name: string;
     repo_name: string;
     git_branch: string;
+    git_repo_id: number;
     build_context: string;
     builder: string;
     buildpacks: string;