Skip to content

Commit 6ab929b

Browse files
authored
[7.x] [Uptime] Enable loading on monitor list (#65670) (#66172)
1 parent 17eb94c commit 6ab929b

File tree

6 files changed

+15
-8
lines changed

6 files changed

+15
-8
lines changed

x-pack/plugins/uptime/public/components/certificates/__tests__/__snapshots__/fingerprint_col.test.tsx.snap

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugins/uptime/public/components/certificates/certificates_list.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ interface Props {
4141
}
4242

4343
export const CertificateList: React.FC<Props> = ({ page, sort, onChange }) => {
44-
const certificates = useSelector(certificatesSelector);
44+
const { data: certificates, loading } = useSelector(certificatesSelector);
4545

4646
const onTableChange = (newVal: Partial<Props>) => {
4747
onChange(newVal.page as Page, newVal.sort as CertSort);
@@ -98,6 +98,7 @@ export const CertificateList: React.FC<Props> = ({ page, sort, onChange }) => {
9898

9999
return (
100100
<EuiBasicTable
101+
loading={loading}
101102
columns={columns}
102103
items={certificates?.certs ?? []}
103104
pagination={pagination}

x-pack/plugins/uptime/public/components/certificates/fingerprint_col.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ export const FingerprintCol: React.FC<Props> = ({ cert }) => {
3232
<EmptyButton>{text} </EmptyButton>
3333
</EuiToolTip>
3434
<EuiCopy textToCopy={val ?? ''}>
35-
{copy => <EuiButtonIcon onClick={copy} iconType="copy" title={COPY_FINGERPRINT} />}
35+
{copy => (
36+
<EuiButtonIcon
37+
aria-label={COPY_FINGERPRINT}
38+
onClick={copy}
39+
iconType="copy"
40+
title={COPY_FINGERPRINT}
41+
/>
42+
)}
3643
</EuiCopy>
3744
</Span>
3845
);

x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,7 @@ export const MonitorListComponent: React.FC<Props> = ({
193193
<EuiBasicTable
194194
aria-label={labels.getDescriptionLabel(items.length)}
195195
error={error?.message}
196-
// Only set loading to true when there are no items present to prevent the bug outlined in
197-
// in https://github.com/elastic/eui/issues/2393 . Once that is fixed we can simply set the value here to
198-
// loading={loading}
199-
loading={loading && (!items || items.length < 1)}
196+
loading={loading}
200197
isExpandable={true}
201198
hasActions={true}
202199
itemId="monitor_id"

x-pack/plugins/uptime/public/pages/certificates.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const CertificatesPage: React.FC = () => {
7272
);
7373
}, [dispatch, page, search, sort.direction, sort.field, lastRefresh]);
7474

75-
const certificates = useSelector(certificatesSelector);
75+
const { data: certificates } = useSelector(certificatesSelector);
7676

7777
return (
7878
<>

x-pack/plugins/uptime/public/state/certificates/certificates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ export function* fetchCertificatesEffect() {
4040
);
4141
}
4242

43-
export const certificatesSelector = ({ certificates }: AppState) => certificates.certs.data;
43+
export const certificatesSelector = ({ certificates }: AppState) => certificates.certs;

0 commit comments

Comments
 (0)