-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Asset Tag validation value #15429
base: develop
Are you sure you want to change the base?
Asset Tag validation value #15429
Conversation
Asset Tag validation value
Asset Tag validation error
PR Summary
|
@@ -26,6 +26,8 @@ | |||
'asset_report' => 'Asset Report', | |||
'asset_tag' => 'Asset Tag', | |||
'asset_tags' => 'Asset Tags', | |||
'asset_tag_error' => 'Asset Tag number must be less then', |
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.
We should just be able to use the standard validation translations here.
</div> | ||
<div class="col-md-2 col-sm-12"> | ||
<button class="add_field_button btn btn-default btn-sm"> | ||
<x-icon type="plus" /> | ||
<i class="fas fa-plus"></i> |
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.
I think you might need to rebase? This would overwrite the blade component stuff I did a few weeks ago
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.
I worked with previous version will check and update.
@@ -290,43 +290,213 @@ function user_add(status_id) { | |||
$(document).ready(function() { | |||
|
|||
var max_fields = 100; //maximum input boxes allowed | |||
var max_value = 100000000000; //maximum allowed value |
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.
How are you determining that number?
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.
It is maximum number where value is properly managed. Over it generated number can be incorrect.
box_html += '<div class="col-md-2 col-sm-12">'; | ||
box_html += '<a href="#" class="remove_field btn btn-default btn-sm"><x-icon type="minus" /></a>'; |
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.
Same regression for blade components here
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.
A few regressions here - but also I'm not 100% clear on what this is supposed to do. If you could clarify, I'd appreciate it!
Hello, are you asking about general purpose of function or some parts of code? |
IIRC, calculating the max there isn't as simple as just a numeric value - otherwise we'd have already put in that validation. (Per #14607) |
Description
This change add validation of Asset Tag value to prevent put incorrect data and keep consistence.
For enabled auto-incremental option:
proposed new asset tag is generated on the base system settings with next incremental value
if provided asset tag start with prefix, then validate if provided value is compliant
if asset tag not start with prefix, allowed is custom value
For not enabled auto-increment option:
Additionally:
max number of value is allowed up to 100000000000, above this value show error notification.
allowed edit only latest tag, previous one is switch to mode read-only to protect value.
Fixes #14829
Type of change
Test Configuration:
Checklist: