Skip to content
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

Setting modification to address requests from UI_NEXT devs #14996

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions awx/api/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
default='',
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.'),
warning_text=_('Changing the redirect URL could impact the ability to login if local authentication is also disabled.'),
category=_('Authentication'),
category_slug='authentication',
)
Expand Down
2 changes: 2 additions & 0 deletions awx/api/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ def get_field_info(self, field):
field_info = OrderedDict()
field_info['type'] = self.label_lookup[field]
field_info['required'] = getattr(field, 'required', False)
field_info['hidden'] = getattr(field, 'hidden', False)

text_attrs = [
'read_only',
'label',
'help_text',
'warning_text',
'min_length',
'max_length',
'min_value',
Expand Down
1 change: 1 addition & 0 deletions awx/conf/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
# Optional; category_slug will be slugified version of category if not
# explicitly provided.
category_slug='cows',
hidden=True,
)


Expand Down
4 changes: 4 additions & 0 deletions awx/conf/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,23 @@ def get_setting_field(self, setting, mixin_class=None, for_user=False, **kwargs)
encrypted = bool(field_kwargs.pop('encrypted', False))
defined_in_file = bool(field_kwargs.pop('defined_in_file', False))
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:
field_kwargs['child'].source = None
field_instance = field_class(**field_kwargs)
field_instance.category_slug = category_slug
field_instance.category = category
field_instance.depends_on = depends_on
field_instance.unit = unit
field_instance.hidden = hidden
if placeholder is not empty:
field_instance.placeholder = placeholder
field_instance.defined_in_file = 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.encrypted = encrypted
field_instance.warning_text = warning_text
original_field_instance = field_instance
if field_class != original_field_class:
original_field_instance = original_field_class(**field_kwargs)
Expand Down
6 changes: 6 additions & 0 deletions awx/main/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
),
category=_('System'),
category_slug='system',
required=False,
)

register(
Expand Down Expand Up @@ -774,6 +775,7 @@
allow_null=True,
category=_('System'),
category_slug='system',
required=False,
)
register(
'AUTOMATION_ANALYTICS_LAST_ENTRIES',
Expand Down Expand Up @@ -815,6 +817,7 @@
help_text=_('Max jobs to allow bulk jobs to launch'),
category=_('Bulk Actions'),
category_slug='bulk',
hidden=True,
)

register(
Expand All @@ -825,6 +828,7 @@
help_text=_('Max number of hosts to allow to be created in a single bulk action'),
category=_('Bulk Actions'),
category_slug='bulk',
hidden=True,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these other settings being hidden?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are not being shown on the UI anyway, and currently its hard coded for the UI to not show these settings

UI_NEXT want this to be dynamic and be determined by the API response

)

register(
Expand All @@ -835,6 +839,7 @@
help_text=_('Max number of hosts to allow to be deleted in a single bulk action'),
category=_('Bulk Actions'),
category_slug='bulk',
hidden=True,
)

register(
Expand All @@ -845,6 +850,7 @@
help_text=_('Enable preview of new user interface.'),
category=_('System'),
category_slug='system',
hidden=True,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one thing I'm not getting from this is how this list of settings to hide came about. Will this just lead to complaints that we hid these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this field only gets read by UI_NEXT

on UI_NEXT itself we don't need to show enabling UI_NEXT

)

register(
Expand Down
2 changes: 2 additions & 0 deletions awx/ui/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
help_text=_('Maximum number of job events for the UI to retrieve within a single request.'),
category=_('UI'),
category_slug='ui',
hidden=True,
)

register(
Expand All @@ -68,4 +69,5 @@
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_slug='ui',
hidden=True,
)
Loading