Fixed connector and alerts view flashing empty state before loading list (#58693)
This commit is contained in:
parent
a06cc31583
commit
515348438b
|
@ -14,6 +14,7 @@ import {
|
|||
EuiEmptyPrompt,
|
||||
EuiTitle,
|
||||
EuiLink,
|
||||
EuiLoadingSpinner,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
@ -370,8 +371,9 @@ export const ActionsConnectorsList: React.FunctionComponent = () => {
|
|||
/>
|
||||
<EuiSpacer size="m" />
|
||||
{/* Render the view based on if there's data or if they can save */}
|
||||
{(isLoadingActions || isLoadingActionTypes) && <EuiLoadingSpinner size="xl" />}
|
||||
{data.length !== 0 && table}
|
||||
{data.length === 0 && canSave && emptyPrompt}
|
||||
{data.length === 0 && canSave && !isLoadingActions && !isLoadingActionTypes && emptyPrompt}
|
||||
{data.length === 0 && !canSave && noPermissionPrompt}
|
||||
<ActionsConnectorsContextProvider
|
||||
value={{
|
||||
|
|
|
@ -17,6 +17,7 @@ import {
|
|||
EuiSpacer,
|
||||
EuiEmptyPrompt,
|
||||
EuiLink,
|
||||
EuiLoadingSpinner,
|
||||
} from '@elastic/eui';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
|
@ -389,7 +390,10 @@ export const AlertsList: React.FunctionComponent = () => {
|
|||
<EuiSpacer size="m" />
|
||||
{convertAlertsToTableItems(alertsState.data, alertTypesState.data).length !== 0 && table}
|
||||
{convertAlertsToTableItems(alertsState.data, alertTypesState.data).length === 0 &&
|
||||
!alertTypesState.isLoading &&
|
||||
!alertsState.isLoading &&
|
||||
emptyPrompt}
|
||||
{(alertTypesState.isLoading || alertsState.isLoading) && <EuiLoadingSpinner size="xl" />}
|
||||
<AlertsContextProvider
|
||||
value={{
|
||||
addFlyoutVisible: alertFlyoutVisible,
|
||||
|
|
Loading…
Reference in a new issue