mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Add isFetchingItems flag to disable the PromptForItems when fetching items in Visualize and Dashboard listing tables. (#10397)
Backports PR #10381
**Commit 1:**
Add isFetchingItems flag to disable the PromptForItems when fetching items in Visualize and Dashboard listing tables.
* Original sha: d2483ad4db
* Authored by CJ Cenizal <cj@cenizal.com> on 2017-02-15T21:19:30Z
This commit is contained in:
parent
af881eaa0c
commit
30dd0f7547
4 changed files with 20 additions and 12 deletions
|
@ -87,7 +87,7 @@
|
|||
<!-- PromptForItems -->
|
||||
<div
|
||||
class="kuiPanel kuiPanel--centered kuiPanel--withHeader"
|
||||
ng-if="!listingController.items.length && !listingController.filter"
|
||||
ng-if="!listingController.isFetchingItems && !listingController.items.length && !listingController.filter"
|
||||
>
|
||||
<div class="kuiPromptForItems">
|
||||
<div class="kuiPromptForItems__message">
|
||||
|
|
|
@ -41,9 +41,12 @@ export function DashboardListingController($injector, $scope) {
|
|||
this.pageOfItems = limitTo(this.items, this.pager.pageSize, this.pager.startIndex);
|
||||
};
|
||||
|
||||
const fetchObjects = () => {
|
||||
const fetchItems = () => {
|
||||
this.isFetchingItems = true;
|
||||
|
||||
dashboardService.find(this.filter)
|
||||
.then(result => {
|
||||
this.isFetchingItems = false;
|
||||
this.items = result.hits;
|
||||
calculateItemsOnPage();
|
||||
});
|
||||
|
@ -57,6 +60,7 @@ export function DashboardListingController($injector, $scope) {
|
|||
selectedItems = this.pageOfItems.slice(0);
|
||||
};
|
||||
|
||||
this.isFetchingItems = false;
|
||||
this.items = [];
|
||||
this.pageOfItems = [];
|
||||
this.filter = '';
|
||||
|
@ -65,7 +69,7 @@ export function DashboardListingController($injector, $scope) {
|
|||
|
||||
$scope.$watch(() => this.filter, () => {
|
||||
deselectAll();
|
||||
fetchObjects();
|
||||
fetchItems();
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -115,7 +119,7 @@ export function DashboardListingController($injector, $scope) {
|
|||
const selectedIds = selectedItems.map(item => item.id);
|
||||
|
||||
dashboardService.delete(selectedIds)
|
||||
.then(fetchObjects)
|
||||
.then(fetchItems)
|
||||
.then(() => {
|
||||
deselectAll();
|
||||
})
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
<!-- PromptForItems -->
|
||||
<div
|
||||
class="kuiPanel kuiPanel--centered kuiPanel--withHeader"
|
||||
ng-if="!listingController.items.length && !listingController.filter"
|
||||
ng-if="!listingController.isFetchingItems && !listingController.items.length && !listingController.filter"
|
||||
>
|
||||
<div class="kuiPromptForItems">
|
||||
<div class="kuiPromptForItems__message">
|
||||
|
|
|
@ -42,12 +42,15 @@ export function VisualizeListingController($injector, $scope) {
|
|||
this.pageOfItems = limitTo(this.items, this.pager.pageSize, this.pager.startIndex);
|
||||
};
|
||||
|
||||
const fetchObjects = () => {
|
||||
const fetchItems = () => {
|
||||
this.isFetchingItems = true;
|
||||
|
||||
visualizationService.find(this.filter)
|
||||
.then(result => {
|
||||
this.items = result.hits;
|
||||
calculateItemsOnPage();
|
||||
});
|
||||
.then(result => {
|
||||
this.isFetchingItems = false;
|
||||
this.items = result.hits;
|
||||
calculateItemsOnPage();
|
||||
});
|
||||
};
|
||||
|
||||
const deselectAll = () => {
|
||||
|
@ -58,6 +61,7 @@ export function VisualizeListingController($injector, $scope) {
|
|||
selectedItems = this.pageOfItems.slice(0);
|
||||
};
|
||||
|
||||
this.isFetchingItems = false;
|
||||
this.items = [];
|
||||
this.pageOfItems = [];
|
||||
this.filter = '';
|
||||
|
@ -66,7 +70,7 @@ export function VisualizeListingController($injector, $scope) {
|
|||
|
||||
$scope.$watch(() => this.filter, () => {
|
||||
deselectAll();
|
||||
fetchObjects();
|
||||
fetchItems();
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -145,7 +149,7 @@ export function VisualizeListingController($injector, $scope) {
|
|||
const selectedIds = selectedItems.map(item => item.id);
|
||||
|
||||
visualizationService.delete(selectedIds)
|
||||
.then(fetchObjects)
|
||||
.then(fetchItems)
|
||||
.then(() => {
|
||||
deselectAll();
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue