diff --git a/frontend/src/actions/cart/cartActions.js b/frontend/src/actions/cart/cartActions.js index 8005745..6f071db 100644 --- a/frontend/src/actions/cart/cartActions.js +++ b/frontend/src/actions/cart/cartActions.js @@ -57,6 +57,9 @@ export const receiveCustomerDetails = (json) => ({ export const fetchCartCount = () => { return dispatch => { dispatch(requestShopCartCount()); + //TODO : fetch cart count from woocommerce (requires plugin) + dispatch(receiveShopCartCount(0)); + /* return client.fetch({url: `${API_SERVER}/cart/api/getCartCount`}).then(response => { if (typeof response.data !== 'undefined' && 'cartItemsCount' in response.data) { dispatch(receiveShopCartCount(response.data.cartItemsCount)); @@ -64,6 +67,7 @@ export const fetchCartCount = () => { }).catch(error => { client.onError(error, dispatch); }); + */ } } diff --git a/frontend/src/actions/dashboard/dashboardActions.js b/frontend/src/actions/dashboard/dashboardActions.js index 14aaad5..18330a4 100644 --- a/frontend/src/actions/dashboard/dashboardActions.js +++ b/frontend/src/actions/dashboard/dashboardActions.js @@ -1,7 +1,4 @@ -import {API_SERVER} from '../../config'; -import HtmlClient from '../../helpers/HtmlClient'; import {REQUEST_GADGETS, RECIEVE_GADGETS} from '../../constants/dashboardConstants'; -const htmlClient = new HtmlClient(); const requestGadgets = () => ({type: REQUEST_GADGETS}); const recieveGadgets = (json) => ({ @@ -12,6 +9,19 @@ const recieveGadgets = (json) => ({ export const fetchGadgets = () => { return dispatch => { dispatch(requestGadgets()); + //TODO : check how to solve gadgets, don't use hardcoded values + const gadgets = [ + { + name: 'CustomerOrderCentral', + idGadget: 0, + }, + { + name: 'CustomerNextActions', + idGadget: 1, + } + ] + dispatch(recieveGadgets(gadgets)); + /* return htmlClient.fetch({ url: `${API_SERVER}/dashboards/api/getMyDashboard` }) @@ -23,5 +33,6 @@ export const fetchGadgets = () => { .catch(error => { htmlClient.onError(error, dispatch); }); + */ } } diff --git a/frontend/src/actions/dashboard/nextActionsActions.js b/frontend/src/actions/dashboard/nextActionsActions.js index 5716e97..ad9960f 100644 --- a/frontend/src/actions/dashboard/nextActionsActions.js +++ b/frontend/src/actions/dashboard/nextActionsActions.js @@ -1,7 +1,4 @@ -import {API_SERVER} from '../../config'; -import HtmlClient from '../../helpers/HtmlClient'; import {REQUEST_NEXT_ACTIONS, RECIEVE_NEXT_ACTIONS} from '../../constants/dashboardConstants'; -const client = new HtmlClient(); export const requestNextActions = () => ({ type: REQUEST_NEXT_ACTIONS, @@ -17,6 +14,9 @@ export const recieveNextActions = (json) => ({ export const fetchNextActions = () => { return dispatch => { dispatch(requestNextActions()); + //TODO : fetch next actions from gravity flow api + dispatch(recieveNextActions({})); + /* return client.fetch({ url: `${API_SERVER}/dashboards/api/getNextActionsInfo` }) @@ -24,5 +24,6 @@ export const fetchNextActions = () => { .catch(error => { client.onError(error, dispatch); }); + */ } } diff --git a/frontend/src/actions/login/authActions.js b/frontend/src/actions/login/authActions.js index 18867ad..fc2a41d 100644 --- a/frontend/src/actions/login/authActions.js +++ b/frontend/src/actions/login/authActions.js @@ -161,6 +161,68 @@ const validateRefreshToken = () => { export const getModules = () => { return dispatch => { dispatch(requestModules()); + //TODO : check how to solve modules, don't hardocde values + const modules={ + modules:{ + modules:[ + { + id:"19", + isInMenu:"0", + menuName:"Cart", + name:"Cart", + url:"cart", + + }, + { + id:"14", + isInMenu:"0", + menuName:"ProfileSettings", + name:"ProfileSettings", + url:"profileSettings", + }, + { + id:"23", + isInMenu:"0", + menuName:"OrderProjects", + name:"OrderProjects", + url:"orderProjects", + }, + { + id:"15", + isInMenu:"0", + menuName:"Terms", + name:"Terms", + url:"terms", + }, + { + id:"1", + isInMenu:"1", + menuName:"Overview", + name:"Dashboards", + url:"dashboards", + }, + { + id:"18", + isInMenu:"1", + menuName:"Co-Market", + name:"CoMarket", + url:"co-market", + } + ], + subModules:{ + "co-market":[ + { + menuName:"Orders", + name:"Orders", + url:"orders", + moduleUrl:"co-market", + } + ] + } + } + } + dispatch(recieveModules(modules)); + /* return htmlClient.fetch({ url: `${API_SERVER}/login/api/getModules`, }) @@ -170,6 +232,7 @@ export const getModules = () => { .catch(error => { htmlClient.onError(error, dispatch); }); + */ } }