manageiq icon indicating copy to clipboard operation
manageiq copied to clipboard

Ability to customize validation failure message for custom dialog elements

Open bfilion87 opened this issue 2 years ago • 8 comments

Currently it is not possible to directly update the validation failure message within a custom dialog Text Box element. The default message is set to "Entered text should match the format:') + ' ' + regexPattern", would be awesome to be able to customize this message displayed to users.

bfilion87 avatar Nov 18 '21 15:11 bfilion87

@brandonfilion Can you copy that screenshot you had in gitter to here?


@akhilkr128 Can you take a look at this one? I dug in a little bit and found this unrelated but interesting bit in the kubevirt dialogs: https://github.com/ManageIQ/manageiq-providers-kubevirt/blob/0a0f34325f84a543502f6e8e7de9a2726d1c81bc/content/miq_dialogs/miq_provision_kubevirt_dialogs_template.yaml#L187-L188

It looks like the dialogs possibly already have a way to set a required_regex_fail_details key, but I'm not sure those can be used for custom dialogs which is what this is about. I think it would be a very useful feature to support this, though.

Here's the code using it: https://github.com/ManageIQ/manageiq/blob/9e063bb9152012e1b0232207a6f2ddecb7c8128d/app/models/miq_request_workflow/dialog_field_validation.rb#L34-L43

Fryguy avatar Nov 18 '21 23:11 Fryguy

image

bfilion87 avatar Nov 18 '21 23:11 bfilion87

Working on this will update the findings here.

akhilkr128 avatar Feb 02 '22 06:02 akhilkr128

@Fryguy. Yes, we can add a fail message option under validator field. Screenshot 2022-02-02 at 11 50 17 AM Working on this.

akhilkr128 avatar Feb 02 '22 06:02 akhilkr128

This change resides under the angular space https://github.com/ManageIQ/ui-components. I can see that we have a plan to change this view to react https://github.com/ManageIQ/manageiq-ui-classic/issues/7603. @Fryguy/ @chessbyte, do I need to wait for the react conversion? Or can I move forward with angular for now?

akhilkr128 avatar Mar 22 '22 12:03 akhilkr128

@Fryguy/ @chessbyte, do I need to wait for the react conversion? Or can I move forward with angular for now?

@kavyanekkalapu what are your thoughts on this?

chessbyte avatar Mar 22 '22 13:03 chessbyte

@akhilkr128 I would suggest to go a head and do it in angular. We have a long way to convert ui-components to react.

kavyanekkalapu avatar Mar 22 '22 13:03 kavyanekkalapu

Sure, I feel the same.

akhilkr128 avatar Mar 22 '22 13:03 akhilkr128

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

miq-bot avatar Feb 27 '23 00:02 miq-bot

This issue has been automatically closed because it has not been updated for at least 3 months.

Feel free to reopen this issue if this issue is still valid.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

miq-bot avatar May 29 '23 00:05 miq-bot