-
Notifications
You must be signed in to change notification settings - Fork 4
Handle creating a duplicate custom new metric #1154
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
Conversation
labkey-jeckels
left a comment
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.
Please add some simple automated test coverage for this scenario.
In manual testing, I confirmed that this fixed the custom metric error handling. There's a similar repro for trace metrics that we should also address here.
| // Check if metric name already exists | ||
| this.checkMetricNameExists(metricName, function (exists) { | ||
| if (exists) { | ||
| let errorMessage = 'A metric with the name "' + Ext4.util.Format.htmlEncode(metricName) + '" already exists. Please choose a different name.'; |
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.
Since you're using setText(), this ends up double-encoding.,
| } | ||
|
|
||
| private void addCustomMetric(String projectName, String metricName, String queryName) | ||
| private void addCustomMetric(String projectName, String metricName, String queryName, boolean checkForDuplicate) |
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.
Would duplicateNameErrorExpected be a better name for this parameter?
Rationale
https://github.com/LabKey/internal-issues/issues/591
Related Pull Requests
Changes