From 55e9db65282f124041dc66cfa0d51b2901db7c29 Mon Sep 17 00:00:00 2001 From: flokots Date: Tue, 2 Apr 2024 03:04:35 +0200 Subject: [PATCH] Add help text for edit instance form This commit adds help text to the Edit Instance form to describe the limitations of the text allowed in the name and description. The help text guides the maximum length for the instance name and description and advises against using special characters or leading or trailing spaces. By providing this information, users will be better informed when modifying instance details, reducing the likelihood of encountering errors. Closes-Bug: #1981165 Change-Id: If8879c20b2842c3dd769e4cdef80834219c637cd --- .../project/instances/workflows/update_instance.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openstack_dashboard/dashboards/project/instances/workflows/update_instance.py b/openstack_dashboard/dashboards/project/instances/workflows/update_instance.py index 4e06635411..896ac79fc2 100644 --- a/openstack_dashboard/dashboards/project/instances/workflows/update_instance.py +++ b/openstack_dashboard/dashboards/project/instances/workflows/update_instance.py @@ -68,13 +68,16 @@ class UpdateInstanceSecurityGroups(sg_base.BaseSecurityGroups): class UpdateInstanceInfoAction(workflows.Action): - name = forms.CharField(label=_("Name"), - max_length=255) + name = forms.CharField(label=_("Name"), max_length=255, help_text=_( + "Max 255 chars. Avoid special chars, leading or trailing spaces.") + ) description = forms.CharField( label=_("Description"), widget=forms.Textarea(attrs={'rows': 4}), max_length=255, - required=False + required=False, + help_text=_( + "Max 255 chars. Avoid special chars, leading or trailing spaces.") ) def __init__(self, request, *args, **kwargs):