Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Split paths and urls in site settings view

dominik-zeglen6a001d658276
diff --git a/saleor/static/dashboard-next/siteSettings/index.tsx b/saleor/static/dashboard-next/siteSettings/index.tsx
index 16bc6f350e..9aef4200f5 100644
--- a/saleor/static/dashboard-next/siteSettings/index.tsx
+++ b/saleor/static/dashboard-next/siteSettings/index.tsx
@@ -1,9 +1,10 @@
import * as React from "react";
import { Route, RouteComponentProps } from "react-router-dom";
+import { siteSettingsPath } from "./urls";
import SiteSettings from "./views/";
export const SiteSettingsSection: React.StatelessComponent<
RouteComponentProps<{}>
-> = ({ match }) => <Route path={match.url} component={SiteSettings} />;
+> = () => <Route path={siteSettingsPath} component={SiteSettings} />;
export default SiteSettingsSection;
diff --git a/saleor/static/dashboard-next/siteSettings/urls.ts b/saleor/static/dashboard-next/siteSettings/urls.ts
index f3a6050615..9718b9b5cc 100644
--- a/saleor/static/dashboard-next/siteSettings/urls.ts
+++ b/saleor/static/dashboard-next/siteSettings/urls.ts
@@ -1,5 +1,9 @@
import * as urlJoin from "url-join";
const siteSettingsSection = "/siteSettings";
-export const siteSettingsUrl = siteSettingsSection;
-export const siteSettingsAddKeyUrl = urlJoin(siteSettingsSection, "addKey");
+
+export const siteSettingsPath = siteSettingsSection;
+export const siteSettingsUrl = siteSettingsPath;
+
+export const siteSettingsAddKeyPath = urlJoin(siteSettingsSection, "addKey");
+export const siteSettingsAddKeyUrl = siteSettingsAddKeyPath;
diff --git a/saleor/static/dashboard-next/siteSettings/views/index.tsx b/saleor/static/dashboard-next/siteSettings/views/index.tsx
index a997c8a2d0..e6f6e85e1f 100644
--- a/saleor/static/dashboard-next/siteSettings/views/index.tsx
+++ b/saleor/static/dashboard-next/siteSettings/views/index.tsx
@@ -23,7 +23,11 @@ import { TypedSiteSettingsQuery } from "../queries";
import { AuthorizationKeyAdd } from "../types/AuthorizationKeyAdd";
import { AuthorizationKeyDelete } from "../types/AuthorizationKeyDelete";
import { ShopSettingsUpdate } from "../types/ShopSettingsUpdate";
-import { siteSettingsAddKeyUrl, siteSettingsUrl } from "../urls";
+import {
+ siteSettingsAddKeyPath,
+ siteSettingsAddKeyUrl,
+ siteSettingsUrl
+} from "../urls";
export const SiteSettings: React.StatelessComponent<{}> = () => (
<Navigator>
@@ -170,7 +174,7 @@ export const SiteSettings: React.StatelessComponent<{}> = () => (
saveButtonBarState={formTransitionState}
/>
<Route
- path={siteSettingsAddKeyUrl}
+ path={siteSettingsAddKeyPath}
render={({ match }) => (
<SiteSettingsKeyDialog
errors={maybe(