Skip to content

Commit

Permalink
feat: #1917 Merge master and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Vu Nguyen committed Jul 13, 2020
2 parents 50d90db + ab629ac commit 2f05308
Show file tree
Hide file tree
Showing 407 changed files with 18,278 additions and 4,751 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@ scripts/jest/.jest-cache

# credentials file to load
credentials.json
# Locally I have had to add these because of: https://github.com/yarnpkg/yarn/issues/7807
# May need to include globally if other people experienece installing issues
.yarnrc
.yarn
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,6 @@
"webpack": "^4.41.5",
"webpack-cli": "^3.3.2",
"webpack-dev-server": "^3.4.1",
"workbox-webpack-plugin": "^4.3.1"
"workbox-webpack-plugin": "^5.1.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const props = {
Component,
routerProps: {
match: {
path: Routes.CLIENT,
path: Routes.DEVELOPER,
params: { page: 1 },
},
location: {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('ApiDocs', () => {

describe('parseIframeUrl', () => {
it('should run correctly', () => {
const pathname = `${Routes.DEVELOPER_API_DOCS}/platform-glossary`
const pathname = `${Routes.API_DOCS}/platform-glossary`
const hash = '#company'
const result = parseIframeUrl(pathname, hash)
expect(result).toEqual('/platform-glossary#company')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import * as React from 'react'
import { useHistory } from 'react-router'
import ErrorBoundary from '@/components/hocs/error-boundary'
import { UnsupportBrowserPopUp } from '@/components/ui/unsupport-browser-pop-up'
import { IFRAME_URLS } from '../../constants/iframe-urls'
import Routes from '../../constants/routes'
import { isIE } from '@/utils/browser'
import Routes from '@/constants/routes'
import { IFRAME_URLS } from '@/constants/iframe-urls'

export const parseIframeUrl = (pathname: string, hash: string): string => {
const path = pathname.split(Routes.DEVELOPER_API_DOCS)[1]
return `${path}${hash}`
const documentPagePath = pathname.split(Routes.API_DOCS)[1]
return `${documentPagePath}${hash}`
}

const ApiDocsPage: React.FC = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import APIDocs from './api-docs'
export default APIDocs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('DeveloperAppDetail', () => {
expect(
mount(
<ReactRedux.Provider store={store}>
<MemoryRouter initialEntries={[{ pathname: Routes.DEVELOPER_APP_DETAIL, key: 'developerAppDetailRoute' }]}>
<MemoryRouter initialEntries={[{ pathname: Routes.APP_DETAIL, key: 'developerAppDetailRoute' }]}>
<DeveloperAppDetail />
</MemoryRouter>
</ReactRedux.Provider>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('ManageApp', () => {
expect(
mount(
<Provider store={store}>
<MemoryRouter initialEntries={[{ pathname: Routes.DEVELOPER_APP_DETAIL, key: 'developerAppDetailRoute' }]}>
<MemoryRouter initialEntries={[{ pathname: Routes.APP_DETAIL, key: 'developerAppDetailRoute' }]}>
<DeveloperManageApp
id="test"
pendingRevisions={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Authentication', () => {
it('should run correctly', () => {
const fn = onMarketplaceButtonClick(history)
fn()
expect(history.replace).toBeCalledWith(Routes.CLIENT)
expect(history.replace).toBeCalledWith(Routes.DEVELOPER)
})
})
describe('onRegisterButtonClick', () => {
Expand All @@ -74,7 +74,7 @@ describe('Authentication', () => {
it('should run correctly', () => {
const fn = onDevelopersButtonClick(history)
fn()
expect(history.replace).toBeCalledWith(Routes.DEVELOPER_DESKTOP)
expect(history.replace).toBeCalledWith(Routes.DESKTOP)
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface AuthenticationParamTypes {

export const onDevelopersButtonClick = (history: History) => {
return () => {
history.replace(Routes.DEVELOPER_DESKTOP)
history.replace(Routes.DESKTOP)
}
}

Expand Down Expand Up @@ -58,7 +58,7 @@ export const renderClientModal = (history, dispatch) => {
please visit the&nbsp;
</span>
<span>
<Link to={Routes.DEVELOPER_DESKTOP}>Desktop</Link>
<Link to={Routes.DESKTOP}>Desktop</Link>
</span>
<span>
&nbsp;page within the Developers Portal, where you can subscribe to a Developer Edition of Agency Cloud.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { mount } from 'enzyme'
import { Provider } from 'react-redux'
import configureStore from 'redux-mock-store'
import appState from '@/reducers/__stubs__/app-state'
import { DeveloperDesktopPage, handleToggleVisibleModal } from '../developer-desktop'
import { DeveloperDesktopPage, handleToggleVisibleModal } from '../desktop'

describe('DeveloperDesktopPage', () => {
let store
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const DeveloperDesktopContentPartOne: React.FC = () => {
</p>
<p>
To learn more about what’s possible with the Desktop API, please visit the{' '}
<a target="_blank" rel="noreferrer" href={`${Routes.DEVELOPER_API_DOCS}/api/desktop-api`}>
<a target="_blank" rel="noreferrer" href={`${Routes.API_DOCS}/api/desktop-api`}>
documentation.
</a>
</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './desktop'

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import initChatBot from '../../../scripts/chat-bot'
import initChatBot from '../../../../scripts/chat-bot'
import { mount } from 'enzyme'
import * as ReactRedux from 'react-redux'
import {
Expand All @@ -10,17 +10,17 @@ import {
handleFaq,
handleViewRoadmap,
handleWhatsNew,
} from '../developer-help'
} from '../help'
import Routes from '@/constants/routes'
import configureStore from 'redux-mock-store'
import { history } from '@/core/router'
import { HelpLinks } from '@/constants/developer-help-links'
import { mockLoginSession } from '../../../sagas/__tests__/auth'
import appState from '@/reducers/__stubs__/app-state'
import { mockLoginSession } from '@/sagas/__tests__/auth'

jest.mock('../../../scripts/chat-bot')
jest.mock('../../../../scripts/chat-bot')

jest.mock('../../../core/router', () => ({
jest.mock('../../../../core/router', () => ({
history: {
push: jest.fn(),
},
Expand Down Expand Up @@ -53,7 +53,7 @@ describe('handleGotoWelcomeGuide', () => {
it('should called with correct props', () => {
const spy = jest.spyOn(history, 'push')
handleGotoWelcomeGuide()
expect(spy).toHaveBeenCalledWith(Routes.DEVELOPER_WELCOME)
expect(spy).toHaveBeenCalledWith(Routes.WELCOME)
})
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { useSelector } from 'react-redux'
import initChatBot from '../../scripts/chat-bot'
import initChatBot from '../../../scripts/chat-bot'
import { history } from '@/core/router'
import { H3 } from '@reapit/elements'
import Routes from '@/constants/routes'
Expand All @@ -17,7 +17,7 @@ import { LoginIdentity } from '@reapit/cognito-auth'
import { selectLoginIdentity } from '@/selector/auth'

export const handleGotoWelcomeGuide = () => {
history.push(Routes.DEVELOPER_WELCOME)
history.push(Routes.WELCOME)
}

export const handleReportBug = () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/developer-portal/src/components/pages/help/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import Help from './help'
export default Help
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import RegisterConfirm from './register-confirm'
export default RegisterConfirm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`DeveloperSettingsPage should match snapshot 1`] = `
exports[`SettingsPage should match snapshot 1`] = `
<ContextProvider
value={
Object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { shallow } from 'enzyme'
import DeveloperSettingsPage from '../settings'
import SettingsPage from '../settings'
import { ReduxState } from '@/types/core'
import { Provider } from 'react-redux'
import configureStore from 'redux-mock-store'
Expand All @@ -17,14 +17,14 @@ const mockState = {
},
} as ReduxState

describe('DeveloperSettingsPage', () => {
describe('SettingsPage', () => {
it('should match snapshot', () => {
const mockStore = configureStore()
const store = mockStore(mockState)

const wrapper = shallow(
<Provider store={store}>
<DeveloperSettingsPage />
<SettingsPage />
</Provider>,
)
expect(wrapper).toMatchSnapshot()
Expand Down
Loading

0 comments on commit 2f05308

Please sign in to comment.