X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fapp%2FvnfSearch%2FVnfSearchActions.js;h=20290d65acbcb0cddcb0411a9ac88e43802606f2;hb=e513a1ce93b9a70f01b62ca7560dbe52376cc5bd;hp=ce3f3e0532cf1c274eb0c18dfcb1a5c48e7486ec;hpb=1580adb8ab521e55a129afc32693071620d85c02;p=aai%2Fsparky-fe.git diff --git a/src/app/vnfSearch/VnfSearchActions.js b/src/app/vnfSearch/VnfSearchActions.js index ce3f3e0..20290d6 100644 --- a/src/app/vnfSearch/VnfSearchActions.js +++ b/src/app/vnfSearch/VnfSearchActions.js @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017 Amdocs + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 Amdocs * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ - import { vnfActionTypes, VNF_FILTER_AGGREGATION_URL, @@ -42,9 +39,6 @@ import { } from 'app/globalInlineMessageBar/GlobalInlineMessageBarActions.js'; import {MESSAGE_LEVEL_WARNING} from 'utils/GlobalConstants.js'; -let fetch = require('node-fetch'); -fetch.Promise = require('es6-promise').Promise; - const itemKeyWord = 'key'; const countKeyWord = 'doc_count'; @@ -206,8 +200,21 @@ function getVnfVisualizationsResultsEvent(results) { }; } +function setBusyFeedback(){ + return { + type: vnfActionTypes.VNF_ACTIVATE_BUSY_FEEDBACK + }; +} + +function disableBusyFeedback(){ + return { + type: vnfActionTypes.VNF_DISABLE_BUSY_FEEDBACK + }; +} + export function processVnfVisualizationsOnFilterChange(filterValueMap) { return dispatch => { + dispatch(setBusyFeedback()); return fetch(VNF_FILTER_AGGREGATION_URL, { method: POST, headers: POST_HEADER, @@ -223,8 +230,13 @@ export function processVnfVisualizationsOnFilterChange(filterValueMap) { } dispatch(getVnfVisualizationsResultsEvent(responseJson)); } + ).then( + () => { + dispatch(disableBusyFeedback()); + } ).catch( () => { + dispatch(disableBusyFeedback()); dispatch(getInvalidQueryEvent()); } );