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

Making verbosity list and options a constant and adding WinRM debug #12378

Merged
merged 4 commits into from
Jun 24, 2022

Conversation

john-westcott-iv
Copy link
Member

SUMMARY
ISSUE TYPE
  • Bug or Docs Fix
COMPONENT NAME
  • UI
AWX VERSION
awx: 21.1.1.dev84+gf042274bc5
ADDITIONAL INFORMATION

@nixocio nixocio self-requested a review June 15, 2022 13:36
Copy link
Member

@kialam kialam left a comment

Choose a reason for hiding this comment

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

This works as-is, however if you wanted to use just one constant variable instead of having to maintain two I would suggest creating a mapper function to return the value (label) you want for the details views.

@@ -12,3 +14,18 @@ export const SESSION_TIMEOUT_KEY = 'awx-session-timeout';
export const SESSION_REDIRECT_URL = 'awx-redirect-url';
export const PERSISTENT_FILTER_KEY = 'awx-persistent-filter';
export const SESSION_USER_ID = 'awx-session-user-id';

export const VERBOSITY = {
Copy link
Member

Choose a reason for hiding this comment

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

Good example of standardization here. If you wanted to just use one constant to represent Verbosity and it's permutations in the UI, I could see creating the object literal containing the key, value, and label keys and then calling a function to return the appropriate label when not used as an options dropdown.

export const getVerbosity = (key) => VERBOSITY.filter(v => v.key === key)
const [{ label }] = getVerbosity(verbosityKey);

You could probably just save both the constant and the function as one object literal itself.

Copy link
Contributor

@nixocio nixocio left a comment

Choose a reason for hiding this comment

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

Those strings are not being selected to be translated.

I followed up with @john-westcott-iv offline.

@AlexSCorey AlexSCorey requested a review from kialam June 22, 2022 15:38
@john-westcott-iv john-westcott-iv dismissed nixocio’s stale review June 22, 2022 20:11

Dismissing @nixocio's review to enable merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants