Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SoniaSanzV committed Dec 4, 2024
1 parent 8fca143 commit 039c7f1
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,24 +172,32 @@ export const PolicyList: React.FunctionComponent<RouteComponentProps<MatchParams
{!isSlmRunning ? (
<Fragment>
<EuiCallOut
title="Snapshot lifecycle management (SLM) is not running"
title={
<FormattedMessage
id="xpack.snapshotRestore.slmWarningTitle"
defaultMessage="Snapshot lifecycle management (SLM) is not running"
/>
}
color="warning"
iconType="warning"
>
<p>
{i18n.translate('xpack.snapshotRestore.slmWarning', {
defaultMessage: 'Policies are not executed. You must restart SLM',
})}{' '}
<EuiLink
href={docLinks.links.snapshotRestore.slmStart}
external={true}
target="_blank"
>
{i18n.translate('xpack.snapshotRestore.slmDocLink', {
defaultMessage: 'by using the API.',
})}
</EuiLink>
</p>
<FormattedMessage
id="xpack.snapshotRestore.slmWarningDescription"
defaultMessage="Policies are not executed. You must restart SLM {slmDocLink}"
values={{
slmDocLink: (
<EuiLink
href={docLinks.links.snapshotRestore.slmStart}
external={true}
target="_blank"
>
{i18n.translate('xpack.snapshotRestore.slmDocLink', {
defaultMessage: 'by using the API.',
})}
</EuiLink>
),
}}
/>
</EuiCallOut>
<EuiSpacer />
</Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export const SnapshotTable: React.FunctionComponent<Props> = (props: Props) => {
defaultMessage: 'State',
}),
truncateText: false,
sortable: true,
render: (state: string) => <SnapshotState state={state} tooltipIcon={false} />,
sortable: false,
render: (state: string) => <SnapshotState state={state} displayTooltipIcon={false} />,
},
{
field: 'repository',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { useServices } from '../../../../../app_context';

interface Props {
state: any;
tooltipIcon: boolean;
displayTooltipIcon: boolean;
}

export const SnapshotState: React.FC<Props> = ({ state, tooltipIcon }) => {
export const SnapshotState: React.FC<Props> = ({ state, displayTooltipIcon }) => {
const { i18n } = useServices();

const stateMap: any = {
Expand Down Expand Up @@ -57,7 +57,7 @@ export const SnapshotState: React.FC<Props> = ({ state, tooltipIcon }) => {

const { color, label, tip } = stateMap[state];

const iconTip = tooltipIcon && tip && <EuiIcon type="questionInCircle" />;
const iconTip = displayTooltipIcon && tip && <EuiIcon type="questionInCircle" />;

return (
<EuiToolTip position="top" content={tip}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const TabSummary: React.FC<Props> = ({ snapshotDetails }) => {
</EuiDescriptionListTitle>

<EuiDescriptionListDescription className="eui-textBreakWord" data-test-subj="value">
<SnapshotState state={state} tooltipIcon={true} />
<SnapshotState state={state} displayTooltipIcon={true} />
</EuiDescriptionListDescription>
</EuiFlexItem>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const sortFieldToESParams = {
durationInMillis: 'duration',
'shards.total': 'shard_count',
'shards.failed': 'failed_shard_count',
state: 'name',
};

const isSearchingForNonExistentRepository = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export const snapshotListSchema = schema.object({
schema.literal('startTimeInMillis'),
schema.literal('shards.total'),
schema.literal('shards.failed'),
schema.literal('state'),
]),
sortDirection: schema.oneOf([schema.literal('desc'), schema.literal('asc')]),
pageIndex: schema.number(),
Expand Down

0 comments on commit 039c7f1

Please sign in to comment.