+
@@ -84,7 +86,7 @@ export const App: React.FunctionComponent = () => {
) : (
-
+
= ({ children, ...rest }) => {
+ return (
+
+
+
+
+
+
+ {children}
+
+
+
+ );
+};
+
+export const SectionLoading: React.FunctionComponent = ({ children }) => {
+ return (
+ }
+ body={{children}}
+ data-test-subj="sectionLoading"
+ />
+ );
+};
+
+/*
+ * Loading component used for full page loads.
+ * For tabbed sections, or within the context of a wizard,
+ * the component may be more appropriate
+ */
+export const PageLoading: React.FunctionComponent = ({ children }) => {
+ return (
+
+ }
+ body={{children}}
+ data-test-subj="sectionLoading"
+ />
+
+ );
+};
diff --git a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_logistics.tsx b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_logistics.tsx
index 6443d774c9ac7..06c65a1713692 100644
--- a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_logistics.tsx
+++ b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_logistics.tsx
@@ -30,7 +30,7 @@ import { useCore, useServices } from '../../../app_context';
import { DEFAULT_POLICY_SCHEDULE, DEFAULT_POLICY_FREQUENCY } from '../../../constants';
import { useLoadRepositories } from '../../../services/http';
import { linkToAddRepository } from '../../../services/navigation';
-import { SectionLoading } from '../../';
+import { InlineLoading } from '../../';
import { StepProps } from './';
import { reactRouterNavigate } from '../../../../../../../../src/plugins/kibana_react/public';
@@ -174,12 +174,12 @@ export const PolicyStepLogistics: React.FunctionComponent = ({
const renderRepositorySelect = () => {
if (isLoadingRepositories) {
return (
-
+
-
+
);
}
diff --git a/x-pack/plugins/snapshot_restore/public/application/components/section_loading.tsx b/x-pack/plugins/snapshot_restore/public/application/components/section_loading.tsx
deleted file mode 100644
index c1548ad960bb0..0000000000000
--- a/x-pack/plugins/snapshot_restore/public/application/components/section_loading.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import React from 'react';
-
-import {
- EuiEmptyPrompt,
- EuiLoadingSpinner,
- EuiText,
- EuiFlexGroup,
- EuiFlexItem,
- EuiTextColor,
-} from '@elastic/eui';
-
-interface Props {
- inline?: boolean;
- children: React.ReactNode;
- [key: string]: any;
-}
-
-export const SectionLoading: React.FunctionComponent = ({ inline, children, ...rest }) => {
- if (inline) {
- return (
-
-
-
-
-
-
- {children}
-
-
-
- );
- }
-
- return (
- }
- body={{children}}
- data-test-subj="sectionLoading"
- />
- );
-};
diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/home.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/home.tsx
index e4a23bac636d8..211d30181c25c 100644
--- a/x-pack/plugins/snapshot_restore/public/application/sections/home/home.tsx
+++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/home.tsx
@@ -9,18 +9,7 @@ import React, { useEffect } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { Route, RouteComponentProps, Switch } from 'react-router-dom';
-import {
- EuiButtonEmpty,
- EuiFlexGroup,
- EuiFlexItem,
- EuiPageBody,
- EuiPageContent,
- EuiSpacer,
- EuiTab,
- EuiTabs,
- EuiTitle,
- EuiText,
-} from '@elastic/eui';
+import { EuiButtonEmpty, EuiPageHeader, EuiSpacer } from '@elastic/eui';
import { BASE_PATH, Section } from '../../constants';
import { useConfig, useCore } from '../../app_context';
@@ -100,79 +89,65 @@ export const SnapshotRestoreHome: React.FunctionComponent
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ <>
+
-
-
-
-
-
-
- {tabs.map((tab) => (
- onSectionChange(tab.id)}
- isSelected={tab.id === section}
- key={tab.id}
- data-test-subj={tab.id.toLowerCase() + '_tab'}
- >
- {tab.name}
-
- ))}
-
+
+ }
+ rightSideItems={[
+
+
+ ,
+ ]}
+ description={
+
+ }
+ tabs={tabs.map((tab) => ({
+ onClick: () => onSectionChange(tab.id),
+ isSelected: tab.id === section,
+ key: tab.id,
+ 'data-test-subj': tab.id.toLowerCase() + '_tab',
+ label: tab.name,
+ }))}
+ />
-
+
-
-
- {/* We have two separate SnapshotList routes because repository names could have slashes in
- * them. This would break a route with a path like snapshots/:repositoryName?/:snapshotId*
- */}
-
-
-
-
-
-
-
+
+
+ {/* We have two separate SnapshotList routes because repository names could have slashes in
+ * them. This would break a route with a path like snapshots/:repositoryName?/:snapshotId*
+ */}
+
+
+
+
+
+ >
);
};
diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/policy_details.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/policy_details.tsx
index 2bad30b95081d..0a283d406e5aa 100644
--- a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/policy_details.tsx
+++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/policy_details.tsx
@@ -40,6 +40,7 @@ import { linkToEditPolicy, linkToSnapshot } from '../../../../services/navigatio
import {
SectionLoading,
+ InlineLoading,
PolicyExecuteProvider,
PolicyDeleteProvider,
} from '../../../../components';
@@ -318,7 +319,7 @@ export const PolicyDetails: React.FunctionComponent = ({
{policyDetails && policyDetails.policy && policyDetails.policy.inProgress ? (
<>
-
+
= ({
values={{ snapshotName: policyDetails.policy.inProgress.snapshotName }}
/>
-
+
>
) : null}
{renderTabs()}
diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/policy_add/policy_add.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/policy_add/policy_add.tsx
index 7b1c10ec59e8a..3927b73abf093 100644
--- a/x-pack/plugins/snapshot_restore/public/application/sections/policy_add/policy_add.tsx
+++ b/x-pack/plugins/snapshot_restore/public/application/sections/policy_add/policy_add.tsx
@@ -9,13 +9,13 @@ import React, { useEffect, useState } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { RouteComponentProps } from 'react-router-dom';
-import { EuiPageBody, EuiPageContent, EuiSpacer, EuiTitle } from '@elastic/eui';
+import { EuiPageContentBody, EuiSpacer, EuiPageHeader } from '@elastic/eui';
import { SlmPolicyPayload } from '../../../../common/types';
import { TIME_UNITS } from '../../../../common';
-import { SectionError, Error } from '../../../shared_imports';
+import { SectionError, PageError } from '../../../shared_imports';
-import { PolicyForm, SectionLoading } from '../../components';
+import { PolicyForm, PageLoading } from '../../components';
import { BASE_PATH, DEFAULT_POLICY_SCHEDULE } from '../../constants';
import { breadcrumbService, docTitleService } from '../../services/navigation';
import { addPolicy, useLoadIndices } from '../../services/http';
@@ -87,49 +87,57 @@ export const PolicyAdd: React.FunctionComponent = ({
setSaveError(null);
};
+ if (isLoadingIndices) {
+ return (
+
+
+
+ );
+ }
+
+ if (errorLoadingIndices) {
+ return (
+
+ }
+ error={errorLoadingIndices}
+ />
+ );
+ }
+
return (
-
-
-
-
+
+
-
-
-
- {isLoadingIndices ? (
-
-
-
- ) : errorLoadingIndices ? (
-
- }
- error={errorLoadingIndices as Error}
- />
- ) : (
-
- )}
-
-
+
+ }
+ />
+
+
+
+
+
);
};
diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/policy_edit/policy_edit.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/policy_edit/policy_edit.tsx
index 0ad1902845770..4ab0f15cc5523 100644
--- a/x-pack/plugins/snapshot_restore/public/application/sections/policy_edit/policy_edit.tsx
+++ b/x-pack/plugins/snapshot_restore/public/application/sections/policy_edit/policy_edit.tsx
@@ -9,12 +9,12 @@ import React, { useEffect, useState } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { RouteComponentProps } from 'react-router-dom';
-import { EuiPageBody, EuiPageContent, EuiSpacer, EuiTitle, EuiCallOut } from '@elastic/eui';
+import { EuiPageContentBody, EuiPageHeader, EuiSpacer, EuiCallOut } from '@elastic/eui';
import { SlmPolicyPayload } from '../../../../common/types';
-import { SectionError, Error } from '../../../shared_imports';
+import { SectionError, Error, PageError } from '../../../shared_imports';
import { useDecodedParams } from '../../lib';
import { TIME_UNITS } from '../../../../common/constants';
-import { SectionLoading, PolicyForm } from '../../components';
+import { PageLoading, PolicyForm } from '../../components';
import { BASE_PATH } from '../../constants';
import { useServices } from '../../app_context';
import { breadcrumbService, docTitleService } from '../../services/navigation';
@@ -106,21 +106,39 @@ export const PolicyEdit: React.FunctionComponent {
+ return saveError ? (
+
+ }
+ error={saveError}
+ />
+ ) : null;
+ };
+
+ const clearSaveError = () => {
+ setSaveError(null);
+ };
+
const renderLoading = () => {
- return errorLoadingPolicy ? (
-
+ return isLoadingPolicy ? (
+
-
+
) : (
-
+
-
+
);
};
@@ -139,8 +157,9 @@ export const PolicyEdit: React.FunctionComponent
- }
- error={errorLoadingIndices as Error}
- />
- );
- }
- };
-
- const renderSaveError = () => {
- return saveError ? (
-
}
- error={saveError}
+ error={errorLoadingIndices as Error}
/>
- ) : null;
- };
-
- const clearSaveError = () => {
- setSaveError(null);
+ );
};
- const renderContent = () => {
- if (isLoadingPolicy || isLoadingIndices) {
- return renderLoading();
- }
- if (errorLoadingPolicy || errorLoadingIndices) {
- return renderError();
- }
+ if (isLoadingPolicy || isLoadingIndices) {
+ return renderLoading();
+ }
- return (
- <>
- {policy.isManagedPolicy ? (
- <>
-
- }
- />
-
- >
- ) : null}
-
- >
- );
- };
+ if (errorLoadingPolicy || errorLoadingIndices) {
+ return renderError();
+ }
return (
-
-
-
-
+
+
-
-
-
- {renderContent()}
-
-
+
+ }
+ />
+
+
+ {policy.isManagedPolicy ? (
+ <>
+
+ }
+ />
+
+ >
+ ) : null}
+
+
+
);
};
diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/repository_add/repository_add.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/repository_add/repository_add.tsx
index 343c0b60a2253..100d345a49c4d 100644
--- a/x-pack/plugins/snapshot_restore/public/application/sections/repository_add/repository_add.tsx
+++ b/x-pack/plugins/snapshot_restore/public/application/sections/repository_add/repository_add.tsx
@@ -10,7 +10,7 @@ import React, { useEffect, useState } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { RouteComponentProps } from 'react-router-dom';
-import { EuiPageBody, EuiPageContent, EuiSpacer, EuiTitle } from '@elastic/eui';
+import { EuiPageContentBody, EuiSpacer, EuiPageHeader } from '@elastic/eui';
import { Repository, EmptyRepository } from '../../../../common/types';
import { SectionError } from '../../../shared_imports';
@@ -79,25 +79,27 @@ export const RepositoryAdd: React.FunctionComponent = ({
};
return (
-
-
-
-
+
+
-
-
-
-
-
-
+
+ }
+ />
+
+
+
+
+
);
};
diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/repository_edit/repository_edit.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/repository_edit/repository_edit.tsx
index e27dd255f3bdf..9ecd1d0e3fafe 100644
--- a/x-pack/plugins/snapshot_restore/public/application/sections/repository_edit/repository_edit.tsx
+++ b/x-pack/plugins/snapshot_restore/public/application/sections/repository_edit/repository_edit.tsx
@@ -5,15 +5,15 @@
* 2.0.
*/
-import React, { useEffect, useState, Fragment } from 'react';
+import React, { useEffect, useState } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { RouteComponentProps } from 'react-router-dom';
-import { EuiCallOut, EuiPageBody, EuiPageContent, EuiSpacer, EuiTitle } from '@elastic/eui';
+import { EuiCallOut, EuiPageContentBody, EuiPageHeader, EuiSpacer } from '@elastic/eui';
import { Repository, EmptyRepository } from '../../../../common/types';
-import { SectionError, Error } from '../../../shared_imports';
-import { RepositoryForm, SectionLoading } from '../../components';
+import { PageError, SectionError, Error } from '../../../shared_imports';
+import { RepositoryForm, PageLoading } from '../../components';
import { BASE_PATH, Section } from '../../constants';
import { useServices } from '../../app_context';
import { breadcrumbService, docTitleService } from '../../services/navigation';
@@ -79,12 +79,12 @@ export const RepositoryEdit: React.FunctionComponent {
return (
-
+
-
+
);
};
@@ -106,7 +106,7 @@ export const RepositoryEdit: React.FunctionComponent {
+ setSaveError(null);
+ };
+
const renderSaveError = () => {
return saveError ? (
{
- setSaveError(null);
- };
-
- const renderContent = () => {
- if (loadingRepository) {
- return renderLoading();
- }
- if (repositoryError) {
- return renderError();
- }
-
- const { isManagedRepository } = repositoryData;
-
- return (
-
- {isManagedRepository ? (
-
-
- }
- />
-
-
- ) : null}
-
-
- );
- };
-
return (
-
-
-
-
+
+
-
-
-
- {renderContent()}
-
-
+
+ }
+ />
+
+
+
+ {isManagedRepository ? (
+ <>
+
+ }
+ />
+
+ >
+ ) : null}
+
+
+
);
};
diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/restore_snapshot/restore_snapshot.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/restore_snapshot/restore_snapshot.tsx
index 685f3c9346f49..0f950ef3234ba 100644
--- a/x-pack/plugins/snapshot_restore/public/application/sections/restore_snapshot/restore_snapshot.tsx
+++ b/x-pack/plugins/snapshot_restore/public/application/sections/restore_snapshot/restore_snapshot.tsx
@@ -8,12 +8,12 @@
import React, { useEffect, useState } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { RouteComponentProps } from 'react-router-dom';
-import { EuiPageBody, EuiPageContent, EuiSpacer, EuiTitle } from '@elastic/eui';
+import { EuiPageContentBody, EuiPageHeader, EuiSpacer } from '@elastic/eui';
import { SnapshotDetails, RestoreSettings } from '../../../../common/types';
-import { SectionError, Error } from '../../../shared_imports';
+import { SectionError, Error, PageError } from '../../../shared_imports';
import { BASE_PATH } from '../../constants';
-import { SectionLoading, RestoreSnapshotForm } from '../../components';
+import { PageLoading, RestoreSnapshotForm } from '../../components';
import { useServices } from '../../app_context';
import { breadcrumbService, docTitleService } from '../../services/navigation';
import { useLoadSnapshot, executeRestore } from '../../services/http';
@@ -76,12 +76,12 @@ export const RestoreSnapshot: React.FunctionComponent {
return (
-
+
-
+
);
};
@@ -103,8 +103,9 @@ export const RestoreSnapshot: React.FunctionComponent {
- if (loadingSnapshot) {
- return renderLoading();
- }
- if (snapshotError) {
- return renderError();
- }
+ if (loadingSnapshot) {
+ return renderLoading();
+ }
- return (
-
- );
- };
+ if (snapshotError) {
+ return renderError();
+ }
return (
-
-
-
-
+
+
-
-
-
- {renderContent()}
-
-
+
+ }
+ />
+
+
+
+
+
);
};
diff --git a/x-pack/plugins/snapshot_restore/public/shared_imports.ts b/x-pack/plugins/snapshot_restore/public/shared_imports.ts
index c38f0daedf996..759453edaba5d 100644
--- a/x-pack/plugins/snapshot_restore/public/shared_imports.ts
+++ b/x-pack/plugins/snapshot_restore/public/shared_imports.ts
@@ -12,6 +12,7 @@ export {
Frequency,
NotAuthorizedSection,
SectionError,
+ PageError,
sendRequest,
SendRequestConfig,
SendRequestResponse,
diff --git a/x-pack/test/functional_with_es_ssl/apps/ml/alert_flyout.ts b/x-pack/test/functional_with_es_ssl/apps/ml/alert_flyout.ts
index 63326448ec1e5..777e6fd598f45 100644
--- a/x-pack/test/functional_with_es_ssl/apps/ml/alert_flyout.ts
+++ b/x-pack/test/functional_with_es_ssl/apps/ml/alert_flyout.ts
@@ -67,7 +67,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
let testJobId = '';
- describe('anomaly detection alert', function () {
+ // Failing: See https://github.com/elastic/kibana/issues/102012
+ describe.skip('anomaly detection alert', function () {
this.tags('ciGroup13');
before(async () => {
diff --git a/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat_dashboard.js b/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat_dashboard.js
index b678e88bcf0df..502c950d2b113 100644
--- a/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat_dashboard.js
+++ b/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat_dashboard.js
@@ -15,6 +15,8 @@ const ARCHIVE = resolve(INTEGRATION_TEST_ROOT, 'test/es_archives/metricbeat');
export default function ({ getService, getPageObjects, updateBaselines }) {
const screenshot = getService('screenshots');
const browser = getService('browser');
+ const find = getService('find');
+ const log = getService('log');
const esArchiver = getService('esArchiver');
const PageObjects = getPageObjects(['common', 'dashboard', 'timePicker']);
@@ -28,7 +30,7 @@ export default function ({ getService, getPageObjects, updateBaselines }) {
'dashboard',
'view/Metricbeat-system-overview-ecs?_g=(filters:!(),refreshInterval:(pause:!t,value:0),' +
'time:(from:%272020-09-29T19:02:37.902Z%27,to:%272020-09-29T19:06:43.218Z%27))&_a=' +
- '(description:%27Overview%20of%20system%20metrics%27,filters:!(),fullScreenMode:!t,' +
+ '(description:%27Overview%20of%20system%20metrics%27,filters:!(),' +
'options:(darkTheme:!f),query:(language:kuery,query:%27%27),timeRestore:!f,' +
'title:%27%5BMetricbeat%20System%5D%20Overview%20ECS%27,viewMode:view)',
{
@@ -45,6 +47,7 @@ export default function ({ getService, getPageObjects, updateBaselines }) {
// await PageObjects.dashboard.clickFullScreenMode();
await PageObjects.common.sleep(2000);
+ await find.clickByButtonText('Dismiss');
await PageObjects.dashboard.waitForRenderComplete();
await browser.setScreenshotSize(1000, 1000);
});
@@ -61,7 +64,7 @@ export default function ({ getService, getPageObjects, updateBaselines }) {
);
expect(percentDifference).to.be.lessThan(0.01);
} finally {
- await PageObjects.dashboard.clickExitFullScreenLogoButton();
+ log.debug('### Screenshot taken');
}
});
});
diff --git a/yarn.lock b/yarn.lock
index a12920f72ba82..a9a81585000b5 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -9293,17 +9293,16 @@ chrome-trace-event@^1.0.2:
dependencies:
tslib "^1.9.0"
-chromedriver@^90.0.0:
- version "90.0.0"
- resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-90.0.0.tgz#1b18960a31a12884981bdc270b43c4356ce7a65a"
- integrity sha512-k+GMmNb7cmuCCctQvUIeNxDGSq8DJauO+UKQS2qLT8aA36CPEcv8rpFepf6lRkNaIlfwdCUt/0B5bZDw3wY2yw==
+chromedriver@^91.0.1:
+ version "91.0.1"
+ resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-91.0.1.tgz#4d70a569901e356c978a41de3019c464f2a8ebd0"
+ integrity sha512-9LktpHiUxM4UWUsr+jI1K1YKx2GENt6BKKJ2mibPj1Wc6ODzX/3fFIlr8CZ4Ftuyga+dHTTbAyPWKwKvybEbKA==
dependencies:
"@testim/chrome-version" "^1.0.7"
axios "^0.21.1"
del "^6.0.0"
extract-zip "^2.0.1"
https-proxy-agent "^5.0.0"
- mkdirp "^1.0.4"
proxy-from-env "^1.1.0"
tcp-port-used "^1.0.1"