Form focused mode
Summary by CodeRabbit
Release Notes
-
New Features
- Introduced a new
formatfield for forms, allowing users to select between "Regular" and "Focused" formats. - Added a modal for confirming format changes, enhancing user experience.
- New components for handling focused format submissions and customization options.
- Enhanced form initialization with a default
formatproperty.
- Introduced a new
-
Bug Fixes
- Improved error handling and state management for form submissions.
-
Localization
- Added translations for navigation buttons ("Back" and "Next") in multiple languages including Arabic, English, Spanish, French, Hindi, Japanese, Portuguese, Chinese, Bengali, German, Indonesian, Korean, Marathi, Punjabi, Russian, Tamil, Telugu, Turkish, Urdu, and Vietnamese.
-
UI Enhancements
- Dynamic adjustments to form layouts and visibility based on selected formats.
- Improved visual feedback and styling in various components for better user interaction.
Walkthrough
The pull request introduces several changes to support a new format attribute in form handling. Key modifications include adding a validation rule for the format field in UserFormRequest, defining a new constant FORMATS in the Form model, and updating the database schema to include the format column. Additionally, new components and UI elements are created to manage and render forms based on the selected format, enhancing user interaction and experience.
Changes
| File Path | Change Summary |
|---|---|
api/app/Http/Requests/UserFormRequest.php |
Added validation rule for format field: 'format' => ['required', Rule::in(Form::FORMATS)]. |
api/app/Models/Forms/Form.php |
Introduced constant FORMATS with values ['regular', 'focused'] and added format to the fillable property. |
api/database/factories/FormFactory.php |
Updated definition() method to include 'format' => 'regular'. |
api/database/migrations/2024_12_04_163142_add_format_to_forms_table.php |
Added migration to introduce format column to forms table with default value 'regular'. |
client/components/open/editors/FormatChangeModal.vue |
Created modal component for confirming format changes, includes dynamic block removal message and confirmation buttons. |
client/components/open/forms/OpenCompleteForm.vue |
Added conditional rendering for OpenFormFocused based on form.format. |
client/components/open/forms/OpenForm.vue |
Added null check for previousFields in previousFieldsPageBreak computed property. |
client/components/open/forms/OpenFormFocused.vue |
Introduced new component for focused form submissions, includes pagination and validation features. |
client/components/open/forms/components/form-components/AddFormBlock.vue |
Added isFocused computed property to filter layout blocks based on form format. |
client/components/open/forms/components/form-components/FormCustomization.vue |
Added format selection feature with FlatSelectInput and modal integration. |
client/components/open/forms/components/form-components/FormEditorPreview.vue |
Introduced isFocused computed property for dynamic height adjustments in form preview. |
client/pages/forms/[slug]/index.vue |
Added dynamic class binding for layout based on isFocused state. |
client/pages/forms/create/CreateFormBaseModal.vue |
Added form prop to create-form-base-modal component for direct form data access. |
client/i18n/lang/ar.json |
Added Arabic translations for "Back" and "Next". |
client/i18n/lang/en.json |
Added English translations for "Back" and "Next". |
client/i18n/lang/es.json |
Added Spanish translations for "Back" and "Next". |
client/i18n/lang/fr.json |
Added French translations for "Back" and "Next". |
client/i18n/lang/hi.json |
Added Hindi translations for "Back" and "Next". |
client/i18n/lang/ja.json |
Added Japanese translations for "Back" and "Next". |
client/i18n/lang/pt.json |
Added Portuguese translations for "Back" and "Next". |
client/i18n/lang/zh.json |
Added Chinese translations for "Back" and "Next". |
client/i18n/lang/bn.json |
Added Bengali translations for "Back" and "Next". |
client/i18n/lang/de.json |
Added German translations for "Back" and "Next". |
client/i18n/lang/jv.json |
Added Indonesian translations for "Back" and "Next". |
client/i18n/lang/ko.json |
Added Korean translations for "Back" and "Next". |
client/i18n/lang/mr.json |
Added Marathi translations for "Back" and "Next". |
client/i18n/lang/pa.json |
Added Punjabi translations for "Back" and "Next". |
client/i18n/lang/ru.json |
Added Russian translations for "Back" and "Next". |
client/i18n/lang/ta.json |
Added Tamil translations for "Back" and "Next". |
client/i18n/lang/te.json |
Added Telugu translations for "Back" and "Next". |
client/i18n/lang/tr.json |
Added Turkish translations for "Back" and "Next". |
client/i18n/lang/ur.json |
Added Urdu translations for "Back" and "Next". |
client/i18n/lang/vi.json |
Added Vietnamese translations for "Back" and "Next". |
Possibly related PRs
-
#580: The changes in
OpenForm.vueinvolve modifications to the form handling logic, which may interact with the newformatfield introduced in the main PR. -
#583: The updates in
OpenCompleteForm.vuerefine the rendering logic based on form states, which could be relevant to the new validation rules for theformatfield in the main PR.
Poem
🐰 In the fields where forms do play,
A newformatjoins the fray.
With modals bright and buttons clear,
Users hop with joy and cheer!
From regular to focused view,
Every change brings something new! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Generate unit testing code for this file. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and generate unit testing code. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. (Beta) -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Closing for now - will work on this later.