mirror of
https://github.com/ansible/awx.git
synced 2026-04-14 06:29:25 -02:30
Setting modification to address requests from UI_NEXT devs (#14996)
Modification to settings - Add hidden to indicate to UI_NEXT to hide the field - Add warning_text to indicate to UI_NEXT to display the warning when specific setting is modified - Address some non required field being marked as required
This commit is contained in:
@@ -93,6 +93,7 @@ register(
|
|||||||
default='',
|
default='',
|
||||||
label=_('Login redirect override URL'),
|
label=_('Login redirect override URL'),
|
||||||
help_text=_('URL to which unauthorized users will be redirected to log in. If blank, users will be sent to the login page.'),
|
help_text=_('URL to which unauthorized users will be redirected to log in. If blank, users will be sent to the login page.'),
|
||||||
|
warning_text=_('Changing the redirect URL could impact the ability to login if local authentication is also disabled.'),
|
||||||
category=_('Authentication'),
|
category=_('Authentication'),
|
||||||
category_slug='authentication',
|
category_slug='authentication',
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -36,11 +36,13 @@ class Metadata(metadata.SimpleMetadata):
|
|||||||
field_info = OrderedDict()
|
field_info = OrderedDict()
|
||||||
field_info['type'] = self.label_lookup[field]
|
field_info['type'] = self.label_lookup[field]
|
||||||
field_info['required'] = getattr(field, 'required', False)
|
field_info['required'] = getattr(field, 'required', False)
|
||||||
|
field_info['hidden'] = getattr(field, 'hidden', False)
|
||||||
|
|
||||||
text_attrs = [
|
text_attrs = [
|
||||||
'read_only',
|
'read_only',
|
||||||
'label',
|
'label',
|
||||||
'help_text',
|
'help_text',
|
||||||
|
'warning_text',
|
||||||
'min_length',
|
'min_length',
|
||||||
'max_length',
|
'max_length',
|
||||||
'min_value',
|
'min_value',
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ register(
|
|||||||
# Optional; category_slug will be slugified version of category if not
|
# Optional; category_slug will be slugified version of category if not
|
||||||
# explicitly provided.
|
# explicitly provided.
|
||||||
category_slug='cows',
|
category_slug='cows',
|
||||||
|
hidden=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -127,6 +127,8 @@ class SettingsRegistry(object):
|
|||||||
encrypted = bool(field_kwargs.pop('encrypted', False))
|
encrypted = bool(field_kwargs.pop('encrypted', False))
|
||||||
defined_in_file = bool(field_kwargs.pop('defined_in_file', False))
|
defined_in_file = bool(field_kwargs.pop('defined_in_file', False))
|
||||||
unit = field_kwargs.pop('unit', None)
|
unit = field_kwargs.pop('unit', None)
|
||||||
|
hidden = field_kwargs.pop('hidden', False)
|
||||||
|
warning_text = field_kwargs.pop('warning_text', None)
|
||||||
if getattr(field_kwargs.get('child', None), 'source', None) is not None:
|
if getattr(field_kwargs.get('child', None), 'source', None) is not None:
|
||||||
field_kwargs['child'].source = None
|
field_kwargs['child'].source = None
|
||||||
field_instance = field_class(**field_kwargs)
|
field_instance = field_class(**field_kwargs)
|
||||||
@@ -134,12 +136,14 @@ class SettingsRegistry(object):
|
|||||||
field_instance.category = category
|
field_instance.category = category
|
||||||
field_instance.depends_on = depends_on
|
field_instance.depends_on = depends_on
|
||||||
field_instance.unit = unit
|
field_instance.unit = unit
|
||||||
|
field_instance.hidden = hidden
|
||||||
if placeholder is not empty:
|
if placeholder is not empty:
|
||||||
field_instance.placeholder = placeholder
|
field_instance.placeholder = placeholder
|
||||||
field_instance.defined_in_file = defined_in_file
|
field_instance.defined_in_file = defined_in_file
|
||||||
if field_instance.defined_in_file:
|
if field_instance.defined_in_file:
|
||||||
field_instance.help_text = str(_('This value has been set manually in a settings file.')) + '\n\n' + str(field_instance.help_text)
|
field_instance.help_text = str(_('This value has been set manually in a settings file.')) + '\n\n' + str(field_instance.help_text)
|
||||||
field_instance.encrypted = encrypted
|
field_instance.encrypted = encrypted
|
||||||
|
field_instance.warning_text = warning_text
|
||||||
original_field_instance = field_instance
|
original_field_instance = field_instance
|
||||||
if field_class != original_field_class:
|
if field_class != original_field_class:
|
||||||
original_field_instance = original_field_class(**field_kwargs)
|
original_field_instance = original_field_class(**field_kwargs)
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ register(
|
|||||||
),
|
),
|
||||||
category=_('System'),
|
category=_('System'),
|
||||||
category_slug='system',
|
category_slug='system',
|
||||||
|
required=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
register(
|
register(
|
||||||
@@ -774,6 +775,7 @@ register(
|
|||||||
allow_null=True,
|
allow_null=True,
|
||||||
category=_('System'),
|
category=_('System'),
|
||||||
category_slug='system',
|
category_slug='system',
|
||||||
|
required=False,
|
||||||
)
|
)
|
||||||
register(
|
register(
|
||||||
'AUTOMATION_ANALYTICS_LAST_ENTRIES',
|
'AUTOMATION_ANALYTICS_LAST_ENTRIES',
|
||||||
@@ -815,6 +817,7 @@ register(
|
|||||||
help_text=_('Max jobs to allow bulk jobs to launch'),
|
help_text=_('Max jobs to allow bulk jobs to launch'),
|
||||||
category=_('Bulk Actions'),
|
category=_('Bulk Actions'),
|
||||||
category_slug='bulk',
|
category_slug='bulk',
|
||||||
|
hidden=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
register(
|
register(
|
||||||
@@ -825,6 +828,7 @@ register(
|
|||||||
help_text=_('Max number of hosts to allow to be created in a single bulk action'),
|
help_text=_('Max number of hosts to allow to be created in a single bulk action'),
|
||||||
category=_('Bulk Actions'),
|
category=_('Bulk Actions'),
|
||||||
category_slug='bulk',
|
category_slug='bulk',
|
||||||
|
hidden=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
register(
|
register(
|
||||||
@@ -835,6 +839,7 @@ register(
|
|||||||
help_text=_('Max number of hosts to allow to be deleted in a single bulk action'),
|
help_text=_('Max number of hosts to allow to be deleted in a single bulk action'),
|
||||||
category=_('Bulk Actions'),
|
category=_('Bulk Actions'),
|
||||||
category_slug='bulk',
|
category_slug='bulk',
|
||||||
|
hidden=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
register(
|
register(
|
||||||
@@ -845,6 +850,7 @@ register(
|
|||||||
help_text=_('Enable preview of new user interface.'),
|
help_text=_('Enable preview of new user interface.'),
|
||||||
category=_('System'),
|
category=_('System'),
|
||||||
category_slug='system',
|
category_slug='system',
|
||||||
|
hidden=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
register(
|
register(
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ register(
|
|||||||
help_text=_('Maximum number of job events for the UI to retrieve within a single request.'),
|
help_text=_('Maximum number of job events for the UI to retrieve within a single request.'),
|
||||||
category=_('UI'),
|
category=_('UI'),
|
||||||
category_slug='ui',
|
category_slug='ui',
|
||||||
|
hidden=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
register(
|
register(
|
||||||
@@ -68,4 +69,5 @@ register(
|
|||||||
help_text=_('If disabled, the page will not refresh when events are received. Reloading the page will be required to get the latest details.'),
|
help_text=_('If disabled, the page will not refresh when events are received. Reloading the page will be required to get the latest details.'),
|
||||||
category=_('UI'),
|
category=_('UI'),
|
||||||
category_slug='ui',
|
category_slug='ui',
|
||||||
|
hidden=True,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user