ambari icon indicating copy to clipboard operation
ambari copied to clipboard

[AMBARI-25600] modify the default name of the cloned widget to match js verification.

Open echohlne opened this issue 5 years ago • 0 comments

What changes were proposed in this pull request?

After cloning an existing widget, try to edit the cloned widget name and find that even if nothing is modified, the save button cannot be clicked, prompting that the widget name is invalid.

as shows belows:

isValidWidgetName: function(value) {
 var widgetNameRegex = /^[\s0-9a-z_\-%]+$/i;
 return widgetNameRegex.test(value);
 }

The automatically generated widget name ends with (Copy), but the regular expression of widgetname does not support parentheses, which often confuses users, so we modified the default name of the cloned widget to match js verification.

How was this patch tested?

manual test works well.

echohlne avatar Dec 07 '20 17:12 echohlne