mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
don't show lookup until data is fetched
This commit is contained in:
@@ -1,14 +1,22 @@
|
|||||||
const templateUrl = require('~features/credentials/input-source-lookup.partial.html');
|
const templateUrl = require('~features/credentials/input-source-lookup.partial.html');
|
||||||
|
|
||||||
function InputSourceLookupController (strings) {
|
function InputSourceLookupController (strings, wait) {
|
||||||
const vm = this || {};
|
const vm = this || {};
|
||||||
|
|
||||||
vm.strings = strings;
|
vm.strings = strings;
|
||||||
vm.title = strings.get('inputSources.TITLE');
|
vm.title = strings.get('inputSources.TITLE');
|
||||||
|
|
||||||
|
vm.$onInit = () => wait('start');
|
||||||
|
|
||||||
|
vm.onReady = () => {
|
||||||
|
vm.isReady = true;
|
||||||
|
wait('stop');
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
InputSourceLookupController.$inject = [
|
InputSourceLookupController.$inject = [
|
||||||
'CredentialsStrings',
|
'CredentialsStrings',
|
||||||
|
'Wait',
|
||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<at-easy-modal title="vm.title" on-close="vm.onClose">
|
<at-easy-modal title="vm.title" on-close="vm.onClose" ng-show="vm.isReady">
|
||||||
<at-tab-group>
|
<at-tab-group>
|
||||||
<at-tab
|
<at-tab
|
||||||
state="vm.tabs.credential"
|
state="vm.tabs.credential"
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
}"
|
}"
|
||||||
results-filter="vm.resultsFilter"
|
results-filter="vm.resultsFilter"
|
||||||
selected-id="vm.selectedId"
|
selected-id="vm.selectedId"
|
||||||
|
on-ready="vm.onReady"
|
||||||
on-select="vm.onSelect"
|
on-select="vm.onSelect"
|
||||||
on-row-click="vm.onRowClick"
|
on-row-click="vm.onRowClick"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ function LookupListController (GetBasePath, Rest, strings) {
|
|||||||
Rest.get({ params })
|
Rest.get({ params })
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
setData(resultsFilter(data));
|
setData(resultsFilter(data));
|
||||||
});
|
})
|
||||||
|
.finally(() => vm.onReady());
|
||||||
};
|
};
|
||||||
|
|
||||||
function setData ({ results, count }) {
|
function setData ({ results, count }) {
|
||||||
@@ -43,6 +44,7 @@ export default {
|
|||||||
bindings: {
|
bindings: {
|
||||||
onSelect: '=',
|
onSelect: '=',
|
||||||
onRowClick: '=',
|
onRowClick: '=',
|
||||||
|
onReady: '=',
|
||||||
selectedId: '=',
|
selectedId: '=',
|
||||||
resourceName: '@',
|
resourceName: '@',
|
||||||
baseParams: '=',
|
baseParams: '=',
|
||||||
|
|||||||
Reference in New Issue
Block a user