Skip to content

[Analyze-605] Disable add to cohort button if dataset not compatible to materialize cohort#1875

Merged
brandantck merged 3 commits intodevelopfrom
brandantck/analyze-605_frontend_validation_for_add_to_cohort_button
Mar 2, 2026
Merged

[Analyze-605] Disable add to cohort button if dataset not compatible to materialize cohort#1875
brandantck merged 3 commits intodevelopfrom
brandantck/analyze-605_frontend_validation_for_add_to_cohort_button

Conversation

@brandantck
Copy link
Copy Markdown
Collaborator

  1. Add request to call backend to check if dataset can materialize cohort, disable button if response is false

Example false response
cannot materialize

Example true response
can materialize

Merge 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.

  • Automated Tests (Jasmine integration tests, Unit tests, and/or Performance tests)
  • Updated Manual tests / Demo Config
  • Documentation (Application guide, Admin guide, Markdown, Readme and/or Wiki)
  • Verified that local development environment is working with latest changes (integrated with latest develop branch)
  • following best practices in code review doc

Copilot AI review requested due to automatic review settings February 19, 2026 08:36
@brandantck brandantck changed the title [Analyze-605] Disable add to cohort button if dataset cannot materialize cohort [Analyze-605] Disable add to cohort button if dataset not compatible to materialize cohort Feb 19, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-disabled CSS class, but the @click.stop handler still calls addCohort(bookmarkDisplay) unconditionally. This makes the disabled behavior depend on pointer-events: none, which is brittle (e.g., programmatic clicks / future CSS changes) and also prevents the title tooltip from appearing on hover. Consider guarding the click handler (only invoke addCohort when 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')"

Comment thread ui/apps/vue-mri-ui-lib/src/store/modules/bookmark.ts Outdated
Comment thread ui/apps/vue-mri-ui-lib/src/store/modules/bookmark.ts Outdated
@brandantck brandantck added this pull request to the merge queue Mar 2, 2026
Merged via the queue into develop with commit 8d489ed Mar 2, 2026
41 checks passed
@brandantck brandantck deleted the brandantck/analyze-605_frontend_validation_for_add_to_cohort_button branch March 2, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bookmark] bookmark endpoints not working for schemas without cohort table (fhir|msradiology)

3 participants