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
2 changes: 1 addition & 1 deletion x-pack/plugins/snapshot_restore/common/types/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface SnapshotDetails {
endTime: string;
endTimeInMillis: number;
durationInMillis: number;
failures: string[];
indexFailures: any[];
shards: SnapshotDetailsShardsStatus;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';

import { useAppDependencies } from '../index';

interface Props {
data: any;
children: React.ReactNode;
}

export const DataPlaceholder: React.SFC<Props> = ({ data, children }) => {
const {
core: { i18n },
} = useAppDependencies();

if (data != null) {
return children;
}

return i18n.translate('xpack.snapshotRestore.dataPlaceholderLabel', {
defaultMessage: '-',
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/

export { DataPlaceholder } from './data_placeholder';
export { RepositoryDeleteProvider } from './repository_delete_provider';
export { RepositoryVerificationBadge } from './repository_verification_badge';
export { RepositoryForm } from './repository_form';

export { RepositoryVerificationBadge } from './repository_verification_badge';
export { SectionError } from './section_error';
export { SectionLoading } from './section_loading';
8 changes: 8 additions & 0 deletions x-pack/plugins/snapshot_restore/public/app/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ export enum REPOSITORY_DOC_PATHS {
gcs = 'repository-gcs.html',
plugins = 'repository.html',
}

export enum SNAPSHOT_STATE {
IN_PROGRESS = 'IN_PROGRESS',
SUCCESS = 'SUCCESS',
FAILED = 'FAILED',
PARTIAL = 'PARTIAL',
INCOMPATIBLE = 'INCOMPATIBLE',
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { useEffect, useState } from 'react';
import React, { useEffect } from 'react';
import { Route, RouteComponentProps, Switch } from 'react-router-dom';

import { EuiPageBody, EuiPageContent, EuiSpacer, EuiTab, EuiTabs, EuiTitle } from '@elastic/eui';

import { BASE_PATH, Section } from '../../constants';
import { useAppDependencies } from '../../index';
import { breadcrumbService } from '../../services/breadcrumb';
import { breadcrumbService } from '../../services/navigation';

import { RepositoryList } from './repository_list';
import { SnapshotList } from './snapshot_list';
Expand All @@ -26,8 +26,6 @@ export const SnapshotRestoreHome: React.FunctionComponent<RouteComponentProps<Ma
},
history,
}) => {
const [activeSection, setActiveSection] = useState<Section>(section);

const {
core: {
i18n: { FormattedMessage },
Expand Down Expand Up @@ -58,7 +56,6 @@ export const SnapshotRestoreHome: React.FunctionComponent<RouteComponentProps<Ma
];

const onSectionChange = (newSection: Section) => {
setActiveSection(newSection);
history.push(`${BASE_PATH}/${newSection}`);
};

Expand All @@ -85,7 +82,7 @@ export const SnapshotRestoreHome: React.FunctionComponent<RouteComponentProps<Ma
{tabs.map(tab => (
<EuiTab
onClick={() => onSectionChange(tab.id)}
isSelected={tab.id === activeSection}
isSelected={tab.id === section}
key={tab.id}
data-test-subject={tab.testSubj}
>
Expand Down
Loading