diff --git a/awx/ui/client/features/credentials/add-edit-credentials.view.html b/awx/ui/client/features/credentials/add-edit-credentials.view.html index 44ca1d7025..9214adda59 100644 --- a/awx/ui/client/features/credentials/add-edit-credentials.view.html +++ b/awx/ui/client/features/credentials/add-edit-credentials.view.html @@ -10,7 +10,11 @@ - + + + + + Type Details diff --git a/awx/ui/client/features/credentials/index.js b/awx/ui/client/features/credentials/index.js index 1aa3e683c3..661d3deedc 100644 --- a/awx/ui/client/features/credentials/index.js +++ b/awx/ui/client/features/credentials/index.js @@ -1,5 +1,5 @@ -import CredentialList from './credentials.list.js'; -import ListController from './list/credentials-list.controller'; +import CredentialList from '../../src/credentials/credentials.list'; +import ListController from '../../src/credentials/list/credentials-list.controller'; import AddController from './add-credentials.controller.js'; import EditController from './edit-credentials.controller.js'; import { N_ } from '../../src/i18n'; @@ -111,7 +111,5 @@ config.$inject = [ angular .module('at.features.credentials', []) .config(config) - .factory('CredentialList', CredentialList) - .controller('ListController', ListController) .controller('AddController', AddController) .controller('EditController', EditController); diff --git a/awx/ui/client/lib/components/_index.less b/awx/ui/client/lib/components/_index.less index 4a313024b8..d26fbbc11d 100644 --- a/awx/ui/client/lib/components/_index.less +++ b/awx/ui/client/lib/components/_index.less @@ -4,3 +4,4 @@ @import 'modal/_index'; @import 'popover/_index'; @import 'tabs/_index'; +@import 'utility/_index'; diff --git a/awx/ui/client/lib/components/index.js b/awx/ui/client/lib/components/index.js index 602ffbdaf3..3f24c7376b 100644 --- a/awx/ui/client/lib/components/index.js +++ b/awx/ui/client/lib/components/index.js @@ -1,9 +1,11 @@ import actionGroup from './action/action-group.directive'; +import divider from './utility/divider.directive'; import form from './form/form.directive'; import formAction from './form/action.directive'; import inputCheckbox from './input/checkbox.directive'; import inputGroup from './input/group.directive'; import inputLabel from './input/label.directive'; +import inputLookup from './input/lookup.directive'; import inputMessage from './input/message.directive'; import inputNumber from './input/number.directive'; import inputSelect from './input/select.directive'; @@ -24,11 +26,13 @@ import BaseInputController from './input/base.controller'; angular .module('at.lib.components', []) .directive('atActionGroup', actionGroup) + .directive('atDivider', divider) .directive('atForm', form) .directive('atFormAction', formAction) .directive('atInputCheckbox', inputCheckbox) .directive('atInputGroup', inputGroup) .directive('atInputLabel', inputLabel) + .directive('atInputLookup', inputLookup) .directive('atInputMessage', inputMessage) .directive('atInputNumber', inputNumber) .directive('atInputSecret', inputSecret) diff --git a/awx/ui/client/lib/components/input/_index.less b/awx/ui/client/lib/components/input/_index.less index a396776a0d..7e6d191351 100644 --- a/awx/ui/client/lib/components/input/_index.less +++ b/awx/ui/client/lib/components/input/_index.less @@ -15,7 +15,7 @@ } } -.at-Checkbox { +.at-InputCheckbox { margin: 0; padding: 0; @@ -26,8 +26,8 @@ } } -.at-InputGroup-button { - height: 100%; +.at-InputContainer { + margin-top: @at-space-6x;; } .at-Input-button { @@ -69,7 +69,6 @@ .at-InputGroup { padding: 0; - margin: 0; margin: @at-space-6x 0 0 0; } @@ -81,11 +80,13 @@ left: -@at-inset-width; } +.at-InputGroup-button { + height: 100%; +} + .at-InputGroup-title { .at-mixin-Heading(@at-font-size-2x); - margin-top: 0; - margin-left: @at-space-5x; - margin-bottom: @at-space-4x; + margin: 0 0 0 @at-space-5x; } .at-InputGroup-divider { @@ -190,6 +191,6 @@ } } -.at-Textarea { +.at-InputTextarea { .at-mixin-FontFixedWidth(); } diff --git a/awx/ui/client/lib/components/input/checkbox.partial.html b/awx/ui/client/lib/components/input/checkbox.partial.html index 86b64994ac..60cc234efd 100644 --- a/awx/ui/client/lib/components/input/checkbox.partial.html +++ b/awx/ui/client/lib/components/input/checkbox.partial.html @@ -1,7 +1,7 @@ -
+
-
+
{ - let tabindex = Number(scope.tab) + index; - let col = input._expand ? 12 : scope.col; - - let element = - `<${input._component} col="${col}" tab="${tabindex}" - state="${state._reference}._group[${index}]"> - `; - - return angular.element(element); - }; - vm.insert = group => { let container = document.createElement('div'); let col = 1; @@ -128,13 +116,13 @@ function AtInputGroupController ($scope, $compile) { group.forEach((input, i) => { if (input._expand && !isDivided) { - container.appendChild(vm.createInputDivider()); + container.appendChild(vm.createDivider()[0]); } container.appendChild(input._element[0]); if ((input._expand || col % colPerRow === 0) && i !== group.length -1) { - container.appendChild(vm.createInputDivider()); + container.appendChild(vm.createDivider()[0]); isDivided = true; col = 0; } else { @@ -147,8 +135,19 @@ function AtInputGroupController ($scope, $compile) { element.appendChild(container); }; - vm.createInputDivider = () => { - return angular.element(`
`)[0]; + vm.createComponent = (input, index) => { + let tabindex = Number(scope.tab) + index; + let col = input._expand ? 12 : scope.col; + + return angular.element( + `<${input._component} col="${col}" tab="${tabindex}" + state="${state._reference}._group[${index}]"> + ` + ); + }; + + vm.createDivider = () => { + return angular.element(''); }; vm.compile = group => { diff --git a/awx/ui/client/lib/components/input/lookup.directive.js b/awx/ui/client/lib/components/input/lookup.directive.js new file mode 100644 index 0000000000..c8316ec8f3 --- /dev/null +++ b/awx/ui/client/lib/components/input/lookup.directive.js @@ -0,0 +1,44 @@ +function atInputLookupLink (scope, element, attrs, controllers) { + let formController = controllers[0]; + let inputController = controllers[1]; + + if (scope.tab === '1') { + element.find('input')[0].focus(); + } + + inputController.init(scope, element, formController); +} + +function AtInputLookupController (baseInputController) { + let vm = this || {}; + + vm.init = (scope, element, form) => { + baseInputController.call(vm, 'input', scope, element, form); + + vm.check(); + }; +} + +AtInputLookupController.$inject = ['BaseInputController']; + +function atInputLookup (pathService) { + return { + restrict: 'E', + transclude: true, + replace: true, + require: ['^^atForm', 'atInputLookup'], + templateUrl: pathService.getPartialPath('components/input/lookup'), + controller: AtInputLookupController, + controllerAs: 'vm', + link: atInputLookupLink, + scope: { + state: '=', + col: '@', + tab: '@' + } + }; +} + +atInputLookup.$inject = ['PathService']; + +export default atInputLookup; diff --git a/awx/ui/client/lib/components/input/lookup.partial.html b/awx/ui/client/lib/components/input/lookup.partial.html new file mode 100644 index 0000000000..a77505db33 --- /dev/null +++ b/awx/ui/client/lib/components/input/lookup.partial.html @@ -0,0 +1,24 @@ +
+
+ + +
+ + + + +
+ + +
+
diff --git a/awx/ui/client/lib/components/input/number.partial.html b/awx/ui/client/lib/components/input/number.partial.html index 90708edd38..57aa355bfa 100644 --- a/awx/ui/client/lib/components/input/number.partial.html +++ b/awx/ui/client/lib/components/input/number.partial.html @@ -1,4 +1,4 @@ -
+
diff --git a/awx/ui/client/lib/components/input/secret.partial.html b/awx/ui/client/lib/components/input/secret.partial.html index 2445338d88..b9979f5520 100644 --- a/awx/ui/client/lib/components/input/secret.partial.html +++ b/awx/ui/client/lib/components/input/secret.partial.html @@ -1,4 +1,4 @@ -
+
diff --git a/awx/ui/client/lib/components/input/select.partial.html b/awx/ui/client/lib/components/input/select.partial.html index d096c4baef..aaa31bebee 100644 --- a/awx/ui/client/lib/components/input/select.partial.html +++ b/awx/ui/client/lib/components/input/select.partial.html @@ -1,4 +1,4 @@ -
+
diff --git a/awx/ui/client/lib/components/input/text.partial.html b/awx/ui/client/lib/components/input/text.partial.html index 676f4f05d6..c5140df834 100644 --- a/awx/ui/client/lib/components/input/text.partial.html +++ b/awx/ui/client/lib/components/input/text.partial.html @@ -1,4 +1,4 @@ -
+
diff --git a/awx/ui/client/lib/components/input/textarea-secret.partial.html b/awx/ui/client/lib/components/input/textarea-secret.partial.html index 14c97eaf37..11d1f7a3df 100644 --- a/awx/ui/client/lib/components/input/textarea-secret.partial.html +++ b/awx/ui/client/lib/components/input/textarea-secret.partial.html @@ -1,4 +1,4 @@ -
+
@@ -15,7 +15,7 @@ ng-class="{'at-InputFile--drag': drag }" type="file" name="files" /> -