Alexander Belanger 5 лет назад
Родитель
Сommit
2152a9da83

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

@@ -26,7 +26,7 @@ type StateType = {
 export default class ResourceTab extends Component<PropsType, StateType> {
 export default class ResourceTab extends Component<PropsType, StateType> {
   state = {
   state = {
     expanded: this.props.expanded || false,
     expanded: this.props.expanded || false,
-    showTooltip: false,
+    showTooltip: false
   };
   };
 
 
   renderDropdownIcon = () => {
   renderDropdownIcon = () => {
@@ -95,7 +95,7 @@ export default class ResourceTab extends Component<PropsType, StateType> {
       handleClick,
       handleClick,
       selected,
       selected,
       status,
       status,
-      roundAllCorners,
+      roundAllCorners
     } = this.props;
     } = this.props;
     return (
     return (
       <StyledResourceTab
       <StyledResourceTab

+ 5 - 6
dashboard/src/components/SaveButton.tsx

@@ -86,7 +86,7 @@ const StatusWrapper = styled.div`
     font-size: 18px;
     font-size: 18px;
     margin-right: 10px;
     margin-right: 10px;
     color: ${(props: { successful: boolean }) =>
     color: ${(props: { successful: boolean }) =>
-    props.successful ? "#4797ff" : "#fcba03"};
+      props.successful ? "#4797ff" : "#fcba03"};
   }
   }
 
 
   animation: statusFloatIn 0.5s;
   animation: statusFloatIn 0.5s;
@@ -132,15 +132,14 @@ const Button = styled.button`
   text-align: left;
   text-align: left;
   border: 0;
   border: 0;
   border-radius: 5px;
   border-radius: 5px;
-  background: ${(props) => (!props.disabled ? props.color : "#aaaabb")};
-  box-shadow: ${(props) =>
-    !props.disabled ? "0 2px 5px 0 #00000030" : "none"};
-  cursor: ${(props) => (!props.disabled ? "pointer" : "default")};
+  background: ${props => (!props.disabled ? props.color : "#aaaabb")};
+  box-shadow: ${props => (!props.disabled ? "0 2px 5px 0 #00000030" : "none")};
+  cursor: ${props => (!props.disabled ? "pointer" : "default")};
   user-select: none;
   user-select: none;
   :focus {
   :focus {
     outline: 0;
     outline: 0;
   }
   }
   :hover {
   :hover {
-    filter: ${(props) => (!props.disabled ? "brightness(120%)" : "")};
+    filter: ${props => (!props.disabled ? "brightness(120%)" : "")};
   }
   }
 `;
 `;

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

@@ -17,7 +17,7 @@ type StateType = {};
 
 
 export default class Selector extends Component<PropsType, StateType> {
 export default class Selector extends Component<PropsType, StateType> {
   state = {
   state = {
-    expanded: false,
+    expanded: false
   };
   };
 
 
   wrapperRef: any = React.createRef();
   wrapperRef: any = React.createRef();
@@ -192,7 +192,7 @@ const Dropdown = styled.div`
 
 
 const StyledSelector = styled.div<{ width: string }>`
 const StyledSelector = styled.div<{ width: string }>`
   position: relative;
   position: relative;
-  width: ${(props) => props.width};
+  width: ${props => props.width};
 `;
 `;
 
 
 const MainSelector = styled.div`
 const MainSelector = styled.div`

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

@@ -27,7 +27,7 @@ export default class TabRegion extends Component<PropsType, StateType> {
   componentDidUpdate(prevProps: PropsType) {
   componentDidUpdate(prevProps: PropsType) {
     let { options, currentTab } = this.props;
     let { options, currentTab } = this.props;
     if (prevProps.options !== options) {
     if (prevProps.options !== options) {
-      if (options.filter((x) => x.value === currentTab).length === 0) {
+      if (options.filter(x => x.value === currentTab).length === 0) {
         this.props.setCurrentTab(this.defaultTab());
         this.props.setCurrentTab(this.defaultTab());
       }
       }
     }
     }

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

@@ -11,7 +11,7 @@ type StateType = {
 
 
 export default class TooltipParent extends Component<PropsType, StateType> {
 export default class TooltipParent extends Component<PropsType, StateType> {
   state = {
   state = {
-    showTooltip: false,
+    showTooltip: false
   };
   };
 
 
   renderTooltip = (): JSX.Element | undefined => {
   renderTooltip = (): JSX.Element | undefined => {

+ 2 - 2
dashboard/src/main/CurrentError.tsx

@@ -12,7 +12,7 @@ type StateType = {};
 
 
 export default class CurrentError extends Component<PropsType, StateType> {
 export default class CurrentError extends Component<PropsType, StateType> {
   state = {
   state = {
-    expanded: false,
+    expanded: false
   };
   };
 
 
   componentDidUpdate(prevProps: PropsType) {
   componentDidUpdate(prevProps: PropsType) {
@@ -32,7 +32,7 @@ export default class CurrentError extends Component<PropsType, StateType> {
           <StyledCurrentError onClick={() => this.setState({ expanded: true })}>
           <StyledCurrentError onClick={() => this.setState({ expanded: true })}>
             <ErrorText>Error: {this.props.currentError}</ErrorText>
             <ErrorText>Error: {this.props.currentError}</ErrorText>
             <CloseButton
             <CloseButton
-              onClick={(e) => {
+              onClick={e => {
                 this.context.setCurrentError(null);
                 this.context.setCurrentError(null);
                 e.stopPropagation();
                 e.stopPropagation();
               }}
               }}

+ 6 - 6
dashboard/src/main/Login.tsx

@@ -23,7 +23,7 @@ export default class Login extends Component<PropsType, StateType> {
     email: "",
     email: "",
     password: "",
     password: "",
     emailError: false,
     emailError: false,
-    credentialError: false,
+    credentialError: false
   };
   };
 
 
   handleKeyDown = (e: any) => {
   handleKeyDown = (e: any) => {
@@ -57,11 +57,11 @@ export default class Login extends Component<PropsType, StateType> {
           "",
           "",
           {
           {
             email: email,
             email: email,
-            password: password,
+            password: password
           },
           },
           {}
           {}
         )
         )
-        .then((res) => {
+        .then(res => {
           // TODO: case and set credential error
           // TODO: case and set credential error
           if (res?.data?.redirect) {
           if (res?.data?.redirect) {
             window.location.href = res.data.redirect;
             window.location.href = res.data.redirect;
@@ -70,7 +70,7 @@ export default class Login extends Component<PropsType, StateType> {
             authenticate();
             authenticate();
           }
           }
         })
         })
-        .catch((err) =>
+        .catch(err =>
           this.context.setCurrentError(err.response.data.errors[0])
           this.context.setCurrentError(err.response.data.errors[0])
         );
         );
     }
     }
@@ -137,7 +137,7 @@ export default class Login extends Component<PropsType, StateType> {
                   this.setState({
                   this.setState({
                     email: e.target.value,
                     email: e.target.value,
                     emailError: false,
                     emailError: false,
-                    credentialError: false,
+                    credentialError: false
                   })
                   })
                 }
                 }
                 valid={!credentialError && !emailError}
                 valid={!credentialError && !emailError}
@@ -152,7 +152,7 @@ export default class Login extends Component<PropsType, StateType> {
                 onChange={(e: ChangeEvent<HTMLInputElement>) =>
                 onChange={(e: ChangeEvent<HTMLInputElement>) =>
                   this.setState({
                   this.setState({
                     password: e.target.value,
                     password: e.target.value,
-                    credentialError: false,
+                    credentialError: false
                   })
                   })
                 }
                 }
                 valid={!credentialError}
                 valid={!credentialError}

+ 5 - 5
dashboard/src/main/Main.tsx

@@ -24,7 +24,7 @@ export default class Main extends Component<PropsType, StateType> {
   state = {
   state = {
     loading: true,
     loading: true,
     isLoggedIn: false,
     isLoggedIn: false,
-    initialized: localStorage.getItem("init") === "true",
+    initialized: localStorage.getItem("init") === "true"
   };
   };
 
 
   componentDidMount() {
   componentDidMount() {
@@ -34,19 +34,19 @@ export default class Main extends Component<PropsType, StateType> {
     error && setCurrentError(error);
     error && setCurrentError(error);
     api
     api
       .checkAuth("", {}, {})
       .checkAuth("", {}, {})
-      .then((res) => {
+      .then(res => {
         if (res && res.data) {
         if (res && res.data) {
           setUser(res?.data?.id, res?.data?.email);
           setUser(res?.data?.id, res?.data?.email);
           this.setState({
           this.setState({
             isLoggedIn: true,
             isLoggedIn: true,
             initialized: true,
             initialized: true,
-            loading: false,
+            loading: false
           });
           });
         } else {
         } else {
           this.setState({ isLoggedIn: false, loading: false });
           this.setState({ isLoggedIn: false, loading: false });
         }
         }
       })
       })
-      .catch((err) => this.setState({ isLoggedIn: false, loading: false }));
+      .catch(err => this.setState({ isLoggedIn: false, loading: false }));
   }
   }
 
 
   initialize = () => {
   initialize = () => {
@@ -106,7 +106,7 @@ export default class Main extends Component<PropsType, StateType> {
         />
         />
         <Route
         <Route
           path={`/:baseRoute`}
           path={`/:baseRoute`}
-          render={(routeProps) => {
+          render={routeProps => {
             const baseRoute = routeProps.match.params.baseRoute;
             const baseRoute = routeProps.match.params.baseRoute;
             if (
             if (
               this.state.isLoggedIn &&
               this.state.isLoggedIn &&

+ 6 - 6
dashboard/src/main/Register.tsx

@@ -25,7 +25,7 @@ export default class Register extends Component<PropsType, StateType> {
     password: "",
     password: "",
     confirmPassword: "",
     confirmPassword: "",
     emailError: false,
     emailError: false,
-    confirmPasswordError: false,
+    confirmPasswordError: false
   };
   };
 
 
   handleKeyDown = (e: any) => {
   handleKeyDown = (e: any) => {
@@ -66,7 +66,7 @@ export default class Register extends Component<PropsType, StateType> {
           "",
           "",
           {
           {
             email: email,
             email: email,
-            password: password,
+            password: password
           },
           },
           {}
           {}
         )
         )
@@ -78,7 +78,7 @@ export default class Register extends Component<PropsType, StateType> {
             authenticate();
             authenticate();
           }
           }
         })
         })
-        .catch((err) => setCurrentError(err.response.data.errors[0]));
+        .catch(err => setCurrentError(err.response.data.errors[0]));
     }
     }
   };
   };
 
 
@@ -112,7 +112,7 @@ export default class Register extends Component<PropsType, StateType> {
       password,
       password,
       confirmPassword,
       confirmPassword,
       emailError,
       emailError,
-      confirmPasswordError,
+      confirmPasswordError
     } = this.state;
     } = this.state;
 
 
     return (
     return (
@@ -154,7 +154,7 @@ export default class Register extends Component<PropsType, StateType> {
               onChange={(e: ChangeEvent<HTMLInputElement>) =>
               onChange={(e: ChangeEvent<HTMLInputElement>) =>
                 this.setState({
                 this.setState({
                   password: e.target.value,
                   password: e.target.value,
-                  confirmPasswordError: false,
+                  confirmPasswordError: false
                 })
                 })
               }
               }
               valid={true}
               valid={true}
@@ -167,7 +167,7 @@ export default class Register extends Component<PropsType, StateType> {
                 onChange={(e: ChangeEvent<HTMLInputElement>) =>
                 onChange={(e: ChangeEvent<HTMLInputElement>) =>
                   this.setState({
                   this.setState({
                     confirmPassword: e.target.value,
                     confirmPassword: e.target.value,
-                    confirmPasswordError: false,
+                    confirmPasswordError: false
                   })
                   })
                 }
                 }
                 valid={!confirmPasswordError}
                 valid={!confirmPasswordError}

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

@@ -72,9 +72,9 @@ class ContextProvider extends Component {
         currentProject: null,
         currentProject: null,
         projects: [],
         projects: [],
         user: null,
         user: null,
-        devOpsMode: true,
+        devOpsMode: true
       });
       });
-    },
+    }
   };
   };
 
 
   render() {
   render() {

+ 3 - 3
dashboard/src/shared/ansiparser.tsx

@@ -8,7 +8,7 @@ const foregroundColors = {
   "35": "magenta",
   "35": "magenta",
   "36": "cyan",
   "36": "cyan",
   "37": "white",
   "37": "white",
-  "90": "grey",
+  "90": "grey"
 } as Record<string, string>;
 } as Record<string, string>;
 
 
 const backgroundColors = {
 const backgroundColors = {
@@ -19,13 +19,13 @@ const backgroundColors = {
   "44": "blue",
   "44": "blue",
   "45": "magenta",
   "45": "magenta",
   "46": "cyan",
   "46": "cyan",
-  "47": "white",
+  "47": "white"
 } as Record<string, string>;
 } as Record<string, string>;
 
 
 const styles = {
 const styles = {
   "1": "bold",
   "1": "bold",
   "3": "italic",
   "3": "italic",
-  "4": "underline",
+  "4": "underline"
 } as Record<string, string>;
 } as Record<string, string>;
 
 
 const eraseChar = (matchingText: any, result: any) => {
 const eraseChar = (matchingText: any, result: any) => {

+ 69 - 72
dashboard/src/shared/api.tsx

@@ -18,7 +18,7 @@ const connectECRRegistry = baseApi<
     aws_integration_id: string;
     aws_integration_id: string;
   },
   },
   { id: number }
   { id: number }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.id}/registries`;
   return `/api/projects/${pathParams.id}/registries`;
 });
 });
 
 
@@ -29,7 +29,7 @@ const connectGCRRegistry = baseApi<
     url: string;
     url: string;
   },
   },
   { id: number }
   { id: number }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.id}/registries`;
   return `/api/projects/${pathParams.id}/registries`;
 });
 });
 
 
@@ -41,7 +41,7 @@ const createAWSIntegration = baseApi<
     aws_secret_access_key: string;
     aws_secret_access_key: string;
   },
   },
   { id: number }
   { id: number }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.id}/integrations/aws`;
   return `/api/projects/${pathParams.id}/integrations/aws`;
 });
 });
 
 
@@ -54,7 +54,7 @@ const createDOCR = baseApi<
   {
   {
     project_id: number;
     project_id: number;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.project_id}/provision/docr`;
   return `/api/projects/${pathParams.project_id}/provision/docr`;
 });
 });
 
 
@@ -67,7 +67,7 @@ const createDOKS = baseApi<
   {
   {
     project_id: number;
     project_id: number;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.project_id}/provision/doks`;
   return `/api/projects/${pathParams.project_id}/provision/doks`;
 });
 });
 
 
@@ -80,7 +80,7 @@ const createGCPIntegration = baseApi<
   {
   {
     project_id: number;
     project_id: number;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.project_id}/integrations/gcp`;
   return `/api/projects/${pathParams.project_id}/integrations/gcp`;
 });
 });
 
 
@@ -91,7 +91,7 @@ const createGCR = baseApi<
   {
   {
     project_id: number;
     project_id: number;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.project_id}/provision/gcr`;
   return `/api/projects/${pathParams.project_id}/provision/gcr`;
 });
 });
 
 
@@ -108,7 +108,7 @@ const createGHAction = baseApi<
     RELEASE_NAME: string;
     RELEASE_NAME: string;
     RELEASE_NAMESPACE: string;
     RELEASE_NAMESPACE: string;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   let { project_id, CLUSTER_ID, RELEASE_NAME, RELEASE_NAMESPACE } = pathParams;
   let { project_id, CLUSTER_ID, RELEASE_NAME, RELEASE_NAMESPACE } = pathParams;
   return `/api/projects/${project_id}/ci/actions?cluster_id=${CLUSTER_ID}&name=${RELEASE_NAME}&namespace=${RELEASE_NAMESPACE}`;
   return `/api/projects/${project_id}/ci/actions?cluster_id=${CLUSTER_ID}&name=${RELEASE_NAME}&namespace=${RELEASE_NAMESPACE}`;
 });
 });
@@ -121,7 +121,7 @@ const createGKE = baseApi<
   {
   {
     project_id: number;
     project_id: number;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.project_id}/provision/gke`;
   return `/api/projects/${pathParams.project_id}/provision/gke`;
 });
 });
 
 
@@ -132,11 +132,11 @@ const createInvite = baseApi<
   {
   {
     id: number;
     id: number;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.id}/invites`;
   return `/api/projects/${pathParams.id}/invites`;
 });
 });
 
 
-const createProject = baseApi<{ name: string }, {}>("POST", (pathParams) => {
+const createProject = baseApi<{ name: string }, {}>("POST", pathParams => {
   return `/api/projects`;
   return `/api/projects`;
 });
 });
 
 
@@ -146,18 +146,18 @@ const deleteCluster = baseApi<
     project_id: number;
     project_id: number;
     cluster_id: number;
     cluster_id: number;
   }
   }
->("DELETE", (pathParams) => {
+>("DELETE", pathParams => {
   return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}`;
   return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}`;
 });
 });
 
 
 const deleteInvite = baseApi<{}, { id: number; invId: number }>(
 const deleteInvite = baseApi<{}, { id: number; invId: number }>(
   "DELETE",
   "DELETE",
-  (pathParams) => {
+  pathParams => {
     return `/api/projects/${pathParams.id}/invites/${pathParams.invId}`;
     return `/api/projects/${pathParams.id}/invites/${pathParams.invId}`;
   }
   }
 );
 );
 
 
-const deleteProject = baseApi<{}, { id: number }>("DELETE", (pathParams) => {
+const deleteProject = baseApi<{}, { id: number }>("DELETE", pathParams => {
   return `/api/projects/${pathParams.id}`;
   return `/api/projects/${pathParams.id}`;
 });
 });
 
 
@@ -176,7 +176,7 @@ const deployTemplate = baseApi<
     name: string;
     name: string;
     version: string;
     version: string;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   let { cluster_id, id, name, version } = pathParams;
   let { cluster_id, id, name, version } = pathParams;
   return `/api/projects/${id}/deploy/${name}/${version}?cluster_id=${cluster_id}`;
   return `/api/projects/${id}/deploy/${name}/${version}?cluster_id=${cluster_id}`;
 });
 });
@@ -189,7 +189,7 @@ const destroyCluster = baseApi<
     project_id: number;
     project_id: number;
     infra_id: number;
     infra_id: number;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.project_id}/infra/${pathParams.infra_id}/eks/destroy`;
   return `/api/projects/${pathParams.project_id}/infra/${pathParams.infra_id}/eks/destroy`;
 });
 });
 
 
@@ -205,7 +205,7 @@ const getBranchContents = baseApi<
     name: string;
     name: string;
     branch: string;
     branch: string;
   }
   }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name}/${pathParams.branch}/contents`;
   return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name}/${pathParams.branch}/contents`;
 });
 });
 
 
@@ -218,7 +218,7 @@ const getBranches = baseApi<
     owner: string;
     owner: string;
     name: string;
     name: string;
   }
   }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name}/branches`;
   return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name}/branches`;
 });
 });
 
 
@@ -229,7 +229,7 @@ const getChart = baseApi<
     storage: StorageType;
     storage: StorageType;
   },
   },
   { id: number; name: string; revision: number }
   { id: number; name: string; revision: number }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/releases/${pathParams.name}/${pathParams.revision}`;
   return `/api/projects/${pathParams.id}/releases/${pathParams.name}/${pathParams.revision}`;
 });
 });
 
 
@@ -244,7 +244,7 @@ const getCharts = baseApi<
     statusFilter: string[];
     statusFilter: string[];
   },
   },
   { id: number }
   { id: number }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/releases`;
   return `/api/projects/${pathParams.id}/releases`;
 });
 });
 
 
@@ -255,7 +255,7 @@ const getChartComponents = baseApi<
     storage: StorageType;
     storage: StorageType;
   },
   },
   { id: number; name: string; revision: number }
   { id: number; name: string; revision: number }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/releases/${pathParams.name}/${pathParams.revision}/components`;
   return `/api/projects/${pathParams.id}/releases/${pathParams.name}/${pathParams.revision}/components`;
 });
 });
 
 
@@ -266,13 +266,13 @@ const getChartControllers = baseApi<
     storage: StorageType;
     storage: StorageType;
   },
   },
   { id: number; name: string; revision: number }
   { id: number; name: string; revision: number }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/releases/${pathParams.name}/${pathParams.revision}/controllers`;
   return `/api/projects/${pathParams.id}/releases/${pathParams.name}/${pathParams.revision}/controllers`;
 });
 });
 
 
 const getClusterIntegrations = baseApi("GET", "/api/integrations/cluster");
 const getClusterIntegrations = baseApi("GET", "/api/integrations/cluster");
 
 
-const getClusters = baseApi<{}, { id: number }>("GET", (pathParams) => {
+const getClusters = baseApi<{}, { id: number }>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/clusters`;
   return `/api/projects/${pathParams.id}/clusters`;
 });
 });
 
 
@@ -282,7 +282,7 @@ const getGitRepoList = baseApi<
     project_id: number;
     project_id: number;
     git_repo_id: number;
     git_repo_id: number;
   }
   }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos`;
   return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos`;
 });
 });
 
 
@@ -291,7 +291,7 @@ const getGitRepos = baseApi<
   {
   {
     project_id: number;
     project_id: number;
   }
   }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.project_id}/gitrepos`;
   return `/api/projects/${pathParams.project_id}/gitrepos`;
 });
 });
 
 
@@ -301,7 +301,7 @@ const getImageRepos = baseApi<
     project_id: number;
     project_id: number;
     registry_id: number;
     registry_id: number;
   }
   }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}/repositories`;
   return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}/repositories`;
 });
 });
 
 
@@ -312,7 +312,7 @@ const getImageTags = baseApi<
     registry_id: number;
     registry_id: number;
     repo_name: string;
     repo_name: string;
   }
   }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}/repositories/${pathParams.repo_name}`;
   return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}/repositories/${pathParams.repo_name}`;
 });
 });
 
 
@@ -321,7 +321,7 @@ const getInfra = baseApi<
   {
   {
     project_id: number;
     project_id: number;
   }
   }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.project_id}/infra`;
   return `/api/projects/${pathParams.project_id}/infra`;
 });
 });
 
 
@@ -330,11 +330,11 @@ const getIngress = baseApi<
     cluster_id: number;
     cluster_id: number;
   },
   },
   { name: string; namespace: string; id: number }
   { name: string; namespace: string; id: number }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/k8s/${pathParams.namespace}/ingress/${pathParams.name}`;
   return `/api/projects/${pathParams.id}/k8s/${pathParams.namespace}/ingress/${pathParams.name}`;
 });
 });
 
 
-const getInvites = baseApi<{}, { id: number }>("GET", (pathParams) => {
+const getInvites = baseApi<{}, { id: number }>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/invites`;
   return `/api/projects/${pathParams.id}/invites`;
 });
 });
 
 
@@ -344,23 +344,23 @@ const getMatchingPods = baseApi<
     selectors: string[];
     selectors: string[];
   },
   },
   { id: number }
   { id: number }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/k8s/pods`;
   return `/api/projects/${pathParams.id}/k8s/pods`;
 });
 });
 
 
 const getMetrics = baseApi<
 const getMetrics = baseApi<
   {
   {
     cluster_id: number;
     cluster_id: number;
-    metric: string,
-    shouldsum: boolean,
-    pods: string[],
-    namespace: string,
-    startrange: number,
-    endrange: number,
-    resolution: string,
+    metric: string;
+    shouldsum: boolean;
+    pods: string[];
+    namespace: string;
+    startrange: number;
+    endrange: number;
+    resolution: string;
   },
   },
   { id: number }
   { id: number }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/k8s/metrics`;
   return `/api/projects/${pathParams.id}/k8s/metrics`;
 });
 });
 
 
@@ -369,7 +369,7 @@ const getNamespaces = baseApi<
     cluster_id: number;
     cluster_id: number;
   },
   },
   { id: number }
   { id: number }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/k8s/namespaces`;
   return `/api/projects/${pathParams.id}/k8s/namespaces`;
 });
 });
 
 
@@ -378,36 +378,33 @@ const getOAuthIds = baseApi<
   {
   {
     project_id: number;
     project_id: number;
   }
   }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.project_id}/integrations/oauth`;
   return `/api/projects/${pathParams.project_id}/integrations/oauth`;
 });
 });
 
 
-const getProjectClusters = baseApi<{}, { id: number }>("GET", (pathParams) => {
+const getProjectClusters = baseApi<{}, { id: number }>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/clusters`;
   return `/api/projects/${pathParams.id}/clusters`;
 });
 });
 
 
-const getProjectRegistries = baseApi<{}, { id: number }>(
-  "GET",
-  (pathParams) => {
-    return `/api/projects/${pathParams.id}/registries`;
-  }
-);
+const getProjectRegistries = baseApi<{}, { id: number }>("GET", pathParams => {
+  return `/api/projects/${pathParams.id}/registries`;
+});
 
 
-const getProjectRepos = baseApi<{}, { id: number }>("GET", (pathParams) => {
+const getProjectRepos = baseApi<{}, { id: number }>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/repos`;
   return `/api/projects/${pathParams.id}/repos`;
 });
 });
 
 
-const getProjects = baseApi<{}, { id: number }>("GET", (pathParams) => {
+const getProjects = baseApi<{}, { id: number }>("GET", pathParams => {
   return `/api/users/${pathParams.id}/projects`;
   return `/api/users/${pathParams.id}/projects`;
 });
 });
 
 
 const getPrometheusIsInstalled = baseApi<
 const getPrometheusIsInstalled = baseApi<
-{
-  cluster_id: number;
-},
-{ id: number }
->("GET", (pathParams) => {
-return `/api/projects/${pathParams.id}/k8s/prometheus/detect`;
+  {
+    cluster_id: number;
+  },
+  { id: number }
+>("GET", pathParams => {
+  return `/api/projects/${pathParams.id}/k8s/prometheus/detect`;
 });
 });
 
 
 const getRegistryIntegrations = baseApi("GET", "/api/integrations/registry");
 const getRegistryIntegrations = baseApi("GET", "/api/integrations/registry");
@@ -419,7 +416,7 @@ const getReleaseToken = baseApi<
     storage: StorageType;
     storage: StorageType;
   },
   },
   { name: string; id: number }
   { name: string; id: number }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/releases/${pathParams.name}/webhook_token`;
   return `/api/projects/${pathParams.id}/releases/${pathParams.name}/webhook_token`;
 });
 });
 
 
@@ -431,7 +428,7 @@ const destroyEKS = baseApi<
     project_id: number;
     project_id: number;
     infra_id: number;
     infra_id: number;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.project_id}/infra/${pathParams.infra_id}/eks/destroy`;
   return `/api/projects/${pathParams.project_id}/infra/${pathParams.infra_id}/eks/destroy`;
 });
 });
 
 
@@ -443,7 +440,7 @@ const destroyGKE = baseApi<
     project_id: number;
     project_id: number;
     infra_id: number;
     infra_id: number;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.project_id}/infra/${pathParams.infra_id}/gke/destroy`;
   return `/api/projects/${pathParams.project_id}/infra/${pathParams.infra_id}/gke/destroy`;
 });
 });
 
 
@@ -455,13 +452,13 @@ const destroyDOKS = baseApi<
     project_id: number;
     project_id: number;
     infra_id: number;
     infra_id: number;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.project_id}/infra/${pathParams.infra_id}/doks/destroy`;
   return `/api/projects/${pathParams.project_id}/infra/${pathParams.infra_id}/doks/destroy`;
 });
 });
 
 
 const getRepoIntegrations = baseApi("GET", "/api/integrations/repo");
 const getRepoIntegrations = baseApi("GET", "/api/integrations/repo");
 
 
-const getRepos = baseApi<{}, { id: number }>("GET", (pathParams) => {
+const getRepos = baseApi<{}, { id: number }>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/repos`;
   return `/api/projects/${pathParams.id}/repos`;
 });
 });
 
 
@@ -472,20 +469,20 @@ const getRevisions = baseApi<
     storage: StorageType;
     storage: StorageType;
   },
   },
   { id: number; name: string }
   { id: number; name: string }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/projects/${pathParams.id}/releases/${pathParams.name}/history`;
   return `/api/projects/${pathParams.id}/releases/${pathParams.name}/history`;
 });
 });
 
 
 const getTemplateInfo = baseApi<{}, { name: string; version: string }>(
 const getTemplateInfo = baseApi<{}, { name: string; version: string }>(
   "GET",
   "GET",
-  (pathParams) => {
+  pathParams => {
     return `/api/templates/${pathParams.name}/${pathParams.version}`;
     return `/api/templates/${pathParams.name}/${pathParams.version}`;
   }
   }
 );
 );
 
 
 const getTemplates = baseApi("GET", "/api/templates");
 const getTemplates = baseApi("GET", "/api/templates");
 
 
-const getUser = baseApi<{}, { id: number }>("GET", (pathParams) => {
+const getUser = baseApi<{}, { id: number }>("GET", pathParams => {
   return `/api/users/${pathParams.id}`;
   return `/api/users/${pathParams.id}`;
 });
 });
 
 
@@ -494,7 +491,7 @@ const linkGithubProject = baseApi<
   {
   {
     project_id: number;
     project_id: number;
   }
   }
->("GET", (pathParams) => {
+>("GET", pathParams => {
   return `/api/oauth/projects/${pathParams.project_id}/github`;
   return `/api/oauth/projects/${pathParams.project_id}/github`;
 });
 });
 
 
@@ -511,7 +508,7 @@ const provisionECR = baseApi<
     aws_integration_id: string;
     aws_integration_id: string;
   },
   },
   { id: number }
   { id: number }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.id}/provision/ecr`;
   return `/api/projects/${pathParams.id}/provision/ecr`;
 });
 });
 
 
@@ -521,7 +518,7 @@ const provisionEKS = baseApi<
     aws_integration_id: string;
     aws_integration_id: string;
   },
   },
   { id: number }
   { id: number }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   return `/api/projects/${pathParams.id}/provision/eks`;
   return `/api/projects/${pathParams.id}/provision/eks`;
 });
 });
 
 
@@ -541,7 +538,7 @@ const rollbackChart = baseApi<
     name: string;
     name: string;
     cluster_id: number;
     cluster_id: number;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   let { id, name, cluster_id } = pathParams;
   let { id, name, cluster_id } = pathParams;
   return `/api/projects/${id}/releases/${name}/rollback?cluster_id=${cluster_id}`;
   return `/api/projects/${id}/releases/${name}/rollback?cluster_id=${cluster_id}`;
 });
 });
@@ -555,7 +552,7 @@ const uninstallTemplate = baseApi<
     namespace: string;
     namespace: string;
     storage: StorageType;
     storage: StorageType;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   let { id, name, cluster_id, storage, namespace } = pathParams;
   let { id, name, cluster_id, storage, namespace } = pathParams;
   return `/api/projects/${id}/deploy/${name}?cluster_id=${cluster_id}&namespace=${namespace}&storage=${storage}`;
   return `/api/projects/${id}/deploy/${name}?cluster_id=${cluster_id}&namespace=${namespace}&storage=${storage}`;
 });
 });
@@ -566,7 +563,7 @@ const updateUser = baseApi<
     allowedContexts?: string[];
     allowedContexts?: string[];
   },
   },
   { id: number }
   { id: number }
->("PUT", (pathParams) => {
+>("PUT", pathParams => {
   return `/api/users/${pathParams.id}`;
   return `/api/users/${pathParams.id}`;
 });
 });
 
 
@@ -581,7 +578,7 @@ const upgradeChartValues = baseApi<
     name: string;
     name: string;
     cluster_id: number;
     cluster_id: number;
   }
   }
->("POST", (pathParams) => {
+>("POST", pathParams => {
   let { id, name, cluster_id } = pathParams;
   let { id, name, cluster_id } = pathParams;
   return `/api/projects/${id}/releases/${name}/upgrade?cluster_id=${cluster_id}`;
   return `/api/projects/${id}/releases/${name}/upgrade?cluster_id=${cluster_id}`;
 });
 });
@@ -648,5 +645,5 @@ export default {
   rollbackChart,
   rollbackChart,
   uninstallTemplate,
   uninstallTemplate,
   updateUser,
   updateUser,
-  upgradeChartValues,
+  upgradeChartValues
 };
 };

+ 6 - 6
dashboard/src/shared/baseApi.tsx

@@ -21,23 +21,23 @@ export const baseApi = <T extends {}, S = {}>(
     if (requestType === "POST") {
     if (requestType === "POST") {
       return axios.post(endpointString, params, {
       return axios.post(endpointString, params, {
         headers: {
         headers: {
-          Authorization: `Bearer ${token}`,
-        },
+          Authorization: `Bearer ${token}`
+        }
       });
       });
     } else if (requestType === "PUT") {
     } else if (requestType === "PUT") {
       return axios.put(endpointString, params, {
       return axios.put(endpointString, params, {
         headers: {
         headers: {
-          Authorization: `Bearer ${token}`,
-        },
+          Authorization: `Bearer ${token}`
+        }
       });
       });
     } else if (requestType === "DELETE") {
     } else if (requestType === "DELETE") {
       return axios.delete(endpointString, params);
       return axios.delete(endpointString, params);
     } else {
     } else {
       return axios.get(endpointString, {
       return axios.get(endpointString, {
         params,
         params,
-        paramsSerializer: function (params) {
+        paramsSerializer: function(params) {
           return qs.stringify(params, { arrayFormat: "repeat" });
           return qs.stringify(params, { arrayFormat: "repeat" });
-        },
+        }
       });
       });
     }
     }
   };
   };

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

@@ -10,7 +10,7 @@ export const infraNames: any = {
   gcr: "Google Container Registry (GCR)",
   gcr: "Google Container Registry (GCR)",
   gke: "Google Kubernetes Engine (GKE)",
   gke: "Google Kubernetes Engine (GKE)",
   docr: "Digital Ocean Container Registry",
   docr: "Digital Ocean Container Registry",
-  doks: "Digital Ocean Kubernetes Service",
+  doks: "Digital Ocean Kubernetes Service"
 };
 };
 
 
 export const integrationList: any = {
 export const integrationList: any = {
@@ -18,68 +18,68 @@ export const integrationList: any = {
     icon:
     icon:
       "https://uxwing.com/wp-content/themes/uxwing/download/10-brands-and-social-media/kubernetes.png",
       "https://uxwing.com/wp-content/themes/uxwing/download/10-brands-and-social-media/kubernetes.png",
     label: "Kubernetes",
     label: "Kubernetes",
-    buttonText: "Add a Cluster",
+    buttonText: "Add a Cluster"
   },
   },
   repo: {
   repo: {
     icon:
     icon:
       "https://3.bp.blogspot.com/-xhNpNJJyQhk/XIe4GY78RQI/AAAAAAAAItc/ouueFUj2Hqo5dntmnKqEaBJR4KQ4Q2K3ACK4BGAYYCw/s1600/logo%2Bgit%2Bicon.png",
       "https://3.bp.blogspot.com/-xhNpNJJyQhk/XIe4GY78RQI/AAAAAAAAItc/ouueFUj2Hqo5dntmnKqEaBJR4KQ4Q2K3ACK4BGAYYCw/s1600/logo%2Bgit%2Bicon.png",
     label: "Git Repository",
     label: "Git Repository",
-    buttonText: "Link a Github Account",
+    buttonText: "Link a Github Account"
   },
   },
   registry: {
   registry: {
     icon:
     icon:
       "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png",
       "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png",
     label: "Docker Registry",
     label: "Docker Registry",
-    buttonText: "Add a Registry",
+    buttonText: "Add a Registry"
   },
   },
   gke: {
   gke: {
     icon: "https://sysdig.com/wp-content/uploads/2016/08/GKE_color.png",
     icon: "https://sysdig.com/wp-content/uploads/2016/08/GKE_color.png",
-    label: "Google Kubernetes Engine (GKE)",
+    label: "Google Kubernetes Engine (GKE)"
   },
   },
   eks: {
   eks: {
     icon: "https://img.stackshare.io/service/7991/amazon-eks.png",
     icon: "https://img.stackshare.io/service/7991/amazon-eks.png",
-    label: "Amazon Elastic Kubernetes Service (EKS)",
+    label: "Amazon Elastic Kubernetes Service (EKS)"
   },
   },
   kube: {
   kube: {
     icon:
     icon:
       "https://uxwing.com/wp-content/themes/uxwing/download/10-brands-and-social-media/kubernetes.png",
       "https://uxwing.com/wp-content/themes/uxwing/download/10-brands-and-social-media/kubernetes.png",
-    label: "Upload Kubeconfig",
+    label: "Upload Kubeconfig"
   },
   },
   docker: {
   docker: {
     icon:
     icon:
       "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png",
       "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png",
-    label: "Docker Hub",
+    label: "Docker Hub"
   },
   },
   gcr: {
   gcr: {
     icon:
     icon:
       "https://carlossanchez.files.wordpress.com/2019/06/21046548.png?w=640",
       "https://carlossanchez.files.wordpress.com/2019/06/21046548.png?w=640",
-    label: "Google Container Registry (GCR)",
+    label: "Google Container Registry (GCR)"
   },
   },
   ecr: {
   ecr: {
     icon:
     icon:
       "https://avatars2.githubusercontent.com/u/52505464?s=400&u=da920f994c67665c7ad6c606a5286557d4f8555f&v=4",
       "https://avatars2.githubusercontent.com/u/52505464?s=400&u=da920f994c67665c7ad6c606a5286557d4f8555f&v=4",
-    label: "Elastic Container Registry (ECR)",
+    label: "Elastic Container Registry (ECR)"
   },
   },
   aws: {
   aws: {
     icon: aws,
     icon: aws,
-    label: "AWS",
+    label: "AWS"
   },
   },
   gcp: {
   gcp: {
     icon: gcp,
     icon: gcp,
-    label: "GCP",
+    label: "GCP"
   },
   },
   do: {
   do: {
     icon: digitalOcean,
     icon: digitalOcean,
-    label: "DigitalOcean",
+    label: "DigitalOcean"
   },
   },
   github: {
   github: {
     icon: github,
     icon: github,
-    label: "GitHub",
+    label: "GitHub"
   },
   },
   gitlab: {
   gitlab: {
     icon: "https://about.gitlab.com/images/press/logo/png/gitlab-icon-rgb.png",
     icon: "https://about.gitlab.com/images/press/logo/png/gitlab-icon-rgb.png",
-    label: "Gitlab",
-  },
+    label: "Gitlab"
+  }
 };
 };
 
 
 export const isAlphanumeric = (x: string | null) => {
 export const isAlphanumeric = (x: string | null) => {
@@ -92,6 +92,6 @@ export const isAlphanumeric = (x: string | null) => {
 
 
 export const getIgnoreCase = (object: any, key: string) => {
 export const getIgnoreCase = (object: any, key: string) => {
   return object[
   return object[
-    Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase())
+    Object.keys(object).find(k => k.toLowerCase() === key.toLowerCase())
   ];
   ];
 };
 };

+ 5 - 5
dashboard/src/shared/feedback.tsx

@@ -10,18 +10,18 @@ export const handleSubmitFeedback = (
       {
       {
         key: process.env.DISCORD_KEY,
         key: process.env.DISCORD_KEY,
         cid: process.env.DISCORD_CID,
         cid: process.env.DISCORD_CID,
-        message: msg,
+        message: msg
       },
       },
       {
       {
         headers: {
         headers: {
-          Authorization: `Bearer <>`,
-        },
+          Authorization: `Bearer <>`
+        }
       }
       }
     )
     )
-    .then((res) => {
+    .then(res => {
       callback && callback(null, res);
       callback && callback(null, res);
     })
     })
-    .catch((err) => {
+    .catch(err => {
       callback && callback(err, null);
       callback && callback(err, null);
     });
     });
 };
 };

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

@@ -11,11 +11,11 @@ export const kindToIcon: { [kind: string]: string } = {
   Role: "portrait",
   Role: "portrait",
   RoleBinding: "swap_horizontal_circle",
   RoleBinding: "swap_horizontal_circle",
   ConfigMap: "map",
   ConfigMap: "map",
-  PodSecurityPolicy: "security",
+  PodSecurityPolicy: "security"
 };
 };
 
 
 export const edgeColors: { [kind: string]: string } = {
 export const edgeColors: { [kind: string]: string } = {
   LabelRel: "#32a85f",
   LabelRel: "#32a85f",
   ControlRel: "#fcb603",
   ControlRel: "#fcb603",
-  SpecRel: "#949EFF",
+  SpecRel: "#949EFF"
 };
 };

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

@@ -14,7 +14,7 @@ export const PorterUrls = [
   "integrations",
   "integrations",
   "new-project",
   "new-project",
   "cluster-dashboard",
   "cluster-dashboard",
-  "project-settings",
+  "project-settings"
 ];
 ];
 
 
 export const setSearchParam = (
 export const setSearchParam = (
@@ -26,6 +26,6 @@ export const setSearchParam = (
   urlParams.set(key, value);
   urlParams.set(key, value);
   return {
   return {
     pathname: location.pathname,
     pathname: location.pathname,
-    search: urlParams.toString(),
+    search: urlParams.toString()
   };
   };
 };
 };

+ 1 - 1
dashboard/src/shared/types.tsx

@@ -66,7 +66,7 @@ export interface EdgeType {
 export enum StorageType {
 export enum StorageType {
   Secret = "secret",
   Secret = "secret",
   ConfigMap = "configmap",
   ConfigMap = "configmap",
-  Memory = "memory",
+  Memory = "memory"
 }
 }
 
 
 // PorterTemplate represents a bundled Porter template
 // PorterTemplate represents a bundled Porter template