diff --git a/js/components/preview/compounds/redux/dispatchActions.js b/js/components/preview/compounds/redux/dispatchActions.js index fc3c82fca..1730066c2 100644 --- a/js/components/preview/compounds/redux/dispatchActions.js +++ b/js/components/preview/compounds/redux/dispatchActions.js @@ -206,11 +206,11 @@ export const handleClickOnCompound = ({ event, data, majorViewStage, index }) => } if (isSelectedID !== undefined) { - await dispatch(removeSelectedCompoundClass(index)); + dispatch(removeSelectedCompoundClass(index)); dispatch(removeFromToBuyList(data, index)); } else { - await dispatch(addSelectedCompoundClass(currentCompoundClass, index)); - dispatch(appendToBuyList(Object.assign({}, data, { class: currentCompoundClass })), index); + dispatch(addSelectedCompoundClass(currentCompoundClass, index)); + dispatch(appendToBuyList(Object.assign({}, data, { class: currentCompoundClass }), index)); } } }; @@ -234,12 +234,7 @@ export const handleBuyListAll = ({ isSelected, items, majorViewStage }) => (disp if (isSelected === false) { dispatch(clearCompounds(items, majorViewStage)); } else { - for (var item in items) { - let index = item.compoundId; - dispatch(appendToBuyList(item, index, true)); - dispatch(addSelectedCompoundClass(item.class, index)); - } - dispatch(appendToBuyListAll(items)); + dispatch(selectAllCompounds()); } }; diff --git a/js/reducers/tracking/dispatchActions.js b/js/reducers/tracking/dispatchActions.js index 97ff46a7f..adf7c0aac 100644 --- a/js/reducers/tracking/dispatchActions.js +++ b/js/reducers/tracking/dispatchActions.js @@ -1472,10 +1472,10 @@ const handleRedoAction = (action, stages) => (dispatch, getState) => { dispatch(handleVectorAction(action, false)); break; case actionType.VECTOR_COUMPOUND_ADDED: - dispatch(handleVectorCompoundAction(action, true)); + dispatch(handleVectorCompoundAction(action, true, majorViewStage)); break; case actionType.VECTOR_COUMPOUND_REMOVED: - dispatch(handleVectorCompoundAction(action, false)); + dispatch(handleVectorCompoundAction(action, false, majorViewStage)); break; case actionType.CLASS_SELECTED: dispatch(handleClassSelectedAction(action, true)); diff --git a/js/reducers/tracking/trackingActions.js b/js/reducers/tracking/trackingActions.js index 7fcc7414f..e764fc3b0 100644 --- a/js/reducers/tracking/trackingActions.js +++ b/js/reducers/tracking/trackingActions.js @@ -373,7 +373,7 @@ export const findTrackAction = (action, state) => { object_type: objectType, object_name: objectName, object_id: objectName, - compoundId: action.item.compoundId, + compoundId: action.index, item: action.item, text: `${actionDescription.VECTOR} ${objectName} ${actionDescription.ADDED} ${actionDescription.TO_SHOPPING_CART}` }; @@ -391,7 +391,7 @@ export const findTrackAction = (action, state) => { object_type: objectType, object_name: objectName, object_id: objectName, - compoundId: action.item.compoundId, + compoundId: action.index, item: action.item, text: `${actionDescription.VECTOR} ${objectName} ${actionDescription.REMOVED} ${actionDescription.FROM_SHOPPING_CART}` }; @@ -486,7 +486,7 @@ export const findTrackAction = (action, state) => { object_id: objectName, oldValue: oldObjectName, value: objectName, - text: `${actionDescription.CLASS} ${objectName} ${actionDescription.SELECTED}` + text: `${actionDescription.CLASS} ${actionDescription.CHANGED} from value: ${oldObjectName} to value: ${objectName}` }; } } else if (action.type === previewCompoundConstants.SET_COMPOUND_CLASSES) {