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

[ML] Data Visualizer: Remove import reference for users without import privileges #135905

Merged
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 @@ -26,9 +26,10 @@ import { WelcomeContent } from './welcome_content';

interface Props {
onFilePickerChange(files: FileList | null): void;
hasPermissionToImport: boolean;
}

export const AboutPanel: FC<Props> = ({ onFilePickerChange }) => {
export const AboutPanel: FC<Props> = ({ onFilePickerChange, hasPermissionToImport }) => {
return (
<EuiPageBody
paddingSize="none"
Expand All @@ -39,7 +40,7 @@ export const AboutPanel: FC<Props> = ({ onFilePickerChange }) => {
<EuiPageContent hasShadow={false} hasBorder>
<EuiFlexGroup gutterSize="xl">
<EuiFlexItem grow={true}>
<WelcomeContent />
<WelcomeContent hasPermissionToImport={hasPermissionToImport} />

<EuiHorizontalRule margin="l" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiSpacer, EuiText, EuiTitle } from

import { useDataVisualizerKibana } from '../../../kibana_context';

export const WelcomeContent: FC = () => {
interface Props {
hasPermissionToImport: boolean;
}

export const WelcomeContent: FC<Props> = ({ hasPermissionToImport }) => {
const {
services: {
fileUpload: { getMaxBytesFormatted },
Expand All @@ -37,10 +41,17 @@ export const WelcomeContent: FC = () => {
<EuiSpacer size="s" />
<EuiText>
<p>
<FormattedMessage
id="xpack.dataVisualizer.file.welcomeContent.visualizeDataFromLogFileDescription"
defaultMessage="Upload your file, analyze its data, and optionally import the data into an Elasticsearch index."
/>
{hasPermissionToImport ? (
<FormattedMessage
id="xpack.dataVisualizer.file.welcomeContent.visualizeAndImportDataFromLogFileDescription"
defaultMessage="Upload your file, analyze its data, and optionally import the data into an Elasticsearch index."
/>
) : (
<FormattedMessage
id="xpack.dataVisualizer.file.welcomeContent.visualizeDataFromLogFileDescription"
defaultMessage="Upload your file and analyze its data."
/>
)}
</p>
</EuiText>
<EuiSpacer size="s" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,12 @@ export class FileDataVisualizerView extends Component {
<div>
{mode === MODE.READ && (
<>
{!loading && !loaded && <AboutPanel onFilePickerChange={this.onFilePickerChange} />}
{!loading && !loaded && (
<AboutPanel
onFilePickerChange={this.onFilePickerChange}
hasPermissionToImport={hasPermissionToImport}
/>
)}

{loading && <LoadingPanel />}

Expand Down