1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 01:21:21 +03:00

Merge pull request #6637 from jlmitch5/revertInMultiCred

update revert link text size in prompt
This commit is contained in:
jlmitch5 2017-06-21 15:05:37 -04:00 committed by GitHub
commit 986c35c1e8
4 changed files with 32 additions and 3 deletions

View File

@ -177,7 +177,7 @@
}
.JobSubmission-revertLink {
font-size: 14px;
font-size: 12px;
}
.JobSubmission-selectedItem {

View File

@ -248,6 +248,21 @@ export default ['templateUrl', 'Rest', 'GetBasePath', 'generateList', '$compile'
}
};
$scope.selectedCredentialsDirty = function() {
if ($scope.originalSelectedCredentials) {
return !($scope.originalSelectedCredentials.machine === null &&
$scope.originalSelectedCredentials.extra.length === 0) &&
!_.eq($scope.selectedCredentials,
$scope.originalSelectedCredentials);
} else {
return false;
}
};
$scope.revertToDefaultCredentials = function() {
$scope.selectedCredentials = _.cloneDeep($scope.originalSelectedCredentials);
};
$scope.removeCredential = function(credToRemove) {
$scope.credTags
.forEach(function(cred) {

View File

@ -16,7 +16,7 @@
</div>
<div class="modal-body">
<div class="MultiCredential-selectedBar"
ng-show="credTags && credTags.length">
ng-show="(credTags && credTags.length) || selectedCredentialsDirty()">
<span class="MultiCredential-selectedBarLabel" translate>
SELECTED:
</span>
@ -48,6 +48,9 @@
</div>
</div>
</div>
<div class="MultiCredential-previewTagRevert">
<a class="MultiCredential-revertLink" href="" ng-show="selectedCredentialsDirty()" ng-click="revertToDefaultCredentials()" translate>REVERT</a>
</div>
</div>
<div class="MultiCredential-credentialSubSection">
<span class="MultiCredential-selectLabel" translate>CREDENTIAL TYPE:</span>
@ -67,7 +70,7 @@
<button type="button"
ng-click="saveForm()"
ng-disabled="!credentials || credentials.length === 0"
class="Lookup-cancel btn btn-sm Form-saveButton" translate>
class="btn btn-sm Form-saveButton" translate>
SELECT
</button>
</div>

View File

@ -122,3 +122,14 @@
line-height: 24px;
text-transform: uppercase;
}
.MultiCredential-previewTagRevert {
flex: 0 0 60px;
line-height: 29px;
margin-left: auto;
text-align: right;
}
.MultiCredential-revertLink {
font-size: 12px;
}