-
Notifications
You must be signed in to change notification settings - Fork 110
Section functionality #2824
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
base: main
Are you sure you want to change the base?
Section functionality #2824
Conversation
Chartman123
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @shynkaruck
thanks for your pull request :) Before getting into detail two things that I noticed at a first quick look at the code.
Also please have a look at the failed checks and fix them.
| "@vue/tsconfig": "^0.5.1", | ||
| "eslint-config-prettier": "^10.1.5", | ||
| "prettier": "^3.6.1", | ||
| "sass-embedded": "^1.89.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you adding this? It's not used anywhere...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this file from the PR
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Add Section functionality to Nextcloud Forms
Description
This PR adds a new "Section" element type to Nextcloud Forms that acts as a visual separator to group fields logically, without affecting data storage, validation, or submission logic.
Functional Requirements
1. Section Creation
2. Editor Display
3. Form Filling Display
4. Export/View Responses Behavior
Technical Implementation
Backend Changes
Constants and Types
lib/Constants.php: AddedANSWER_TYPE_SECTION = 'section'constantlib/ResponseDefinitions.php: UpdatedFormsQuestionTypeto include"section"API Controller (
lib/Controller/ApiController.php)isRequired = falsewhen cloning formsSubmission Service (
lib/Service/SubmissionService.php)Frontend Changes
Components
src/components/Questions/QuestionSection.vue: New component for section renderingsrc/components/Questions/Question.vue: Updated to support section display and editingsrc/models/AnswerTypes.js: Added section type with appropriate icon and labelssrc/models/Constants.ts: AddedANSWER_TYPE_SECTIONconstantViews
src/views/Create.vue: Updated to pass question type to componentssrc/views/Submit.vue: Updated to filter sections from validation and storagesrc/components/Results/ResultsSummary.vue: Updated to handle sections in results displaysrc/components/Results/Submission.vue: Updated to filter sections from submission dataTesting
Backend Tests
ApiControllerTest.php
testUpdateQuestion_sectionCannotBeRequired(): Verifies sections cannot be made requiredtestNewOption_sectionCannotHaveOptions(): Verifies sections cannot have optionstestUploadFiles_sectionCannotHaveFileUploads(): Verifies sections cannot have file uploadstestGetSubmissions_sectionsAreFilteredOut(): Verifies sections are filtered from exporttestNewSubmission_sectionsAreNotStored(): Verifies sections are not stored in answersSubmissionServiceTest.php
testGetSubmissionsData_sectionsAreFilteredOut(): Verifies sections are filtered from export datatestValidateSubmission_sectionsAreIgnored(): Verifies sections are ignored in validationtestValidateSubmission_sectionsCannotBeRequired(): Verifies sections cannot be required in validationFiles Changed
Backend Files
lib/Constants.php- Added section constantlib/ResponseDefinitions.php- Updated type definitionslib/Controller/ApiController.php- Added section validation and filteringlib/Service/SubmissionService.php- Added export filteringFrontend Files
src/components/Questions/QuestionSection.vue- New section componentsrc/components/Questions/Question.vue- Updated for section supportsrc/models/AnswerTypes.js- Added section typesrc/models/Constants.ts- Added section constantsrc/views/Create.vue- Updated component propssrc/views/Submit.vue- Updated validation and storage logicsrc/components/Results/ResultsSummary.vue- Updated results displaysrc/components/Results/Submission.vue- Updated submission handlingTest Files
tests/Unit/Controller/ApiControllerTest.php- Added section teststests/Unit/Service/SubmissionServiceTest.php- Added section testsScreenshots
Before
After
Breaking Changes
None. This is a purely additive feature that does not affect existing functionality.
Notes to Reviewers
Constants::ANSWER_TYPE_SECTIONon backend,ANSWER_TYPE_SECTIONon frontend)Related Issues
This PR implements the section functionality as requested in the technical specification.