[Uptime] Added loading for certificates page on initial load (#111526)

This commit is contained in:
Shahzad 2021-09-08 19:33:54 +02:00 committed by GitHub
parent b36ffc98fc
commit 032810e46a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -15,7 +15,7 @@ import { CertMonitors } from './cert_monitors';
import * as labels from './translations';
import { Cert, CertMonitor } from '../../../common/runtime_types';
import { FingerprintCol } from './fingerprint_col';
import { NO_CERTS_AVAILABLE } from './translations';
import { LOADING_CERTIFICATES, NO_CERTS_AVAILABLE } from './translations';
interface Page {
index: number;
@ -111,7 +111,13 @@ export const CertificateList: React.FC<Props> = ({ page, sort, onChange }) => {
direction: sort.direction,
},
}}
noItemsMessage={<span data-test-subj="uptimeCertsEmptyMessage">{NO_CERTS_AVAILABLE}</span>}
noItemsMessage={
loading ? (
LOADING_CERTIFICATES
) : (
<span data-test-subj="uptimeCertsEmptyMessage">{NO_CERTS_AVAILABLE}</span>
)
}
/>
);
};

View file

@ -70,3 +70,7 @@ export const COPY_FINGERPRINT = i18n.translate('xpack.uptime.certs.list.copyFing
export const NO_CERTS_AVAILABLE = i18n.translate('xpack.uptime.certs.list.empty', {
defaultMessage: 'No Certificates found. Note: Certificates are only visible for Heartbeat 7.8+',
});
export const LOADING_CERTIFICATES = i18n.translate('xpack.uptime.certificates.loading', {
defaultMessage: 'Loading certificates ...',
});