diff --git a/awx/ui/client/components/_index.less b/awx/ui/client/components/_index.less index 5bd6f2be23..b8be713d43 100644 --- a/awx/ui/client/components/_index.less +++ b/awx/ui/client/components/_index.less @@ -1,3 +1,4 @@ +@import 'action/_index'; @import 'badge/_index'; @import 'form/_index'; @import 'input/_index'; diff --git a/awx/ui/client/components/action/_index.less b/awx/ui/client/components/action/_index.less index e69de29bb2..95231f8a41 100644 --- a/awx/ui/client/components/action/_index.less +++ b/awx/ui/client/components/action/_index.less @@ -0,0 +1,7 @@ +.at-ActionGroup { + margin-top: @at-space-6x; + + button:last-child { + margin-left: @at-space-5x; + } +} diff --git a/awx/ui/client/components/action/action-group.directive.js b/awx/ui/client/components/action/action-group.directive.js new file mode 100644 index 0000000000..da1bf668d7 --- /dev/null +++ b/awx/ui/client/components/action/action-group.directive.js @@ -0,0 +1,16 @@ +function atActionGroup (pathService) { + return { + restrict: 'E', + transclude: true, + replace: true, + templateUrl: pathService.getPartialPath('components/action/action-group'), + scope: { + col: '@', + pos: '@' + } + }; +} + +atActionGroup.$inject = ['PathService']; + +export default atActionGroup; diff --git a/awx/ui/client/components/action/action-group.partial.html b/awx/ui/client/components/action/action-group.partial.html new file mode 100644 index 0000000000..b704a1f981 --- /dev/null +++ b/awx/ui/client/components/action/action-group.partial.html @@ -0,0 +1,5 @@ +
+
+ +
+
diff --git a/awx/ui/client/components/form/form-action.directive.js b/awx/ui/client/components/action/action.directive.js similarity index 71% rename from awx/ui/client/components/form/form-action.directive.js rename to awx/ui/client/components/action/action.directive.js index 0f99d2d332..47c1625405 100644 --- a/awx/ui/client/components/form/form-action.directive.js +++ b/awx/ui/client/components/action/action.directive.js @@ -1,3 +1,20 @@ +let $state; + +function applyCancelProperties (scope) { + scope.text = scope.config.text || 'CANCEL'; + scope.fill = 'Hollow'; + scope.color = 'white'; + scope.disabled = false; + scope.action = () => $state.go('^'); +} + +function applySaveProperties (scope) { + scope.text = 'SAVE'; + scope.fill = ''; + scope.color = 'green'; + scope.disabled = true; +} + function link (scope, el, attrs, form) { form.use('action', scope, el); @@ -11,27 +28,15 @@ function link (scope, el, attrs, form) { } } -function applyCancelProperties (scope) { - scope.text = 'CANCEL'; - scope.fill = 'Hollow'; - scope.color = 'white'; - scope.disabled = false; -} +function atFormAction (_$state_, pathService) { + $state = _$state_; -function applySaveProperties (scope) { - scope.text = 'SAVE'; - scope.fill = ''; - scope.color = 'green'; - scope.disabled = true; -} - -function atFormAction (pathService) { return { restrict: 'E', transclude: true, replace: true, require: '^^at-form', - templateUrl: pathService.getPartialPath('components/form/form-action'), + templateUrl: pathService.getPartialPath('components/action/action'), link, scope: { config: '=' @@ -39,6 +44,6 @@ function atFormAction (pathService) { }; } -atFormAction.$inject = ['PathService']; +atFormAction.$inject = ['$state', 'PathService']; export default atFormAction; diff --git a/awx/ui/client/components/form/form-action.partial.html b/awx/ui/client/components/action/action.partial.html similarity index 57% rename from awx/ui/client/components/form/form-action.partial.html rename to awx/ui/client/components/action/action.partial.html index bb85f7ed1e..cded0da9f0 100644 --- a/awx/ui/client/components/form/form-action.partial.html +++ b/awx/ui/client/components/action/action.partial.html @@ -1,4 +1,4 @@ diff --git a/awx/ui/client/components/action/add.directive.js b/awx/ui/client/components/action/add.directive.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/awx/ui/client/components/action/cancel.directive.js b/awx/ui/client/components/action/cancel.directive.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/awx/ui/client/components/action/delete.directive.js b/awx/ui/client/components/action/delete.directive.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/awx/ui/client/components/action/save.directive.js b/awx/ui/client/components/action/save.directive.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/awx/ui/client/components/form/_index.less b/awx/ui/client/components/form/_index.less index 593626f5ca..8b13789179 100644 --- a/awx/ui/client/components/form/_index.less +++ b/awx/ui/client/components/form/_index.less @@ -1,7 +1 @@ -.at-FormActionGroup { - margin-top: @at-space-6x; - button:last-child { - margin-left: @at-space-5x; - } -} diff --git a/awx/ui/client/components/form/form-action-group.directive.js b/awx/ui/client/components/form/form-action-group.directive.js deleted file mode 100644 index f13fcf7250..0000000000 --- a/awx/ui/client/components/form/form-action-group.directive.js +++ /dev/null @@ -1,16 +0,0 @@ -function atFormActionGroup (pathService) { - return { - restrict: 'E', - transclude: true, - replace: true, - require: '^^at-form', - templateUrl: pathService.getPartialPath('components/form/form-action-group'), - scope: { - config: '=' - } - }; -} - -atFormActionGroup.$inject = ['PathService']; - -export default atFormActionGroup; diff --git a/awx/ui/client/components/form/form-action-group.partial.html b/awx/ui/client/components/form/form-action-group.partial.html deleted file mode 100644 index 4c7d3d00c3..0000000000 --- a/awx/ui/client/components/form/form-action-group.partial.html +++ /dev/null @@ -1,5 +0,0 @@ -
-
- -
-
diff --git a/awx/ui/client/components/index.js b/awx/ui/client/components/index.js index c71407dbe3..2b4532e9d2 100644 --- a/awx/ui/client/components/index.js +++ b/awx/ui/client/components/index.js @@ -1,7 +1,7 @@ +import action from './action/action.directive'; +import actionGroup from './action/action-group.directive'; import badge from './badge/badge.directive'; import form from './form/form.directive'; -import formAction from './form/form-action.directive'; -import formActionGroup from './form/form-action-group.directive'; import inputLabel from './input/label.directive'; import inputSearch from './input/search.directive'; import inputSelect from './input/select.directive'; @@ -15,10 +15,10 @@ import toggleContent from './toggle/content.directive'; angular .module('at.components', []) + .directive('atAction', action) + .directive('atActionGroup', actionGroup) .directive('atBadge', badge) .directive('atForm', form) - .directive('atFormAction', formAction) - .directive('atFormActionGroup', formActionGroup) .directive('atInputLabel', inputLabel) .directive('atInputSearch', inputSearch) .directive('atInputSelect', inputSelect) diff --git a/awx/ui/client/components/input/_index.less b/awx/ui/client/components/input/_index.less index 129c386dfe..c20b04ef25 100644 --- a/awx/ui/client/components/input/_index.less +++ b/awx/ui/client/components/input/_index.less @@ -3,7 +3,7 @@ background: @at-white; border-radius: @at-border-radius; - color: @at-gray-dark-3x; + color: @at-gray-dark-5x; &, &:active { border-color: @at-gray-dark-2x; diff --git a/awx/ui/client/src/credentials/add-credentials.view.html b/awx/ui/client/src/credentials/add-credentials.view.html index 05ba307a44..b4ca5857f3 100644 --- a/awx/ui/client/src/credentials/add-credentials.view.html +++ b/awx/ui/client/src/credentials/add-credentials.view.html @@ -12,10 +12,10 @@ - - - - + + + +