2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 import {aaiActionTypes} from './MainScreenWrapperConstants.js';
23 globalAutoCompleteSearchBarActionTypes
24 } from 'app/globalAutoCompleteSearchBar/GlobalAutoCompleteSearchBarConstants.js';
26 contextHandlerActionTypes
27 } from 'app/contextHandler/ContextHandlerConstants.js';
29 personalizationActionTypes
30 } from 'app/personlaization/PersonalizationConstans.js';
32 export default (state = {}, action) => {
33 switch (action.type) {
34 case aaiActionTypes.AAI_SHOW_MENU:
37 showMenu: action.data.showMenu,
38 toggleButtonActive: action.data.showMenu // if showing menu, then toggle
41 case aaiActionTypes.EXTENSIBLE_VIEW_NETWORK_CALLBACK_RESPONSE_RECEIVED:
43 obj['extensibleViewNetworkCallbackData'] = {};
44 obj['extensibleViewNetworkCallbackData'][action.data.paramName] = action.data.viewData;
45 // If there are some current viewData that need to be kept:
46 for(var vData in action.data.curViewData) {
47 obj['extensibleViewNetworkCallbackData'][vData] = action.data.curViewData[vData];
50 case aaiActionTypes.EXTENSIBLE_VIEW_NETWORK_CALLBACK_CLEAR_DATA:
53 extensibleViewNetworkCallbackData : {}
55 case globalAutoCompleteSearchBarActionTypes.SEARCH_WARNING_EVENT:
58 extensibleViewNetworkCallbackData: {clearView: true}
60 case contextHandlerActionTypes.SINGLE_SUGGESTION_FOUND:
63 externalRequestFound: action.data
66 case aaiActionTypes.SET_SECONDARY_TITLE:
69 secondaryTitle: action.data
71 case contextHandlerActionTypes.SUBSCRIPTION_PAYLOAD_FOUND:
74 subscriptionPayload: action.data.subscriptionDetails,
75 subscriptionEnabled: true
77 case contextHandlerActionTypes.SUBSCRIPTION_PAYLOAD_EMPTY:
80 subscriptionEnabled: false
82 case personalizationActionTypes.PERSONALIZATION_PAYLOAD_FOUND:
85 aaiTopLeftPersonalizedHeader: action.data.topLeftHeader,
86 aaiPersonalizedHtmlDocumentTitle: action.data.htmlDocumentTitle