+ ,
+
+ dispatch(setOpenObservationsDialog(false))}
+ >
+
+
+
+ ]}
+ >
+ {isLoadingInspirationListOfMolecules === false && moleculeList && (
+ <>
+
+
+ {/* {Object.keys(moleculeProperty).map(key => (
+
+ {moleculeProperty[key]}
+
+ ))} */}
+ {allSelectedMolecules.length > 0 && (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/* C stands for contacts now */}
+
+
+
+
+
+ )}
+
+
+
+ {moleculeList.length > 0 &&
+ moleculeList.map((molecule, index, array) => {
+ let data = molecule;
+ let previousData = index > 0 && { ...array[index - 1] };
+ let nextData = index < array?.length && { ...array[index + 1] };
+ const selected = allSelectedMolecules.some(molecule => molecule.id === data.id);
+
+ return (
+
+
+
+ );
+ })}
+ {!(moleculeList.length > 0) && (
+
+
+ No molecules found!
+
+
+ )}
+
+ >
+ )}
+ {isLoadingInspirationListOfMolecules === true && (
+
+
+
+
+
+ )}
+
+
+ );
+ })
+);
diff --git a/js/reducers/selection/actions.js b/js/reducers/selection/actions.js
index 7bd53f8c3..a13560ac0 100644
--- a/js/reducers/selection/actions.js
+++ b/js/reducers/selection/actions.js
@@ -405,6 +405,20 @@ export const setTagEditorOpen = isOpen => {
};
};
+export const setOpenObservationsDialog = isOpen => {
+ return {
+ type: constants.SET_OPEN_OBSERVATIONS_DIALOG,
+ isOpen: isOpen
+ };
+};
+
+export const setObservationsForLHSCmp = observations => {
+ return {
+ type: constants.SET_OBSERVATIONS_FOR_LHS_CMP,
+ observations: observations
+ };
+};
+
export const setMoleculeForTagEdit = molId => {
return {
type: constants.SET_MOLECULE_FOR_TAG_EDIT,
@@ -464,7 +478,7 @@ export const appendToObsCmpListToEdit = cmpId => {
export const removeFromObsCmpListToEdit = cmpId => {
return {
type: constants.REMOVE_FROM_OBS_MOL_LIST_TO_EDIT,
- molId: cmpId
+ cmpId: cmpId
};
};
diff --git a/js/reducers/selection/constants.js b/js/reducers/selection/constants.js
index 011716efa..6a62e382f 100644
--- a/js/reducers/selection/constants.js
+++ b/js/reducers/selection/constants.js
@@ -76,6 +76,10 @@ export const constants = {
APPEND_TO_OBS_MOL_LIST_TO_EDIT: prefix + 'APPEND_TO_OBS_MOL_LIST_TO_EDIT',
REMOVE_FROM_OBS_MOL_LIST_TO_EDIT: prefix + 'REMOVE_FROM_OBS_MOL_LIST_TO_EDIT',
+ SET_OPEN_OBSERVATIONS_DIALOG: prefix + 'SET_OPEN_OBSERVATIONS_DIALOG',
+
+ SET_OBSERVATIONS_FOR_LHS_CMP: prefix + 'SET_OBSERVATIONS_FOR_LHS_CMP',
+
SET_TAG_TO_EDIT: prefix + 'SET_TAG_TO_EDIT',
SET_DISPLAY_ALL_MOLECULES: prefix + 'SET_DISPLAY_ALL_MOLECULES',
SET_DISPLAY_UNTAGGED_MOLECULES: prefix + 'SET_DISPLAY_UNTAGGED_MOLECULES',
diff --git a/js/reducers/selection/selectionReducers.js b/js/reducers/selection/selectionReducers.js
index 95a200038..6337ef944 100644
--- a/js/reducers/selection/selectionReducers.js
+++ b/js/reducers/selection/selectionReducers.js
@@ -46,7 +46,10 @@ export const INITIAL_STATE = {
//display all molecules in hit navigator regardless of the tag selection
displayAllMolecules: false,
displayUntaggedMolecules: false,
- nextXMolecules: 0
+ nextXMolecules: 0,
+
+ isObservationDialogOpen: false,
+ observationsForLHSCmp: []
};
export function selectionReducers(state = INITIAL_STATE, action = {}) {
@@ -152,6 +155,12 @@ export function selectionReducers(state = INITIAL_STATE, action = {}) {
diminishedComplexList.delete(action.item.id);
return Object.assign({}, state, { complexList: [...diminishedComplexList] });
+ case constants.SET_OPEN_OBSERVATIONS_DIALOG:
+ return { ...state, isObservationDialogOpen: action.isOpen };
+
+ case constants.SET_OBSERVATIONS_FOR_LHS_CMP:
+ return { ...state, observationsForLHSCmp: [...action.observations] };
+
case constants.SET_SURFACE_LIST:
let newSurfaceList = new Set();
action.surfaceList.forEach(f => {
diff --git a/js/reducers/selection/selectors.js b/js/reducers/selection/selectors.js
index cc2721bcf..696a54e68 100644
--- a/js/reducers/selection/selectors.js
+++ b/js/reducers/selection/selectors.js
@@ -7,6 +7,13 @@ const getCurrentVector = state => state.selectionReducers.currentVector;
const getBondColorMapOfVectors = state => state.selectionReducers.bondColorMapOfVectors;
const getCompoundsOfVectors = state => state.selectionReducers.compoundsOfVectors;
+const fragmentDisplayList = state => state.selectionReducers.fragmentDisplayList;
+const proteinList = state => state.selectionReducers.proteinList;
+const complexList = state => state.selectionReducers.complexList;
+const surfaceList = state => state.selectionReducers.surfaceList;
+const densityList = state => state.selectionReducers.densityList;
+const vectorOnList = state => state.selectionReducers.vectorOnList;
+
export const getMoleculeOfCurrentVector = createSelector(
getCurrentVector,
getVectorList,
@@ -92,3 +99,29 @@ export const getAllCompoundsList = createSelector(
return compoundsList;
}
);
+
+export const isAnyObservationTurnedOnForCmp = createSelector(
+ (_, observations = []) => observations,
+ fragmentDisplayList,
+ proteinList,
+ complexList,
+ surfaceList,
+ densityList,
+ vectorOnList,
+ (observations, ligands, proteins, complexis, surfaces, densities, vectors) => {
+ const allLists = new Set(ligands);
+ proteins.forEach(p => allLists.add(p));
+ complexis.forEach(p => allLists.add(p));
+ surfaces.forEach(p => allLists.add(p));
+ densities.forEach(p => allLists.add(p));
+ vectors.forEach(p => allLists.add(p));
+ let hasInspiration = false;
+ observations.forEach(moleculeID => {
+ if (allLists.has(moleculeID)) {
+ hasInspiration = true;
+ return hasInspiration;
+ }
+ });
+ return hasInspiration;
+ }
+);