[Analyze-605] Disable add to cohort button if dataset not compatible to materialize cohort#1875
Merged
brandantck merged 3 commits intodevelopfrom Mar 2, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a frontend capability check to determine whether the selected dataset can materialize cohorts, and uses it to disable the “Add to cohort/collection” action when materialization isn’t supported (Issue #605).
Changes:
- Add Vuex state/getter/mutation to track
canDatasetMaterializeCohorts. - Add a Vuex action that calls a backend endpoint to check cohort materialization capability.
- Wire the capability flag through the Bookmarks components to disable the “Add to collection” icon.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/apps/vue-mri-ui-lib/src/store/mutation-types.ts | Adds a new mutation type constant for cohort-materialization capability. |
| ui/apps/vue-mri-ui-lib/src/store/modules/bookmark.ts | Stores capability flag in Vuex; adds action + mutation to populate it from backend. |
| ui/apps/vue-mri-ui-lib/src/components/PatientAnalytics.vue | Triggers the capability check during bookmark initialization. |
| ui/apps/vue-mri-ui-lib/src/components/Bookmarks.vue | Passes the capability flag down into BookmarkItems. |
| ui/apps/vue-mri-ui-lib/src/components/BookmarkItems.vue | Uses the capability flag to disable the “Add to collection” icon. |
Comments suppressed due to low confidence (1)
ui/apps/vue-mri-ui-lib/src/components/BookmarkItems.vue:592
- The Add-to-cohort icon is only being disabled via the
icon-button-disabledCSS class, but the@click.stophandler still callsaddCohort(bookmarkDisplay)unconditionally. This makes the disabled behavior depend onpointer-events: none, which is brittle (e.g., programmatic clicks / future CSS changes) and also prevents thetitletooltip from appearing on hover. Consider guarding the click handler (only invokeaddCohortwhen enabled) and moving the tooltip to an element that still receives pointer events so users can discover why the action is disabled.
<div
:class="`icon-button ${
['D', 'D+M', 'A', 'A+M'].includes(getBookmarkType(bookmarkDisplay)) && canDatasetMaterializeCohorts ? '' : 'icon-button-disabled'
}`"
style="width: 32px; height: 32px; display: flex; justify-content: center; align-items: center"
@click.stop="addCohort(bookmarkDisplay)"
:title="getText('MRI_PA_BUTTON_ADD_TO_COLLECTION')"
khairul-syazwan
approved these changes
Feb 19, 2026
…n_for_add_to_cohort_button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
falseExample

falseresponseExample

trueresponseMerge Checklist
Please cross check this list if additions / modifications needs to be done on top of your core changes and tick them off. Reviewer can as well glance through and help the developer if something is missed out.
developbranch)