summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/connectApp/src/actions
diff options
context:
space:
mode:
authorAijana Schumann <aijana.schumann@highstreet-technologies.com>2020-04-09 02:07:03 +0200
committerAijana S <aijana.schumann@highstreet-technologies.com>2020-04-09 12:48:56 +0000
commit09809bce94321fe3527a4203ad8ba1628b222936 (patch)
tree5f93ac7497599170fa555c407f3e748cfd7ebca2 /sdnr/wt/odlux/apps/connectApp/src/actions
parente8f2d78e408d56fe8efe96ad5958256502d6e5b0 (diff)
Connect App Bugfix
Fix too many network calls made for gui cuttrough Issue-ID: SDNC-1152 Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com> Change-Id: I3f63d2f81ace802768d3e8814899de8d32dd4d11
Diffstat (limited to 'sdnr/wt/odlux/apps/connectApp/src/actions')
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/actions/commonNetworkElementsActions.ts57
1 files changed, 37 insertions, 20 deletions
diff --git a/sdnr/wt/odlux/apps/connectApp/src/actions/commonNetworkElementsActions.ts b/sdnr/wt/odlux/apps/connectApp/src/actions/commonNetworkElementsActions.ts
index a6d81c10c..a3bdc6828 100644
--- a/sdnr/wt/odlux/apps/connectApp/src/actions/commonNetworkElementsActions.ts
+++ b/sdnr/wt/odlux/apps/connectApp/src/actions/commonNetworkElementsActions.ts
@@ -38,7 +38,7 @@ export class SetPanelAction extends Action {
}
export class AddWebUriList extends Action {
- constructor(public searchedElements: guiCutThrough[], public notSearchedElements: string[], public newlySearchedElements?: string[]) {
+ constructor(public searchedElements: guiCutThrough[], public notSearchedElements: string[], public unsupportedElements: string[], public newlySearchedElements?: string[] ) {
super();
}
}
@@ -72,35 +72,52 @@ export const findWebUrisForGuiCutThroughAsyncAction = (networkElements: NetworkE
let notConnectedElements: string[] = [];
let elementsToSearch: string[] = [];
let prevFoundElements: string[] = [];
+ let unsupportedElements: string[]= [];
networkElements.forEach(item => {
- const id = item.id as string;
- if (item.status === "Connected") {
-
- // element is connected and is added to search list, if it doesn't exist already
- const exists = guiCutThrough.searchedElements.filter(element => element.nodeId === id).length > 0;
- if (!exists) {
- elementsToSearch.push(id);
-
- //element was found previously, but not searched for a weburi
- if (guiCutThrough.notSearchedElements.length > 0 && guiCutThrough.notSearchedElements.includes(id)) {
- prevFoundElements.push(id);
+ const id = item.id as string;
+ if (item.status === "Connected") {
+
+ if(item.coreModelCapability!== "Unsupported"){
+ // element is connected and is added to search list, if it doesn't exist already
+ const exists = guiCutThrough.searchedElements.filter(element => element.nodeId === id).length > 0;
+ if (!exists) {
+ elementsToSearch.push(id);
+
+ //element was found previously, but wasn't connected
+ if (guiCutThrough.notSearchedElements.length > 0 && guiCutThrough.notSearchedElements.includes(id)) {
+ prevFoundElements.push(id);
+ }
+ }
+ }else{
+ // element does not support core model and must not be searched for a weburi
+ const id = item.id as string;
+ const exists = guiCutThrough.unsupportedElements.filter(element => element === id).length > 0;
+ if(!exists){
+ unsupportedElements.push(id);
+
+ //element was found previously, but wasn't connected
+ if (guiCutThrough.notSearchedElements.length > 0 && guiCutThrough.notSearchedElements.includes(id)) {
+ prevFoundElements.push(id);
+ }
+ }
}
}
- }
- else {
- // element isn't connected and cannot be searched for a weburi
- if (!guiCutThrough.notSearchedElements.includes(id)) {
- notConnectedElements.push(item.id as string);
+ else {
+ // element isn't connected and cannot be searched for a weburi
+ if (!guiCutThrough.notSearchedElements.includes(id)) {
+ notConnectedElements.push(item.id as string);
+ }
}
- }
});
- if (elementsToSearch.length > 0 || notConnectedElements.length > 0) {
+
+ if (elementsToSearch.length > 0 || notConnectedElements.length > 0 || unsupportedElements.length>0 ) {
const result = await connectService.getAllWebUriExtensionsForNetworkElementListAsync(elementsToSearch);
- dispatcher(new AddWebUriList(result, notConnectedElements, prevFoundElements));
+ dispatcher(new AddWebUriList(result, notConnectedElements, unsupportedElements, prevFoundElements));
}
+
isBusy = false;
}