Prechádzať zdrojové kódy

Merge branch 'stacks-v1' of github.com:porter-dev/porter into stacks-v1

Feroze Mohideen 3 rokov pred
rodič
commit
47e7d3d3c8

BIN
dashboard/src/assets/infra.png


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

@@ -254,7 +254,7 @@ const Block = styled.div<{ disabled?: boolean }>`
   color: #ffffff;
   position: relative;
   border-radius: 5px;
-  background: linear-gradient(160deg, #26292e, #26292e);
+  background: ${({ theme }) => theme.clickable.bg};
   border: 1px solid #494b4f;
   :hover {
     border: ${(props) => (props.disabled ? "" : "1px solid #7a7b80")};

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

@@ -404,7 +404,7 @@ const StyledForm = styled.div`
   position: relative;
   padding: 30px 30px 25px;
   border-radius: 5px;
-  background: #26292e;
+  background: ${({ theme }) => theme.fg};
   border: 1px solid #494b4f;
   font-size: 13px;
   margin-bottom: 30px;

+ 9 - 3
dashboard/src/components/porter/Checkbox.tsx

@@ -5,18 +5,21 @@ type Props = {
   checked: boolean;
   toggleChecked: () => void;
   children: React.ReactNode;
+  disabled?: boolean;
 };
 
 const Checkbox: React.FC<Props> = ({
   checked,
   toggleChecked,
   children,
+  disabled,
 }) => {
   return (
     <StyledCheckbox>
       <Box 
         checked={checked}
-        onClick={toggleChecked}
+        onClick={!disabled && toggleChecked}
+        disabled={disabled}
       >
         <i className="material-icons">done</i>
       </Box>
@@ -32,10 +35,12 @@ const StyledCheckbox = styled.div`
   align-items: center;
 `;
 
-const Box = styled.div<{ checked: boolean }>`
+const Box = styled.div<{
+  checked: boolean;
+  disabled: boolean;
+}>`
   width: 12px;
   height: 12px;
-  cursor: pointer;
   border: 1px solid #ffffff55;
   margin-right: 10px;
   border-radius: 3px;
@@ -43,6 +48,7 @@ const Box = styled.div<{ checked: boolean }>`
   display: flex;
   align-items: center;
   justify-content: center;
+  cursor: ${(props) => (props.disabled ? "not-allowed" : "pointer")};
 
   > i {
     font-size: 12px;

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

@@ -114,6 +114,23 @@ const ExpandedApp: React.FC<Props> = ({ ...props }) => {
           revision: 0,
         }
       );
+      if (resPorterApp?.data?.repo_name) {
+        const resBranchContents = await api.getBranchContents(
+          "<token>",
+          { dir: "./" },
+          {
+            project_id: currentProject.id,
+            git_repo_id: resPorterApp.data.git_repo_id,
+            kind: "github",
+            owner: resPorterApp.data.repo_name.split("/")[0],
+            name: resPorterApp.data.repo_name.split("/")[1],
+            branch: resPorterApp.data.git_branch,
+          }
+        );
+        console.log(resBranchContents);
+      } else {
+        setWorkflowCheckPassed(true);
+      }
       const newAppData = {
         app: resPorterApp?.data,
         chart: resChartData?.data,

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

@@ -277,6 +277,7 @@ const NewAppFlow: React.FC<Props> = ({ ...props }) => {
                 <Text color="helper">
                   Lowercase letters, numbers, and "-" only.
                 </Text>
+                <Spacer y={0.5} />
                 <Input
                   placeholder="ex: academic-sophon"
                   value={formState.applicationName}

+ 1 - 1
dashboard/src/main/home/onboarding/Onboarding.tsx

@@ -159,7 +159,7 @@ const Onboarding = () => {
           <DashboardHeader
             image={lightning}
             title="Getting started"
-            description="Create a new cluster in your own cloud provider to get started with Porter."
+            description="Select your existing cloud provider to get started with Porter."
             disableLineBreak
             capitalize={false}
           />

+ 18 - 0
dashboard/src/main/home/sidebar/Sidebar.tsx

@@ -1,11 +1,13 @@
 import React, { Component } from "react";
 import styled from "styled-components";
+
 import category from "assets/category.svg";
 import integrations from "assets/integrations-bold.png";
 import rocket from "assets/rocket.png";
 import settings from "assets/settings-bold.png";
 import web from "assets/web-bold.png";
 import addOns from "assets/add-ons-bold.png";
+import infra from "assets/infra.png";
 
 import { Context } from "shared/Context";
 
@@ -194,6 +196,22 @@ class Sidebar extends Component<PropsType, StateType> {
               Integrations
             </NavButton>
           )}
+          {this.props.isAuthorized("settings", "", [
+            "get",
+            "update",
+            "delete",
+          ]) && (
+            <NavButton
+              path={"/cluster-dashboard"}
+              targetClusterName={currentCluster?.name}
+              active={
+                window.location.pathname.startsWith("/cluster-dashboard")
+              }
+            >
+              <Img src={infra} />
+              Infrastructure
+            </NavButton>
+          )}
           {this.props.isAuthorized("settings", "", [
             "get",
             "update",