Skip to content

Commit

Permalink
chore: #1997 remove /developer prefix in developer-portal routes
Browse files Browse the repository at this point in the history
  • Loading branch information
undefined committed Jul 13, 2020
1 parent 219cb32 commit dee72fa
Show file tree
Hide file tree
Showing 22 changed files with 179 additions and 84 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`DeveloperSubmitAppSuccessfully renders correctly 1`] = `
<Component
centerContent={true}
flexColumn={true}
hasPadding={true}
>
<Component
flexColumn={true}
hasBackground={true}
hasPadding={true}
>
<CallToAction
className="container-footer"
dataTest="submit-success-section"
footerItems={
<React.Fragment>
<Unknown
onClick={[MockFunction]}
type="button"
variant="primary"
>
My Apps
</Unknown>
<Unknown
onClick={[MockFunction]}
type="button"
variant="primary"
>
Submit another app
</Unknown>
</React.Fragment>
}
isCard={true}
title="Success"
>
<p>
Your App has now been registered and can be accessed by clicking on ‘My Apps’ below.
</p>
<br />
<p>
You will be directed to the ‘My Apps’ page where you will be able to access the ‘Client ID’ of your App (required for authentication) and or make any changes to your App by clicking ‘Edit Details’.
</p>
<br />
<p>
<strong>
Currently, your App is only visible to you
</strong>
and will not be available in the Marketplace until you have made it ‘Listed’. When you are ready to do this, click on ‘Edit Detail’ and tick the ‘Is Listed’ check box located in the ‘Marketplace Status’ section.
</p>
<br />
<p>
<strong>
Please note:
</strong>
Any changes you make now to your App (including making it ‘Listed’) will require approval. These are called ‘Revisions’. All revisions will be sent to our Admin department and whilst your App is being reviewed, you will not be able to make any further changes and the App will be marked as ‘Pending Revision’.
</p>
<br />
<p>
Once you have ‘Listed’ your application, and any revisions have been approved, your app will be live in the Marketplace and available for install by customers.
</p>
<br />
<p>
For any issues or support, please visit the
<Link
to="/help"
>
‘Help’
</Link>
page.
</p>
<br />
</CallToAction>
</Component>
</Component>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`DeveloperAppDetail should match a snapshot 1`] = `
Array [
Object {
"key": "developerAppDetailRoute",
"pathname": "/developer/apps/:appid",
"pathname": "/apps/:appid",
},
]
}
Expand All @@ -34,7 +34,7 @@ exports[`DeveloperAppDetail should match a snapshot 1`] = `
Object {
"hash": "",
"key": "developerAppDetailRoute",
"pathname": "/developer/apps/:appid",
"pathname": "/apps/:appid",
"search": "",
},
],
Expand All @@ -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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`ManageApp should match snapshot 1`] = `
Array [
Object {
"key": "developerAppDetailRoute",
"pathname": "/developer/apps/:appid",
"pathname": "/apps/:appid",
},
]
}
Expand All @@ -34,7 +34,7 @@ exports[`ManageApp should match snapshot 1`] = `
Object {
"hash": "",
"key": "developerAppDetailRoute",
"pathname": "/developer/apps/:appid",
"pathname": "/apps/:appid",
"search": "",
},
],
Expand All @@ -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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
})

Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -55,7 +56,7 @@ export const handleUninstallSuccess = ({
}

export const handleOpenAppPreview = (appId: string) => () => {
const url = `developer/apps/${appId}/preview`
const url = routes.DEVELOPER_APP_PREVIEW.replace(':appId', appId)
window.open(url, '_blank')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`Login should match a snapshot 1`] = `
Array [
Object {
"key": "developerHomeRoute",
"pathname": "/developer/apps",
"pathname": "/apps",
},
]
}
Expand All @@ -34,7 +34,7 @@ exports[`Login should match a snapshot 1`] = `
Object {
"hash": "",
"key": "developerHomeRoute",
"pathname": "/developer/apps",
"pathname": "/apps",
"search": "",
},
],
Expand All @@ -47,7 +47,7 @@ exports[`Login should match a snapshot 1`] = `
"location": Object {
"hash": "",
"key": "developerHomeRoute",
"pathname": "/developer/apps",
"pathname": "/apps",
"search": "",
},
"push": [Function],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exports[`Authentication renderClientModal should match snapshot 1`] = `
</span>
<span>
<Link
to="/developer/desktop"
to="/desktop"
>
Desktop
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ exports[`DeveloperDesktopPage should match snapshot 1`] = `
To learn more about what’s possible with the Desktop API, please visit the
<a
href="/developer/api-docs/api/desktop-api"
href="/api-docs/api/desktop-api"
rel="noreferrer"
target="_blank"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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,
},
Expand All @@ -119,12 +119,12 @@ exports[`DeveloperSubmitApp should match a snapshot when pendingRevisions = true
>
<Component>
<Redirect
to="/developer/apps/undefined"
to="/apps/undefined"
>
<Lifecycle
onMount={[Function]}
onUpdate={[Function]}
to="/developer/apps/undefined"
to="/apps/undefined"
/>
</Redirect>
</Component>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
})

Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -293,7 +294,7 @@ export const handleOpenAppPreview = ({
media,
}

const url = `developer/apps/${appId}/preview`
const url = routes.DEVELOPER_APP_PREVIEW.replace(':appId', appId)
localStorage.setItem('developer-preview-app', JSON.stringify(appDetailState))
window.open(url, '_blank')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`Login should match a snapshot 1`] = `
Array [
Object {
"key": "loginRoute",
"pathname": "/developer/login",
"pathname": "/login",
},
]
}
Expand All @@ -34,7 +34,7 @@ exports[`Login should match a snapshot 1`] = `
Object {
"hash": "",
"key": "loginRoute",
"pathname": "/developer/login",
"pathname": "/login",
"search": "",
},
],
Expand All @@ -47,7 +47,7 @@ exports[`Login should match a snapshot 1`] = `
"location": Object {
"hash": "",
"key": "loginRoute",
"pathname": "/developer/login",
"pathname": "/login",
"search": "",
},
"push": [Function],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export const handleShowNotificationAfterPasswordChanged = (

export const onLoginButtonClick = (isFirtTimeLogin: boolean) => {
return () => {
const redirectRoute = getDefaultRoute(isFirtTimeLogin)
redirectToLogin(window.reapit.config.cognitoClientId, redirectRoute, 'DEVELOPER')
// const redirectRoute = getDefaultRoute(isFirtTimeLogin)
redirectToLogin(window.reapit.config.cognitoClientId, 'http://localhost:8080/developer/apps', 'DEVELOPER')
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,14 +513,14 @@ exports[`Register should match a snapshot 1`] = `
>
Already have an account?
<Link
to="/developer/login"
to="/login"
>
<LinkAnchor
href="/developer/login"
href="/login"
navigate={[Function]}
>
<a
href="/developer/login"
href="/login"
onClick={[Function]}
>
Login
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
]
}
Expand All @@ -45,12 +45,12 @@ exports[`Tabs should match a snapshot 1`] = `
<ul>
<li
className=""
key="/developer/settings/"
key="/settings/"
>
<a
aria-controls="/developer/settings/"
aria-controls="/settings/"
aria-selected={false}
id="/developer/settings/"
id="/settings/"
onClick={[Function]}
role="tab"
>
Expand All @@ -59,12 +59,12 @@ exports[`Tabs should match a snapshot 1`] = `
</li>
<li
className=""
key="/developer/settings/organisation"
key="/settings/organisation"
>
<a
aria-controls="/developer/settings/organisation"
aria-controls="/settings/organisation"
aria-selected={false}
id="/developer/settings/organisation"
id="/settings/organisation"
onClick={[Function]}
role="tab"
>
Expand All @@ -73,12 +73,12 @@ exports[`Tabs should match a snapshot 1`] = `
</li>
<li
className=""
key="/developer/settings/billing"
key="/settings/billing"
>
<a
aria-controls="/developer/settings/billing"
aria-controls="/settings/billing"
aria-selected={false}
id="/developer/settings/billing"
id="/settings/billing"
onClick={[Function]}
role="tab"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ exports[`WebhookTestModalBody WebhookTestModalBody should match snapshot 1`] = `
<a
className={[Function]}
href="/developer/api-docs/api/webhooks#testing"
href="/api-docs/api/webhooks#testing"
rel="noopener noreferrer"
target="_blank"
>
Expand Down
Loading

0 comments on commit dee72fa

Please sign in to comment.