You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/11/23 02:10:45 UTC

[GitHub] [incubator-devlake] mintsweet commented on a diff in pull request #3770: feat(config-ui): encapsulate base layout component

mintsweet commented on code in PR #3770:
URL: https://github.com/apache/incubator-devlake/pull/3770#discussion_r1029967994


##########
config-ui/src/App.js:
##########
@@ -57,66 +63,104 @@ function App(props) {
 
   return (
     <Router>
-      <Route exact path='/'>
-        <ErrorBoundary>
-          <Integration />
-        </ErrorBoundary>
-      </Route>
-      <Route path='/integrations/:providerId'>
-        <ErrorBoundary>
-          <ManageIntegration />
-        </ErrorBoundary>
-      </Route>
-      <Route path='/connections/add/:providerId'>
-        <ErrorBoundary>
-          <AddConnection />
-        </ErrorBoundary>
-      </Route>
-      <Route path='/connections/configure/:providerId/:connectionId'>
-        <ErrorBoundary>
-          <ConfigureConnection />
-        </ErrorBoundary>
-      </Route>
-      <Route exact path='/integrations'>
-        <ErrorBoundary>
-          <Integration />
-        </ErrorBoundary>
-      </Route>
-      <Route exact path='/blueprints/create'>
-        <ErrorBoundary>
-          <CreateBlueprint />
-        </ErrorBoundary>
-      </Route>
-      <Route exact path='/blueprints/detail/:bId'>
-        <ErrorBoundary>
-          <BlueprintDetail />
-        </ErrorBoundary>
-      </Route>
-      <Route exact path='/blueprints/settings/:bId'>
-        <ErrorBoundary>
-          <BlueprintSettings />
-        </ErrorBoundary>
-      </Route>
-      <Route exact path='/blueprints'>
-        <ErrorBoundary>
-          <Blueprints />
-        </ErrorBoundary>
-      </Route>
-      <Route exact path='/connections/incoming-webhook'>
-        <IncomingWebhookConnection />
-      </Route>
-      <Route exact path='/offline'>
-        <Offline />
-      </Route>
-      <MigrationAlertDialog
-        isOpen={migrationAlertOpened}
-        onClose={handleMigrationDialogClose}
-        onCancel={handleCancelMigration}
-        onConfirm={handleConfirmMigration}
-        isMigrating={isProcessing}
-        wasSuccessful={wasMigrationSuccessful}
-        hasFailed={hasMigrationFailed}
-      />
+      <Switch>
+        <Route exact path='/offline' component={() => <Offline />} />
+
+        <Route>
+          <BaseLayout>
+            <Switch>
+              <Route
+                path='/'
+                exact
+                component={() => <Redirect to='/integrations' />}

Review Comment:
   This way of writing is the same, but what I want is `component={<XXX />}`
   
   However, there is a problem with the export of the current page. It can only be compatible with the writing method and will be improved in the future.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org