Skip to content

Commit 7b5b6e5

Browse files
Merge remote-tracking branch 'remotes/origin/#505' into allfunctionality
2 parents 80744db + d1b73f2 commit 7b5b6e5

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

js/components/preview/compounds/redux/dispatchActions.js

+4-9
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@ export const handleClickOnCompound = ({ event, data, majorViewStage, index }) =>
206206
}
207207

208208
if (isSelectedID !== undefined) {
209-
await dispatch(removeSelectedCompoundClass(index));
209+
dispatch(removeSelectedCompoundClass(index));
210210
dispatch(removeFromToBuyList(data, index));
211211
} else {
212-
await dispatch(addSelectedCompoundClass(currentCompoundClass, index));
213-
dispatch(appendToBuyList(Object.assign({}, data, { class: currentCompoundClass })), index);
212+
dispatch(addSelectedCompoundClass(currentCompoundClass, index));
213+
dispatch(appendToBuyList(Object.assign({}, data, { class: currentCompoundClass }), index));
214214
}
215215
}
216216
};
@@ -234,12 +234,7 @@ export const handleBuyListAll = ({ isSelected, items, majorViewStage }) => (disp
234234
if (isSelected === false) {
235235
dispatch(clearCompounds(items, majorViewStage));
236236
} else {
237-
for (var item in items) {
238-
let index = item.compoundId;
239-
dispatch(appendToBuyList(item, index, true));
240-
dispatch(addSelectedCompoundClass(item.class, index));
241-
}
242-
dispatch(appendToBuyListAll(items));
237+
dispatch(selectAllCompounds());
243238
}
244239
};
245240

js/reducers/tracking/dispatchActions.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1472,10 +1472,10 @@ const handleRedoAction = (action, stages) => (dispatch, getState) => {
14721472
dispatch(handleVectorAction(action, false));
14731473
break;
14741474
case actionType.VECTOR_COUMPOUND_ADDED:
1475-
dispatch(handleVectorCompoundAction(action, true));
1475+
dispatch(handleVectorCompoundAction(action, true, majorViewStage));
14761476
break;
14771477
case actionType.VECTOR_COUMPOUND_REMOVED:
1478-
dispatch(handleVectorCompoundAction(action, false));
1478+
dispatch(handleVectorCompoundAction(action, false, majorViewStage));
14791479
break;
14801480
case actionType.CLASS_SELECTED:
14811481
dispatch(handleClassSelectedAction(action, true));

js/reducers/tracking/trackingActions.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ export const findTrackAction = (action, state) => {
373373
object_type: objectType,
374374
object_name: objectName,
375375
object_id: objectName,
376-
compoundId: action.item.compoundId,
376+
compoundId: action.index,
377377
item: action.item,
378378
text: `${actionDescription.VECTOR} ${objectName} ${actionDescription.ADDED} ${actionDescription.TO_SHOPPING_CART}`
379379
};
@@ -391,7 +391,7 @@ export const findTrackAction = (action, state) => {
391391
object_type: objectType,
392392
object_name: objectName,
393393
object_id: objectName,
394-
compoundId: action.item.compoundId,
394+
compoundId: action.index,
395395
item: action.item,
396396
text: `${actionDescription.VECTOR} ${objectName} ${actionDescription.REMOVED} ${actionDescription.FROM_SHOPPING_CART}`
397397
};
@@ -486,7 +486,7 @@ export const findTrackAction = (action, state) => {
486486
object_id: objectName,
487487
oldValue: oldObjectName,
488488
value: objectName,
489-
text: `${actionDescription.CLASS} ${objectName} ${actionDescription.SELECTED}`
489+
text: `${actionDescription.CLASS} ${actionDescription.CHANGED} from value: ${oldObjectName} to value: ${objectName}`
490490
};
491491
}
492492
} else if (action.type === previewCompoundConstants.SET_COMPOUND_CLASSES) {

0 commit comments

Comments
 (0)