don't show lookup until data is fetched

This commit is contained in:
Jake McDermott 2019-03-05 10:28:08 -05:00
parent 736bd2ed67
commit 6d0f2948aa
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7
3 changed files with 14 additions and 3 deletions

View File

@ -1,14 +1,22 @@
const templateUrl = require('~features/credentials/input-source-lookup.partial.html');
function InputSourceLookupController (strings) {
function InputSourceLookupController (strings, wait) {
const vm = this || {};
vm.strings = strings;
vm.title = strings.get('inputSources.TITLE');
vm.$onInit = () => wait('start');
vm.onReady = () => {
vm.isReady = true;
wait('stop');
};
}
InputSourceLookupController.$inject = [
'CredentialsStrings',
'Wait',
];
export default {

View File

@ -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
state="vm.tabs.credential"
@ -23,6 +23,7 @@
}"
results-filter="vm.resultsFilter"
selected-id="vm.selectedId"
on-ready="vm.onReady"
on-select="vm.onSelect"
on-row-click="vm.onRowClick"
/>

View File

@ -15,7 +15,8 @@ function LookupListController (GetBasePath, Rest, strings) {
Rest.get({ params })
.then(({ data }) => {
setData(resultsFilter(data));
});
})
.finally(() => vm.onReady());
};
function setData ({ results, count }) {
@ -43,6 +44,7 @@ export default {
bindings: {
onSelect: '=',
onRowClick: '=',
onReady: '=',
selectedId: '=',
resourceName: '@',
baseParams: '=',