diff --git a/packages/developer-portal/src/components/pages/app-detail/__tests__/__snapshots__/app-detail.test.tsx.snap b/packages/developer-portal/src/components/pages/app-detail/__tests__/__snapshots__/app-detail.test.tsx.snap index 18e70acc7c..b4e835f279 100644 --- a/packages/developer-portal/src/components/pages/app-detail/__tests__/__snapshots__/app-detail.test.tsx.snap +++ b/packages/developer-portal/src/components/pages/app-detail/__tests__/__snapshots__/app-detail.test.tsx.snap @@ -18,7 +18,7 @@ exports[`DeveloperAppDetail should match a snapshot 1`] = ` Array [ Object { "key": "developerAppDetailRoute", - "pathname": "/developer/apps/:appid", + "pathname": "/apps/:appid", }, ] } @@ -34,7 +34,7 @@ exports[`DeveloperAppDetail should match a snapshot 1`] = ` Object { "hash": "", "key": "developerAppDetailRoute", - "pathname": "/developer/apps/:appid", + "pathname": "/apps/:appid", "search": "", }, ], @@ -47,7 +47,7 @@ exports[`DeveloperAppDetail should match a snapshot 1`] = ` "location": Object { "hash": "", "key": "developerAppDetailRoute", - "pathname": "/developer/apps/:appid", + "pathname": "/apps/:appid", "search": "", }, "push": [Function], diff --git a/packages/developer-portal/src/components/pages/app-detail/__tests__/__snapshots__/app-management.test.tsx.snap b/packages/developer-portal/src/components/pages/app-detail/__tests__/__snapshots__/app-management.test.tsx.snap index bc2329c333..0e70fb8c94 100644 --- a/packages/developer-portal/src/components/pages/app-detail/__tests__/__snapshots__/app-management.test.tsx.snap +++ b/packages/developer-portal/src/components/pages/app-detail/__tests__/__snapshots__/app-management.test.tsx.snap @@ -18,7 +18,7 @@ exports[`ManageApp should match snapshot 1`] = ` Array [ Object { "key": "developerAppDetailRoute", - "pathname": "/developer/apps/:appid", + "pathname": "/apps/:appid", }, ] } @@ -34,7 +34,7 @@ exports[`ManageApp should match snapshot 1`] = ` Object { "hash": "", "key": "developerAppDetailRoute", - "pathname": "/developer/apps/:appid", + "pathname": "/apps/:appid", "search": "", }, ], @@ -47,7 +47,7 @@ exports[`ManageApp should match snapshot 1`] = ` "location": Object { "hash": "", "key": "developerAppDetailRoute", - "pathname": "/developer/apps/:appid", + "pathname": "/apps/:appid", "search": "", }, "push": [Function], diff --git a/packages/developer-portal/src/components/pages/app-detail/__tests__/app-content.test.tsx b/packages/developer-portal/src/components/pages/app-detail/__tests__/app-content.test.tsx index 838c60027e..4df67ccad0 100644 --- a/packages/developer-portal/src/components/pages/app-detail/__tests__/app-content.test.tsx +++ b/packages/developer-portal/src/components/pages/app-detail/__tests__/app-content.test.tsx @@ -74,7 +74,7 @@ describe('AppContent', () => { const spyOpenUrl = jest.spyOn(window, 'open') const fn = handleOpenAppPreview(appId) fn() - expect(spyOpenUrl).toBeCalledWith('developer/apps/appId/preview', '_blank') + expect(spyOpenUrl).toBeCalledWith('/apps/appId/preview', '_blank') }) }) diff --git a/packages/developer-portal/src/components/pages/app-detail/app-content.tsx b/packages/developer-portal/src/components/pages/app-detail/app-content.tsx index 70a54a45fc..9452010808 100644 --- a/packages/developer-portal/src/components/pages/app-detail/app-content.tsx +++ b/packages/developer-portal/src/components/pages/app-detail/app-content.tsx @@ -1,4 +1,5 @@ import * as React from 'react' +import routes from '@/constants/routes' import dayjs from 'dayjs' import { Dispatch } from 'redux' import { GET_ALL_PAGE_SIZE } from '@/constants/paginator' @@ -54,7 +55,7 @@ export const handleUninstallSuccess = ({ } export const handleOpenAppPreview = (appId: string) => () => { - const url = `developer/apps/${appId}/preview` + const url = routes.APP_PREVIEW.replace(':appId', appId) window.open(url, '_blank') } diff --git a/packages/developer-portal/src/components/pages/apps/__tests__/__snapshots__/apps.test.tsx.snap b/packages/developer-portal/src/components/pages/apps/__tests__/__snapshots__/apps.test.tsx.snap index c0f1c608df..4b01f7b804 100644 --- a/packages/developer-portal/src/components/pages/apps/__tests__/__snapshots__/apps.test.tsx.snap +++ b/packages/developer-portal/src/components/pages/apps/__tests__/__snapshots__/apps.test.tsx.snap @@ -18,7 +18,7 @@ exports[`Login should match a snapshot 1`] = ` Array [ Object { "key": "developerHomeRoute", - "pathname": "/developer/apps", + "pathname": "/apps", }, ] } @@ -34,7 +34,7 @@ exports[`Login should match a snapshot 1`] = ` Object { "hash": "", "key": "developerHomeRoute", - "pathname": "/developer/apps", + "pathname": "/apps", "search": "", }, ], @@ -47,7 +47,7 @@ exports[`Login should match a snapshot 1`] = ` "location": Object { "hash": "", "key": "developerHomeRoute", - "pathname": "/developer/apps", + "pathname": "/apps", "search": "", }, "push": [Function], diff --git a/packages/developer-portal/src/components/pages/authentication/__test__/__snapshots__/authentication.test.tsx.snap b/packages/developer-portal/src/components/pages/authentication/__test__/__snapshots__/authentication.test.tsx.snap index 716a909317..3342388725 100644 --- a/packages/developer-portal/src/components/pages/authentication/__test__/__snapshots__/authentication.test.tsx.snap +++ b/packages/developer-portal/src/components/pages/authentication/__test__/__snapshots__/authentication.test.tsx.snap @@ -27,7 +27,7 @@ exports[`Authentication renderClientModal should match snapshot 1`] = ` Desktop diff --git a/packages/developer-portal/src/components/pages/authentication/__test__/authentication.test.tsx b/packages/developer-portal/src/components/pages/authentication/__test__/authentication.test.tsx index ee8ed54e11..a5b318bbf4 100644 --- a/packages/developer-portal/src/components/pages/authentication/__test__/authentication.test.tsx +++ b/packages/developer-portal/src/components/pages/authentication/__test__/authentication.test.tsx @@ -58,9 +58,10 @@ describe('Authentication', () => { }) describe('onMarketplaceButtonClick', () => { it('should run correctly', () => { - const fn = onMarketplaceButtonClick(history) - fn() - expect(history.replace).toBeCalledWith(Routes.DEVELOPER) + jest.spyOn(window, 'open') + onMarketplaceButtonClick() + expect(window.open).toBeCalledWith(window.reapit.config.marketplaceUrl, '_self') + ;(window.open as jest.Mock).mockReset() }) }) describe('onRegisterButtonClick', () => { diff --git a/packages/developer-portal/src/components/pages/authentication/authentication.tsx b/packages/developer-portal/src/components/pages/authentication/authentication.tsx index 4220421180..a62b0e27da 100644 --- a/packages/developer-portal/src/components/pages/authentication/authentication.tsx +++ b/packages/developer-portal/src/components/pages/authentication/authentication.tsx @@ -27,10 +27,8 @@ export const onRegisterButtonClick = (history: History) => { } } -export const onMarketplaceButtonClick = (history: History) => { - return () => { - history.replace(Routes.DEVELOPER) - } +export const onMarketplaceButtonClick = () => { + window.open(window.reapit.config.marketplaceUrl, '_self') } export const onLogoutButtonClick = (dispatch: Dispatch) => { @@ -77,7 +75,7 @@ export const renderDeveloperModal = (history, dispatch) => { footerItems={ <> - + } diff --git a/packages/developer-portal/src/components/pages/desktop/__tests__/__snapshots__/desktop.test.tsx.snap b/packages/developer-portal/src/components/pages/desktop/__tests__/__snapshots__/desktop.test.tsx.snap index b620ff5bf8..01e6e19ed9 100644 --- a/packages/developer-portal/src/components/pages/desktop/__tests__/__snapshots__/desktop.test.tsx.snap +++ b/packages/developer-portal/src/components/pages/desktop/__tests__/__snapshots__/desktop.test.tsx.snap @@ -53,7 +53,7 @@ exports[`DeveloperDesktopPage should match snapshot 1`] = ` To learn more about what’s possible with the Desktop API, please visit the diff --git a/packages/developer-portal/src/components/pages/edit-app/__tests__/__snapshots__/developer-edit-app.test.tsx.snap b/packages/developer-portal/src/components/pages/edit-app/__tests__/__snapshots__/developer-edit-app.test.tsx.snap index 2b4cb6c5b5..600ad7e9e1 100644 --- a/packages/developer-portal/src/components/pages/edit-app/__tests__/__snapshots__/developer-edit-app.test.tsx.snap +++ b/packages/developer-portal/src/components/pages/edit-app/__tests__/__snapshots__/developer-edit-app.test.tsx.snap @@ -95,7 +95,7 @@ exports[`DeveloperSubmitApp should match a snapshot when pendingRevisions = true "entries": Array [ Object { "hash": "", - "pathname": "/developer/apps/undefined", + "pathname": "/apps/undefined", "search": "", "state": undefined, }, @@ -108,7 +108,7 @@ exports[`DeveloperSubmitApp should match a snapshot when pendingRevisions = true "listen": [Function], "location": Object { "hash": "", - "pathname": "/developer/apps/undefined", + "pathname": "/apps/undefined", "search": "", "state": undefined, }, @@ -119,12 +119,12 @@ exports[`DeveloperSubmitApp should match a snapshot when pendingRevisions = true > diff --git a/packages/developer-portal/src/components/pages/edit-app/__tests__/developer-edit-app.test.tsx b/packages/developer-portal/src/components/pages/edit-app/__tests__/developer-edit-app.test.tsx index 049afb6bc3..a457cbea49 100644 --- a/packages/developer-portal/src/components/pages/edit-app/__tests__/developer-edit-app.test.tsx +++ b/packages/developer-portal/src/components/pages/edit-app/__tests__/developer-edit-app.test.tsx @@ -222,7 +222,7 @@ describe('DeveloperSubmitApp', () => { const fn = handleOpenAppPreview(params) fn() expect(spyLocalStorageSetItem).toBeCalledWith('developer-preview-app', expected) - expect(spyOpenUrl).toBeCalledWith('developer/apps/appId/preview', '_blank') + expect(spyOpenUrl).toBeCalledWith('/apps/appId/preview', '_blank') }) }) diff --git a/packages/developer-portal/src/components/pages/edit-app/developer-edit-app.tsx b/packages/developer-portal/src/components/pages/edit-app/developer-edit-app.tsx index 84858cec06..e084f86b1a 100644 --- a/packages/developer-portal/src/components/pages/edit-app/developer-edit-app.tsx +++ b/packages/developer-portal/src/components/pages/edit-app/developer-edit-app.tsx @@ -1,4 +1,5 @@ import * as React from 'react' +import routes from '@/constants/routes' import { Redirect } from 'react-router-dom' import { History } from 'history' import { useHistory, useParams } from 'react-router' @@ -293,7 +294,7 @@ export const handleOpenAppPreview = ({ media, } - const url = `developer/apps/${appId}/preview` + const url = routes.APP_PREVIEW.replace(':appId', appId) localStorage.setItem('developer-preview-app', JSON.stringify(appDetailState)) window.open(url, '_blank') } diff --git a/packages/developer-portal/src/components/pages/login/__tests__/__snapshots__/login.test.tsx.snap b/packages/developer-portal/src/components/pages/login/__tests__/__snapshots__/login.test.tsx.snap index bcad241754..9856fe4ae2 100644 --- a/packages/developer-portal/src/components/pages/login/__tests__/__snapshots__/login.test.tsx.snap +++ b/packages/developer-portal/src/components/pages/login/__tests__/__snapshots__/login.test.tsx.snap @@ -18,7 +18,7 @@ exports[`Login should match a snapshot 1`] = ` Array [ Object { "key": "loginRoute", - "pathname": "/developer/login", + "pathname": "/login", }, ] } @@ -34,7 +34,7 @@ exports[`Login should match a snapshot 1`] = ` Object { "hash": "", "key": "loginRoute", - "pathname": "/developer/login", + "pathname": "/login", "search": "", }, ], @@ -47,7 +47,7 @@ exports[`Login should match a snapshot 1`] = ` "location": Object { "hash": "", "key": "loginRoute", - "pathname": "/developer/login", + "pathname": "/login", "search": "", }, "push": [Function], diff --git a/packages/developer-portal/src/components/pages/register/__tests__/__snapshots__/register.test.tsx.snap b/packages/developer-portal/src/components/pages/register/__tests__/__snapshots__/register.test.tsx.snap index 1fcfcd529d..5db3cb6ddd 100644 --- a/packages/developer-portal/src/components/pages/register/__tests__/__snapshots__/register.test.tsx.snap +++ b/packages/developer-portal/src/components/pages/register/__tests__/__snapshots__/register.test.tsx.snap @@ -513,14 +513,14 @@ exports[`Register should match a snapshot 1`] = ` > Already have an account? Login diff --git a/packages/developer-portal/src/components/pages/settings/__tests__/__snapshots__/tabs.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/__tests__/__snapshots__/tabs.test.tsx.snap index cfad30cae9..eba83d449c 100644 --- a/packages/developer-portal/src/components/pages/settings/__tests__/__snapshots__/tabs.test.tsx.snap +++ b/packages/developer-portal/src/components/pages/settings/__tests__/__snapshots__/tabs.test.tsx.snap @@ -21,19 +21,19 @@ exports[`Tabs should match a snapshot 1`] = ` "active": false, "displayText": "Profile", "onTabClick": [Function], - "tabIdentifier": "/developer/settings/", + "tabIdentifier": "/settings/", }, Object { "active": false, "displayText": "Organisation", "onTabClick": [Function], - "tabIdentifier": "/developer/settings/organisation", + "tabIdentifier": "/settings/organisation", }, Object { "active": false, "displayText": "Billing", "onTabClick": [Function], - "tabIdentifier": "/developer/settings/billing", + "tabIdentifier": "/settings/billing", }, ] } @@ -45,12 +45,12 @@ exports[`Tabs should match a snapshot 1`] = `