From 4b87cf4d3c50dacb356c8e53a80bbabcba14b621 Mon Sep 17 00:00:00 2001 From: Aijana Schumann Date: Thu, 9 Apr 2020 02:07:03 +0200 Subject: Connect App Bugfix Fix too many network calls made for gui cuttrough Issue-ID: SDNC-1152 Signed-off-by: Aijana Schumann Change-Id: I3f63d2f81ace802768d3e8814899de8d32dd4d11 --- .../apps/connectApp/src/handlers/connectAppRootHandler.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sdnr/wt/odlux/apps/connectApp/src/handlers') diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts index 23a801424..302a981eb 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts +++ b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts @@ -43,14 +43,17 @@ const currentOpenPanelHandler: IActionHandler = (state = null, action) interface guiCutThroughState { searchedElements: guiCutThrough[]; notSearchedElements: string[]; + unsupportedElements: string[]; } -const guiCutThroughHandler: IActionHandler = (state = { searchedElements: [], notSearchedElements: [] }, action) => { +const guiCutThroughHandler: IActionHandler = (state = { searchedElements: [], notSearchedElements: [], unsupportedElements:[] }, action) => { if (action instanceof AddWebUriList) { let notSearchedElements: string[]; let searchedElements: guiCutThrough[]; + let unsupportedElements: string[]; notSearchedElements = state.notSearchedElements.concat(action.notSearchedElements); + unsupportedElements = state.unsupportedElements.concat(action.unsupportedElements); //remove elements, which were just searched if (action.newlySearchedElements) { @@ -61,13 +64,14 @@ const guiCutThroughHandler: IActionHandler = (state = { sear searchedElements = state.searchedElements.concat(action.searchedElements); - state = { searchedElements: searchedElements, notSearchedElements: notSearchedElements } + state = { searchedElements: searchedElements, notSearchedElements: notSearchedElements, unsupportedElements: unsupportedElements } } else if (action instanceof RemoveWebUri) { const nodeId = action.element; const webUris = state.searchedElements.filter(item => item.nodeId !== nodeId); const knownElements = state.notSearchedElements.filter(item => item !== nodeId); - state = { notSearchedElements: knownElements, searchedElements: webUris }; + const unsupportedElement = state.unsupportedElements.filter(item => item != nodeId); + state = { notSearchedElements: knownElements, searchedElements: webUris, unsupportedElements: unsupportedElement }; } return state; } -- cgit 1.2.3-korg