From c0d86e32cb9755ff47e7db3992ec5c3a1069efc0 Mon Sep 17 00:00:00 2001 From: Vu Nguyen Date: Mon, 13 Jul 2020 10:53:10 +0700 Subject: [PATCH] feat: #1917 Purge unused code from settings page --- .../__snapshots__/client-setting.tsx.snap | 127 ------------------ .../set-as-admin-modal.test.tsx.snap | 0 .../__snapshots__/settings.test.tsx.snap} | 2 +- .../settings/__tests__/client-setting.tsx | 33 ----- .../__tests__/set-as-admin-modal.test.tsx | 0 .../settings.test.tsx} | 2 +- .../delete-confirm.test.tsx.snap | 0 .../__snapshots__/subscriptions.test.tsx.snap | 0 .../billing/__tests__/delete-confirm.test.tsx | 0 .../billing/__tests__/subscriptions.test.tsx | 0 .../settings}/billing/delete-confirm.tsx | 0 .../settings}/billing/subscriptions.tsx | 0 .../pages/settings/client-setting.tsx | 39 ------ .../developer-settings-billing-tab/index.ts | 1 - .../index.ts | 1 - .../settings/developer-settings/index.ts | 1 - .../change-password-form.test.tsx.snap | 0 .../contact-information-form.test.tsx.snap | 0 .../__snapshots__/forms.test.tsx.snap | 0 .../__tests__/change-password-form.test.tsx | 0 .../contact-information-form.test.tsx | 0 .../forms/__tests__/forms.test.tsx | 0 .../forms/change-password-form.tsx | 0 .../forms/contact-information-form.tsx | 2 +- .../{developer-settings => }/forms/forms.tsx | 0 .../{developer-settings => }/forms/index.ts | 0 .../src/components/pages/settings/index.ts | 2 + .../settings}/set-as-admin-modal.tsx | 0 .../settings-billing-tab.tsx.snap} | 0 .../__tests__/settings-billing-tab.tsx} | 2 +- .../accounts-information-form.test.tsx.snap | 0 .../contact-information-section.test.tsx.snap | 0 .../direct-debit-section.test.tsx.snap | 0 .../reapit-reference-section.test.tsx.snap | 0 .../accounts-information-form.test.tsx | 0 .../contact-information-section.test.tsx | 0 .../__tests__/direct-debit-section.test.tsx | 0 .../reapit-reference-section.test.tsx | 0 .../__tests__/validation-schema.ts | 0 .../accounts-information-form.tsx | 0 .../contact-information-section.tsx | 0 .../direct-debit-section.tsx | 0 .../form-schema/form-fields.ts | 0 .../form-schema/validation-schema.ts | 0 .../accounts-information-form/index.ts | 0 .../reapit-reference-section.tsx | 0 .../settings/settings-billing-tab/index.ts | 1 + .../settings-billing-tab.tsx} | 6 +- .../__snapshots__/members.test.tsx.snap | 0 .../settings-organisation-tab.test.tsx.snap} | 0 .../__tests__/members.test.tsx | 0 .../settings-organisation-tab.test.tsx} | 2 +- .../settings-organisation-tab/index.ts | 1 + .../members.tsx | 2 +- .../company-information.test.tsx.snap | 0 .../__tests__/company-information.test.tsx | 0 .../company-address-section.tsx | 0 .../company-information-section.tsx | 0 .../organisation-form/country-options-list.ts | 0 .../form-schema/form-fields.ts | 0 .../form-schema/validation-schema.ts | 0 .../organisation-form/index.ts | 0 .../organisation-form/organisation-form.tsx | 0 .../settings-organisation-tab.tsx} | 0 .../developer-settings.tsx => settings.tsx} | 6 +- .../src/components/pages/settings/tabs.tsx | 18 +-- .../src/components/ui/menu.tsx | 2 +- .../developer-portal/src/constants/routes.ts | 6 +- .../__tests__/__snapshots__/router.tsx.snap | 14 -- packages/developer-portal/src/core/router.tsx | 30 ++--- .../cypress/pages/developer-settings-page.ts | 2 +- .../src/tests/cypress/pages/settings-page.ts | 2 +- .../src/utils/__tests__/route-dispatcher.ts | 2 +- .../utils/form/__tests__/change-password.ts | 2 +- ...ion.ts => settings-contact-information.ts} | 4 +- .../src/utils/form/change-password.ts | 2 +- ...ion.ts => settings-contact-information.ts} | 2 +- .../src/utils/route-dispatcher.ts | 2 +- 78 files changed, 48 insertions(+), 270 deletions(-) delete mode 100644 packages/developer-portal/src/components/pages/settings/__tests__/__snapshots__/client-setting.tsx.snap rename packages/developer-portal/src/components/{ui/developer-settings => pages/settings}/__tests__/__snapshots__/set-as-admin-modal.test.tsx.snap (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings/__tests__/__snapshots__/developer-settings.test.tsx.snap => __tests__/__snapshots__/settings.test.tsx.snap} (97%) delete mode 100644 packages/developer-portal/src/components/pages/settings/__tests__/client-setting.tsx rename packages/developer-portal/src/components/{ui/developer-settings => pages/settings}/__tests__/set-as-admin-modal.test.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings/__tests__/developer-settings.test.tsx => __tests__/settings.test.tsx} (92%) rename packages/developer-portal/src/components/{ui/developer-settings => pages/settings}/billing/__tests__/__snapshots__/delete-confirm.test.tsx.snap (100%) rename packages/developer-portal/src/components/{ui/developer-settings => pages/settings}/billing/__tests__/__snapshots__/subscriptions.test.tsx.snap (100%) rename packages/developer-portal/src/components/{ui/developer-settings => pages/settings}/billing/__tests__/delete-confirm.test.tsx (100%) rename packages/developer-portal/src/components/{ui/developer-settings => pages/settings}/billing/__tests__/subscriptions.test.tsx (100%) rename packages/developer-portal/src/components/{ui/developer-settings => pages/settings}/billing/delete-confirm.tsx (100%) rename packages/developer-portal/src/components/{ui/developer-settings => pages/settings}/billing/subscriptions.tsx (100%) delete mode 100644 packages/developer-portal/src/components/pages/settings/client-setting.tsx delete mode 100644 packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/index.ts delete mode 100644 packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/index.ts delete mode 100644 packages/developer-portal/src/components/pages/settings/developer-settings/index.ts rename packages/developer-portal/src/components/pages/settings/{developer-settings => }/forms/__tests__/__snapshots__/change-password-form.test.tsx.snap (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings => }/forms/__tests__/__snapshots__/contact-information-form.test.tsx.snap (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings => }/forms/__tests__/__snapshots__/forms.test.tsx.snap (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings => }/forms/__tests__/change-password-form.test.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings => }/forms/__tests__/contact-information-form.test.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings => }/forms/__tests__/forms.test.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings => }/forms/change-password-form.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings => }/forms/contact-information-form.tsx (97%) rename packages/developer-portal/src/components/pages/settings/{developer-settings => }/forms/forms.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings => }/forms/index.ts (100%) create mode 100644 packages/developer-portal/src/components/pages/settings/index.ts rename packages/developer-portal/src/components/{ui/developer-settings => pages/settings}/set-as-admin-modal.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab/__tests__/__snapshots__/developer-settings-billing-tab.tsx.snap => settings-billing-tab/__tests__/__snapshots__/settings-billing-tab.tsx.snap} (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab/__tests__/developer-settings-billing-tab.tsx => settings-billing-tab/__tests__/settings-billing-tab.tsx} (77%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/__tests__/__snapshots__/accounts-information-form.test.tsx.snap (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/__tests__/__snapshots__/contact-information-section.test.tsx.snap (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/__tests__/__snapshots__/direct-debit-section.test.tsx.snap (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/__tests__/__snapshots__/reapit-reference-section.test.tsx.snap (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/__tests__/accounts-information-form.test.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/__tests__/contact-information-section.test.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/__tests__/direct-debit-section.test.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/__tests__/reapit-reference-section.test.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/__tests__/validation-schema.ts (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/accounts-information-form.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/contact-information-section.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/direct-debit-section.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/form-schema/form-fields.ts (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/form-schema/validation-schema.ts (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/index.ts (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab => settings-billing-tab}/accounts-information-form/reapit-reference-section.tsx (100%) create mode 100644 packages/developer-portal/src/components/pages/settings/settings-billing-tab/index.ts rename packages/developer-portal/src/components/pages/settings/{developer-settings-billing-tab/developer-settings-billing-tab.tsx => settings-billing-tab/settings-billing-tab.tsx} (69%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab => settings-organisation-tab}/__tests__/__snapshots__/members.test.tsx.snap (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab/__tests__/__snapshots__/developer-settings-organisation-tab.tsx.snap => settings-organisation-tab/__tests__/__snapshots__/settings-organisation-tab.test.tsx.snap} (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab => settings-organisation-tab}/__tests__/members.test.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab/__tests__/developer-settings-organisation-tab.tsx => settings-organisation-tab/__tests__/settings-organisation-tab.test.tsx} (96%) create mode 100644 packages/developer-portal/src/components/pages/settings/settings-organisation-tab/index.ts rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab => settings-organisation-tab}/members.tsx (97%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab => settings-organisation-tab}/organisation-form/__tests__/__snapshots__/company-information.test.tsx.snap (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab => settings-organisation-tab}/organisation-form/__tests__/company-information.test.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab => settings-organisation-tab}/organisation-form/company-address-section.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab => settings-organisation-tab}/organisation-form/company-information-section.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab => settings-organisation-tab}/organisation-form/country-options-list.ts (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab => settings-organisation-tab}/organisation-form/form-schema/form-fields.ts (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab => settings-organisation-tab}/organisation-form/form-schema/validation-schema.ts (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab => settings-organisation-tab}/organisation-form/index.ts (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab => settings-organisation-tab}/organisation-form/organisation-form.tsx (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings-organisation-tab/developer-settings-organisation-tab.tsx => settings-organisation-tab/settings-organisation-tab.tsx} (100%) rename packages/developer-portal/src/components/pages/settings/{developer-settings/developer-settings.tsx => settings.tsx} (87%) rename packages/developer-portal/src/utils/form/__tests__/{developer-settings-contact-information.ts => settings-contact-information.ts} (87%) rename packages/developer-portal/src/utils/form/{developer-settings-contact-information.ts => settings-contact-information.ts} (92%) diff --git a/packages/developer-portal/src/components/pages/settings/__tests__/__snapshots__/client-setting.tsx.snap b/packages/developer-portal/src/components/pages/settings/__tests__/__snapshots__/client-setting.tsx.snap deleted file mode 100644 index eeedaeed8f..0000000000 --- a/packages/developer-portal/src/components/pages/settings/__tests__/__snapshots__/client-setting.tsx.snap +++ /dev/null @@ -1,127 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`ClientSettingsPage should match snapshot 1`] = ` - - - - - -
- -

- Settings -

-
-
-
- -
- -
- Customer ID: - - testClientId - -
-
- -
- This is your Customer ID which you will need for use with Private Apps and Web Components. -
-
- -
- - - -
-
-
-
-
-
-
-
-`; diff --git a/packages/developer-portal/src/components/ui/developer-settings/__tests__/__snapshots__/set-as-admin-modal.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/__tests__/__snapshots__/set-as-admin-modal.test.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/ui/developer-settings/__tests__/__snapshots__/set-as-admin-modal.test.tsx.snap rename to packages/developer-portal/src/components/pages/settings/__tests__/__snapshots__/set-as-admin-modal.test.tsx.snap diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/__tests__/__snapshots__/developer-settings.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/__tests__/__snapshots__/settings.test.tsx.snap similarity index 97% rename from packages/developer-portal/src/components/pages/settings/developer-settings/__tests__/__snapshots__/developer-settings.test.tsx.snap rename to packages/developer-portal/src/components/pages/settings/__tests__/__snapshots__/settings.test.tsx.snap index 4250329739..df36c95add 100644 --- a/packages/developer-portal/src/components/pages/settings/developer-settings/__tests__/__snapshots__/developer-settings.test.tsx.snap +++ b/packages/developer-portal/src/components/pages/settings/__tests__/__snapshots__/settings.test.tsx.snap @@ -32,6 +32,6 @@ exports[`DeveloperSettingsPage should match snapshot 1`] = ` } } > - + `; diff --git a/packages/developer-portal/src/components/pages/settings/__tests__/client-setting.tsx b/packages/developer-portal/src/components/pages/settings/__tests__/client-setting.tsx deleted file mode 100644 index 9788b1bf4f..0000000000 --- a/packages/developer-portal/src/components/pages/settings/__tests__/client-setting.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import React from 'react' -import { mount } from 'enzyme' -import { ClientSettingsPage, handleLogout } from '../client-setting' -import { authLogout } from '@/actions/auth' -import { Provider } from 'react-redux' -import { MemoryRouter } from 'react-router' -import Routes from '@/constants/routes' -import configureStore from 'redux-mock-store' -import appState from '@/reducers/__stubs__/app-state' - -describe('ClientSettingsPage', () => { - it('should match snapshot', () => { - const mockStore = configureStore() - const store = mockStore(appState) - - expect( - mount( - - - - - , - ), - ).toMatchSnapshot() - }) - - it('should handleLogout run correctly', () => { - const dispatch = jest.fn() - const fn = handleLogout(dispatch) - fn() - expect(dispatch).toBeCalledWith(authLogout()) - }) -}) diff --git a/packages/developer-portal/src/components/ui/developer-settings/__tests__/set-as-admin-modal.test.tsx b/packages/developer-portal/src/components/pages/settings/__tests__/set-as-admin-modal.test.tsx similarity index 100% rename from packages/developer-portal/src/components/ui/developer-settings/__tests__/set-as-admin-modal.test.tsx rename to packages/developer-portal/src/components/pages/settings/__tests__/set-as-admin-modal.test.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/__tests__/developer-settings.test.tsx b/packages/developer-portal/src/components/pages/settings/__tests__/settings.test.tsx similarity index 92% rename from packages/developer-portal/src/components/pages/settings/developer-settings/__tests__/developer-settings.test.tsx rename to packages/developer-portal/src/components/pages/settings/__tests__/settings.test.tsx index 81a0c7be18..811dda2eca 100644 --- a/packages/developer-portal/src/components/pages/settings/developer-settings/__tests__/developer-settings.test.tsx +++ b/packages/developer-portal/src/components/pages/settings/__tests__/settings.test.tsx @@ -1,6 +1,6 @@ import React from 'react' import { shallow } from 'enzyme' -import DeveloperSettingsPage from '../developer-settings' +import DeveloperSettingsPage from '../settings' import { ReduxState } from '@/types/core' import { Provider } from 'react-redux' import configureStore from 'redux-mock-store' diff --git a/packages/developer-portal/src/components/ui/developer-settings/billing/__tests__/__snapshots__/delete-confirm.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/billing/__tests__/__snapshots__/delete-confirm.test.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/ui/developer-settings/billing/__tests__/__snapshots__/delete-confirm.test.tsx.snap rename to packages/developer-portal/src/components/pages/settings/billing/__tests__/__snapshots__/delete-confirm.test.tsx.snap diff --git a/packages/developer-portal/src/components/ui/developer-settings/billing/__tests__/__snapshots__/subscriptions.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/billing/__tests__/__snapshots__/subscriptions.test.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/ui/developer-settings/billing/__tests__/__snapshots__/subscriptions.test.tsx.snap rename to packages/developer-portal/src/components/pages/settings/billing/__tests__/__snapshots__/subscriptions.test.tsx.snap diff --git a/packages/developer-portal/src/components/ui/developer-settings/billing/__tests__/delete-confirm.test.tsx b/packages/developer-portal/src/components/pages/settings/billing/__tests__/delete-confirm.test.tsx similarity index 100% rename from packages/developer-portal/src/components/ui/developer-settings/billing/__tests__/delete-confirm.test.tsx rename to packages/developer-portal/src/components/pages/settings/billing/__tests__/delete-confirm.test.tsx diff --git a/packages/developer-portal/src/components/ui/developer-settings/billing/__tests__/subscriptions.test.tsx b/packages/developer-portal/src/components/pages/settings/billing/__tests__/subscriptions.test.tsx similarity index 100% rename from packages/developer-portal/src/components/ui/developer-settings/billing/__tests__/subscriptions.test.tsx rename to packages/developer-portal/src/components/pages/settings/billing/__tests__/subscriptions.test.tsx diff --git a/packages/developer-portal/src/components/ui/developer-settings/billing/delete-confirm.tsx b/packages/developer-portal/src/components/pages/settings/billing/delete-confirm.tsx similarity index 100% rename from packages/developer-portal/src/components/ui/developer-settings/billing/delete-confirm.tsx rename to packages/developer-portal/src/components/pages/settings/billing/delete-confirm.tsx diff --git a/packages/developer-portal/src/components/ui/developer-settings/billing/subscriptions.tsx b/packages/developer-portal/src/components/pages/settings/billing/subscriptions.tsx similarity index 100% rename from packages/developer-portal/src/components/ui/developer-settings/billing/subscriptions.tsx rename to packages/developer-portal/src/components/pages/settings/billing/subscriptions.tsx diff --git a/packages/developer-portal/src/components/pages/settings/client-setting.tsx b/packages/developer-portal/src/components/pages/settings/client-setting.tsx deleted file mode 100644 index 6bc5b6bb36..0000000000 --- a/packages/developer-portal/src/components/pages/settings/client-setting.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import * as React from 'react' -import { H3, Button, LevelRight, FormHeading, FormSubHeading, Section } from '@reapit/elements' -import { Dispatch } from 'redux' -import { useSelector, useDispatch } from 'react-redux' -import { authLogout } from '@/actions/auth' -import { selectClientId } from '@/selector/auth' - -export const handleLogout = (dispatch: Dispatch) => () => { - dispatch(authLogout()) -} - -export const ClientSettingsPage: React.FC = () => { - const dispatch = useDispatch() - const customerId = useSelector(selectClientId) - - const logout = handleLogout(dispatch) - return ( - <> -
-

Settings

-
-
- - Customer ID: {customerId} - - - This is your Customer ID which you will need for use with Private Apps and Web Components. - - - - -
- - ) -} - -export default ClientSettingsPage diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/index.ts b/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/index.ts deleted file mode 100644 index 420fc0af2f..0000000000 --- a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './developer-settings-billing-tab' diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/index.ts b/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/index.ts deleted file mode 100644 index a699f3a717..0000000000 --- a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './developer-settings-organisation-tab' diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/index.ts b/packages/developer-portal/src/components/pages/settings/developer-settings/index.ts deleted file mode 100644 index 75bab4644d..0000000000 --- a/packages/developer-portal/src/components/pages/settings/developer-settings/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './developer-settings' diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/forms/__tests__/__snapshots__/change-password-form.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/forms/__tests__/__snapshots__/change-password-form.test.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings/forms/__tests__/__snapshots__/change-password-form.test.tsx.snap rename to packages/developer-portal/src/components/pages/settings/forms/__tests__/__snapshots__/change-password-form.test.tsx.snap diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/forms/__tests__/__snapshots__/contact-information-form.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/forms/__tests__/__snapshots__/contact-information-form.test.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings/forms/__tests__/__snapshots__/contact-information-form.test.tsx.snap rename to packages/developer-portal/src/components/pages/settings/forms/__tests__/__snapshots__/contact-information-form.test.tsx.snap diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/forms/__tests__/__snapshots__/forms.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/forms/__tests__/__snapshots__/forms.test.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings/forms/__tests__/__snapshots__/forms.test.tsx.snap rename to packages/developer-portal/src/components/pages/settings/forms/__tests__/__snapshots__/forms.test.tsx.snap diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/forms/__tests__/change-password-form.test.tsx b/packages/developer-portal/src/components/pages/settings/forms/__tests__/change-password-form.test.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings/forms/__tests__/change-password-form.test.tsx rename to packages/developer-portal/src/components/pages/settings/forms/__tests__/change-password-form.test.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/forms/__tests__/contact-information-form.test.tsx b/packages/developer-portal/src/components/pages/settings/forms/__tests__/contact-information-form.test.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings/forms/__tests__/contact-information-form.test.tsx rename to packages/developer-portal/src/components/pages/settings/forms/__tests__/contact-information-form.test.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/forms/__tests__/forms.test.tsx b/packages/developer-portal/src/components/pages/settings/forms/__tests__/forms.test.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings/forms/__tests__/forms.test.tsx rename to packages/developer-portal/src/components/pages/settings/forms/__tests__/forms.test.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/forms/change-password-form.tsx b/packages/developer-portal/src/components/pages/settings/forms/change-password-form.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings/forms/change-password-form.tsx rename to packages/developer-portal/src/components/pages/settings/forms/change-password-form.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/forms/contact-information-form.tsx b/packages/developer-portal/src/components/pages/settings/forms/contact-information-form.tsx similarity index 97% rename from packages/developer-portal/src/components/pages/settings/developer-settings/forms/contact-information-form.tsx rename to packages/developer-portal/src/components/pages/settings/forms/contact-information-form.tsx index d69226c63e..5691053f9d 100644 --- a/packages/developer-portal/src/components/pages/settings/developer-settings/forms/contact-information-form.tsx +++ b/packages/developer-portal/src/components/pages/settings/forms/contact-information-form.tsx @@ -15,7 +15,7 @@ import { GridItem, } from '@reapit/elements' import { DeveloperModel } from '@reapit/foundations-ts-definitions' -import { validate } from '@/utils/form/developer-settings-contact-information' +import { validate } from '@/utils/form/settings-contact-information' export type ContactInformationFormProps = FormikProps diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/forms/forms.tsx b/packages/developer-portal/src/components/pages/settings/forms/forms.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings/forms/forms.tsx rename to packages/developer-portal/src/components/pages/settings/forms/forms.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/forms/index.ts b/packages/developer-portal/src/components/pages/settings/forms/index.ts similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings/forms/index.ts rename to packages/developer-portal/src/components/pages/settings/forms/index.ts diff --git a/packages/developer-portal/src/components/pages/settings/index.ts b/packages/developer-portal/src/components/pages/settings/index.ts new file mode 100644 index 0000000000..8b43ae2ee4 --- /dev/null +++ b/packages/developer-portal/src/components/pages/settings/index.ts @@ -0,0 +1,2 @@ +import Settings from './settings' +export default Settings diff --git a/packages/developer-portal/src/components/ui/developer-settings/set-as-admin-modal.tsx b/packages/developer-portal/src/components/pages/settings/set-as-admin-modal.tsx similarity index 100% rename from packages/developer-portal/src/components/ui/developer-settings/set-as-admin-modal.tsx rename to packages/developer-portal/src/components/pages/settings/set-as-admin-modal.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/__tests__/__snapshots__/developer-settings-billing-tab.tsx.snap b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/__tests__/__snapshots__/settings-billing-tab.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/__tests__/__snapshots__/developer-settings-billing-tab.tsx.snap rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/__tests__/__snapshots__/settings-billing-tab.tsx.snap diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/__tests__/developer-settings-billing-tab.tsx b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/__tests__/settings-billing-tab.tsx similarity index 77% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/__tests__/developer-settings-billing-tab.tsx rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/__tests__/settings-billing-tab.tsx index f240a2b0da..f8fa637b31 100644 --- a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/__tests__/developer-settings-billing-tab.tsx +++ b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/__tests__/settings-billing-tab.tsx @@ -1,6 +1,6 @@ import React from 'react' import { shallow } from 'enzyme' -import DeveloperBillingTabPage from '../developer-settings-billing-tab' +import DeveloperBillingTabPage from '../settings-billing-tab' describe('DeveloperBillingTabPage', () => { it('should match snapshot', () => { diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/__snapshots__/accounts-information-form.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/__snapshots__/accounts-information-form.test.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/__snapshots__/accounts-information-form.test.tsx.snap rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/__snapshots__/accounts-information-form.test.tsx.snap diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/__snapshots__/contact-information-section.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/__snapshots__/contact-information-section.test.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/__snapshots__/contact-information-section.test.tsx.snap rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/__snapshots__/contact-information-section.test.tsx.snap diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/__snapshots__/direct-debit-section.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/__snapshots__/direct-debit-section.test.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/__snapshots__/direct-debit-section.test.tsx.snap rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/__snapshots__/direct-debit-section.test.tsx.snap diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/__snapshots__/reapit-reference-section.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/__snapshots__/reapit-reference-section.test.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/__snapshots__/reapit-reference-section.test.tsx.snap rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/__snapshots__/reapit-reference-section.test.tsx.snap diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/accounts-information-form.test.tsx b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/accounts-information-form.test.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/accounts-information-form.test.tsx rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/accounts-information-form.test.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/contact-information-section.test.tsx b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/contact-information-section.test.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/contact-information-section.test.tsx rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/contact-information-section.test.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/direct-debit-section.test.tsx b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/direct-debit-section.test.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/direct-debit-section.test.tsx rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/direct-debit-section.test.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/reapit-reference-section.test.tsx b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/reapit-reference-section.test.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/reapit-reference-section.test.tsx rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/reapit-reference-section.test.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/validation-schema.ts b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/validation-schema.ts similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/__tests__/validation-schema.ts rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/__tests__/validation-schema.ts diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/accounts-information-form.tsx b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/accounts-information-form.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/accounts-information-form.tsx rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/accounts-information-form.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/contact-information-section.tsx b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/contact-information-section.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/contact-information-section.tsx rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/contact-information-section.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/direct-debit-section.tsx b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/direct-debit-section.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/direct-debit-section.tsx rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/direct-debit-section.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/form-schema/form-fields.ts b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/form-schema/form-fields.ts similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/form-schema/form-fields.ts rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/form-schema/form-fields.ts diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/form-schema/validation-schema.ts b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/form-schema/validation-schema.ts similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/form-schema/validation-schema.ts rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/form-schema/validation-schema.ts diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/index.ts b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/index.ts similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/index.ts rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/index.ts diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/reapit-reference-section.tsx b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/reapit-reference-section.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/accounts-information-form/reapit-reference-section.tsx rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/accounts-information-form/reapit-reference-section.tsx diff --git a/packages/developer-portal/src/components/pages/settings/settings-billing-tab/index.ts b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/index.ts new file mode 100644 index 0000000000..9997e6c258 --- /dev/null +++ b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/index.ts @@ -0,0 +1 @@ +export { default } from './settings-billing-tab' diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/developer-settings-billing-tab.tsx b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/settings-billing-tab.tsx similarity index 69% rename from packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/developer-settings-billing-tab.tsx rename to packages/developer-portal/src/components/pages/settings/settings-billing-tab/settings-billing-tab.tsx index e609f4eb51..c1d0130241 100644 --- a/packages/developer-portal/src/components/pages/settings/developer-settings-billing-tab/developer-settings-billing-tab.tsx +++ b/packages/developer-portal/src/components/pages/settings/settings-billing-tab/settings-billing-tab.tsx @@ -2,9 +2,9 @@ import * as React from 'react' import { Section } from '@reapit/elements' import { Tabs } from '../tabs' import AccountsInformationForm from './accounts-information-form' -import Subcriptions from '@/components/ui/developer-settings/billing/subscriptions' +import Subcriptions from '@/components/pages/settings/billing/subscriptions' -const DevelperSettingsBillingTabPage: React.FC<{}> = () => { +const SettingsBillingTabPage: React.FC<{}> = () => { // FEATURE FLAG const isProd = window.reapit.config.appEnv === 'production' @@ -20,4 +20,4 @@ const DevelperSettingsBillingTabPage: React.FC<{}> = () => { ) } -export default DevelperSettingsBillingTabPage +export default SettingsBillingTabPage diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/__tests__/__snapshots__/members.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/__tests__/__snapshots__/members.test.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/__tests__/__snapshots__/members.test.tsx.snap rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/__tests__/__snapshots__/members.test.tsx.snap diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/__tests__/__snapshots__/developer-settings-organisation-tab.tsx.snap b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/__tests__/__snapshots__/settings-organisation-tab.test.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/__tests__/__snapshots__/developer-settings-organisation-tab.tsx.snap rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/__tests__/__snapshots__/settings-organisation-tab.test.tsx.snap diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/__tests__/members.test.tsx b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/__tests__/members.test.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/__tests__/members.test.tsx rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/__tests__/members.test.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/__tests__/developer-settings-organisation-tab.tsx b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/__tests__/settings-organisation-tab.test.tsx similarity index 96% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/__tests__/developer-settings-organisation-tab.tsx rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/__tests__/settings-organisation-tab.test.tsx index f976218d50..8480f60615 100644 --- a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/__tests__/developer-settings-organisation-tab.tsx +++ b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/__tests__/settings-organisation-tab.test.tsx @@ -1,6 +1,6 @@ import React from 'react' import { shallow } from 'enzyme' -import DeveloperOrganisationTabPage, { handleToggleVisibleModal } from '../developer-settings-organisation-tab' +import DeveloperOrganisationTabPage, { handleToggleVisibleModal } from '../settings-organisation-tab' import * as ReactRedux from 'react-redux' describe('DeveloperOrganisationTabPage', () => { diff --git a/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/index.ts b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/index.ts new file mode 100644 index 0000000000..ba8ee9c096 --- /dev/null +++ b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/index.ts @@ -0,0 +1 @@ +export { default } from './settings-organisation-tab' diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/members.tsx b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/members.tsx similarity index 97% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/members.tsx rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/members.tsx index 3b8d43690e..88f6d67458 100644 --- a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/members.tsx +++ b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/members.tsx @@ -1,6 +1,6 @@ import React from 'react' import { FlexContainerBasic, Table, Section, H5 } from '@reapit/elements' -import SetAsAdminModal from '@/components/ui/developer-settings/set-as-admin-modal' +import SetAsAdminModal from '@/components/pages/settings/set-as-admin-modal' import SetMemberStatusModal from '@/components/ui/organisation-set-member-status-modal' import styles from '@/styles/elements/link.scss?mod' import { developerStub } from '@/sagas/__stubs__/developer' diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/__tests__/__snapshots__/company-information.test.tsx.snap b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/__tests__/__snapshots__/company-information.test.tsx.snap similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/__tests__/__snapshots__/company-information.test.tsx.snap rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/__tests__/__snapshots__/company-information.test.tsx.snap diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/__tests__/company-information.test.tsx b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/__tests__/company-information.test.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/__tests__/company-information.test.tsx rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/__tests__/company-information.test.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/company-address-section.tsx b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/company-address-section.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/company-address-section.tsx rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/company-address-section.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/company-information-section.tsx b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/company-information-section.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/company-information-section.tsx rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/company-information-section.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/country-options-list.ts b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/country-options-list.ts similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/country-options-list.ts rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/country-options-list.ts diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/form-schema/form-fields.ts b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/form-schema/form-fields.ts similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/form-schema/form-fields.ts rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/form-schema/form-fields.ts diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/form-schema/validation-schema.ts b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/form-schema/validation-schema.ts similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/form-schema/validation-schema.ts rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/form-schema/validation-schema.ts diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/index.ts b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/index.ts similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/index.ts rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/index.ts diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/organisation-form.tsx b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/organisation-form.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/organisation-form/organisation-form.tsx rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/organisation-form/organisation-form.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/developer-settings-organisation-tab.tsx b/packages/developer-portal/src/components/pages/settings/settings-organisation-tab/settings-organisation-tab.tsx similarity index 100% rename from packages/developer-portal/src/components/pages/settings/developer-settings-organisation-tab/developer-settings-organisation-tab.tsx rename to packages/developer-portal/src/components/pages/settings/settings-organisation-tab/settings-organisation-tab.tsx diff --git a/packages/developer-portal/src/components/pages/settings/developer-settings/developer-settings.tsx b/packages/developer-portal/src/components/pages/settings/settings.tsx similarity index 87% rename from packages/developer-portal/src/components/pages/settings/developer-settings/developer-settings.tsx rename to packages/developer-portal/src/components/pages/settings/settings.tsx index e0677fcb16..714c3989d0 100644 --- a/packages/developer-portal/src/components/pages/settings/developer-settings/developer-settings.tsx +++ b/packages/developer-portal/src/components/pages/settings/settings.tsx @@ -3,14 +3,14 @@ import { selectLoginIdentity } from '@/selector/auth' import { useSelector } from 'react-redux' import { Loader, Section } from '@reapit/elements' import { Forms } from './forms/forms' -import { Tabs } from '../tabs' +import { Tabs } from './tabs' /** * render one of: * developer version and admin version - profile tab * ^ they both sit on "/developer/settings" route which is so confusing atm */ -const DevelperSettingsPage: React.FC = () => { +const SettingsPage: React.FC = () => { // it take a while to 'AUTH_LOGIN_SUCCESS' to fire. If you user is admin, they may exerience a flash // this make sure settings page don't render until 'loginIdentity' is availabe const loginIdentity = useSelector(selectLoginIdentity) @@ -29,4 +29,4 @@ const DevelperSettingsPage: React.FC = () => { ) } -export default DevelperSettingsPage +export default SettingsPage diff --git a/packages/developer-portal/src/components/pages/settings/tabs.tsx b/packages/developer-portal/src/components/pages/settings/tabs.tsx index 8572ff96a0..1cf271be7f 100644 --- a/packages/developer-portal/src/components/pages/settings/tabs.tsx +++ b/packages/developer-portal/src/components/pages/settings/tabs.tsx @@ -15,32 +15,32 @@ export type TabConfigsProps = { export const tabConfigs = ({ currentUrl, history, isAdmin, isProd }: TabConfigsProps): TabConfig[] => { const tabs = [ { - tabIdentifier: Routes.DEVELOPER_SETTINGS, + tabIdentifier: Routes.SETTINGS, displayText: 'Profile', onTabClick: () => { - history.push(Routes.DEVELOPER_SETTINGS) + history.push(Routes.SETTINGS) }, - active: currentUrl === Routes.DEVELOPER_SETTINGS, + active: currentUrl === Routes.SETTINGS, }, { - tabIdentifier: Routes.DEVELOPER_SETTINGS_BILLING_TAB, + tabIdentifier: Routes.SETTINGS_BILLING_TAB, displayText: 'Billing', onTabClick: () => { - history.push(Routes.DEVELOPER_SETTINGS_BILLING_TAB) + history.push(Routes.SETTINGS_BILLING_TAB) }, - active: currentUrl === Routes.DEVELOPER_SETTINGS_BILLING_TAB, + active: currentUrl === Routes.SETTINGS_BILLING_TAB, }, ] if (isAdmin && !isProd) { // Use splice to make sure ORGANISATION_TAB is second tab tabs.splice(1, 0, { - tabIdentifier: Routes.DEVELOPER_SETTINGS_ORGANISATION_TAB, + tabIdentifier: Routes.SETTINGS_ORGANISATION_TAB, displayText: 'Organisation', onTabClick: () => { - history.push(Routes.DEVELOPER_SETTINGS_ORGANISATION_TAB) + history.push(Routes.SETTINGS_ORGANISATION_TAB) }, - active: currentUrl === Routes.DEVELOPER_SETTINGS_ORGANISATION_TAB, + active: currentUrl === Routes.SETTINGS_ORGANISATION_TAB, }) } diff --git a/packages/developer-portal/src/components/ui/menu.tsx b/packages/developer-portal/src/components/ui/menu.tsx index bec35aeb12..fc1f6d1e28 100644 --- a/packages/developer-portal/src/components/ui/menu.tsx +++ b/packages/developer-portal/src/components/ui/menu.tsx @@ -148,7 +148,7 @@ export const generateMenuConfig = ( { title: 'Settings', key: 'SETTINGS', - url: Routes.DEVELOPER_SETTINGS, + url: Routes.SETTINGS, icon: , type: 'SECONDARY', }, diff --git a/packages/developer-portal/src/constants/routes.ts b/packages/developer-portal/src/constants/routes.ts index 305f2b6250..b0482540f6 100644 --- a/packages/developer-portal/src/constants/routes.ts +++ b/packages/developer-portal/src/constants/routes.ts @@ -22,9 +22,9 @@ const Routes = { ANALYTICS_TAB: '/developer/analytics/:activeTab?', DEVELOPER_RESET_PASSWORD: '/developer/reset-password', DEVELOPER_WEBHOOKS: '/developer/webhooks', - DEVELOPER_SETTINGS: '/developer/settings/', - DEVELOPER_SETTINGS_ORGANISATION_TAB: '/developer/settings/organisation', - DEVELOPER_SETTINGS_BILLING_TAB: '/developer/settings/billing', + SETTINGS: '/developer/settings/', + SETTINGS_ORGANISATION_TAB: '/developer/settings/organisation', + SETTINGS_BILLING_TAB: '/developer/settings/billing', SUBMIT_APP: '/developer/submit-app', DEVELOPER_HELP: '/developer/help', DEVELOPER_APP_PREVIEW: '/developer/apps/:appId/preview', diff --git a/packages/developer-portal/src/core/__tests__/__snapshots__/router.tsx.snap b/packages/developer-portal/src/core/__tests__/__snapshots__/router.tsx.snap index b1f8a34cf0..ba67c6f73e 100644 --- a/packages/developer-portal/src/core/__tests__/__snapshots__/router.tsx.snap +++ b/packages/developer-portal/src/core/__tests__/__snapshots__/router.tsx.snap @@ -181,20 +181,6 @@ exports[`Router should match a snapshot 1`] = ` fetcher={true} path="/client/help" /> - catchChunkError(() => import('../components/pages const Client = React.lazy(() => catchChunkError(() => import('../components/pages/client'))) const ClientWelcomePage = React.lazy(() => catchChunkError(() => import('../components/pages/client-welcome'))) const InstalledApps = React.lazy(() => catchChunkError(() => import('../components/pages/installed-apps'))) -const ClientSetting = React.lazy(() => catchChunkError(() => import('../components/pages/settings/client-setting'))) const ClientAppsManagement = React.lazy(() => catchChunkError(() => import('../components/pages/client-app-management')), ) @@ -36,16 +35,14 @@ const AdminAppsPage = React.lazy(() => catchChunkError(() => import('../componen const RegisterConfirm = React.lazy(() => catchChunkError(() => import('../components/pages/register-confirm'))) const AdminStats = React.lazy(() => catchChunkError(() => import('../components/pages/admin-stats'))) const WebhooksPage = React.lazy(() => catchChunkError(() => import('../components/pages/webhooks'))) -const DeveloperSettingsPage = React.lazy(() => - catchChunkError(() => import('../components/pages/settings/developer-settings')), -) +const SettingsPage = React.lazy(() => catchChunkError(() => import('../components/pages/settings/settings'))) -const DeveloperSettingsOrganisationTabPage = React.lazy(() => - catchChunkError(() => import('../components/pages/settings/developer-settings-organisation-tab')), +const SettingsOrganisationTabPage = React.lazy(() => + catchChunkError(() => import('../components/pages/settings/settings-organisation-tab')), ) -const DeveloperSettingsBillingTabPage = React.lazy(() => - catchChunkError(() => import('../components/pages/settings/developer-settings-billing-tab')), +const SettingsBillingTabPage = React.lazy(() => + catchChunkError(() => import('../components/pages/settings/settings-billing-tab')), ) const DeveloperAdminBillingPage = React.lazy(() => catchChunkError(() => import('../components/pages/admin-billing'))) @@ -92,7 +89,6 @@ const Router = () => { - { /> + - { }) it('should dispatch to requestDeveloperData for the admin approvals paginate route', async () => { - await routeDispatcher(Routes.DEVELOPER_SETTINGS as RouteValue, { page: '2' }) + await routeDispatcher(Routes.SETTINGS as RouteValue, { page: '2' }) expect(store.dispatch).toHaveBeenCalledWith(requestDeveloperData()) }) diff --git a/packages/developer-portal/src/utils/form/__tests__/change-password.ts b/packages/developer-portal/src/utils/form/__tests__/change-password.ts index 3717556eb1..9c4b524097 100644 --- a/packages/developer-portal/src/utils/form/__tests__/change-password.ts +++ b/packages/developer-portal/src/utils/form/__tests__/change-password.ts @@ -1,5 +1,5 @@ import { validate } from '../change-password' -import { ChangePasswordValues } from '@/components/pages/settings/developer-settings/forms/change-password-form' +import { ChangePasswordValues } from '@/components/pages/settings/forms/change-password-form' import errorMessages from '@/constants/error-messages' describe('changePasswordValidation', () => { diff --git a/packages/developer-portal/src/utils/form/__tests__/developer-settings-contact-information.ts b/packages/developer-portal/src/utils/form/__tests__/settings-contact-information.ts similarity index 87% rename from packages/developer-portal/src/utils/form/__tests__/developer-settings-contact-information.ts rename to packages/developer-portal/src/utils/form/__tests__/settings-contact-information.ts index eadd6fefc9..8fb7e5d1bd 100644 --- a/packages/developer-portal/src/utils/form/__tests__/developer-settings-contact-information.ts +++ b/packages/developer-portal/src/utils/form/__tests__/settings-contact-information.ts @@ -1,5 +1,5 @@ -import { validate } from '../developer-settings-contact-information' -import { ContactInformationValues } from '@/components/pages/settings/developer-settings/forms/contact-information-form' +import { validate } from '../settings-contact-information' +import { ContactInformationValues } from '@/components/pages/settings/forms/contact-information-form' import errorMessages from '@/constants/error-messages' describe('ContactInformationValues validation', () => { diff --git a/packages/developer-portal/src/utils/form/change-password.ts b/packages/developer-portal/src/utils/form/change-password.ts index 41a914300d..121552d7a4 100644 --- a/packages/developer-portal/src/utils/form/change-password.ts +++ b/packages/developer-portal/src/utils/form/change-password.ts @@ -1,4 +1,4 @@ -import { ChangePasswordValues } from '@/components/pages/settings/developer-settings/forms/change-password-form' +import { ChangePasswordValues } from '@/components/pages/settings/forms/change-password-form' import { validateRequire, validatePassword } from '@reapit/elements' export type ChangePasswordFormErrorKeys = keyof ChangePasswordValues diff --git a/packages/developer-portal/src/utils/form/developer-settings-contact-information.ts b/packages/developer-portal/src/utils/form/settings-contact-information.ts similarity index 92% rename from packages/developer-portal/src/utils/form/developer-settings-contact-information.ts rename to packages/developer-portal/src/utils/form/settings-contact-information.ts index 1606fb0a71..72b6cc0ebc 100644 --- a/packages/developer-portal/src/utils/form/developer-settings-contact-information.ts +++ b/packages/developer-portal/src/utils/form/settings-contact-information.ts @@ -1,4 +1,4 @@ -import { ContactInformationValues } from '@/components/pages/settings/developer-settings/forms/contact-information-form' +import { ContactInformationValues } from '@/components/pages/settings/forms/contact-information-form' import ErrorMessages from '@/constants/error-messages' import { isValidPersonName, isValidTelephone } from '@/utils/validate' diff --git a/packages/developer-portal/src/utils/route-dispatcher.ts b/packages/developer-portal/src/utils/route-dispatcher.ts index 1483ff6e31..da49e1802a 100644 --- a/packages/developer-portal/src/utils/route-dispatcher.ts +++ b/packages/developer-portal/src/utils/route-dispatcher.ts @@ -98,7 +98,7 @@ const routeDispatcher = async (route: RouteValue, params?: StringMap, search?: s case Routes.ADMIN_APPS: store.dispatch(adminAppsRequestData(getParamsFromPath(search || ''))) break - case Routes.DEVELOPER_SETTINGS: + case Routes.SETTINGS: store.dispatch(requestDeveloperData()) break case Routes.DEVELOPER_WEBHOOKS: