From 27e2f67d4525fcf0a8ee20bc5b49b3c964124ba1 Mon Sep 17 00:00:00 2001 From: Peter Hudec Date: Wed, 21 Feb 2024 14:22:13 +0000 Subject: [PATCH 1/3] Removed unnecessary reducers --- src/client/reducers.js | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/src/client/reducers.js b/src/client/reducers.js index 0ef707117ac..33d686cfe62 100644 --- a/src/client/reducers.js +++ b/src/client/reducers.js @@ -181,41 +181,7 @@ import getInteractionReducer from './modules/Interactions/InteractionDetails/red import { PREVIEW_QUOTE_ID } from './modules/Omis/state' import orderQuoteReducer from './modules/Omis/reducer' -const parseProps = (domNode) => { - if (!domNode) { - return { - modulePermissions: [], - currentAdviserId: '', - currentAdviserName: '', - activeFeatures: null, - activeFeatureGroups: null, - userPermissions: [], - csrfToken: '', - } - } - return 'props' in domNode.dataset ? JSON.parse(domNode.dataset.props) : {} -} - -const appWrapper = document.getElementById('react-app') - -const { - modulePermissions, - currentAdviserId, - currentAdviserName, - activeFeatures, - activeFeatureGroups, - userPermissions, - csrfToken, -} = parseProps(appWrapper) - export const reducers = { - currentAdviserId: () => currentAdviserId, - currentAdviserName: () => currentAdviserName, - activeFeatures: () => activeFeatures, - activeFeatureGroups: () => activeFeatureGroups, - modulePermissions: () => modulePermissions, - userPermissions: () => userPermissions, - csrfToken: () => csrfToken, tasks, [FLASH_MESSAGE_ID]: flashMessageReducer, [COMPANY_LISTS_STATE_ID]: companyListsReducer, @@ -236,8 +202,6 @@ export const reducers = { ...ContactForm.reducerSpread, ...Form.reducerSpread, ...FieldAddAnother.reducerSpread, - // A reducer is required to be able to set a preloadedState parameter - referrerUrl: (state = {}) => state, [DNB_CHECK_ID]: dnbCheckReducer, [INVESTMENT_OPPORTUNITIES_LIST_ID]: investmentOpportunitiesListReducer, [INVESTMENT_OPPORTUNITIES_DETAILS_ID]: investmentOpportunitiesDetailsReducer, From 8afd679d9b75e77c95f89fba4a5814c7dedfd1c1 Mon Sep 17 00:00:00 2001 From: Peter Hudec Date: Thu, 22 Feb 2024 09:10:34 +0000 Subject: [PATCH 2/3] Removed obsolete import --- src/client/tasks.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/tasks.js b/src/client/tasks.js index 040830d6371..2e3ad5f235f 100644 --- a/src/client/tasks.js +++ b/src/client/tasks.js @@ -447,6 +447,7 @@ import { getExportProject, getExportWin, } from '../client/modules/ExportWins/Form/tasks' +import { patchExportWinReview } from './modules/ExportWins/tasks.js' export const tasks = { 'Create list': createList, @@ -702,4 +703,5 @@ export const tasks = { [TASK_PREVIEW_QUOTE]: previewQuote, [TASK_CREATE_QUOTE]: createQuote, [TASK_CANCEL_QUOTE]: cancelQuote, + TASK_PATCH_EXPORT_WIN_REVIEW: patchExportWinReview, } From 28abf441482b2a8192a3cf13a6c6d88f0749c17d Mon Sep 17 00:00:00 2001 From: Peter Hudec Date: Wed, 28 Feb 2024 15:59:21 +0000 Subject: [PATCH 3/3] Removed the accidentally comitted export wins code --- src/client/tasks.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/client/tasks.js b/src/client/tasks.js index 2e3ad5f235f..040830d6371 100644 --- a/src/client/tasks.js +++ b/src/client/tasks.js @@ -447,7 +447,6 @@ import { getExportProject, getExportWin, } from '../client/modules/ExportWins/Form/tasks' -import { patchExportWinReview } from './modules/ExportWins/tasks.js' export const tasks = { 'Create list': createList, @@ -703,5 +702,4 @@ export const tasks = { [TASK_PREVIEW_QUOTE]: previewQuote, [TASK_CREATE_QUOTE]: createQuote, [TASK_CANCEL_QUOTE]: cancelQuote, - TASK_PATCH_EXPORT_WIN_REVIEW: patchExportWinReview, }