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,
|
EuiEmptyPrompt,
|
||||||
EuiTitle,
|
EuiTitle,
|
||||||
EuiLink,
|
EuiLink,
|
||||||
|
EuiLoadingSpinner,
|
||||||
} from '@elastic/eui';
|
} from '@elastic/eui';
|
||||||
import { i18n } from '@kbn/i18n';
|
import { i18n } from '@kbn/i18n';
|
||||||
import { FormattedMessage } from '@kbn/i18n/react';
|
import { FormattedMessage } from '@kbn/i18n/react';
|
||||||
|
@ -370,8 +371,9 @@ export const ActionsConnectorsList: React.FunctionComponent = () => {
|
||||||
/>
|
/>
|
||||||
<EuiSpacer size="m" />
|
<EuiSpacer size="m" />
|
||||||
{/* Render the view based on if there's data or if they can save */}
|
{/* 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 && table}
|
||||||
{data.length === 0 && canSave && emptyPrompt}
|
{data.length === 0 && canSave && !isLoadingActions && !isLoadingActionTypes && emptyPrompt}
|
||||||
{data.length === 0 && !canSave && noPermissionPrompt}
|
{data.length === 0 && !canSave && noPermissionPrompt}
|
||||||
<ActionsConnectorsContextProvider
|
<ActionsConnectorsContextProvider
|
||||||
value={{
|
value={{
|
||||||
|
|
|
@ -17,6 +17,7 @@ import {
|
||||||
EuiSpacer,
|
EuiSpacer,
|
||||||
EuiEmptyPrompt,
|
EuiEmptyPrompt,
|
||||||
EuiLink,
|
EuiLink,
|
||||||
|
EuiLoadingSpinner,
|
||||||
} from '@elastic/eui';
|
} from '@elastic/eui';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
|
|
||||||
|
@ -389,7 +390,10 @@ export const AlertsList: React.FunctionComponent = () => {
|
||||||
<EuiSpacer size="m" />
|
<EuiSpacer size="m" />
|
||||||
{convertAlertsToTableItems(alertsState.data, alertTypesState.data).length !== 0 && table}
|
{convertAlertsToTableItems(alertsState.data, alertTypesState.data).length !== 0 && table}
|
||||||
{convertAlertsToTableItems(alertsState.data, alertTypesState.data).length === 0 &&
|
{convertAlertsToTableItems(alertsState.data, alertTypesState.data).length === 0 &&
|
||||||
|
!alertTypesState.isLoading &&
|
||||||
|
!alertsState.isLoading &&
|
||||||
emptyPrompt}
|
emptyPrompt}
|
||||||
|
{(alertTypesState.isLoading || alertsState.isLoading) && <EuiLoadingSpinner size="xl" />}
|
||||||
<AlertsContextProvider
|
<AlertsContextProvider
|
||||||
value={{
|
value={{
|
||||||
addFlyoutVisible: alertFlyoutVisible,
|
addFlyoutVisible: alertFlyoutVisible,
|
||||||
|
|
Loading…
Reference in a new issue