Skip to content

Commit

Permalink
small CR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sabarasaba committed Jun 15, 2021
1 parent f483cc3 commit ac17846
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 27 deletions.
54 changes: 30 additions & 24 deletions x-pack/plugins/ingest_pipelines/public/application/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { FormattedMessage } from '@kbn/i18n/react';
import { EuiPageContent } from '@elastic/eui';
import { EuiPageContent, EuiEmptyPrompt } from '@elastic/eui';
import React, { FunctionComponent } from 'react';
import { Router, Switch, Route } from 'react-router-dom';

Expand All @@ -19,7 +19,6 @@ import {
useAuthorizationContext,
WithPrivileges,
SectionLoading,
NotAuthorizedSection,
} from '../shared_imports';

import { PipelinesList, PipelinesCreate, PipelinesEdit, PipelinesClone } from './sections';
Expand Down Expand Up @@ -61,35 +60,42 @@ export const App: FunctionComponent = () => {
{({ isLoading, hasPrivileges, privilegesMissing }) => {
if (isLoading) {
return (
<SectionLoading>
<FormattedMessage
id="xpack.ingestPipelines.app.checkingPrivilegesDescription"
defaultMessage="Checking privileges…"
/>
</SectionLoading>
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
<SectionLoading>
<FormattedMessage
id="xpack.ingestPipelines.app.checkingPrivilegesDescription"
defaultMessage="Checking privileges…"
/>
</SectionLoading>
</EuiPageContent>
);
}

if (!hasPrivileges) {
return (
<EuiPageContent>
<NotAuthorizedSection
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
<EuiEmptyPrompt
iconType="securityApp"
title={
<FormattedMessage
id="xpack.ingestPipelines.app.deniedPrivilegeTitle"
defaultMessage="Cluster privileges required"
/>
<h2>
<FormattedMessage
id="xpack.ingestPipelines.app.deniedPrivilegeTitle"
defaultMessage="Cluster privileges required"
/>
</h2>
}
message={
<FormattedMessage
id="xpack.ingestPipelines.app.deniedPrivilegeDescription"
defaultMessage="To use Ingest Pipelines, you must have {privilegesCount,
plural, one {this cluster privilege} other {these cluster privileges}}: {missingPrivileges}."
values={{
missingPrivileges: privilegesMissing.cluster!.join(', '),
privilegesCount: privilegesMissing.cluster!.length,
}}
/>
body={
<p>
<FormattedMessage
id="xpack.ingestPipelines.app.deniedPrivilegeDescription"
defaultMessage="To use Ingest Pipelines, you must have {privilegesCount,
plural, one {this cluster privilege} other {these cluster privileges}}: {missingPrivileges}."
values={{
missingPrivileges: privilegesMissing.cluster!.join(', '),
privilegesCount: privilegesMissing.cluster!.length,
}}
/>
</p>
}
/>
</EuiPageContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ export const PipelinesEdit: React.FunctionComponent<RouteComponentProps<MatchPar
<h2>
<FormattedMessage
id="xpack.ingestPipelines.edit.fetchPipelineError"
defaultMessage="Unable to load existing pipeline"
defaultMessage="Unable to load '{name}'"
values={{ name: decodedPipelineName }}
/>
</h2>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const EmptyList: FunctionComponent = () => {
id="xpack.ingestPipelines.list.table.emptyPromptDescription"
defaultMessage="For example, you might create a pipeline with one processor that removes a field and another processor that renames a field."
/>
<br />
{' '}
<EuiLink href={services.documentation.getIngestNodeUrl()} target="_blank" external>
{i18n.translate('xpack.ingestPipelines.list.table.emptyPromptDocumentionLink', {
defaultMessage: 'Learn more',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const PipelinesList: React.FunctionComponent<RouteComponentProps> = ({
<h2 data-test-subj="pipelineLoadError">
<FormattedMessage
id="xpack.ingestPipelines.list.loadErrorTitle"
defaultMessage="Unable to load pipelines."
defaultMessage="Unable to load pipelines"
/>
</h2>
}
Expand Down

0 comments on commit ac17846

Please sign in to comment.