Skip to content

Commit

Permalink
final cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rshen91 committed May 15, 2024
1 parent 09a1d19 commit aaf103d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export const reportingExportModalProvider = ({
};

const generateReportPNG = ({ intl }: { intl: InjectedIntl }) => {
const { layout: outerLayout } = getJobParams(jobProviderOptions, 'printablePdfV2')();
const { layout: outerLayout } = getJobParams(jobProviderOptions, 'pngV2')();
let dimensions = outerLayout?.dimensions;
if (!dimensions) {
const el = document.querySelector('[data-shared-items-container]');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export const EmbedContent = ({
>
<FormattedMessage
id="share.link.copyEmbedCodeButton"
defaultMessage="Copy Embed code"
defaultMessage="Copy embed code"
/>
</EuiButton>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ const ExportContentUi = ({ isDirty, aggregateReportTypes, intl, onClose }: Expor
>
<FormattedMessage
id="share.postURLWatcherMessage.unsavedChanges"
defaultMessage="Unsaved changes: URL may change if you upgrade Kibana"
defaultMessage="URL may change if you upgrade Kibana."
/>
</EuiCallOut>
</>
Expand Down
30 changes: 20 additions & 10 deletions src/plugins/share/public/components/tabs/link/link_content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import {
EuiForm,
EuiSpacer,
EuiText,
EuiToolTip,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import React, { useCallback, useState } from 'react';
import { IShareContext } from '../../context';
Expand Down Expand Up @@ -49,7 +51,7 @@ export const LinkContent = ({
}: LinkProps) => {
const [url, setUrl] = useState<string>('');
const [urlParams] = useState<UrlParams | undefined>(undefined);
const [, setTextCopied] = useState(false);
const [isTextCopied, setTextCopied] = useState(false);
const [, setShortUrlCache] = useState<string | undefined>(undefined);

const getUrlWithUpdatedParams = useCallback(
Expand Down Expand Up @@ -142,16 +144,24 @@ export const LinkContent = ({
</EuiForm>
<EuiFlexGroup justifyContent="flexEnd" responsive={false}>
<EuiFlexItem grow={false}>
<EuiButton
fill
data-test-subj="copyShareUrlButton"
data-share-url={url}
onBlur={() => (objectType === 'lens' && isDirty ? null : setTextCopied(false))}
onClick={copyUrlHelper}
color={objectType === 'lens' && isDirty ? 'warning' : 'primary'}
<EuiToolTip
content={
isTextCopied
? i18n.translate('share.link.copied', { defaultMessage: 'Text copied' })
: null
}
>
<FormattedMessage id="share.link.copyLinkButton" defaultMessage="Copy link" />
</EuiButton>
<EuiButton
fill
data-test-subj="copyShareUrlButton"
data-share-url={url}
onBlur={() => (objectType === 'lens' && isDirty ? null : setTextCopied(false))}
onClick={copyUrlHelper}
color={objectType === 'lens' && isDirty ? 'warning' : 'primary'}
>
<FormattedMessage id="share.link.copyLinkButton" defaultMessage="Copy link" />
</EuiButton>
</EuiToolTip>
</EuiFlexItem>
</EuiFlexGroup>
</>
Expand Down

0 comments on commit aaf103d

Please sign in to comment.