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

Add new validator for custom field checkboxes and fix asset model default updates #14369

Merged
merged 25 commits into from Mar 26, 2024

Conversation

spencerrlongg
Copy link
Collaborator

@spencerrlongg spencerrlongg commented Mar 5, 2024

Description

This adds a new validator for checkboxes, as well as adding support for submitting an array for checkbox options through the API.

This also removes the option to encrypt new checkbox custom fields after a conversation with the team.

Tests are included, but not working yet. After a conversation with @marcusmoore there's an issue with the AssetModel factory (if I'm remembering correctly) preventing custom fields from being properly testable, I left the tests in the PR but commented to serve as a reminder to get that fixed and leave them there for future un-commenting.

****Removed the commented tests because they were making all tests fail for some reason, I have them locally so we can re-implement when the factory issue is resolved.

Fixes #SC-24343

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

image image

Test Configuration:

  • PHP version: 8.1
  • MySQL version 8.2

Copy link

Copy link

what-the-diff bot commented Mar 5, 2024

PR Summary

  • Enhanced Checkbox Handling in Assets Management
    Adjusted the AssetsController file to manage checkboxes better by encoding and decoding their values and changing arrays into strings for simpler handling.

  • Updated Model Import Statement
    Modified the import statement for the CustomField model in the AssetModelsController file.

  • Validation Enhancements in Custom Fieldset
    Augmented the CustomFieldset file to ensure checkbox values are part of the provided options by performing additional validation.

  • Improved Checkbox Validation in Service Provider
    The ValidationServiceProvider file now includes code for better validation of checkboxes, ensuring the submitted values match the provided options.

  • Added New Error Message for Checkbox Validation
    Introduced a new error message for the “checkboxes” validation rule in the validation language file.

@spencerrlongg spencerrlongg marked this pull request as ready for review March 9, 2024 03:20
@spencerrlongg spencerrlongg changed the title [WIP] Add new validator for custom field checkboxes and fix asset model default updates Add new validator for custom field checkboxes and fix asset model default updates Mar 9, 2024
@spencerrlongg
Copy link
Collaborator Author

@snipe friendly poke

@spencerrlongg
Copy link
Collaborator Author

per @snipe adding some validation for radio buttons as well, please hold

@spencerrlongg
Copy link
Collaborator Author

alright, added @snipe

@snipe snipe merged commit 850f85f into snipe:develop Mar 26, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants