mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
As suggested by @legrego in #28792, this PR adds a config flag to completely disable the welcome screen, which is enabled by the functional test runner to ensure that the welcome screen doesn't pop up.
This commit is contained in:
parent
d0db449622
commit
d5b3984e5a
8 changed files with 6 additions and 46 deletions
|
@ -51,7 +51,8 @@ export default function (kibana) {
|
|||
return Joi.object({
|
||||
enabled: Joi.boolean().default(true),
|
||||
defaultAppId: Joi.string().default('home'),
|
||||
index: Joi.string().default('.kibana')
|
||||
index: Joi.string().default('.kibana'),
|
||||
disableWelcomeScreen: Joi.boolean().default(false),
|
||||
}).default();
|
||||
},
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ export function injectVars(server) {
|
|||
|
||||
return {
|
||||
kbnDefaultAppId: serverConfig.get('kibana.defaultAppId'),
|
||||
disableWelcomeScreen: serverConfig.get('kibana.disableWelcomeScreen'),
|
||||
regionmapsConfig: regionmap,
|
||||
mapConfig: mapConfig,
|
||||
tilemapsConfig: {
|
||||
|
|
|
@ -23,6 +23,7 @@ import { Synopsis } from './synopsis';
|
|||
import { AddData } from './add_data';
|
||||
import { RecentlyAccessed, recentlyAccessedShape } from './recently_accessed';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import chrome from 'ui/chrome';
|
||||
|
||||
import {
|
||||
EuiButton,
|
||||
|
@ -46,7 +47,7 @@ export class Home extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
const isWelcomeEnabled = props.localStorage.getItem(KEY_ENABLE_WELCOME) !== 'false';
|
||||
const isWelcomeEnabled = !(chrome.getInjected('disableWelcomeScreen') || props.localStorage.getItem(KEY_ENABLE_WELCOME) === 'false');
|
||||
|
||||
this.state = {
|
||||
// If welcome is enabled, we wait for loading to complete
|
||||
|
|
|
@ -59,6 +59,7 @@ export default function () {
|
|||
`--elasticsearch.hosts=${formatUrl(servers.elasticsearch)}`,
|
||||
`--elasticsearch.username=${servers.elasticsearch.username}`,
|
||||
`--elasticsearch.password=${servers.elasticsearch.password}`,
|
||||
`--kibana.disableWelcomeScreen=true`,
|
||||
],
|
||||
},
|
||||
|
||||
|
|
|
@ -57,7 +57,6 @@ import {
|
|||
BrowserProvider,
|
||||
InspectorProvider,
|
||||
PieChartProvider,
|
||||
WelcomeProvider,
|
||||
} from './services';
|
||||
|
||||
export default async function ({ readConfigFile }) {
|
||||
|
@ -120,7 +119,6 @@ export default async function ({ readConfigFile }) {
|
|||
browser: BrowserProvider,
|
||||
pieChart: PieChartProvider,
|
||||
inspector: InspectorProvider,
|
||||
welcome: WelcomeProvider,
|
||||
},
|
||||
servers: commonConfig.get('servers'),
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ export { RenderableProvider } from './renderable';
|
|||
export { TableProvider } from './table';
|
||||
export { BrowserProvider } from './browser';
|
||||
export { InspectorProvider } from './inspector';
|
||||
export { WelcomeProvider } from './welcome';
|
||||
|
||||
export * from './visualizations';
|
||||
export * from './dashboard';
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export async function WelcomeProvider({ getService, getPageObjects }) {
|
||||
const browser = getService('browser');
|
||||
const lifecycle = getService('lifecycle');
|
||||
const PageObjects = getPageObjects(['common']);
|
||||
|
||||
const welcome = new class Welcome {
|
||||
async disable() {
|
||||
await browser.setLocalStorageItem('home:welcome:show', 'false');
|
||||
}
|
||||
};
|
||||
|
||||
lifecycle.on('beforeTests', async () => {
|
||||
await PageObjects.common.navigateToApp('home');
|
||||
await welcome.disable();
|
||||
await PageObjects.common.navigateToApp('home');
|
||||
});
|
||||
|
||||
return welcome;
|
||||
}
|
|
@ -15,7 +15,6 @@ export function SecurityPageProvider({ getService, getPageObjects }) {
|
|||
const kibanaServer = getService('kibanaServer');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const welcome = getService('welcome');
|
||||
const PageObjects = getPageObjects(['common', 'header', 'settings', 'home']);
|
||||
|
||||
class LoginPage {
|
||||
|
@ -108,8 +107,6 @@ export function SecurityPageProvider({ getService, getPageObjects }) {
|
|||
throw new Error('Logout is not completed yet');
|
||||
}
|
||||
});
|
||||
|
||||
await welcome.disable();
|
||||
}
|
||||
|
||||
async clickRolesSection() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue