Kaynağa Gözat

Stacks qa improvements (#3091)

jusrhee 3 yıl önce
ebeveyn
işleme
5c85846e66

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

@@ -131,9 +131,9 @@ const ProvisionerFlow: React.FC<Props> = ({
               Separate from the AWS cost, Porter charges based on the amount of resources that are being used.
               Separate from the AWS cost, Porter charges based on the amount of resources that are being used.
             </Text>
             </Text>
             <Spacer inline width="5px" />
             <Spacer inline width="5px" />
-            <Link hasunderline to="https://porter.run/pricing">
+            <Link hasunderline to="https://porter.run/pricing" target="_blank">
               Learn more about our pricing
               Learn more about our pricing
-            </Link>.
+            </Link>
             <Spacer y={1} />
             <Spacer y={1} />
             <Text color="helper">
             <Text color="helper">
               All AWS resources will be automatically deleted when you delete your Porter project. Please enter the AWS base cost ("315.94") below to proceed:
               All AWS resources will be automatically deleted when you delete your Porter project. Please enter the AWS base cost ("315.94") below to proceed:

+ 14 - 15
dashboard/src/components/porter/Checkbox.tsx

@@ -20,24 +20,22 @@ const Checkbox: React.FC<Props> = ({
   return (
   return (
     disabled && disabledTooltip ?
     disabled && disabledTooltip ?
       <Tooltip content={disabledTooltip} position="right">
       <Tooltip content={disabledTooltip} position="right">
-        <StyledCheckbox>
-          <Box
-            checked={checked}
-            onClick={disabled ? () => { } : toggleChecked}
-            disabled={disabled}
-          >
+        <StyledCheckbox 
+          onClick={disabled ? () => { } : toggleChecked}
+          disabled={disabled}
+        >
+          <Box checked={checked}>
             <i className="material-icons">done</i>
             <i className="material-icons">done</i>
           </Box>
           </Box>
           {children}
           {children}
         </StyledCheckbox>
         </StyledCheckbox>
       </Tooltip>
       </Tooltip>
       :
       :
-      <StyledCheckbox>
-        <Box
-          checked={checked}
-          onClick={disabled ? () => { } : toggleChecked}
-          disabled={disabled}
-        >
+      <StyledCheckbox 
+        onClick={disabled ? () => { } : toggleChecked}
+        disabled={disabled}
+      >
+        <Box checked={checked}>
           <i className="material-icons">done</i>
           <i className="material-icons">done</i>
         </Box>
         </Box>
         {children}
         {children}
@@ -47,14 +45,16 @@ const Checkbox: React.FC<Props> = ({
 
 
 export default Checkbox;
 export default Checkbox;
 
 
-const StyledCheckbox = styled.div`
+const StyledCheckbox = styled.div<{
+  disabled?: boolean;
+}>`
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
+  cursor: ${(props) => (props.disabled ? "not-allowed" : "pointer")};
 `;
 `;
 
 
 const Box = styled.div<{
 const Box = styled.div<{
   checked: boolean;
   checked: boolean;
-  disabled?: boolean;
 }>`
 }>`
   width: 12px;
   width: 12px;
   height: 12px;
   height: 12px;
@@ -65,7 +65,6 @@ const Box = styled.div<{
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
   justify-content: center;
   justify-content: center;
-  cursor: ${(props) => (props.disabled ? "not-allowed" : "pointer")};
 
 
   > i {
   > i {
     font-size: 12px;
     font-size: 12px;

+ 34 - 15
dashboard/src/components/porter/Link.tsx

@@ -2,6 +2,8 @@ import DynamicLink from "components/DynamicLink";
 import React, { useEffect, useState } from "react";
 import React, { useEffect, useState } from "react";
 import styled from "styled-components";
 import styled from "styled-components";
 
 
+import Icon from "components/porter/Icon";
+
 type Props = {
 type Props = {
   to?: string;
   to?: string;
   onClick?: () => void;
   onClick?: () => void;
@@ -18,35 +20,54 @@ const Link: React.FC<Props> = ({
   hasunderline,
   hasunderline,
 }) => {
 }) => {
   return (
   return (
-    <>
+    <LinkWrapper>
       {to ? (
       {to ? (
-        <StyledLink 
-          to={to} 
-          target={target}
-          hasunderline={hasunderline}
-        >
+        <StyledLink to={to} target={target}>
           {children}
           {children}
+          {target === "_blank" && (
+            <div>
+            <Svg data-testid="geist-icon" fill="none" height="1em" shape-rendering="geometricPrecision" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" width="1em" data-darkreader-inline-stroke="" data-darkreader-inline-color=""><path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"></path><path d="M15 3h6v6"></path><path d="M10 14L21 3"></path></Svg>
+            </div>
+          )}
         </StyledLink>
         </StyledLink>
       ) : (
       ) : (
-        <Div 
-          onClick={onClick}
-          hasunderline={hasunderline}
-        >
+        <Div onClick={onClick}>
           {children}
           {children}
         </Div>
         </Div>
       )}
       )}
-    </>
+      {hasunderline && <Underline />}
+    </LinkWrapper>
   );
   );
 };
 };
 
 
 export default Link;
 export default Link;
 
 
-const Div = styled.span<{ hasunderline?: boolean }>`
+const Svg = styled.svg`
+  margin-bottom: -1px;
+  margin-left: 5px;
+  color: #ffffff;
+  stroke: #ffffff;
+  stroke-width: 2;
+`;
+
+const Underline = styled.div`
+  position: absolute;
+  bottom: -2px;
+  left: 0px;
+  height: 1px;
+  width: 100%;
+  background: #ffffff;
+`;
+
+const LinkWrapper = styled.span`
+  position: relative;
+`;
+
+const Div = styled.span`
   color: #ffffff;
   color: #ffffff;
   cursor: pointer;
   cursor: pointer;
   font-size: 13px;
   font-size: 13px;
   display: inline-flex;
   display: inline-flex;
-  border-bottom: ${props => props.hasunderline ? "1px solid #fff" : ""};
 `;
 `;
 
 
 const StyledLink = styled(DynamicLink)<{ hasunderline?: boolean }>`
 const StyledLink = styled(DynamicLink)<{ hasunderline?: boolean }>`
@@ -54,6 +75,4 @@ const StyledLink = styled(DynamicLink)<{ hasunderline?: boolean }>`
   display: inline-flex;
   display: inline-flex;
   font-size: 13px;
   font-size: 13px;
   cursor: pointer;
   cursor: pointer;
-  text-decoration: ;
-  border-bottom: ${props => props.hasunderline ? "1px solid #fff" : ""};
 `;
 `;

+ 13 - 12
dashboard/src/main/home/add-on-dashboard/AddOnDashboard.tsx

@@ -46,6 +46,7 @@ const namespaceBlacklist = [
   "kube-public",
   "kube-public",
   "kube-system",
   "kube-system",
   "monitoring",
   "monitoring",
+  "porter-agent-system",
 ];
 ];
 
 
 const templateBlacklist = [
 const templateBlacklist = [
@@ -197,15 +198,15 @@ const AppDashboard: React.FC<Props> = ({
                           app.chart.metadata.icon
                           app.chart.metadata.icon
                         }
                         }
                       />
                       />
-                      <Text size={14}>
-                        {app.name}
-                      </Text>
+                      <Text size={14}>{app.name}</Text>
                     </Container>
                     </Container>
                     <StatusIcon src={healthy} />
                     <StatusIcon src={healthy} />
-                    <Text size={13} color="#ffffff44">
+                    <Container row>
                       <SmallIcon opacity="0.4" src={time} />
                       <SmallIcon opacity="0.4" src={time} />
-                      {readableDate(app.info.last_deployed)}
-                    </Text>
+                      <Text size={13} color="#ffffff44">
+                        {readableDate(app.info.last_deployed)}
+                      </Text>
+                    </Container>
                   </Block>
                   </Block>
                 );
                 );
               })}
               })}
@@ -222,17 +223,17 @@ const AppDashboard: React.FC<Props> = ({
                           app.chart.metadata.icon
                           app.chart.metadata.icon
                         }
                         }
                       />
                       />
-                      <Text size={14}>
-                        {app.name}
-                      </Text>
+                      <Text size={14}>{app.name}</Text>
                       <Spacer inline x={1} />
                       <Spacer inline x={1} />
                       <MidIcon src={healthy} height="16px" />
                       <MidIcon src={healthy} height="16px" />
                     </Container>
                     </Container>
                     <Spacer height="15px" />
                     <Spacer height="15px" />
-                    <Text size={13} color="#ffffff44">
+                    <Container row>
                       <SmallIcon opacity="0.4" src={time} />
                       <SmallIcon opacity="0.4" src={time} />
-                      {readableDate(app.info.last_deployed)}
-                    </Text>
+                      <Text size={13} color="#ffffff44">
+                        {readableDate(app.info.last_deployed)}
+                      </Text>
+                    </Container>
                   </Row>
                   </Row>
                 );
                 );
               })}
               })}

+ 2 - 2
dashboard/src/main/home/add-on-dashboard/ConfigureTemplate.tsx

@@ -182,7 +182,7 @@ const ConfigureTemplate: React.FC<Props> = ({
                 src={hardcodedIcons[currentTemplate.name] || currentTemplate.icon}
                 src={hardcodedIcons[currentTemplate.name] || currentTemplate.icon}
               />
               />
             }
             }
-            title={`Configure new ${hardcodedNames[currentTemplate.name] || currentTemplate.name} instance`}
+            title={`Configure new "${hardcodedNames[currentTemplate.name] || currentTemplate.name}" instance`}
             capitalize={false}
             capitalize={false}
             disableLineBreak
             disableLineBreak
           />
           />
@@ -194,7 +194,7 @@ const ConfigureTemplate: React.FC<Props> = ({
                 <Text size={16}>Add-on name</Text>
                 <Text size={16}>Add-on name</Text>
                 <Spacer y={0.5} />
                 <Spacer y={0.5} />
                 <Text color="helper">
                 <Text color="helper">
-                  Randomly generated if left blank (lowercase letters, numbers, and "-" only).
+                  Lowercase letters, numbers, and "-" only.
                 </Text>
                 </Text>
                 <Spacer height="20px" />
                 <Spacer height="20px" />
                 <Input
                 <Input

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

@@ -818,15 +818,13 @@ const ExpandedApp: React.FC<Props> = ({ ...props }) => {
               <>
               <>
                 <Spacer inline x={1} />
                 <Spacer inline x={1} />
                 <Container row>
                 <Container row>
-                  <Link
+                  <A
                     target="_blank"
                     target="_blank"
-                    to={`https://github.com/${appData.app.repo_name}`}
+                    href={`https://github.com/${appData.app.repo_name}`}
                   >
                   >
                     <SmallIcon src={github} />
                     <SmallIcon src={github} />
-                    <Text size={13}>
-                      {appData.app.repo_name}
-                    </Text>
-                  </Link>
+                    <Text size={13}>{appData.app.repo_name}</Text>
+                  </A>
                 </Container>
                 </Container>
               </>
               </>
             )}
             )}
@@ -913,25 +911,17 @@ const ExpandedApp: React.FC<Props> = ({ ...props }) => {
                               onClick={() => window.location.reload()}
                               onClick={() => window.location.reload()}
                             >
                             >
                               <img src={refresh} />
                               <img src={refresh} />
-                              <Underline>Refresh</Underline>
+                              Refresh
                             </RefreshButton>
                             </RefreshButton>
                           </>
                           </>
                         </>
                         </>
                       }
                       }
                     >
                     >
-                      <div
-                        style={{
-                          display: "flex",
-                          alignItems: "center",
-                          marginBottom: "-20px",
-                        }}
-                      >
                         Your build was not successful.
                         Your build was not successful.
-                        <Spacer inline width="15px" />
+                        <Spacer inline width="5px" />
                         <>
                         <>
                           <Link
                           <Link
                             hasunderline
                             hasunderline
-                            target="_blank"
                             onClick={() => setModalVisible(true)}
                             onClick={() => setModalVisible(true)}
                           >
                           >
                             View logs
                             View logs
@@ -945,7 +935,6 @@ const ExpandedApp: React.FC<Props> = ({ ...props }) => {
                             />
                             />
                           )}
                           )}
                         </>
                         </>
-                      </div>
 
 
                       <Spacer inline width="5px" />
                       <Spacer inline width="5px" />
                     </Banner>
                     </Banner>
@@ -961,7 +950,7 @@ const ExpandedApp: React.FC<Props> = ({ ...props }) => {
                             onClick={() => window.location.reload()}
                             onClick={() => window.location.reload()}
                           >
                           >
                             <img src={refresh} />
                             <img src={refresh} />
-                            <Underline>Refresh</Underline>
+                            Refresh
                           </RefreshButton>
                           </RefreshButton>
                         </>
                         </>
                       }
                       }
@@ -1079,6 +1068,11 @@ const ExpandedApp: React.FC<Props> = ({ ...props }) => {
 
 
 export default withRouter(ExpandedApp);
 export default withRouter(ExpandedApp);
 
 
+const A = styled.a`
+  display: flex;
+  align-items: center;
+`;
+
 const Underline = styled.div`
 const Underline = styled.div`
   border-bottom: 1px solid #ffffff;
   border-bottom: 1px solid #ffffff;
 `;
 `;

+ 3 - 7
dashboard/src/main/home/app-dashboard/expanded-app/GHABanner.tsx

@@ -44,17 +44,15 @@ const GHABanner: React.FC<Props> = ({
                 </RefreshButton>
                 </RefreshButton>
               }
               }
             >
             >
-              Your application will not be available until you merge
+              Your application will not be available until you merge the Porter PR.
               <Spacer inline width="5px" />
               <Spacer inline width="5px" />
               <Link
               <Link
                 to={pullRequestUrl}
                 to={pullRequestUrl}
                 target="_blank"
                 target="_blank"
                 hasunderline
                 hasunderline
               >
               >
-                this PR
+                Merge PR
               </Link>
               </Link>
-              <Spacer inline width="5px" />
-              into your branch.
             </Banner>
             </Banner>
           ) : (
           ) : (
             <Banner
             <Banner
@@ -101,12 +99,11 @@ const StyledGHABanner = styled.div`
 `;
 `;
 
 
 const RefreshButton = styled.div`
 const RefreshButton = styled.div`
-  color: #ffffff44;
+  color: #ffffff;
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
   cursor: pointer;
   cursor: pointer;
   :hover {
   :hover {
-    color: #ffffff;
     > img {
     > img {
       opacity: 1;
       opacity: 1;
     }
     }
@@ -118,6 +115,5 @@ const RefreshButton = styled.div`
     justify-content: center;
     justify-content: center;
     height: 11px;
     height: 11px;
     margin-right: 10px;
     margin-right: 10px;
-    opacity: 0.3;
   }
   }
 `;
 `;

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

@@ -35,6 +35,7 @@ import { string, z } from "zod";
 import { PorterJson, PorterYamlSchema, createFinalPorterYaml } from "./schema";
 import { PorterJson, PorterYamlSchema, createFinalPorterYaml } from "./schema";
 import { ReleaseService, Service } from "./serviceTypes";
 import { ReleaseService, Service } from "./serviceTypes";
 import GithubConnectModal from "./GithubConnectModal";
 import GithubConnectModal from "./GithubConnectModal";
+import Link from "components/porter/Link";
 
 
 type Props = RouteComponentProps & {};
 type Props = RouteComponentProps & {};
 
 
@@ -464,12 +465,14 @@ const NewAppFlow: React.FC<Props> = ({ ...props }) => {
                 <Spacer y={0.5} />
                 <Spacer y={0.5} />
                 <Text color="helper">
                 <Text color="helper">
                   Deploy from a Git repository or a Docker registry.
                   Deploy from a Git repository or a Docker registry.
-                  <a
-                    href="https://docs.porter.run/deploying-applications/overview"
+                  <Spacer inline width="5px" />
+                  <Link
+                    hasunderline
+                    to="https://docs.porter.run/standard/deploying-applications/overview"
                     target="_blank"
                     target="_blank"
                   >
                   >
-                    &nbsp;Learn more.
-                  </a>
+                    Learn more
+                  </Link>
                 </Text>
                 </Text>
                 <Spacer y={0.5} />
                 <Spacer y={0.5} />
                 <SourceSelector
                 <SourceSelector

+ 3 - 2
dashboard/src/main/home/modals/AccountSettingsModal.tsx

@@ -10,6 +10,7 @@ import Heading from "components/form-components/Heading";
 import Helper from "components/form-components/Helper";
 import Helper from "components/form-components/Helper";
 
 
 import TabSelector from "components/TabSelector";
 import TabSelector from "components/TabSelector";
+import Link from "components/porter/Link";
 
 
 interface GithubAppAccessData {
 interface GithubAppAccessData {
   username?: string;
   username?: string;
@@ -102,9 +103,9 @@ const AccountSettingsModal = () => {
                   </List>
                   </List>
                   <br />
                   <br />
                   Don't see the right repos?{" "}
                   Don't see the right repos?{" "}
-                  <A href={"/api/integrations/github-app/install"}>
+                  <Link target="_blank" to={"/api/integrations/github-app/install"} hasunderline>
                     Install Porter in more repositories
                     Install Porter in more repositories
-                  </A>
+                  </Link>
                 </>
                 </>
               )}
               )}
             </Placeholder>
             </Placeholder>

+ 6 - 11
dashboard/src/main/home/navbar/Navbar.tsx

@@ -26,15 +26,16 @@ class Navbar extends Component<PropsType, StateType> {
   renderSettingsDropdown = () => {
   renderSettingsDropdown = () => {
     if (this.state.showDropdown) {
     if (this.state.showDropdown) {
       let version = this.context?.capabilities?.version;
       let version = this.context?.capabilities?.version;
+      let userEmail = this.context.user && this.context.user.email;
+      let isLongEmail = userEmail && userEmail.length > 25;
+      userEmail = "sarntdenadtendearnetdne@gmail.com"
       return (
       return (
         <>
         <>
           <CloseOverlay
           <CloseOverlay
             onClick={() => this.setState({ showDropdown: false })}
             onClick={() => this.setState({ showDropdown: false })}
           />
           />
           <Dropdown dropdownWidth="250px" dropdownMaxHeight="200px">
           <Dropdown dropdownWidth="250px" dropdownMaxHeight="200px">
-            <DropdownLabel>
-              {this.context.user && this.context.user.email}
-            </DropdownLabel>
+            <DropdownLabel>{userEmail}</DropdownLabel>
             <UserDropdownButton
             <UserDropdownButton
               onClick={() =>
               onClick={() =>
                 this.context.setCurrentModal("AccountSettingsModal", {})
                 this.context.setCurrentModal("AccountSettingsModal", {})
@@ -87,7 +88,6 @@ const VersionTag = styled.div`
   right: 10px;
   right: 10px;
   top: 15px;
   top: 15px;
   color: #ffffff22;
   color: #ffffff22;
-  font-weight: 400;
 `;
 `;
 
 
 const SettingsIcon = styled.div`
 const SettingsIcon = styled.div`
@@ -125,7 +125,6 @@ const UserDropdownButton = styled.button`
   position: relative;
   position: relative;
   height: 40px;
   height: 40px;
   font-size: 13px;
   font-size: 13px;
-  font-weight: 500;
   font-family: "Work Sans", sans-serif;
   font-family: "Work Sans", sans-serif;
   color: white;
   color: white;
   width: 100%;
   width: 100%;
@@ -162,13 +161,9 @@ const DropdownLabel = styled.div`
   font-size: 13px;
   font-size: 13px;
   height: 40px;
   height: 40px;
   color: #ffffff44;
   color: #ffffff44;
-  font-weight: 500;
-  display: flex;
-  align-items: center;
   padding: 13px;
   padding: 13px;
-  max-width: 180px;
-  white-space: nowrap;
   overflow: hidden;
   overflow: hidden;
+  white-space: nowrap;
   text-overflow: ellipsis;
   text-overflow: ellipsis;
 `;
 `;
 
 
@@ -243,4 +238,4 @@ const NavButton = styled.a`
       props.selected ? "#ffffff" : "#ffffff88"};
       props.selected ? "#ffffff" : "#ffffff88"};
     font-size: 20px;
     font-size: 20px;
   }
   }
-`;
+`;

+ 10 - 9
dashboard/src/main/home/project-settings/ProjectSettings.tsx

@@ -14,6 +14,8 @@ import { RouteComponentProps, withRouter, WithRouterProps } from "react-router";
 import { getQueryParam } from "shared/routing";
 import { getQueryParam } from "shared/routing";
 import APITokensSection from "./APITokensSection";
 import APITokensSection from "./APITokensSection";
 import _ from "lodash";
 import _ from "lodash";
+import Link from "components/porter/Link";
+import Spacer from "components/porter/Spacer";
 
 
 type PropsType = RouteComponentProps & WithAuthProps & {};
 type PropsType = RouteComponentProps & WithAuthProps & {};
 
 
@@ -153,16 +155,15 @@ class ProjectSettings extends Component<PropsType, StateType> {
           <Helper>
           <Helper>
             Destruction of resources sometimes results in dangling resources. To
             Destruction of resources sometimes results in dangling resources. To
             ensure that everything has been properly destroyed, please visit
             ensure that everything has been properly destroyed, please visit
-            your cloud provider's console. Instructions to properly delete all
-            resources can be found
-            <a
-              target="none"
-              href="https://docs.getporter.dev/docs/deleting-dangling-resources"
+            your cloud provider's console.
+            <Spacer inline width="5px" />
+            <Link
+              target="_blank"
+              hasunderline
+              to="https://docs.porter.run/other/deleting-dangling-resources"
             >
             >
-              {" "}
-              here
-            </a>
-            .
+              Deletion instructions
+            </Link>
           </Helper>
           </Helper>
 
 
           <Warning highlight={true}>This action cannot be undone.</Warning>
           <Warning highlight={true}>This action cannot be undone.</Warning>

+ 2 - 2
dashboard/src/shared/common.tsx

@@ -102,12 +102,12 @@ export const integrationList: any = {
   gcp: {
   gcp: {
     icon: gcp,
     icon: gcp,
     label: "GCP",
     label: "GCP",
-    tagline: "Coming soon"
+    tagline: "Contact support@porter.run"
   },
   },
   azure: {
   azure: {
     icon: azure,
     icon: azure,
     label: "Azure",
     label: "Azure",
-    tagline: "Coming soon"
+    tagline: "Contact support@porter.run"
   },
   },
   do: {
   do: {
     icon: digitalOcean,
     icon: digitalOcean,

+ 3 - 0
dashboard/src/shared/hardcodedNameDict.tsx

@@ -1,3 +1,5 @@
+import lightning from "../assets/lightning.png";
+
 const hardcodedNames: { [key: string]: string } = {
 const hardcodedNames: { [key: string]: string } = {
   agones: "Agones System",
   agones: "Agones System",
   docker: "Docker",
   docker: "Docker",
@@ -64,6 +66,7 @@ const hardcodedIcons: { [key: string]: string } = {
   "tailscale-relay": "https://play-lh.googleusercontent.com/wczDL05-AOb39FcL58L32h6j_TrzzGTXDLlOrOmJ-aNsnoGsT1Gkk2vU4qyTb7tGxRw=w240-h480-rw",
   "tailscale-relay": "https://play-lh.googleusercontent.com/wczDL05-AOb39FcL58L32h6j_TrzzGTXDLlOrOmJ-aNsnoGsT1Gkk2vU4qyTb7tGxRw=w240-h480-rw",
   "postgres-toolbox": "https://cdn-icons-png.flaticon.com/512/5133/5133626.png",
   "postgres-toolbox": "https://cdn-icons-png.flaticon.com/512/5133/5133626.png",
   "ecr-secrets-updater": "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/amazonwebservices/amazonwebservices-original.svg",
   "ecr-secrets-updater": "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/amazonwebservices/amazonwebservices-original.svg",
+  "porter-agent": lightning,
 };
 };
 
 
 export { hardcodedNames, hardcodedIcons };
 export { hardcodedNames, hardcodedIcons };