Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
EuiSpacer,
EuiText,
EuiTitle,
useGeneratedHtmlId,
} from '@elastic/eui';
import type { FunctionComponent } from 'react';
import React, { useState } from 'react';
Expand Down Expand Up @@ -414,6 +415,7 @@ export interface CertificateChainProps {
}
const CertificateChain: FunctionComponent<CertificateChainProps> = ({ certificateChain }) => {
const [showModal, setShowModal] = useState(false);
const modalTitleId = useGeneratedHtmlId();

return (
<>
Expand All @@ -423,9 +425,13 @@ const CertificateChain: FunctionComponent<CertificateChainProps> = ({ certificat
compressed
/>
{showModal && (
<EuiModal onClose={() => setShowModal(false)} maxWidth={euiThemeVars.euiBreakpoints.s}>
<EuiModal
aria-labelledby={modalTitleId}
onClose={() => setShowModal(false)}
maxWidth={euiThemeVars.euiBreakpoints.s}
>
<EuiModalHeader>
<EuiModalHeaderTitle>
<EuiModalHeaderTitle id={modalTitleId}>
<FormattedMessage
id="interactiveSetup.certificateChain.title"
defaultMessage="Certificate chain"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,50 @@ import {
EuiModalHeader,
EuiModalHeaderTitle,
EuiTextColor,
useGeneratedHtmlId,
} from '@elastic/eui';

interface ExternalUrlErrorModalProps {
url: string;
handleClose: () => void;
}

export const ExternalUrlErrorModal = ({ url, handleClose }: ExternalUrlErrorModalProps) => (
<EuiModal onClose={handleClose}>
<EuiModalHeader>
<EuiModalHeaderTitle>
<FormattedMessage
id="visTypeTimeseries.externalUrlErrorModal.headerTitle"
defaultMessage="Access to this external URL is not yet enabled"
/>
</EuiModalHeaderTitle>
</EuiModalHeader>
<EuiModalBody>
<FormattedMessage
id="visTypeTimeseries.externalUrlErrorModal.bodyMessage"
defaultMessage="Configure {externalUrlPolicy} in your {kibanaConfigFileName} to allow access to {url}."
values={{
url: (
<EuiTextColor color="warning" component="span">
{url}
</EuiTextColor>
),
externalUrlPolicy: 'externalUrl.policy',
kibanaConfigFileName: 'kibana.yml',
}}
/>
</EuiModalBody>
<EuiModalFooter>
<EuiButton onClick={handleClose} fill>
export const ExternalUrlErrorModal = ({ url, handleClose }: ExternalUrlErrorModalProps) => {
const externalUrlErrorModalTitleId = useGeneratedHtmlId();

return (
<EuiModal onClose={handleClose} aria-labelledby={externalUrlErrorModalTitleId}>
<EuiModalHeader>
<EuiModalHeaderTitle id={externalUrlErrorModalTitleId}>
<FormattedMessage
id="visTypeTimeseries.externalUrlErrorModal.headerTitle"
defaultMessage="Access to this external URL is not yet enabled"
/>
</EuiModalHeaderTitle>
</EuiModalHeader>
<EuiModalBody>
<FormattedMessage
id="visTypeTimeseries.externalUrlErrorModal.closeButtonLabel"
defaultMessage="Close"
id="visTypeTimeseries.externalUrlErrorModal.bodyMessage"
defaultMessage="Configure {externalUrlPolicy} in your {kibanaConfigFileName} to allow access to {url}."
values={{
url: (
<EuiTextColor color="warning" component="span">
{url}
</EuiTextColor>
),
externalUrlPolicy: 'externalUrl.policy',
kibanaConfigFileName: 'kibana.yml',
}}
/>
</EuiButton>
</EuiModalFooter>
</EuiModal>
);
</EuiModalBody>
<EuiModalFooter>
<EuiButton onClick={handleClose} fill>
<FormattedMessage
id="visTypeTimeseries.externalUrlErrorModal.closeButtonLabel"
defaultMessage="Close"
/>
</EuiButton>
</EuiModalFooter>
</EuiModal>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const DrilldownsWithEmbeddableExample: React.FC = () => {
</EuiFlexGroup>

{showManager && (
<EuiFlyout onClose={() => setShowManager(false)} aria-labelledby="Drilldown Manager">
<EuiFlyout onClose={() => setShowManager(false)} aria-label="Drilldown Manager">
<plugins.uiActionsEnhanced.DrilldownManager
key={viewRef.current}
initialRoute={viewRef.current}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const DrilldownsWithoutEmbeddableExample: React.FC = () => {
</EuiFlexGroup>

{showManager && (
<EuiFlyout onClose={() => setShowManager(false)} aria-labelledby="Drilldown Manager">
<EuiFlyout onClose={() => setShowManager(false)} aria-label="Drilldown Manager">
<plugins.uiActionsEnhanced.DrilldownManager
key={viewRef.current}
initialRoute={viewRef.current}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const DrilldownsWithoutEmbeddableSingleButtonExample: React.FC = () => {
</EuiFlexGroup>

{showManager && (
<EuiFlyout onClose={() => setShowManager(false)} aria-labelledby="Drilldown Manager">
<EuiFlyout onClose={() => setShowManager(false)} aria-label="Drilldown Manager">
<plugins.uiActionsEnhanced.DrilldownManager
initialRoute={'/create'}
dynamicActionManager={managerWithoutEmbeddableSingleButton}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';
import PropTypes from 'prop-types';
import { i18n } from '@kbn/i18n';
Expand All @@ -17,6 +16,7 @@ import {
EuiText,
EuiEmptyPrompt,
EuiSpacer,
useGeneratedHtmlId,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { withSuspense } from '@kbn/presentation-util-plugin/public';
Expand Down Expand Up @@ -48,48 +48,57 @@ const strings = {
}),
};

export const DatasourcePreview = ({ done, datatable }) => (
<EuiModal onClose={done} maxWidth="1000px" className="canvasModal--fixedSize">
<EuiModalHeader>
<EuiModalHeaderTitle>{strings.getModalTitle()}</EuiModalHeaderTitle>
</EuiModalHeader>
<EuiModalBody className="canvasDatasourcePreview">
<EuiText size="s">
<p>
<FormattedMessage
id="xpack.canvas.datasourceDatasourcePreview.modalDescription"
defaultMessage="The following data will be available to the selected element upon clicking {saveLabel} in the sidebar."
values={{
saveLabel: <strong>{strings.getSaveButtonLabel()}</strong>,
}}
/>
</p>
</EuiText>
<EuiSpacer />
{datatable.type === 'error' ? (
<Error payload={datatable} />
) : (
<EuiPanel className="canvasDatasourcePreview__panel" paddingSize="none">
{datatable.rows.length > 0 ? (
<Datatable datatable={datatable} showHeader paginate />
) : (
<EuiEmptyPrompt
title={<h2>{strings.getEmptyTitle()}</h2>}
titleSize="s"
body={
<p>
{strings.getEmptyFirstLineDescription()}
<br />
{strings.getEmptySecondLineDescription()}
</p>
}
export const DatasourcePreview = ({ done, datatable }) => {
const modalTitleId = useGeneratedHtmlId();

return (
<EuiModal
aria-labelledby={modalTitleId}
onClose={done}
maxWidth="1000px"
className="canvasModal--fixedSize"
>
<EuiModalHeader>
<EuiModalHeaderTitle id={modalTitleId}>{strings.getModalTitle()}</EuiModalHeaderTitle>
</EuiModalHeader>
<EuiModalBody className="canvasDatasourcePreview">
<EuiText size="s">
<p>
<FormattedMessage
id="xpack.canvas.datasourceDatasourcePreview.modalDescription"
defaultMessage="The following data will be available to the selected element upon clicking {saveLabel} in the sidebar."
values={{
saveLabel: <strong>{strings.getSaveButtonLabel()}</strong>,
}}
/>
)}
</EuiPanel>
)}
</EuiModalBody>
</EuiModal>
);
</p>
</EuiText>
<EuiSpacer />
{datatable.type === 'error' ? (
<Error payload={datatable} />
) : (
<EuiPanel className="canvasDatasourcePreview__panel" paddingSize="none">
{datatable.rows.length > 0 ? (
<Datatable datatable={datatable} showHeader paginate />
) : (
<EuiEmptyPrompt
title={<h2>{strings.getEmptyTitle()}</h2>}
titleSize="s"
body={
<p>
{strings.getEmptyFirstLineDescription()}
<br />
{strings.getEmptySecondLineDescription()}
</p>
}
/>
)}
</EuiPanel>
)}
</EuiModalBody>
</EuiModal>
);
};

DatasourcePreview.propTypes = {
datatable: PropTypes.object,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
EuiSpacer,
EuiText,
EuiTitle,
htmlIdGenerator,
} from '@elastic/eui';

import { serializeAutoFollowPattern } from '../../../common/services/auto_follow_pattern_serialization';
Expand All @@ -36,12 +37,13 @@ export class AutoFollowPatternRequestFlyout extends PureComponent {
const endpoint = `PUT /_ccr/auto_follow/${name ? name : '<autoFollowPatternName>'}`;
const payload = JSON.stringify(serializeAutoFollowPattern(autoFollowPattern), null, 2);
const request = `${endpoint}\n${payload}`;
const modalTitleId = htmlIdGenerator()('autoFollowPatternRequestFlyoutTitle');

return (
<EuiFlyout maxWidth={480} onClose={close}>
<EuiFlyout maxWidth={480} onClose={close} aria-labelledby={modalTitleId}>
<EuiFlyoutHeader>
<EuiTitle>
<h2>
<h2 id={modalTitleId}>
{name ? (
<FormattedMessage
id="xpack.crossClusterReplication.autoFollowPatternForm.requestFlyout.namedTitle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
EuiSpacer,
EuiText,
EuiTitle,
htmlIdGenerator,
} from '@elastic/eui';

import { serializeFollowerIndex } from '../../../../common/services/follower_index_serialization';
Expand All @@ -35,12 +36,13 @@ export class FollowerIndexRequestFlyout extends PureComponent {
const endpoint = `PUT /${name ? name : '<followerIndexName>'}/_ccr/follow`;
const payload = JSON.stringify(serializeFollowerIndex(followerIndex), null, 2);
const request = `${endpoint}\n${payload}`;
const flyoutTitleId = htmlIdGenerator()('flyoutTitle');

return (
<EuiFlyout maxWidth={480} onClose={close}>
<EuiFlyout maxWidth={480} onClose={close} aria-labelledby={flyoutTitleId}>
<EuiFlyoutHeader>
<EuiTitle>
<h2>
<h2 id={flyoutTitleId}>
<FormattedMessage
id="xpack.crossClusterReplication.followerIndexForm.requestFlyout.title"
defaultMessage="Request"
Expand Down
Loading
Loading