aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/connectApp/src/handlers
diff options
context:
space:
mode:
authorKAPIL SINGAL <ks220y@att.com>2020-02-02 19:27:46 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-02 19:27:46 +0000
commit1584ac712f243707197128b3e3d344e435bd2f31 (patch)
tree70ed41e168dd155a85010167a81a932967097345 /sdnr/wt/odlux/apps/connectApp/src/handlers
parent33b86ad077a2e472df5d4ed15227298a238eb8ae (diff)
parent05ef023752abdb4f1e072332496dc7c6eaff8965 (diff)
Merge "SDN-R add updated odlux"
Diffstat (limited to 'sdnr/wt/odlux/apps/connectApp/src/handlers')
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts31
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts4
2 files changed, 22 insertions, 13 deletions
diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts
index 1440599fd..23a801424 100644
--- a/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts
+++ b/sdnr/wt/odlux/apps/connectApp/src/handlers/connectAppRootHandler.ts
@@ -21,7 +21,7 @@ import { combineActionHandler } from '../../../../framework/src/flux/middleware'
import { INetworkElementsState, networkElementsActionHandler } from './networkElementsHandler';
import { IConnectionStatusLogState, connectionStatusLogActionHandler } from './connectionStatusLogHandler';
import { IInfoNetworkElementsState, infoNetworkElementsActionHandler } from './infoNetworkElementHandler';
-import { SetPanelAction, AddWebUriList, RemoveWebUri } from '../actions/commonNetworkElementsActions';
+import { SetPanelAction, AddWebUriList, RemoveWebUri, SetWeburiSearchBusy } from '../actions/commonNetworkElementsActions';
import { PanelId } from '../models/panelId';
import { guiCutThrough } from '../models/guiCutTrough';
@@ -41,26 +41,33 @@ const currentOpenPanelHandler: IActionHandler<PanelId> = (state = null, action)
}
interface guiCutThroughState {
- availableWebUris: guiCutThrough[];
- knownElements: string[];
+ searchedElements: guiCutThrough[];
+ notSearchedElements: string[];
}
-const guiCutThroughHandler: IActionHandler<guiCutThroughState> = (state = { availableWebUris: [], knownElements: [] }, action) => {
+const guiCutThroughHandler: IActionHandler<guiCutThroughState> = (state = { searchedElements: [], notSearchedElements: [] }, action) => {
if (action instanceof AddWebUriList) {
- let knownElements: string[];
- let availableWebUris: guiCutThrough[];
+ let notSearchedElements: string[];
+ let searchedElements: guiCutThrough[];
- knownElements = state.knownElements.concat(action.knownElements);
+ notSearchedElements = state.notSearchedElements.concat(action.notSearchedElements);
- availableWebUris = state.availableWebUris.concat(action.element);
+ //remove elements, which were just searched
+ if (action.newlySearchedElements) {
+ action.newlySearchedElements.forEach(item => {
+ notSearchedElements = notSearchedElements.filter(id => id !== item);
+ })
+ }
- state = { availableWebUris: availableWebUris, knownElements: knownElements }
+ searchedElements = state.searchedElements.concat(action.searchedElements);
+
+ state = { searchedElements: searchedElements, notSearchedElements: notSearchedElements }
} else if (action instanceof RemoveWebUri) {
const nodeId = action.element;
- const webUris = state.availableWebUris.filter(item => item.nodeId !== nodeId);
- const knownElements = state.knownElements.filter(item => item !== nodeId);
- state = { knownElements: knownElements, availableWebUris: webUris };
+ const webUris = state.searchedElements.filter(item => item.nodeId !== nodeId);
+ const knownElements = state.notSearchedElements.filter(item => item !== nodeId);
+ state = { notSearchedElements: knownElements, searchedElements: webUris };
}
return state;
}
diff --git a/sdnr/wt/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts b/sdnr/wt/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts
index 78c7000d2..4fe858c69 100644
--- a/sdnr/wt/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts
+++ b/sdnr/wt/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts
@@ -31,11 +31,13 @@ export const {
createActions: createNetworkElementsActions,
createProperties: createNetworkElementsProperties,
reloadAction: networkElementsReloadAction,
+ reloadActionAsync: networkElementsReloadActionAsync
// set value action, to change a value
} = createExternal<NetworkElementConnection>(networkElementsSearchHandler, appState => {
- const webUris = appState.connect.guiCutThrough.availableWebUris;
+ const webUris = appState.connect.guiCutThrough.searchedElements;
+ // add weburi links, if element is connected & weburi available
if (appState.connect.networkElements.rows && webUris.length > 0) {
appState.connect.networkElements.rows.forEach(element => {