From d812972d3c7a722beb1e20442c5f8f44d69a3175 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Wed, 4 Mar 2020 08:24:20 -0500 Subject: [PATCH 1/2] Wrap credential help text at 110 chars --- .../src/screens/Template/shared/JobTemplateForm.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx b/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx index f9f68507cb..19ca4d3467 100644 --- a/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx +++ b/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx @@ -368,9 +368,11 @@ class JobTemplateForm extends Component { label={i18n._(t`Credentials`)} promptId="template-ask-credential-on-launch" promptName="ask_credential_on_launch" - tooltip={i18n._( - t`Select credentials that allow Tower to access the nodes this job will be ran against. You can only select one credential of each type. For machine credentials (SSH), checking "Prompt on launch" without selecting credentials will require you to select a machine credential at run time. If you select credentials and check "Prompt on launch", the selected credential(s) become the defaults that can be updated at run time.` - )} + tooltip={i18n._(t`Select credentials that allow Tower to access the nodes this job will be ran + against. You can only select one credential of each type. For machine credentials (SSH), + checking "Prompt on launch" without selecting credentials will require you to select a machine + credential at run time. If you select credentials and check "Prompt on launch", the selected + credential(s) become the defaults that can be updated at run time.`)} > {({ field }) => { From deaf2028ad6575e162d1ca8d64e068b4c2a8f358 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Wed, 4 Mar 2020 09:08:46 -0500 Subject: [PATCH 2/2] Request all types for multicred lookup --- .../Lookup/MultiCredentialsLookup.jsx | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.jsx b/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.jsx index 81601a687d..1bc80341b9 100644 --- a/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.jsx +++ b/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.jsx @@ -18,9 +18,24 @@ const QS_CONFIG = getQSConfig('credentials', { }); async function loadCredentialTypes() { - const { data } = await CredentialTypesAPI.read(); - const acceptableTypes = ['machine', 'cloud', 'net', 'ssh', 'vault']; - return data.results.filter(type => acceptableTypes.includes(type.kind)); + const pageSize = 200; + const acceptableKinds = ['machine', 'cloud', 'net', 'ssh', 'vault']; + // The number of credential types a user can have is unlimited. In practice, it is unlikely for + // users to have more than a page at the maximum request size. + const { + data: { next, results }, + } = await CredentialTypesAPI.read({ page_size: pageSize }); + let nextResults = []; + if (next) { + const { data } = await CredentialTypesAPI.read({ + page_size: pageSize, + page: 2, + }); + nextResults = data.results; + } + return results + .concat(nextResults) + .filter(type => acceptableKinds.includes(type.kind)); } async function loadCredentials(params, selectedCredentialTypeId) {