Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

173 moderator and editor can release a bundle during the creation #182

Open
wants to merge 13 commits into
base: v3.2.1
Choose a base branch
from

Conversation

schluebbo
Copy link
Collaborator

Restricted isPublished to admins, ensured validation error persistence, and refactored bundle-related logic into BundleService.

Key Changes:

  • Restricted isPublished to admins in the backend and frontend.
  • Ensured hasScores and QuestionnaireGroupDTO persist after validation errors.
  • Moved getBundleDTO, saveOrUpdateBundle, and related logic to BundleService.
  • Extracted methods for questionnaire persistence, ACL creation, and property updates.

- Force `isPublished = false` for non-admins in `editBundle()`
- Hide "Release" checkbox in UI for non-admins
- Ensure `QuestionnaireGroupDTO` is set when reassigning questionnaires
- Prevents assigned questionnaires from becoming unmovable after errors
- Replaced direct `bundleDao` call in `BundleController` with `BundleService.isBundleModifiable()`
- Extracted text cleanup logic into `BundleService.cleanUpTextFields()`
- Moved removal of unassigned bundle questionnaires to `BundleService.removeUnassignedBundleQuestionnaires()`
- Introduced `BundleService.prepareBundleForEdit()` to centralize pre-processing logic
- Ensure `hasScores` is restored in `BundleController` after a validation error
- Prevents the score activation button from disappearing in the UI
…e redundant method

- Replaced `getAvailableQuestionnaires` in `BundleController` with the existing method from `BundleService`
- Adjusted returned list from an immutable to a mutable list for modifications
- Removed unused `getAvailableQuestionnaires` method from `BundleController` as it is no longer needed
…o BundleService

- Extracted logic for synchronizing assigned and available questionnaires into `syncAssignedAndAvailableQuestionnaires` in `BundleService`
- Ensured `exportTemplates`, `questionnaireGroupDTO`, and `hasScores` are properly updated in assigned questionnaires
- Moved `saveOrUpdateBundle` logic from `BundleController` to `BundleService`
- Removed redundant dependencies from `BundleController` that are now handled by `BundleService`
- Moved bundle property assignment into a new method `updateBundleProperties`
- Simplified bundle initialization by using a conditional expression
- Moved ACL entry creation to `createAclEntry` for better code organization
- Extracted bundle questionnaire cleanup logic into `cleanupRemovedBundleQuestionnaires`
…Questionnaires`

- Moved bundle questionnaire persistence into a separate method for better readability.
- Simplified `saveOrUpdateBundle` by handling `isPublished` logic separately.
- Extracted `getBundleDTO` from `BundleController` to `BundleService`.
@schluebbo schluebbo self-assigned this Feb 20, 2025
Copy link

Test Results:

TestsPassed ✅Skipped ⚠️Failed
JUnit Test Report1007 ran997 passed10 skipped0 failed

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.

1 participant