瀏覽代碼

expand apps from list

Justin Rhee 3 年之前
父節點
當前提交
18099ec2f8

+ 0 - 3
api/server/handlers/stacks/update_porter_app.go

@@ -50,9 +50,6 @@ func (c *UpdatePorterAppHandler) ServeHTTP(w http.ResponseWriter, r *http.Reques
 		return
 	}
 
-	if request.Name != "" {
-		porterApp.Name = request.Name
-	}
 	if request.RepoName != "" {
 		porterApp.RepoName = request.RepoName
 	}

+ 0 - 1
api/types/porter_app.go

@@ -36,7 +36,6 @@ type CreatePorterAppRequest struct {
 }
 
 type UpdatePorterAppRequest struct {
-	Name         string `json:"name"`
 	RepoName     string `json:"repo_name"`
 	GitBranch    string `json:"git_branch"`
 	BuildContext string `json:"build_context"`

+ 39 - 34
dashboard/src/main/home/app-dashboard/AppDashboard.tsx

@@ -1,6 +1,7 @@
 import React, { useEffect, useState, useContext, useMemo } from "react";
 import styled from "styled-components";
 import _ from "lodash";
+import { Link, LinkProps } from "react-router-dom";
 
 import web from "assets/web.png";
 import github from "assets/github.png";
@@ -20,7 +21,7 @@ import Spacer from "components/porter/Spacer";
 import Text from "components/porter/Text";
 import SearchBar from "components/porter/SearchBar";
 import Toggle from "components/porter/Toggle";
-import Link from "components/porter/Link";
+import PorterLink from "components/porter/Link";
 import Loading from "components/Loading";
 
 type Props = {
@@ -119,11 +120,11 @@ const AppDashboard: React.FC<Props> = ({
           setActive={setView}
         />
         <Spacer inline x={2} />
-        <Link to="/apps/new">
+        <PorterLink to="/apps/new">
           <Button onClick={() => {}} height="30px" width="160px">
             <I className="material-icons">add</I> New application
           </Button>
-        </Link>
+        </PorterLink>
       </Container>
       <Spacer y={1} />
       {isLoading ? <Loading offset="-150px" /> : view === "grid" ? (
@@ -131,21 +132,23 @@ const AppDashboard: React.FC<Props> = ({
          {(filteredApps ?? []).map((app: any, i: number) => {
            if (!namespaceBlacklist.includes(app.name)) {
              return (
-               <Block key={i}>
-                 <Text size={14}>
-                   <Icon src={icons[i % icons.length]} />
-                   {app.name}
-                 </Text>
-                 <StatusIcon src={healthy} />
-                 <Text size={13} color="#ffffff44">
-                   <SmallIcon opacity="0.6" src={github} />
-                   porter-dev/porter
-                 </Text>
-                 <Text size={13} color="#ffffff44">
-                   <SmallIcon opacity="0.4" src={time} />
-                   Updated 6:35 PM on 4/23/2023
-                 </Text>
-               </Block>
+              <Link to={`/apps/${app.name}`}>
+                <Block key={i}>
+                  <Text size={14}>
+                    <Icon src={icons[i % icons.length]} />
+                    {app.name}
+                  </Text>
+                  <StatusIcon src={healthy} />
+                  <Text size={13} color="#ffffff44">
+                    <SmallIcon opacity="0.6" src={github} />
+                    porter-dev/porter
+                  </Text>
+                  <Text size={13} color="#ffffff44">
+                    <SmallIcon opacity="0.4" src={time} />
+                    6:35 PM on 4/23/2023
+                  </Text>
+                </Block>
+              </Link>
              );
            }
          })}
@@ -155,22 +158,24 @@ const AppDashboard: React.FC<Props> = ({
           {(filteredApps ?? []).map((app: any, i: number) => {
             if (!namespaceBlacklist.includes(app.name)) {
               return (
-                <Row key={i}>
-                  <Text size={14}>
-                    <MidIcon src={icons[i % icons.length]} />
-                    {app.name}
-                    <Spacer inline x={1} />
-                    <MidIcon src={healthy} />
-                  </Text>
-                  <Spacer height="15px" />
-                  <Text size={13} color="#ffffff44">
-                    <SmallIcon opacity="0.6" src={github} />
-                    porter-dev/porter
-                    <Spacer inline x={1} />
-                    <SmallIcon opacity="0.4" src={time} />
-                    Updated 6:35 PM on 4/23/2023
-                  </Text>
-                </Row>
+                <Link to={`/apps/${app.name}`}>
+                  <Row key={i}>
+                    <Text size={14}>
+                      <MidIcon src={icons[i % icons.length]} />
+                      {app.name}
+                      <Spacer inline x={1} />
+                      <MidIcon src={healthy} />
+                    </Text>
+                    <Spacer height="15px" />
+                    <Text size={13} color="#ffffff44">
+                      <SmallIcon opacity="0.6" src={github} />
+                      porter-dev/porter
+                      <Spacer inline x={1} />
+                      <SmallIcon opacity="0.4" src={time} />
+                      6:35 PM on 4/23/2023
+                    </Text>
+                  </Row>
+                </Link>
               );
             }
           })}

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

@@ -225,7 +225,7 @@ const NewAppFlow: React.FC<Props> = ({ ...props }) => {
             git_branch: branch,
             build_context: folderPath,
             builder: (buildConfig as any)?.builder,
-            buildpacks: (buildConfig as any)?.buildpacks.join(",") ?? "",
+            buildpacks: (buildConfig as any)?.buildpacks?.join(",") ?? "",
             dockerfile: dockerfilePath,
             image_repo_uri: imageUrl,
           },

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

@@ -209,7 +209,6 @@ const createPorterApp = baseApi<
 
 const updatePorterApp = baseApi<
   {
-    name?: string;
     repo_name?: string;
     git_branch?: string;
     build_context?: string;