From 8b0876cb3ac2131ef533c0d806d97087da2a2734 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Mon, 19 Jun 2017 15:26:21 -0400 Subject: [PATCH] update revert link text size in prompt add revert to multi cred modal --- .../src/job-submission/job-submission.block.less | 2 +- .../multi-credential-modal.directive.js | 15 +++++++++++++++ .../multi-credential-modal.partial.html | 7 +++++-- .../multi-credential/multi-credential.block.less | 11 +++++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/job-submission/job-submission.block.less b/awx/ui/client/src/job-submission/job-submission.block.less index 2af138796e..2baff771f8 100644 --- a/awx/ui/client/src/job-submission/job-submission.block.less +++ b/awx/ui/client/src/job-submission/job-submission.block.less @@ -177,7 +177,7 @@ } .JobSubmission-revertLink { - font-size: 14px; + font-size: 12px; } .JobSubmission-selectedItem { diff --git a/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential-modal.directive.js b/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential-modal.directive.js index 8cc48a3237..8772caeb13 100644 --- a/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential-modal.directive.js +++ b/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential-modal.directive.js @@ -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) { diff --git a/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential-modal.partial.html b/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential-modal.partial.html index 3aada2ef59..c3d472283e 100644 --- a/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential-modal.partial.html +++ b/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential-modal.partial.html @@ -16,7 +16,7 @@ +
+ REVERT +
CREDENTIAL TYPE: @@ -67,7 +70,7 @@
diff --git a/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.block.less b/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.block.less index 0255a1f5b7..619cb458f9 100644 --- a/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.block.less +++ b/awx/ui/client/src/templates/job_templates/multi-credential/multi-credential.block.less @@ -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; +}