Remove Has Data check from Alerts page so page is always accessible (#154851)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Coen Warmer 2023-04-17 15:15:15 +02:00 committed by GitHub
parent 13f9d7ac7d
commit 035d28e757
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 26 deletions

View file

@ -28,7 +28,6 @@ import {
useAlertSearchBarStateContainer,
} from '../../components/shared/alert_search_bar/containers';
import { calculateTimeRangeBucketSize } from '../overview/helpers/calculate_bucket_size';
import { getNoDataConfig } from '../../utils/no_data_config';
import { getAlertSummaryTimeRange } from '../../utils/alert_summary_widget';
import { observabilityAlertFeatureIds } from '../../config/alert_feature_ids';
import type { ObservabilityAppServices } from '../../application/types';
@ -49,7 +48,6 @@ function InternalAlertsPage() {
timefilter: { timefilter: timeFilterService },
},
},
docLinks,
http,
notifications: { toasts },
triggersActionsUi: {
@ -162,25 +160,14 @@ function InternalAlertsPage() {
const manageRulesHref = http.basePath.prepend('/app/observability/alerts/rules');
// If there is any data, set hasData to true otherwise we need to wait till all the data is loaded before setting hasData to true or false; undefined indicates the data is still loading.
const hasData = hasAnyData === true || (isAllRequestsComplete === false ? undefined : false);
if (!hasAnyData && !isAllRequestsComplete) {
return <LoadingObservability />;
}
const noDataConfig = getNoDataConfig({
hasData,
basePath: http.basePath,
docsLink: docLinks.links.observability.guide,
});
return (
<Provider value={alertSearchBarStateContainer}>
<ObservabilityPageTemplate
noDataConfig={noDataConfig}
isPageDataLoaded={isAllRequestsComplete}
data-test-subj={noDataConfig ? 'noDataPage' : 'alertsPageWithData'}
data-test-subj="alertsPageWithData"
pageHeader={{
pageTitle: (
<>{i18n.translate('xpack.observability.alertsTitle', { defaultMessage: 'Alerts' })} </>

View file

@ -41,12 +41,6 @@ export default ({ getService }: FtrProviderContext) => {
await esArchiver.unload('x-pack/test/functional/es_archives/observability/alerts');
});
describe('With no data', () => {
it('Shows the no data screen', async () => {
await observability.alerts.common.getNoDataPageOrFail();
});
});
describe('Alerts table', () => {
before(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/infra/simple_logs');

View file

@ -39,12 +39,6 @@ export default ({ getService }: FtrProviderContext) => {
await esArchiver.unload('x-pack/test/functional/es_archives/observability/alerts');
});
describe('With no data', () => {
it('Shows the no data screen', async () => {
await observability.alerts.common.getNoDataPageOrFail();
});
});
// FLAKY: https://github.com/elastic/kibana/issues/124681
describe.skip('Stat counters', () => {
beforeEach(async () => {