Skip to content

Commit

Permalink
[8.x] [Dashboard] Await new services in exported listing table (#195277
Browse files Browse the repository at this point in the history
…) (#195301)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Dashboard] Await new services in exported listing table
(#195277)](#195277)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Hannah
Mudge","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-07T17:36:27Z","message":"[Dashboard]
Await new services in exported listing table (#195277)\n\nCloses
https://github.com/elastic/kibana/issues/194733\r\n\r\n##
Summary\r\n\r\nIn #193644, I
forgot to remove\r\nreferences to the old `servicesReady` promise - this
caused an issue\r\nwhere it never resolved `true`, so anywhere that
depended on this would\r\nbe stuck in a loading state. This PR fixes
this by replacing all\r\ninstances of `servicesReady` with the
new\r\n`untilPluginStartServicesReady` promise.\r\n\r\nSpecifically,
this fixes the exported `DashboardListingTable` that the\r\nSecurity
page uses:\r\n\r\n-
**Before:**\r\n\r\n\r\nhttps://github.com/user-attachments/assets/78fc8ad8-7bff-43bf-95ec-d52f4da91371\r\n\r\n-
**After:**\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/af1be9d3-9af5-4a30-9b5d-bc4352214a97\r\n\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"10271a2e1fb5860a8a6d3d3e3f072d5b67a3f63f","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Dashboard","regression","release_note:fix","Team:Presentation","loe:small","impact:medium","v9.0.0","backport:prev-minor"],"title":"[Dashboard]
Await new services in exported listing
table","number":195277,"url":"https://github.com/elastic/kibana/pull/195277","mergeCommit":{"message":"[Dashboard]
Await new services in exported listing table (#195277)\n\nCloses
https://github.com/elastic/kibana/issues/194733\r\n\r\n##
Summary\r\n\r\nIn #193644, I
forgot to remove\r\nreferences to the old `servicesReady` promise - this
caused an issue\r\nwhere it never resolved `true`, so anywhere that
depended on this would\r\nbe stuck in a loading state. This PR fixes
this by replacing all\r\ninstances of `servicesReady` with the
new\r\n`untilPluginStartServicesReady` promise.\r\n\r\nSpecifically,
this fixes the exported `DashboardListingTable` that the\r\nSecurity
page uses:\r\n\r\n-
**Before:**\r\n\r\n\r\nhttps://github.com/user-attachments/assets/78fc8ad8-7bff-43bf-95ec-d52f4da91371\r\n\r\n-
**After:**\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/af1be9d3-9af5-4a30-9b5d-bc4352214a97\r\n\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"10271a2e1fb5860a8a6d3d3e3f072d5b67a3f63f"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195277","number":195277,"mergeCommit":{"message":"[Dashboard]
Await new services in exported listing table (#195277)\n\nCloses
https://github.com/elastic/kibana/issues/194733\r\n\r\n##
Summary\r\n\r\nIn #193644, I
forgot to remove\r\nreferences to the old `servicesReady` promise - this
caused an issue\r\nwhere it never resolved `true`, so anywhere that
depended on this would\r\nbe stuck in a loading state. This PR fixes
this by replacing all\r\ninstances of `servicesReady` with the
new\r\n`untilPluginStartServicesReady` promise.\r\n\r\nSpecifically,
this fixes the exported `DashboardListingTable` that the\r\nSecurity
page uses:\r\n\r\n-
**Before:**\r\n\r\n\r\nhttps://github.com/user-attachments/assets/78fc8ad8-7bff-43bf-95ec-d52f4da91371\r\n\r\n-
**After:**\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/af1be9d3-9af5-4a30-9b5d-bc4352214a97\r\n\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"10271a2e1fb5860a8a6d3d3e3f072d5b67a3f63f"}}]}]
BACKPORT-->

Co-authored-by: Hannah Mudge <[email protected]>
  • Loading branch information
kibanamachine and Heenawter authored Oct 7, 2024
1 parent 093914a commit 8579a52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/plugins/dashboard/public/dashboard_listing/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import React, { Suspense } from 'react';
import { EuiEmptyPrompt, EuiLoadingSpinner } from '@elastic/eui';
import React, { Suspense } from 'react';

import { servicesReady } from '../plugin';
import { untilPluginStartServicesReady } from '../services/kibana_services';
import { DashboardListingProps } from './types';

const ListingTableLoadingIndicator = () => {
Expand All @@ -20,7 +20,7 @@ const ListingTableLoadingIndicator = () => {
const LazyDashboardListing = React.lazy(() =>
(async () => {
const modulePromise = import('./dashboard_listing_table');
const [module] = await Promise.all([modulePromise, servicesReady]);
const [module] = await Promise.all([modulePromise, untilPluginStartServicesReady()]);

return {
default: module.DashboardListingTable,
Expand Down
1 change: 0 additions & 1 deletion src/plugins/dashboard/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ export interface DashboardStart {
}

export let resolveServicesReady: () => void;
export const servicesReady = new Promise<void>((resolve) => (resolveServicesReady = resolve));

export class DashboardPlugin
implements
Expand Down

0 comments on commit 8579a52

Please sign in to comment.