Jo Chuang 5 years ago
parent
commit
50c5cd007b

+ 2 - 2
dashboard/src/main/home/integrations/IntegrationCategories.tsx

@@ -83,7 +83,7 @@ class IntegrationCategories extends Component<PropsType, StateType> {
             this.setState({
               currentOptions,
               currentTitles,
-              currentIntegrationData: res.data,
+              currentIntegrationData: final,
             });
           })
           .catch(console.log);
@@ -144,7 +144,7 @@ class IntegrationCategories extends Component<PropsType, StateType> {
                 this.context.setCurrentModal("IntegrationsModal", {
                   category: currentCategory,
                   setCurrentIntegration: (x: string) =>
-                    this.props.history.push(`/integrations/create/${this.props.category}/${x}`),
+                    this.props.history.push(`/integrations/${this.props.category}/create/${x}`),
                 })
               }
             >

+ 5 - 5
dashboard/src/main/home/integrations/Integrations.tsx

@@ -22,7 +22,7 @@ class Integrations extends Component<PropsType, StateType> {
   };
 
   render = () => <StyledIntegrations><Switch>
-    <Route path="/integrations/create/:category/:integration" render={(rp) => {
+    <Route path="/integrations/:category/create/:integration" render={(rp) => {
       const { integration, category } = rp.match.params;
       if (!IntegrationCategoryStrings.includes(category)) {
         this.props.history.push("/integrations");
@@ -36,7 +36,7 @@ class Integrations extends Component<PropsType, StateType> {
             <Flex>
               <i
                 className="material-icons"
-                onClick={() => this.props.history.push(`/integrations/category/${category}`)}
+                onClick={() => this.props.history.push(`/integrations/${category}`)}
               >
                 keyboard_backspace
                 </i>
@@ -47,7 +47,7 @@ class Integrations extends Component<PropsType, StateType> {
           <CreateIntegrationForm
             integrationName={integration}
             closeForm={() => {
-              this.props.history.push(`/integrations/category/${category}`)
+              this.props.history.push(`/integrations/${category}`)
             }}
           />
           <Br />
@@ -55,7 +55,7 @@ class Integrations extends Component<PropsType, StateType> {
       );
 
     }} />
-    <Route path="/integrations/category/:category" render={(rp) => {
+    <Route path="/integrations/:category" render={(rp) => {
       const currentCategory = rp.match.params.category;
       if (!IntegrationCategoryStrings.includes(currentCategory)) {
         this.props.history.push("/integrations");
@@ -73,7 +73,7 @@ class Integrations extends Component<PropsType, StateType> {
         <IntegrationList
           currentCategory={""}
           integrations={["kubernetes", "registry", "repo"]}
-          setCurrent={(x) => this.props.history.push(`/integrations/category/${x}`)}
+          setCurrent={(x) => this.props.history.push(`/integrations/${x}`)}
           isCategory={true}
         />
       </div>