diff --git a/www/frontSrc/Header/Reducers/navReducer.js b/www/frontSrc/Header/Reducers/navReducer.js index fc9b102f667..9f00fb68c2f 100644 --- a/www/frontSrc/Header/Reducers/navReducer.js +++ b/www/frontSrc/Header/Reducers/navReducer.js @@ -20,23 +20,10 @@ export default function navReducer ( isFetching: true, } case REQUEST_NAV_ITEMS_SUCCESS: - const color = ['#00A499', '#84BD00', '#E98F2C', '#009FDF', '#10069F'] - const data = action.data - const result = data.reduce((acc, item, i) => { - acc = [ - ...acc, - { - ...item, - key: i, - color: color[i] - } - ] - return acc - }, []) return { ...state, - data: result, + data: action.data, dataFetched: true, isFetching: false, error: false, diff --git a/www/frontSrc/Store/store.js b/www/frontSrc/Store/store.js index fce691cac0e..4afd38565fd 100644 --- a/www/frontSrc/Store/store.js +++ b/www/frontSrc/Store/store.js @@ -6,6 +6,7 @@ import clockReducer from '../Header/Reducers/clockReducer' import serviceReducer from '../Header/Reducers/serviceReducer' import hostReducer from '../Header/Reducers/hostReducer' import pollerReducer from '../Header/Reducers/pollerReducer' +import navReducer from '../Header/Reducers/navReducer' const logger = createLogger() @@ -15,6 +16,7 @@ const rootReducer = combineReducers({ service: serviceReducer, host: hostReducer, poller: pollerReducer, + nav: navReducer, }) export const store = createStore( diff --git a/www/frontSrc/webservices/navApi.js b/www/frontSrc/webservices/navApi.js index 2e8eb267222..aec1bb0ee53 100644 --- a/www/frontSrc/webservices/navApi.js +++ b/www/frontSrc/webservices/navApi.js @@ -1,14 +1,14 @@ import axios from "axios" import { requestNavItems, requestNavItemsSuccess, requestNavItemsFail } from '../Header/Actions/navActions' -const hostUrl = './api/internal.php?object=centreon_menu&action=menu' +const navUrl = './api/internal.php?object=centreon_menu&action=menu' export function getNavItems() { return (dispatch) => { dispatch(requestNavItems()) return axios.get( - hostUrl + navUrl ) .then( res => {