Skip to content

Commit

Permalink
- checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
boriskovar-m2ms committed Jan 18, 2023
1 parent d4b88df commit 5b74eb4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions docker-compose.dev.vector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ services:
SQUONK2_UNIT_BILLING_DAY: 3
OIDC_AS_CLIENT_ID: 'account-server-api-dev'
OIDC_DM_CLIENT_ID: 'data-manager-api-dev'
OIDC_KEYCLOAK_REALM: 'https://keycloak.xchem-dev.diamond.ac.uk/auth/realms/xchem'
depends_on:
- database
- graph
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ const JobConfigurationDialog = ({ snapshots }) => {

const currentSessionProject = useSelector(state => state.projectReducers.currentProject);
const currentProject = useSelector(state => state.targetReducers.currentProject);
if (!currentProject) {
setErrorMsg('No project selected, please navigate to landing page and select a target.');
}
// if (!currentProject) {
// setErrorMsg('No project selected, please navigate to landing page and select a target.');
// }
const currentSnapshotID = useSelector(state => state.projectReducers.currentSnapshot.id);
const currentSnapshot = snapshots?.[currentSnapshotID];
const targetId = useSelector(state => state.apiReducers.target_on);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ const JobLauncherDialog = () => {
const targetName = useSelector(state => state.apiReducers.target_on_name);
const currentProject = useSelector(state => state.targetReducers.currentProject);

if (!currentProject) {
setErrorMsg('No project selected, please navigate to landing page and select a target.');
}
// if (!currentProject) {
// setErrorMsg('No project selected, please navigate to landing page and select a target.');
// }

// Get data from previous window
const jobLauncherData = useSelector(state => state.projectReducers.jobLauncherData);
Expand Down
16 changes: 9 additions & 7 deletions js/components/preview/projectHistoryPanel/ProjectHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ export const ProjectHistory = memo(({ showFullHistory, graphKey, expanded, onExp
const currentSnapshotTree = useSelector(state => state.projectReducers.currentSnapshotTree);
const jobPopUpAnchorEl = useSelector(state => state.projectReducers.jobPopUpAnchorEl);
const isSnapshotDirty = useSelector(state => state.trackingReducers.isSnapshotDirty);
const currentProject = useSelector(state => state.projectReducers.currentProject);
const currentProjectID = currentProject && currentProject.projectID;
const projectID = paramsProjectID && paramsProjectID != null ? paramsProjectID : currentProjectID;
const currentSessionProject = useSelector(state => state.projectReducers.currentProject);
const currentSessionProjectID = currentSessionProject && currentSessionProject.projectID;
const sessionProjectID = paramsProjectID && paramsProjectID != null ? paramsProjectID : currentSessionProjectID;

const currentProject = useSelector(state => state.targetReducers.currentProject);

const [tryToOpen, setTryToOpen] = useState(false);
const [transitionToSnapshot, setTransitionToSnapshot] = useState(null);
Expand All @@ -116,10 +118,10 @@ export const ProjectHistory = memo(({ showFullHistory, graphKey, expanded, onExp
dispatch(setIsOpenModalBeforeExit(true));
setTryToOpen(false);
} else if (!isSnapshotDirty && tryToOpen && transitionToSnapshot) {
dispatch(changeSnapshot(projectID, transitionToSnapshot.hash, nglViewList, stage));
dispatch(changeSnapshot(sessionProjectID, transitionToSnapshot.hash, nglViewList, stage));
setTryToOpen(false);
}
}, [dispatch, isSnapshotDirty, nglViewList, projectID, stage, transitionToSnapshot, tryToOpen]);
}, [dispatch, isSnapshotDirty, nglViewList, sessionProjectID, stage, transitionToSnapshot, tryToOpen]);

const commitFunction = useCallback(
({ title, hash, isSelected = false }) => {
Expand Down Expand Up @@ -257,7 +259,7 @@ export const ProjectHistory = memo(({ showFullHistory, graphKey, expanded, onExp
size="small"
onClick={() => dispatch(refreshJobsData())}
startIcon={<Refresh />}
disabled={DJANGO_CONTEXT.squonk_available === false}
disabled={DJANGO_CONTEXT.squonk_available === false || !currentProject}
>
Refresh
</Button>
Expand All @@ -269,7 +271,7 @@ export const ProjectHistory = memo(({ showFullHistory, graphKey, expanded, onExp
size="small"
onClick={handleClickJobLauncher}
startIcon={<PlayArrow />}
disabled={DJANGO_CONTEXT.squonk_available === false}
disabled={DJANGO_CONTEXT.squonk_available === false || !currentProject}
>
Job Launcher
</Button>
Expand Down

0 comments on commit 5b74eb4

Please sign in to comment.