Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIQ-1098 404 error in Connection page #260

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions public/app/features/connections/Connections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { StoreState, useSelector } from 'app/types';

import { ROUTES } from './constants';
import {
ConnectDataPage,
DataSourceDashboardsPage,
DataSourceDetailsPage,
DataSourcesListPage,
Expand All @@ -17,7 +16,6 @@ import {

export default function Connections() {
const navIndex = useSelector((state: StoreState) => state.navIndex);
const isConnectDataPageOverriden = Boolean(navIndex['standalone-plugin-page-/connections/connect-data']);

const YourConnectionsPage =
navIndex['connections-your-connections'].children && navIndex['connections-your-connections'].children?.length > 1
Expand All @@ -34,18 +32,15 @@ export default function Connections() {
}}
>
<Switch>
{/* Redirect to "Connect data" by default */}
<Route exact sensitive path={ROUTES.Base} component={() => <Redirect to={ROUTES.ConnectData} />} />
{/* Redirect to "Your connections" by default */}
<Route exact sensitive path={ROUTES.Base} component={() => <Redirect to={ROUTES.YourConnections} />} />
<Route exact sensitive path={ROUTES.YourConnections} component={YourConnectionsPage} />
<Route exact sensitive path={ROUTES.DataSources} component={DataSourcesListPage} />
<Route exact sensitive path={ROUTES.DataSourcesDetails} component={DataSourceDetailsPage} />
<Route exact sensitive path={ROUTES.DataSourcesNew} component={NewDataSourcePage} />
<Route exact sensitive path={ROUTES.DataSourcesEdit} component={EditDataSourcePage} />
<Route exact sensitive path={ROUTES.DataSourcesDashboards} component={DataSourceDashboardsPage} />

{/* "Connect data" page - we don't register a route in case a plugin already registers a standalone page for it */}
{!isConnectDataPageOverriden && <Route exact sensitive path={ROUTES.ConnectData} component={ConnectDataPage} />}

{/* Not found */}
<Route component={() => <Redirect to="/notfound" />} />
</Switch>
Expand Down
Loading