From af7ec17ccddf840908fa90c18cdfa8395b9064d6 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Fri, 25 May 2018 17:21:43 -0400 Subject: [PATCH 1/3] fix a few minor issues that have broken the User Token creation see: https://github.com/ansible/tower/issues/1928 --- awx/api/serializers.py | 2 +- .../features/users/tokens/users-tokens-add.controller.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index ebe019ddb9..9a27eadf0c 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -1073,7 +1073,7 @@ class UserAuthorizedTokenSerializer(BaseOAuth2TokenSerializer): validated_data['expires'] = now() + timedelta( seconds=settings.OAUTH2_PROVIDER['ACCESS_TOKEN_EXPIRE_SECONDS'] ) - obj = super(OAuth2TokenSerializer, self).create(validated_data) + obj = super(UserAuthorizedTokenSerializer, self).create(validated_data) obj.save() if obj.application is not None: RefreshToken.objects.create( diff --git a/awx/ui/client/features/users/tokens/users-tokens-add.controller.js b/awx/ui/client/features/users/tokens/users-tokens-add.controller.js index 1421077b1c..8e01fe5a3f 100644 --- a/awx/ui/client/features/users/tokens/users-tokens-add.controller.js +++ b/awx/ui/client/features/users/tokens/users-tokens-add.controller.js @@ -42,11 +42,11 @@ function AddTokensController ( required: true, _component: 'at-input-select', _data: [ - strings.get('add.SCOPE_PLACEHOLDER'), - strings.get('add.SCOPE_READ_LABEL'), - strings.get('add.SCOPE_WRITE_LABEL') + { label: strings.get('add.SCOPE_PLACEHOLDER'), value: '' }, + { label: strings.get('add.SCOPE_READ_LABEL'), value: 'read' }, + { label: strings.get('add.SCOPE_WRITE_LABEL'), value: 'write' } ], - _exp: 'choice for (index, choice) in state._data', + _exp: 'choice.value as choice.label for (index, choice) in state._data', _format: 'array' }; From 9d87f8527509a24c9accddaf0c3d26f4c39e4353 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Fri, 25 May 2018 20:06:58 -0400 Subject: [PATCH 2/3] fix wording of search keys --- awx/ui/client/features/output/output.strings.js | 2 +- awx/ui/client/src/shared/smart-search/smart-search.partial.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/features/output/output.strings.js b/awx/ui/client/features/output/output.strings.js index f7b0a20565..a3fb2458e3 100644 --- a/awx/ui/client/features/output/output.strings.js +++ b/awx/ui/client/features/output/output.strings.js @@ -73,7 +73,7 @@ function OutputStrings (BaseString) { ns.search = { ADDITIONAL_INFORMATION_HEADER: t.s('ADDITIONAL_INFORMATION'), - ADDITIONAL_INFORMATION: t.s('For additional information on advanced search search syntax please see the Ansible Tower'), + ADDITIONAL_INFORMATION: t.s('For additional information on advanced search syntax please see the Ansible Tower'), CLEAR_ALL: t.s('CLEAR ALL'), DOCUMENTATION: t.s('documentation'), EXAMPLES: t.s('EXAMPLES'), diff --git a/awx/ui/client/src/shared/smart-search/smart-search.partial.html b/awx/ui/client/src/shared/smart-search/smart-search.partial.html index a44a90f649..04615f9460 100644 --- a/awx/ui/client/src/shared/smart-search/smart-search.partial.html +++ b/awx/ui/client/src/shared/smart-search/smart-search.partial.html @@ -49,7 +49,7 @@
{{ 'ADDITIONAL INFORMATION' | translate }}: - {{ 'For additional information on advanced search search syntax please see the Ansible Tower' | translate }} + {{ 'For additional information on advanced search syntax please see the Ansible Tower' | translate }} {{ 'documentation' | translate }}.
From 5d0a131530b0adc5bc89316641116aa82f3cff5e Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Tue, 29 May 2018 16:29:14 -0400 Subject: [PATCH 3/3] Add credential tags to job details --- awx/ui/client/features/output/_index.less | 2 + .../features/output/details.component.js | 24 +++++----- .../features/output/details.partial.html | 17 ++++--- .../features/output/search.partial.html | 2 +- awx/ui/client/lib/components/list/_index.less | 1 - awx/ui/client/lib/components/tag/_index.less | 48 ++++++++++++------- .../lib/components/tag/tag.directive.js | 2 + .../lib/components/tag/tag.partial.html | 4 +- 8 files changed, 63 insertions(+), 37 deletions(-) diff --git a/awx/ui/client/features/output/_index.less b/awx/ui/client/features/output/_index.less index a41721dd37..8ca2c8a5d0 100644 --- a/awx/ui/client/features/output/_index.less +++ b/awx/ui/client/features/output/_index.less @@ -366,6 +366,8 @@ } .JobResults-resultRowText { + display: flex; + flex-flow: row wrap; width: ~"calc(70% - 20px)"; flex: 1 0 auto; text-transform: none; diff --git a/awx/ui/client/features/output/details.component.js b/awx/ui/client/features/output/details.component.js index 512e68985a..03fd2f9d02 100644 --- a/awx/ui/client/features/output/details.component.js +++ b/awx/ui/client/features/output/details.component.js @@ -389,27 +389,29 @@ function getResultTracebackDetails () { } function getCredentialDetails () { - const credential = resource.model.get('summary_fields.credential'); + const credentials = resource.model.get('summary_fields.credentials'); - if (!credential) { + let credentialTags = []; + + if (!credentials || credentials.length < 1) { return null; } - let label = strings.get('labels.CREDENTIAL'); + credentialTags = credentials.map((cred) => buildCredentialDetails(cred)); - if (resource.type === 'playbook') { - label = strings.get('labels.MACHINE_CREDENTIAL'); - } + const label = strings.get('labels.CREDENTIAL'); + const value = credentialTags; - if (resource.type === 'inventory') { - label = strings.get('labels.SOURCE_CREDENTIAL'); - } + return { label, value }; +} +function buildCredentialDetails (credential) { + const icon = `${credential.kind}`; const link = `/#/credentials/${credential.id}`; const tooltip = strings.get('tooltips.CREDENTIAL'); const value = $filter('sanitize')(credential.name); - return { label, link, tooltip, value }; + return { icon, link, tooltip, value }; } function getForkDetails () { @@ -679,7 +681,7 @@ function JobDetailsController ( vm.launchedBy = getLaunchedByDetails(); vm.jobExplanation = getJobExplanationDetails(); vm.verbosity = getVerbosityDetails(); - vm.credential = getCredentialDetails(); + vm.credentials = getCredentialDetails(); vm.forks = getForkDetails(); vm.limit = getLimitDetails(); vm.instanceGroup = getInstanceGroupDetails(); diff --git a/awx/ui/client/features/output/details.partial.html b/awx/ui/client/features/output/details.partial.html index 1913c4c074..47f538a44c 100644 --- a/awx/ui/client/features/output/details.partial.html +++ b/awx/ui/client/features/output/details.partial.html @@ -216,15 +216,18 @@ -
- +
+
- - {{ vm.credential.value }} - + data-tip-watch="credential.tooltip"> +
diff --git a/awx/ui/client/features/output/search.partial.html b/awx/ui/client/features/output/search.partial.html index ff2a49e73a..702b4749b3 100644 --- a/awx/ui/client/features/output/search.partial.html +++ b/awx/ui/client/features/output/search.partial.html @@ -37,7 +37,7 @@
-
+
diff --git a/awx/ui/client/lib/components/list/_index.less b/awx/ui/client/lib/components/list/_index.less index 08b39d8f05..321631559a 100644 --- a/awx/ui/client/lib/components/list/_index.less +++ b/awx/ui/client/lib/components/list/_index.less @@ -170,7 +170,6 @@ } .at-RowItem-tag { - text-transform: uppercase; font-weight: 100; background-color: @at-color-list-row-item-tag-background; border-radius: @at-border-radius; diff --git a/awx/ui/client/lib/components/tag/_index.less b/awx/ui/client/lib/components/tag/_index.less index 1fa4f5ace5..5fa309c106 100644 --- a/awx/ui/client/lib/components/tag/_index.less +++ b/awx/ui/client/lib/components/tag/_index.less @@ -1,8 +1,6 @@ -.TagComponentWrapper { - padding: @at-space; -} .TagComponent { - color: white; + color: @at-white; + cursor: default; background: @at-blue; border-radius: @at-space; font-size: 12px; @@ -12,30 +10,48 @@ min-height: @at-space-4x; overflow: hidden; max-width: 200px; + margin: @at-space; } .TagComponent-name { + color: @at-white; margin: 2px @at-space-2x; align-self: center; word-break: break-word; text-transform: lowercase; -} -.TagComponent--cloud { - &:before { - content: '\f0c2'; - color: white; - height: @at-space-4x; - width: @at-space-4x; + &:hover, + &:focus { + color: @at-white; } } -.TagComponent--key { - &:before { +.TagComponent-icon { + line-height: 20px; + margin-left: @at-space-2x; + + &--cloud:before { + content: '\f0c2'; + } + + &--insights:before { + content: '\f129'; + } + + &--net:before { + content: '\f0e8'; + } + + &--scm:before { + content: '\f126'; + } + + &--ssh:before { content: '\f084'; - color: white; - height: @at-space-4x; - width: @at-space-4x; + } + + &--vault:before { + content: '\f187'; } } diff --git a/awx/ui/client/lib/components/tag/tag.directive.js b/awx/ui/client/lib/components/tag/tag.directive.js index 0616bb5e0d..f18ae9dce9 100644 --- a/awx/ui/client/lib/components/tag/tag.directive.js +++ b/awx/ui/client/lib/components/tag/tag.directive.js @@ -8,6 +8,8 @@ function atTag () { templateUrl, scope: { tag: '=', + icon: '@?', + link: '@?', removeTag: '&?', }, }; diff --git a/awx/ui/client/lib/components/tag/tag.partial.html b/awx/ui/client/lib/components/tag/tag.partial.html index ba7fbada4f..f16da4da42 100644 --- a/awx/ui/client/lib/components/tag/tag.partial.html +++ b/awx/ui/client/lib/components/tag/tag.partial.html @@ -1,5 +1,7 @@
-
{{ tag }}
+
+ {{ tag }} +
{{ tag }}