Open
Conversation
- Added Review and ReviewMessage entities with JPA annotations - Introduced ReviewStatus enumeration - Implemented ReviewDao and ReviewMessageDao with corresponding DAO implementations - Updated persistence.xml to include Review and ReviewMessage - Added systemClock bean in AppConfig for timestamp mocking in tests
- Implement ReviewController for managing review views - Add ReviewService for retrieving and filtering reviews - Create Thymeleaf templates for assigned and all reviews
- Added `ReviewController` with endpoints for listing and creating review requests. - Introduced `CreateReviewForm` and validation via `CreateReviewValidator`. - Updated `ReviewService` to handle review request creation and validation. - Extended `QuestionnaireService` to fetch questionnaires by ID. - Enhanced `UserService` to retrieve users by role. - Modified `Questionnaire` and `QuestionnaireDTO` to include an `isApproved` field. - Created `ConditionalValidation` annotation and `ConditionalValidatorDispatcher` for dynamic validation handling. - Added localized messages for review-related actions. - Created `review/create.html` for the review request form.
- Added `getEmailPreview` endpoint in `ReviewController` to generate localized email previews. - Extended `CreateReviewForm` with `personalMessage` and `language` fields. - Updated `ReviewService` to support email preview generation. - Implemented email preview UI in `review/create.html`, allowing users to see the email content before sending. - Added localized messages for email-related labels and messages.
- Added `removeReview` endpoint in `ReviewController` to allow deletion of reviews. - Implemented `deleteReviewById` in `ReviewService` with validation for access control. - Introduced `canModifyReview` method to check if a user has permission to delete a review. - Extended `ValidationResult` with new error messages for invalid review ID, unauthorized access, and missing reviews. - Added localized success and error messages for review deletion
- Added review management link to `admin.html` and `mobileAdmin.html`.
- Implemented `/review/details` endpoint to view and manage review decisions. - Added approval, rejection, resubmission, and reviewer assignment logic. - Introduced `ReviewDecisionForm` for review actions. - Implemented `ReviewDecisionValidator` for input validation. - Added support for setting a questionnaire as the main version. - Created UI for review details, including reviewer selection and conversation history.
- Introduced `ApprovalStatus` enum for better questionnaire status handling - Added direct approval/disapproval functionality for questionnaires (admins) - Ensured review completion when a questionnaire is approved by an admin - Prevented duplicate review requests for the same questionnaire - Improved questionnaire versioning and group management - Adjusted UI labels and messages
- Unified `/review` as base path with structured routes. - Split pending/completed reviews into separate lists & details pages.
- Moved user detail population to DTOs (`setEditorDetails()`, `setReviewerDetails()`). - `sendReviewActionMail()` now returns `ValidationResult` instead of `boolean`. - Improved error handling and logging for mail failures. - Simplified Review constructor & added missing setters.
…stionnaireServiceTest - Added `ReviewServiceTest` to cover review creation, approval, rejection, resubmission, deletion, and permission checks. - Introduced `CreateReviewValidatorTest` to validate review form fields. - Expanded `QuestionnaireServiceTest` with tests for questionnaire approval, disapproval, and edit restrictions.
…& admins full access - Added `createdBy` field to `Questionnaire` to track the creator - Updated review logic: - Editors can only request reviews for their own questionnaires - Moderators and admins can see all unapproved questionnaires - Extended `QuestionnaireDTOMapper` and `QuestionnaireFactory` to include `createdBy` - Added tests for `getUnapprovedQuestionnaires()` to validate the new behavior
…e and manage questionnaires - Moderators can now approve and disapprove questionnaires. - Questionnaires created or imported by a moderator are now also approved by default.
…s for editors - Modified `getAllReviewers()` in `ReviewService` to include moderators as reviewers. - Updated `pending-details.html` to allow moderators (not just admins) to approve or reject reviews. - Updated `getUnapprovedQuestionnaires()` to allow editors to request reviews only for questionnaires they created or modified. - Added `isCreatedOrModifiedBy(Long userId)` to `Questionnaire` and `QuestionnaireDTO` for simpler authorization logic. - Refactored `list.html` to ensure only authorized users can request reviews or delete questionnaires.
…fixing - Moved `getAllReviewers()` to `UserService`. - Improved validation in `CreateReviewValidator`: - Now ensures the selected reviewer is valid. - Fixed incorrect setting of sender/receiver names in `ReviewMessageDTO.setReceiverDetails()`. - Updated `ReviewService`: - Refactored `addReviewMessage()` to explicitly pass sender and receiver IDs. - Removed redundant validation methods (`validateUserId` and `getInitials`). - Fixed incorrect cancel button URL in `review/create.html`. - Improved error messages and validation messages in multiple locales.
…ml logic corrected - Admins now see approval options in the review detail view - Adjusted visibility logic in template (considering isAdmin flag) - Fixed mail link generation to point to /pending/details - Added JavaDoc comments in controller and service classes
…on logic** - Moved questionnaire deletion logic from controller to `QuestionnaireService` (`removeQuestionnaire` method). - Improved readability and structure of the removal process for conditions, scores, bundles, reviews, and version groups. - Added permission checks: only the questionnaire creator or users with moderator/admin roles can delete. - Updated frontend to show the delete button only for users with appropriate permissions.
…a fields - Added new table `review` for managing review processes - Added new table `review_message` for conversation between editor and reviewer - Added `approval_status` column to `questionnaire`, defaulting to 'DRAFT' - Set `approval_status` to 'APPROVED' for existing questionnaires - Added `created_by` column to `questionnaire` and populated it from `changed_by` - Added `main_questionnaire_id` column to `questionnaire_version_group` and initialized it with the latest version per group
- Users can no longer assign themselves as reviewers when creating a review request. - Added missing `createdBy` assignment in FHIR import.
Test Results:
|
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.
Description
This pull request introduces the new Review Feature for questionnaires in MoPat. The feature allows Editors to request a review for their questionnaires and enables Moderators and Admins to review and approve or reject those submissions.
Key Features
Editors can:
Moderators and Admins can:
Admins additionally can:
Email notifications:
Technical Changes
reviewandreview_message.questionnaire:approval_status(DRAFT / UNDER_REVIEW / APPROVED)created_bymain_questionnaire_idtoquestionnaire_version_group.