Skip to content

Commit

Permalink
fix: small tweaks for go live (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcvay authored Feb 18, 2020
1 parent d8c6d69 commit a178100
Show file tree
Hide file tree
Showing 22 changed files with 73 additions and 57 deletions.
24 changes: 3 additions & 21 deletions packages/config-manager/reapit-config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,12 @@
"PLATFORM_API_BASE_URL": "https://dev.platform.reapit.cloud",
"MARKETPLACE_API_BASE_URL": "https://dev.platformmarketplace.reapit.cloud",
"MARKET_PLACE_URL": "https://dev.marketplace.reapit.cloud",
"MARKETPLACE_API_KEY": "",
"MARKETPLACE_GOOGLE_ANALYTICS_KEY": "",
"NODE_ENV": "development",
"NPM_TOKEN": "",
"GOOGLE_MAPS_API_KEY": "",
"COGNITO_USERPOOL_ID": "",
"COGNITO_USERPOOL_ID": "eu-west-2_hbt0B7yys",
"COGNITO_OAUTH_URL": "https://dev.connect.reapit.cloud",
"COGNITO_CLIENT_ID_MARKETPLACE": "",
"COGNITO_CLIENT_ID_GEO_DIARY": "",
"COGNITO_CLIENT_ID_AML_APP": "",
"COGNITO_CLIENT_ID_LTL_APP": "",
"COGNITO_CLIENT_ID": "",
"SWAGGER_BASE_URL": "https://dev.platform.reapit.cloud/docs",
"DEVELOPER_ACCOUNT_EMAIL": "",
"DEVELOPER_ACCOUNT_PASSWORD": "",
"CLIENT_ACCOUNT_EMAIL": "",
"CLIENT_ACCOUNT_PASSWORD": "",
"ADMIN_ACCOUNT_EMAIL": "",
"ADMIN_ACCOUNT_PASSWORD": "",
"APPLICATION_URL": "http://localhost:8080",
"RETRIES": 0,
"CHATBOT_APP_ID": "",
"SENTRY_PROJECT_URL_MARKETPLACE": "",
"SENTRY_PROJECT_URL_GEO_DIARY": "",
"SENTRY_PROJECT_URL_AML_APP": "",
"SENTRY_PROJECT_URL_LTL_APP": ""
"APPLICATION_URL": "http://localhost:8080"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ exports[`DeveloperSubmitAppSuccessfully renders correctly 1`] = `
</p>
<br />
<p>
You will be directed to the ‘My Apps’ page where you will be able to access the ‘Client ID’ of you App (required for authentication) and or make any changes to your App by clicking ‘Edit Details’.
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>
Expand All @@ -53,15 +53,21 @@ exports[`DeveloperSubmitAppSuccessfully renders correctly 1`] = `
<strong>
Please note:
</strong>
Any changes you make now to your App (included 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’.
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 ‘Help’ page.
For any issues or support, please visit the
<Link
to="/developer/help"
>
‘Help’
</Link>
page.
</p>
<br />
</CallToAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ exports[`DeveloperSubmitApp should match a snapshot 1`] = `
<Component
onContinueClick={[Function]}
onViewDocClick={[Function]}
visible={false}
visible={true}
/>
</Fragment>
`;
Expand Down Expand Up @@ -119,7 +119,7 @@ exports[`DeveloperSubmitApp should match submit revision form snapshot 1`] = `
<Component
onContinueClick={[Function]}
onViewDocClick={[Function]}
visible={false}
visible={true}
/>
</Fragment>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,9 @@ describe('handleSubmitModalViewDocs', () => {
window.location = location
})
it('should call window.location.assign', () => {
const spy = jest.spyOn(window.location, 'assign')
const spy = jest.spyOn(window, 'open')
handleSubmitModalViewDocs()
expect(spy).toHaveBeenCalledWith(DOCS_LINKS.DEVELOPER_PORTAL)
expect(spy).toHaveBeenCalledWith(DOCS_LINKS.DEVELOPER_PORTAL, '_blank')
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as React from 'react'
import { FlexContainerResponsive, Button } from '@reapit/elements'
import CallToAction from '../ui/call-to-action'
import styles from '@/styles/pages/developer-submit-app-successfully.scss?mod'
import { Link } from 'react-router-dom'
import Routes from '@/constants/routes'

export interface DeveloperSubmitAppSuccessfullyProps {
onGoBackToApps: () => void
Expand Down Expand Up @@ -32,8 +34,8 @@ export const DeveloperSubmitAppSuccessfully: React.FC<DeveloperSubmitAppSuccessf
<br />
<p>
You will be directed to the &lsquo;My Apps&rsquo; page where you will be able to access the &lsquo;Client
ID&rsquo; of you App (required for authentication) and or make any changes to your App by clicking &lsquo;Edit
Details&rsquo;.
ID&rsquo; of your App (required for authentication) and or make any changes to your App by clicking
&lsquo;Edit Details&rsquo;.
</p>
<br />
<p>
Expand All @@ -43,7 +45,7 @@ export const DeveloperSubmitAppSuccessfully: React.FC<DeveloperSubmitAppSuccessf
</p>
<br />
<p>
<strong>Please note:</strong> Any changes you make now to your App (included making it &lsquo;Listed&rsquo;)
<strong>Please note:</strong> Any changes you make now to your App (including making it &lsquo;Listed&rsquo;)
will require approval. These are called &lsquo;Revisions&rsquo;. 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 &lsquo;Pending Revision&rsquo;.
Expand All @@ -54,7 +56,9 @@ export const DeveloperSubmitAppSuccessfully: React.FC<DeveloperSubmitAppSuccessf
live in the Marketplace and available for install by customers.
</p>
<br />
<p>For any issues or support, please visit the &lsquo;Help&rsquo; page.</p>
<p>
For any issues or support, please visit the <Link to={Routes.DEVELOPER_HELP}>&lsquo;Help&rsquo;</Link> page.
</p>

<br />
</CallToAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ export const handleSubmitModalContinue = setIsSubmitModalOpen => () => {
}

export const handleSubmitModalViewDocs = () => {
window.location.assign(DOCS_LINKS.DEVELOPER_PORTAL)
const newTab = window.open(DOCS_LINKS.DEVELOPER_PORTAL, '_blank')

if (newTab) {
newTab.focus()
}
}

const getGoBackToAppsFunc = ({ history }: Pick<RouteComponentProps, 'history'>) =>
Expand Down Expand Up @@ -274,7 +278,7 @@ export const SubmitApp: React.FC<SubmitAppProps> = ({
// const handleOnChangeAgree = setIsAgreedTerms.bind(null, prev => !prev)

// submit modal state
const [isSubmitModalOpen, setIsSubmitModalOpen] = React.useState<boolean>(false)
const [isSubmitModalOpen, setIsSubmitModalOpen] = React.useState<boolean>(!getCookieString(COOKIE_FIRST_SUBMIT))

const [submitError, setSubmitError] = React.useState<string>()
const goBackToApps = getGoBackToAppsFunc({ history })
Expand Down Expand Up @@ -367,14 +371,14 @@ export const SubmitApp: React.FC<SubmitAppProps> = ({
<Form noValidate={true}>
<FormSection data-test="submit-app-form">
<Helper>
For more information on how to complete this form, please view our &quot;Step-by-step&quot; guide
For more information on how to complete this form, please view our &quot;Step-by-step&quot;
guide&nbsp;
<a
className={linkStyles.link}
href="https://foundations-documentation.reapit.cloud/developer-portal"
target="_blank"
rel="noopener noreferrer"
>
{' '}
here
</a>
</Helper>
Expand Down Expand Up @@ -440,7 +444,7 @@ export const SubmitApp: React.FC<SubmitAppProps> = ({
labelText="Launch URI"
id="launch Url"
name="launchUri"
placeholder="The launch page for your app. HTTP:// or HTTPS://"
placeholder="The launch page for your app. HTTPS only other than for http://localhost"
/>
</GridItem>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`AppAuthenticationDetail should match a snapshot 1`] = `
href="#"
onClick={[Function]}
>
Show Client Credentials
Show Secret
</a>
</div>
</Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
exports[`SandboxPopUp should match snapshot with default 1`] = `
<div>
<Component
message="Data in the dev portal APIs is sandbox and is regularly refreshed. You should not
use these feeds for production apps, they are for development purposes only."
message="This is a sandbox environment, with anonymised test data and isolated from production"
onCloseToast={[Function]}
variant="info"
visible={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exports[`SubmitAppReadDocModal should match snapshot with minimal props 1`] = `
title="Important"
visible={true}
>
Before continuing with registering your app, we strongly advise that you read the step to step guide on how best to complete the following form. Please confirm if have read the documentation?
Before continuing with registering your app, we strongly advise that you read the "Step-by-step" guide on how best to complete the following form. Please confirm if have read the documentation?
</Component>
`;

Expand Down Expand Up @@ -50,6 +50,6 @@ exports[`SubmitAppReadDocModal should match snapshot with some additional props
title="title"
visible={true}
>
Before continuing with registering your app, we strongly advise that you read the step to step guide on how best to complete the following form. Please confirm if have read the documentation?
Before continuing with registering your app, we strongly advise that you read the "Step-by-step" guide on how best to complete the following form. Please confirm if have read the documentation?
</Component>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const AppAuthenticationDetail: React.FunctionComponent<AppAuthenticationD
<div className={appDetailStyles.appInfoRow}>
<p className={appDetailStyles.appInfoProperty}>Authentication:</p>
<a href="#" onClick={handleShowAuthCode} className={styles.btnShowAuthentication}>
Show Client Credentials
Show Secret
</a>
</div>
{loading && <Loader body={false} />}
Expand Down
3 changes: 1 addition & 2 deletions packages/marketplace/src/components/ui/sandbox-pop-up.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ export const popUp = (setOpen, loading) => () => {

export const SandboxPopUp = ({
loading = false,
message = `Data in the dev portal APIs is sandbox and is regularly refreshed. You should not
use these feeds for production apps, they are for development purposes only.`,
message = 'This is a sandbox environment, with anonymised test data and isolated from production',
}) => {
const [isOpen, setIsOpen] = React.useState<boolean>(false)
const setOpen = React.useCallback(setIsOpen.bind(null, true), [setIsOpen])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export const SubmitAppReadDocModal: React.FC<SubmitAppReadDocModalProps> = ({
}
{...rest}
>
Before continuing with registering your app, we strongly advise that you read the step to step guide on how best
to complete the following form. Please confirm if have read the documentation?
Before continuing with registering your app, we strongly advise that you read the &quot;Step-by-step&quot; guide
on how best to complete the following form. Please confirm if have read the documentation?
</Modal>
)
}
4 changes: 3 additions & 1 deletion packages/marketplace/src/sagas/__tests__/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ describe('auth thunks', () => {
const TIME_OFFSET = 0
MockDate.set('2019-12-18T16:30:00', TIME_OFFSET)
const gen = cloneableGenerator(setFirstTimeLogin)()
expect(gen.next().value).toEqual(call(setCookieString, COOKIE_FIRST_TIME_LOGIN, new Date()))
expect(gen.next().value).toEqual(
call(setCookieString, COOKIE_FIRST_TIME_LOGIN, new Date(), COOKIE_MAX_AGE_INFINITY),
)
expect(gen.next().value).toEqual(put(toggleFirstLogin(false)))
expect(gen.next().done).toBe(true)
MockDate.reset()
Expand Down
2 changes: 1 addition & 1 deletion packages/marketplace/src/sagas/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const checkFirstTimeLogin = function*() {
}

export const setFirstTimeLogin = function*() {
yield call(setCookieString, COOKIE_FIRST_TIME_LOGIN, new Date())
yield call(setCookieString, COOKIE_FIRST_TIME_LOGIN, new Date(), COOKIE_MAX_AGE_INFINITY)
yield put(toggleFirstLogin(false))
}

Expand Down
2 changes: 1 addition & 1 deletion packages/marketplace/src/styles/vendor/swagger.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}

hgroup.main {
pre.base-url, a {
pre.base-url {
display: none;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-branches.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-functions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a178100

Please sign in to comment.