Skip to content

Commit

Permalink
#462 Mass actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Adriána Kohanová committed Nov 26, 2020
1 parent 0cb5476 commit 799efbb
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 73 deletions.
2 changes: 1 addition & 1 deletion js/components/datasets/inspirationDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export const InspirationDialog = memo(
const removeSelectedType = (type, skipTracking = false) => {
if (type === 'ligand') {
moleculeList.forEach(molecule => {
dispatch(removeType[type](stage, molecule, colourList[molecule.id % colourList.length], false, skipTracking));
dispatch(removeType[type](stage, molecule, skipTracking));
});
} else {
moleculeList.forEach(molecule => {
Expand Down
8 changes: 4 additions & 4 deletions js/components/datasets/redux/dispatchActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,11 @@ export const removeOrAddAllHitProteinsOfList = (areAllSelected, moleculeList = [

if (areAllSelected) {
let molecules = dispatch(getSelectedMoleculesByType(type, false, moleculeList));
dispatch(setDeselectedAllByType(type, molecules));
dispatch(setDeselectedAllByType(type, null, molecules, true));
dispatch(removeAllHitProteins(moleculeList, stage, true));
} else {
let molecules = dispatch(getSelectedMoleculesByType(type, true, moleculeList));
dispatch(setSelectedAllByType(type, molecules));
dispatch(setSelectedAllByType(type, null, molecules, true));
dispatch(addAllHitProteins(moleculeList, stage, true));
}
};
Expand Down Expand Up @@ -497,11 +497,11 @@ export const removeOrAddAllComplexesOfList = (areAllSelected, moleculeList = [],

if (areAllSelected) {
let molecules = dispatch(getSelectedMoleculesByType(type, false, moleculeList));
dispatch(setDeselectedAllByType(type, molecules));
dispatch(setDeselectedAllByType(type, null, molecules, true));
dispatch(removeAllComplexes(moleculeList, stage, true));
} else {
let molecules = dispatch(getSelectedMoleculesByType(type, true, moleculeList));
dispatch(setSelectedAllByType(type, molecules));
dispatch(setSelectedAllByType(type, null, molecules, true));
dispatch(addAllComplexes(moleculeList, stage, true));
}
};
Expand Down
9 changes: 6 additions & 3 deletions js/reducers/tracking/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,16 @@ export const actionDescription = {
TO_SHOPPING_CART: 'to shopping cart',
FROM_SHOPPING_CART: 'from shopping cart',
LIGAND: 'Ligand',
SIDECHAINS: 'Sidechain',
INTERACTIONS: 'Interaction',
SIDECHAIN: 'Sidechain',
INTERACTION: 'Interaction',
VECTOR: 'Vector',
SURFACE: 'Surface',
SITE: 'Site',
TARGET: 'Target',
ALL: 'All'
ALL: 'All',
LIGANDS: 'Ligands',
SIDECHAINS: 'Sidechains',
INTERACTIONS: 'Interactions'
};

export const actionObjectType = {
Expand Down
Loading

0 comments on commit 799efbb

Please sign in to comment.