Skip to content

Commit

Permalink
Persist for edits on existing studies
Browse files Browse the repository at this point in the history
  • Loading branch information
subhramit committed Aug 21, 2024
1 parent 2ced5a5 commit 2e9b4da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ private void setupSaveSurveyButton(boolean isEdit) {

setResultConverter(button -> {
if (button == saveSurveyButtonType) {
return viewModel.saveStudy();
SlrStudyAndDirectory result = viewModel.saveStudy();
if (result != null && isEdit) {
viewModel.updateSelectedCatalogs();
}
return result;
}
// Cancel button will return null
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,12 @@ public void initializeSelectedCatalogs() {
}
}

private void updateSelectedCatalogs() {
public void updateSelectedCatalogs() {
List<String> selectedCatalogsList = databases.stream()
.filter(StudyCatalogItem::isEnabled)
.map(StudyCatalogItem::getName)
.collect(Collectors.toList());

preferencesService.getWorkspacePreferences().setSelectedSlrCatalogs(selectedCatalogsList);
}
}

0 comments on commit 2e9b4da

Please sign in to comment.