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

Feature: Custom Form #300

Merged
merged 18 commits into from Jan 12, 2024
Merged

Feature: Custom Form #300

merged 18 commits into from Jan 12, 2024

Conversation

Xinecraft
Copy link
Member

@Xinecraft Xinecraft commented Dec 25, 2023

Todo

  1. Implement Custom Form Feature.
  2. Implement Notification for Custom Form.
  3. Add Custom Form information in Docs (minetrax.github.io).

Summary by CodeRabbit

  • New Feature: Introduced a comprehensive custom form handling system, including form creation, update, submission, and management.
  • New Feature: Added "Forms" to the navigation settings for easy access.
  • New Feature: Implemented event-driven notifications for new form submissions to notify staff members.
  • New Feature: Expanded authorization policies for several models including Badge, Comment, CustomForm, Download, News, Poll, Post, Rank, Server, Session, and Shout.
  • Refactor: Updated TelescopeServiceProvider to unconditionally track all entries and hide sensitive request headers.
  • Bug Fix: Ensured platform_version is set to null when platform value is not available in SessionController.
  • New Feature: Enhanced ThemeSettings with additional properties for better customization.

Copy link

github-actions bot commented Dec 25, 2023

Image description CodeRabbit

Walkthrough

This pull request introduces a comprehensive custom form handling feature, including models, controllers, policies, and database changes. It also includes updates to the user interface components, enhances security by hiding sensitive headers, refines notification management, and expands theme settings.

Changes

Files Summary
app/Enums/CustomFormStatus.php, app/Http/Controllers/Admin/CustomFormController.php, app/Http/Requests/CreateCustomFormRequest.php, app/Models/CustomForm.php, database/factories/CustomFormFactory.php, database/migrations/2023_12_23_062302_create_custom_forms_table.php Introduced a new feature for handling custom forms, including classes for form status enumeration, controllers for managing forms, request classes for form creation and update validation, models for the forms, and related changes to the database.
public/build/assets/AfterCreateSteps-7c3259f9.js, public/build/assets/PlayersMinecraftVersionMetricBox-6e4896e6.js Updated UI components with new instructions and module path changes.
app/Providers/TelescopeServiceProvider.php Enhanced security by unconditionally allowing all entries to be tracked and hiding sensitive request headers.
app/Http/Controllers/Admin/SessionController.php, app/Http/Controllers/NotificationController.php Refined notification management by adding validation rules and modifying retrieval methods.
app/Models/User.php, app/Policies/CustomPagePolicy.php, app/Providers/AuthServiceProvider.php, app/Settings/ThemeSettings.php Expanded theme settings with new properties and added a method to retrieve maximum role weight. Also, updated authorization policies for several models.

"With every line of code, we weave a tale,
Of forms and themes, where no detail is frail.
Security tightened, notifications refined,
In every corner, improvements you'll find.
So here's to the changes, big and small,
May our code be strong, and never fall! 🎉🐇"


Uplevel your code reviews with CodeRabbit Pro

CodeRabbit Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between cbeb8a6 and 22b5f46 commits.
Files selected (23)
  • app/Enums/CustomFormStatus.php (1)
  • app/Http/Controllers/Admin/CustomFormController.php (1)
  • app/Http/Controllers/Admin/Settings/NavigationSettingController.php (2)
  • app/Http/Controllers/CustomFormController.php (1)
  • app/Http/Requests/CreateCustomFormRequest.php (1)
  • app/Http/Requests/UpdateCustomFormRequest.php (1)
  • app/Models/CustomForm.php (1)
  • app/Models/CustomFormSubmission.php (1)
  • app/Policies/CustomFormPolicy.php (1)
  • app/Providers/AuthServiceProvider.php (3)
  • config/app.php (1)
  • config/constants.php (1)
  • database/factories/CustomFormFactory.php (1)
  • database/migrations/2023_12_23_062302_create_custom_forms_table.php (1)
  • database/migrations/2023_12_23_062852_create_custom_form_submissions_table.php (1)
  • database/seeders/PermissionSeeder.php (1)
  • database/seeders/RoleSeeder.php (1)
  • formkit.config.js (1)
  • public/build/assets/AdminLayout-3d8543c9.js (1)
  • public/build/assets/AdminLayout-ea4e1499.js (1)
  • public/build/assets/AfterCreateSteps-7c3259f9.js (1)
  • public/build/assets/AfterCreateSteps-ee329dc2.js (1)
  • public/build/assets/PlayersMinecraftVersionMetricBox-6e4896e6.js (1)
Files ignored due to filter (3)
  • package-lock.json
  • package.json
  • public/build/manifest.json
Files not summarized due to errors (2)
  • public/build/assets/AdminLayout-3d8543c9.js (diff tokens exceeds limit)
  • public/build/assets/AdminLayout-ea4e1499.js (diff tokens exceeds limit)
Files not reviewed due to errors (3)
  • app/Http/Requests/UpdateCustomFormRequest.php (no response)
  • app/Providers/AuthServiceProvider.php (no response)
  • public/build/assets/AfterCreateSteps-7c3259f9.js (no response)
Files skipped from review due to trivial changes (13)
  • app/Enums/CustomFormStatus.php
  • app/Http/Requests/CreateCustomFormRequest.php
  • app/Models/CustomForm.php
  • app/Models/CustomFormSubmission.php
  • config/app.php
  • config/constants.php
  • database/factories/CustomFormFactory.php
  • database/seeders/PermissionSeeder.php
  • database/seeders/RoleSeeder.php
  • formkit.config.js
  • public/build/assets/AfterCreateSteps-ee329dc2.js
  • public/build/assets/AdminLayout-3d8543c9.js (diff too large)
  • public/build/assets/AdminLayout-ea4e1499.js (diff too large)
Review comments generated (22)
  • Review: 17
  • LGTM: 5

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

app/Http/Controllers/CustomFormController.php Outdated Show resolved Hide resolved
app/Http/Controllers/CustomFormController.php Outdated Show resolved Hide resolved
app/Http/Controllers/CustomFormController.php Outdated Show resolved Hide resolved
app/Http/Controllers/Admin/CustomFormController.php Outdated Show resolved Hide resolved
app/Http/Controllers/Admin/CustomFormController.php Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 22b5f46 and 5442ab3 commits.
Files selected (12)
  • app/Http/Controllers/Admin/CustomFormController.php (1)
  • app/Http/Controllers/CustomFormController.php (1)
  • app/Http/Requests/CreateCustomFormRequest.php (1)
  • app/Http/Requests/UpdateCustomFormRequest.php (1)
  • app/Models/CustomForm.php (1)
  • app/Models/CustomFormSubmission.php (1)
  • app/Models/User.php (1)
  • app/Policies/CustomFormPolicy.php (1)
  • app/Providers/AuthServiceProvider.php (2)
  • database/migrations/2023_12_23_062302_create_custom_forms_table.php (1)
  • database/migrations/2023_12_23_062852_create_custom_form_submissions_table.php (1)
  • database/seeders/PermissionSeeder.php (1)
Files not reviewed due to errors (2)
  • app/Http/Requests/UpdateCustomFormRequest.php (no response)
  • app/Http/Controllers/Admin/CustomFormController.php (no response)
Files skipped from review due to trivial changes (4)
  • app/Http/Controllers/CustomFormController.php
  • app/Models/CustomFormSubmission.php
  • app/Models/User.php
  • database/seeders/PermissionSeeder.php
Review comments generated (10)
  • Review: 5
  • LGTM: 5

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

app/Providers/AuthServiceProvider.php Outdated Show resolved Hide resolved
app/Policies/CustomFormPolicy.php Show resolved Hide resolved
app/Policies/CustomFormPolicy.php Show resolved Hide resolved
app/Http/Requests/CreateCustomFormRequest.php Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 5442ab3 and a19c653 commits.
Files selected (8)
  • app/Http/Controllers/Admin/CustomFormController.php (1)
  • app/Http/Controllers/CustomFormController.php (1)
  • app/Http/Requests/CreateCustomFormRequest.php (1)
  • app/Http/Requests/UpdateCustomFormRequest.php (1)
  • app/Models/CustomForm.php (1)
  • app/Providers/TelescopeServiceProvider.php (2)
  • app/View/Components/PhpVarsToJsTransformer.php (1)
  • database/migrations/2023_12_23_062302_create_custom_forms_table.php (1)
Files skipped from review due to trivial changes (2)
  • app/Http/Controllers/Admin/CustomFormController.php
  • app/View/Components/PhpVarsToJsTransformer.php
Review comments generated (8)
  • Review: 7
  • LGTM: 1

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

app/Http/Requests/CreateCustomFormRequest.php Show resolved Hide resolved
app/Models/CustomForm.php Outdated Show resolved Hide resolved
app/Http/Controllers/CustomFormController.php Outdated Show resolved Hide resolved
app/Http/Requests/UpdateCustomFormRequest.php Show resolved Hide resolved
app/Http/Requests/UpdateCustomFormRequest.php Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between a19c653 and 3ea94e7 commits.
Files selected (24)
  • app/Events/CustomFormSubmissionCreated.php (1)
  • app/Http/Controllers/Admin/CustomFormController.php (1)
  • app/Http/Controllers/Admin/CustomFormSubmissionController.php (1)
  • app/Http/Controllers/Admin/SessionController.php (1)
  • app/Http/Controllers/CustomFormController.php (1)
  • app/Http/Controllers/NotificationController.php (2)
  • app/Http/Controllers/PlayerController.php (2)
  • app/Jobs/CalculatePlayersRatingJob.php (5)
  • app/Listeners/NotifyStaffOnCustomFormSubmission.php (1)
  • app/Models/CustomForm.php (1)
  • app/Models/CustomFormSubmission.php (1)
  • app/Models/User.php (1)
  • app/Notifications/CustomFormSubmissionCreatedNotification.php (1)
  • app/Policies/CustomFormSubmissionPolicy.php (1)
  • app/Policies/CustomPagePolicy.php (7)
  • app/Providers/AuthServiceProvider.php (2)
  • app/Providers/EventServiceProvider.php (2)
  • app/Providers/TelescopeServiceProvider.php (3)
  • app/Settings/ThemeSettings.php (1)
  • config/inertia.php (1)
  • database/migrations/2023_12_23_062852_create_custom_form_submissions_table.php (1)
  • public/build/assets/AdminLayout-ad7cd5a5.js (1)
  • public/build/assets/AfterCreateSteps-6a13ed31.js (1)
  • public/build/assets/PlayersMinecraftVersionMetricBox-85e9ca8c.js (1)
Files ignored due to filter (1)
  • public/build/manifest.json
Files not summarized due to errors (1)
  • public/build/assets/AdminLayout-ad7cd5a5.js (diff tokens exceeds limit)
Files not reviewed due to errors (7)
  • app/Listeners/NotifyStaffOnCustomFormSubmission.php (no response)
  • app/Http/Controllers/Admin/CustomFormSubmissionController.php (no response)
  • app/Notifications/CustomFormSubmissionCreatedNotification.php (no response)
  • app/Policies/CustomFormSubmissionPolicy.php (no response)
  • app/Policies/CustomPagePolicy.php (no response)
  • app/Settings/ThemeSettings.php (no response)
  • database/migrations/2023_12_23_062852_create_custom_form_submissions_table.php (no response)
Files skipped from review due to trivial changes (7)
  • app/Http/Controllers/Admin/CustomFormController.php
  • app/Http/Controllers/Admin/SessionController.php
  • app/Http/Controllers/PlayerController.php
  • app/Jobs/CalculatePlayersRatingJob.php
  • app/Models/User.php
  • app/Providers/EventServiceProvider.php
  • public/build/assets/AdminLayout-ad7cd5a5.js (diff too large)
Review comments generated (16)
  • Review: 10
  • LGTM: 6

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

app/Events/CustomFormSubmissionCreated.php Show resolved Hide resolved
app/Http/Controllers/CustomFormController.php Show resolved Hide resolved
app/Http/Controllers/CustomFormController.php Show resolved Hide resolved
app/Http/Controllers/CustomFormController.php Show resolved Hide resolved
app/Providers/AuthServiceProvider.php Show resolved Hide resolved
app/Providers/AuthServiceProvider.php Show resolved Hide resolved
config/inertia.php Show resolved Hide resolved
app/Providers/TelescopeServiceProvider.php Show resolved Hide resolved
app/Providers/TelescopeServiceProvider.php Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 3ea94e7 and ba1c3c6 commits.
Files selected (2)
  • app/View/Components/PhpVarsToJsTransformer.php (1)
  • config/minetrax.php (1)
Files skipped from review due to trivial changes (2)
  • app/View/Components/PhpVarsToJsTransformer.php
  • config/minetrax.php
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

@Xinecraft Xinecraft self-assigned this Jan 11, 2024
@Xinecraft Xinecraft changed the title WiP: Custom Form Feature: Custom Form Jan 11, 2024
@Xinecraft Xinecraft merged commit 4871c69 into main Jan 12, 2024
3 checks passed
@Xinecraft Xinecraft deleted the feature/custom-form branch February 11, 2024 19:54
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.

None yet

1 participant