Merge branch 'release_3.3.0' into fixTokenScopeAddInUI

This commit is contained in:
Ryan Petrello
2018-05-30 10:18:56 -04:00
committed by GitHub
11 changed files with 66 additions and 40 deletions

View File

@@ -1073,7 +1073,7 @@ class UserAuthorizedTokenSerializer(BaseOAuth2TokenSerializer):
validated_data['expires'] = now() + timedelta( validated_data['expires'] = now() + timedelta(
seconds=settings.OAUTH2_PROVIDER['ACCESS_TOKEN_EXPIRE_SECONDS'] seconds=settings.OAUTH2_PROVIDER['ACCESS_TOKEN_EXPIRE_SECONDS']
) )
obj = super(OAuth2TokenSerializer, self).create(validated_data) obj = super(UserAuthorizedTokenSerializer, self).create(validated_data)
obj.save() obj.save()
if obj.application is not None: if obj.application is not None:
RefreshToken.objects.create( RefreshToken.objects.create(

View File

@@ -366,6 +366,8 @@
} }
.JobResults-resultRowText { .JobResults-resultRowText {
display: flex;
flex-flow: row wrap;
width: ~"calc(70% - 20px)"; width: ~"calc(70% - 20px)";
flex: 1 0 auto; flex: 1 0 auto;
text-transform: none; text-transform: none;

View File

@@ -389,27 +389,29 @@ function getResultTracebackDetails () {
} }
function getCredentialDetails () { 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; return null;
} }
let label = strings.get('labels.CREDENTIAL'); credentialTags = credentials.map((cred) => buildCredentialDetails(cred));
if (resource.type === 'playbook') { const label = strings.get('labels.CREDENTIAL');
label = strings.get('labels.MACHINE_CREDENTIAL'); const value = credentialTags;
}
if (resource.type === 'inventory') { return { label, value };
label = strings.get('labels.SOURCE_CREDENTIAL'); }
}
function buildCredentialDetails (credential) {
const icon = `${credential.kind}`;
const link = `/#/credentials/${credential.id}`; const link = `/#/credentials/${credential.id}`;
const tooltip = strings.get('tooltips.CREDENTIAL'); const tooltip = strings.get('tooltips.CREDENTIAL');
const value = $filter('sanitize')(credential.name); const value = $filter('sanitize')(credential.name);
return { label, link, tooltip, value }; return { icon, link, tooltip, value };
} }
function getForkDetails () { function getForkDetails () {
@@ -679,7 +681,7 @@ function JobDetailsController (
vm.launchedBy = getLaunchedByDetails(); vm.launchedBy = getLaunchedByDetails();
vm.jobExplanation = getJobExplanationDetails(); vm.jobExplanation = getJobExplanationDetails();
vm.verbosity = getVerbosityDetails(); vm.verbosity = getVerbosityDetails();
vm.credential = getCredentialDetails(); vm.credentials = getCredentialDetails();
vm.forks = getForkDetails(); vm.forks = getForkDetails();
vm.limit = getLimitDetails(); vm.limit = getLimitDetails();
vm.instanceGroup = getInstanceGroupDetails(); vm.instanceGroup = getInstanceGroupDetails();

View File

@@ -216,15 +216,18 @@
</div> </div>
<!-- CREDENTIAL DETAIL --> <!-- CREDENTIAL DETAIL -->
<div class="JobResults-resultRow" ng-if="vm.credential"> <div class="JobResults-resultRow" ng-if="vm.credentials">
<label class="JobResults-resultRowLabel">{{ vm.credential.label }}</label> <label class="JobResults-resultRowLabel">{{ vm.credentials.label }}</label>
<div class="JobResults-resultRowText"> <div class="JobResults-resultRowText">
<a href="{{ vm.credential.link }}" <at-tag
aw-tool-tip="{{ vm.credential.tooltip }}" ng-repeat="credential in vm.credentials.value"
tag="credential.value"
icon="{{ credential.icon }}"
link="{{ credential.link }}"
aw-tool-tip="{{ credential.tooltip }}"
data-placement="top" data-placement="top"
data-tip-watch="vm.credential.tooltip"> data-tip-watch="credential.tooltip">
{{ vm.credential.value }} </at-tag>
</a>
</div> </div>
</div> </div>

View File

@@ -73,7 +73,7 @@ function OutputStrings (BaseString) {
ns.search = { ns.search = {
ADDITIONAL_INFORMATION_HEADER: t.s('ADDITIONAL_INFORMATION'), 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'), CLEAR_ALL: t.s('CLEAR ALL'),
DOCUMENTATION: t.s('documentation'), DOCUMENTATION: t.s('documentation'),
EXAMPLES: t.s('EXAMPLES'), EXAMPLES: t.s('EXAMPLES'),

View File

@@ -37,7 +37,7 @@
</form> </form>
<div class="jobz-tagz"> <div class="jobz-tagz">
<div class="TagComponentWrapper" ng-repeat="tag in vm.tags track by $index"> <div ng-repeat="tag in vm.tags track by $index">
<at-tag tag="tag" remove-tag="vm.removeSearchTag($index)"></at-tag> <at-tag tag="tag" remove-tag="vm.removeSearchTag($index)"></at-tag>
</div> </div>
<div class="jobz-searchClearAllContainer"> <div class="jobz-searchClearAllContainer">

View File

@@ -170,7 +170,6 @@
} }
.at-RowItem-tag { .at-RowItem-tag {
text-transform: uppercase;
font-weight: 100; font-weight: 100;
background-color: @at-color-list-row-item-tag-background; background-color: @at-color-list-row-item-tag-background;
border-radius: @at-border-radius; border-radius: @at-border-radius;

View File

@@ -1,8 +1,6 @@
.TagComponentWrapper {
padding: @at-space;
}
.TagComponent { .TagComponent {
color: white; color: @at-white;
cursor: default;
background: @at-blue; background: @at-blue;
border-radius: @at-space; border-radius: @at-space;
font-size: 12px; font-size: 12px;
@@ -12,30 +10,48 @@
min-height: @at-space-4x; min-height: @at-space-4x;
overflow: hidden; overflow: hidden;
max-width: 200px; max-width: 200px;
margin: @at-space;
} }
.TagComponent-name { .TagComponent-name {
color: @at-white;
margin: 2px @at-space-2x; margin: 2px @at-space-2x;
align-self: center; align-self: center;
word-break: break-word; word-break: break-word;
text-transform: lowercase; text-transform: lowercase;
}
.TagComponent--cloud { &:hover,
&:before { &:focus {
content: '\f0c2'; color: @at-white;
color: white;
height: @at-space-4x;
width: @at-space-4x;
} }
} }
.TagComponent--key { .TagComponent-icon {
&:before { 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'; content: '\f084';
color: white; }
height: @at-space-4x;
width: @at-space-4x; &--vault:before {
content: '\f187';
} }
} }

View File

@@ -8,6 +8,8 @@ function atTag () {
templateUrl, templateUrl,
scope: { scope: {
tag: '=', tag: '=',
icon: '@?',
link: '@?',
removeTag: '&?', removeTag: '&?',
}, },
}; };

View File

@@ -1,5 +1,7 @@
<div class="TagComponent" ng-transclude> <div class="TagComponent" ng-transclude>
<div class="TagComponent-name">{{ tag }}</div> <div ng-if="icon" class="fa TagComponent-icon TagComponent-icon--{{icon}}"></div>
<a ng-if="link" class="TagComponent-name" href="{{ link }}">{{ tag }}</a>
<div ng-if="!link" class="TagComponent-name">{{ tag }}</div>
<div ng-if="removeTag" class="TagComponent-button" ng-click="removeTag(index)"> <div ng-if="removeTag" class="TagComponent-button" ng-click="removeTag(index)">
<i class="fa fa-times TagComponent-button__delete"></i> <i class="fa fa-times TagComponent-button__delete"></i>
</div> </div>

View File

@@ -49,7 +49,7 @@
</div> </div>
<div class="SmartSearch-keyRow"> <div class="SmartSearch-keyRow">
<b>{{ 'ADDITIONAL INFORMATION' | translate }}:</b> <b>{{ 'ADDITIONAL INFORMATION' | translate }}:</b>
<span>{{ 'For additional information on advanced search search syntax please see the Ansible Tower' | translate }} <span>{{ 'For additional information on advanced search syntax please see the Ansible Tower' | translate }}
<a ng-attr-href="{{ documentationLink || undefined }}" target="_blank"> {{ 'documentation' | translate }}</a>.</span> <a ng-attr-href="{{ documentationLink || undefined }}" target="_blank"> {{ 'documentation' | translate }}</a>.</span>
</div> </div>
</div> </div>