feat: UI Support for Community Calibration Permission Broadening#625
Conversation
Allow any authenticated user to create calibrations on published score sets (community calibrations), not just score set contributors/owners. - Use backend's `add_calibration` permission action instead of deriving calibration access from the `update` permission - Add EmailPrompt gate to calibration creation/edit dialogs so users without an email are prompted before proceeding - Make EmailPrompt modal with z-index above calibration dialogs for proper stacking - Handle 403 email-related errors on calibration save with descriptive toast messages - Remove redundant `userIsAuthorizedToEditScoreSet` check on calibration edit button (backend handles this via per-calibration permissions) - Rename `classificationSources` to `evidenceSources` across all components and schema types to match backend API rename
…tion types and sources
|
UI support for VariantEffect/mavedb-api#666 |
| if (path[0] == 'body') { | ||
| path = path.slice(1) | ||
| } | ||
| let customPath = error.ctx?.custom_loc |
There was a problem hiding this comment.
| let customPath = error.ctx?.custom_loc | |
| let customPath = error.ctx?.error?.custom_loc |
There was a problem hiding this comment.
I'm not seeing publication identifier errors (like "Calibrations with functional classifications must provide at least one method source publication") in the UI. I think this pair of changes is needed, but make sure it's correct for other error cases.
This matches the validation error handling in ScoreSetCreator.vue and ScoreSetCalibrationsView.vue, and perhaps we can refactor it at some point into shared code.
There was a problem hiding this comment.
Ah good catch, thanks. Not sure how this one ended up different from the logic in the ScoreSetCalibrationsView method which is where I must have tested it. Should've done it in both spots.
It should definitely be shared code. It was pretty straightforward to refactor out, so I just made that change here in b49053e. I had to leave some logic in each of the individual components to handle toasts and validation error persistence to the calibration editor component.
| if (customPath && customPath[0] == 'body') { | ||
| customPath = customPath.slice(1) | ||
| } | ||
| path = path.join('.') |
There was a problem hiding this comment.
| path = path.join('.') | |
| if (customPath) { | |
| path = path.concat(customPath) | |
| } | |
| path = path.join('.') |
This pull request implements several improvements and refactors related to calibration management and evidence source handling in the application. The main changes include renaming the "classificationSources" field to "evidenceSources" throughout the codebase, improving authorization logic for adding calibrations, and enhancing user experience by prompting users to add an email address when required. Additionally, the pull request introduces UI and error handling enhancements for calibration-related actions.
Calibration Source Renaming and Refactor:
classificationSourcestoevidenceSourcesin components such asCalibrationEditor.vue,CalibrationTable.vue, andAssayFactSheet.vue, including data models, props, computed properties, and template bindings. This ensures consistency in terminology and improves clarity in the codebase. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Authorization and Permission Improvements:
add_calibrationpermission rather than relying onupdate, both in the backend API calls and in UI logic, to more accurately reflect user capabilities for adding calibrations. [1] [2] [3] [4]Email Prompt and Error Handling Enhancements:
EmailPromptcomponent to calibration-related views (ScoreSetCalibrationsView.vueandScoreSetView.vue), prompting users to add an email address if required before creating or editing calibrations. [1] [2] [3] [4] [5] [6]UI and Usability Improvements:
Dialog and Modal Improvements:
EmailPromptdialog to use a higher z-index and modal behavior for better visibility and focus when prompting users.