snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Added the option to make Asset serials required and error messages

Open Godmartinz opened this issue 8 months ago • 6 comments

Description

So this adds a validation rule require_serial. This makes a serial required or nullable based on a boolean in the settings:

image adds an error and message for required and unique options being selected if there are serials that are not filled or unique.

Unique error: image Required error: image

Fixes #FD-41625

Type of change

Please delete options that are not relevant.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [ ] Test A
  • [ ] Test B

Test Configuration:

  • PHP version:
  • MySQL version
  • Webserver version
  • OS version

Checklist:

  • [ ] I have read the Contributing documentation available here: https://snipe-it.readme.io/docs/contributing-overview
  • [ ] I have formatted this PR according to the project guidelines: https://snipe-it.readme.io/docs/contributing-overview#pull-request-guidelines
  • [ ] My code follows the style guidelines of this project
  • [ ] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally with my changes

Godmartinz avatar Jun 24 '24 22:06 Godmartinz