From 58c20396ff040e514beeff2259bc120be4272c27 Mon Sep 17 00:00:00 2001 From: Boris Kovar Date: Tue, 26 Nov 2024 14:10:50 +0100 Subject: [PATCH] #1483 - final fixes --- js/components/header/index.js | 10 ---- .../molecule/moleculeView/moleculeView.js | 2 +- .../preview/molecule/redux/dispatchActions.js | 53 +------------------ .../projectHistoryPanel/editSnapshotDialog.js | 52 +++++++++--------- .../preview/redux/dispatchActions.js | 3 +- .../projects/addProjectDetail/index.js | 7 ++- .../projects/redux/dispatchActions.js | 4 +- .../snapshot/redux/dispatchActions.js | 2 + 8 files changed, 36 insertions(+), 97 deletions(-) diff --git a/js/components/header/index.js b/js/components/header/index.js index 9a86f3cdf..c7a3b316a 100644 --- a/js/components/header/index.js +++ b/js/components/header/index.js @@ -514,16 +514,6 @@ export default memo( )} - - - diff --git a/js/components/preview/molecule/moleculeView/moleculeView.js b/js/components/preview/molecule/moleculeView/moleculeView.js index 951c8d886..900af8be6 100644 --- a/js/components/preview/molecule/moleculeView/moleculeView.js +++ b/js/components/preview/molecule/moleculeView/moleculeView.js @@ -1034,7 +1034,7 @@ const MoleculeView = memo( if (isDensityOn === false && isDensityCustomOn === false) { dispatch(getDensityMapData(data)).then(r => { if (r) { - dispatch(setDensityModalOpen(true)); + setDensityModalOpen(true); } else { addNewDensity(); } diff --git a/js/components/preview/molecule/redux/dispatchActions.js b/js/components/preview/molecule/redux/dispatchActions.js index 50b7d1f74..ac0044287 100644 --- a/js/components/preview/molecule/redux/dispatchActions.js +++ b/js/components/preview/molecule/redux/dispatchActions.js @@ -868,22 +868,6 @@ export const removeSelectedMolTypes = (majorViewStage, molecules, skipTracking, }); }; -// export const searchMoleculeGroupByMoleculeID = moleculeID => (dispatch, getState) => -// api({ url: `${base_url}/api/molgroup/?mol_id=${moleculeID}` }).then(response => { -// let resultMolGroupID = null; -// const molGroupID = response?.data?.results[0]?.id; -// const mol_group_list = getState().apiReducers.mol_group_list; - -// if (mol_group_list && Array.isArray(mol_group_list) && molGroupID) { -// mol_group_list.forEach((item, index) => { -// if (item.id === molGroupID) { -// resultMolGroupID = index + 1; -// } -// }); -// } -// return Promise.resolve(resultMolGroupID); -// }); - export const applyDirectSelection = stage => (dispatch, getState) => { const state = getState(); @@ -947,44 +931,9 @@ export const getQualityInformation = (data, molType, width, height) => (dispatch export const getProteinData = molecule => dispatch => { return new Promise((resolve, reject) => { resolve(molecule.proteinData); - }); /*dispatch(getProteinDataByMolId(molecule.id, molecule.code));*/ + }); }; -// export const getProteinDataByMolId = (molId, proteinCode) => (dispatch, getState) => { -// const state = getState(); -// const proteindDataCache = state.previewReducers.molecule.proteinDataCache; - -// const molIdStr = molId.toString(); -// if (proteindDataCache.hasOwnProperty(molIdStr)) { -// return new Promise((resolve, reject) => { -// resolve(proteindDataCache[molIdStr]); -// }); -// } else { -// return loadProteinData(proteinCode).then(i => { -// if (!proteindDataCache.hasOwnProperty(molIdStr)) { -// dispatch(addProteindDataToCache(molId.toString(), i)); -// } -// return i; -// }); -// } -// }; - -// const loadProteinData = code => { -// if (code) { -// let url = new URL(`${base_url}/api/proteins/?code=${code}`); -// let onCancel = () => {}; -// return api({ -// url, -// onCancel -// }).then(response => { -// return response.data.results; -// }); -// } else { -// console.error('Trying to load protein data for unknown molecule protein code.'); -// return Promise.resolve(); -// } -// }; - export const getMolImage = (molId, molType, width, height) => (dispatch, getState) => { const state = getState(); diff --git a/js/components/preview/projectHistoryPanel/editSnapshotDialog.js b/js/components/preview/projectHistoryPanel/editSnapshotDialog.js index ff36aa5ca..885fdf016 100644 --- a/js/components/preview/projectHistoryPanel/editSnapshotDialog.js +++ b/js/components/preview/projectHistoryPanel/editSnapshotDialog.js @@ -8,6 +8,8 @@ import { base_url } from '../../routes/constants'; import { api, METHOD } from '../../../utils/api'; import { addToastMessage } from '../../../reducers/selection/actions'; import { TOAST_LEVELS } from '../../toast/constants'; +import { InputFieldAvatar } from '../../projects/projectModal/inputFieldAvatar'; +import { Description, Title } from '@material-ui/icons'; const useStyles = makeStyles(theme => ({ body: { @@ -25,8 +27,8 @@ const useStyles = makeStyles(theme => ({ margin: theme.spacing(1), width: 400 }, - renameTargetPopup: { - width: '300px', + editSnashotPopup: { + width: '600px', borderRadius: '5px', border: '1px solid #000', display: 'flex', @@ -116,7 +118,7 @@ export const EditSnapshotDialog = () => { return ( snapshotToBeEdited && ( -
+
Edit target