Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.8] [Uptime] Enable loading on monitor list (#65670) #66173

Merged
merged 1 commit into from
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface Props {
}

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

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

return (
<EuiBasicTable
loading={loading}
columns={columns}
items={certificates?.certs ?? []}
pagination={pagination}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ export const FingerprintCol: React.FC<Props> = ({ cert }) => {
<EmptyButton>{text} </EmptyButton>
</EuiToolTip>
<EuiCopy textToCopy={val ?? ''}>
{copy => <EuiButtonIcon onClick={copy} iconType="copy" title={COPY_FINGERPRINT} />}
{copy => (
<EuiButtonIcon
aria-label={COPY_FINGERPRINT}
onClick={copy}
iconType="copy"
title={COPY_FINGERPRINT}
/>
)}
</EuiCopy>
</Span>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,7 @@ export const MonitorListComponent: React.FC<Props> = ({
<EuiBasicTable
aria-label={labels.getDescriptionLabel(items.length)}
error={error?.message}
// Only set loading to true when there are no items present to prevent the bug outlined in
// in https://github.com/elastic/eui/issues/2393 . Once that is fixed we can simply set the value here to
// loading={loading}
loading={loading && (!items || items.length < 1)}
loading={loading}
isExpandable={true}
hasActions={true}
itemId="monitor_id"
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/uptime/public/pages/certificates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const CertificatesPage: React.FC = () => {
);
}, [dispatch, page, search, sort.direction, sort.field, lastRefresh]);

const certificates = useSelector(certificatesSelector);
const { data: certificates } = useSelector(certificatesSelector);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ export function* fetchCertificatesEffect() {
);
}

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