Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(nav): reset nav code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridene committed Jul 26, 2018
1 parent c92aab0 commit c2e9871
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
15 changes: 1 addition & 14 deletions www/frontSrc/Header/Reducers/navReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions www/frontSrc/Store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -15,6 +16,7 @@ const rootReducer = combineReducers({
service: serviceReducer,
host: hostReducer,
poller: pollerReducer,
nav: navReducer,
})

export const store = createStore(
Expand Down
4 changes: 2 additions & 2 deletions www/frontSrc/webservices/navApi.js
Original file line number Diff line number Diff line change
@@ -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 => {
Expand Down

0 comments on commit c2e9871

Please sign in to comment.