forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Telemetry/opt in welcome screen (elastic#42110)
* refactor opt_in_message * welcome optin card * finish optin in welcome screen * add steps * disable current step * remove checkbox option * add metrics * fix typescript checks * hide in oss * update snapshots * only require TelemetryOptInProvider if telemetry is enabled * pass telemetry description from service * remove x-pack import * remove x-pack import * update image * update per design feedback * update props * fix in oss * await before moving to next screen * utlize bannerId in telemtry provider * keep export in 1 line * ts-ignore banner import * add test * update tests * update translations * update home tests * remove extra license header * showTelemetryOptIn -> shouldShowTelemetryOptIn * remote extra EuiTexts * update jest snapshot * unencrypted telemetry example
- Loading branch information
Showing
40 changed files
with
1,099 additions
and
779 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
src/legacy/core_plugins/kibana/public/home/components/__snapshots__/home.test.js.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 1 addition & 2 deletions
3
src/legacy/core_plugins/kibana/public/home/components/_welcome.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/legacy/core_plugins/kibana/public/home/components/home.test.mocks.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { notificationServiceMock } from '../../../../../../core/public/mocks'; | ||
|
||
jest.doMock('ui/new_platform', () => { | ||
return { | ||
npSetup: { | ||
core: { | ||
notifications: notificationServiceMock.createSetupContract(), | ||
}, | ||
}, | ||
}; | ||
}); | ||
|
||
jest.doMock( | ||
'ui/chrome', | ||
() => ({ | ||
getBasePath: jest.fn(() => 'path'), | ||
getInjected: jest.fn(() => ''), | ||
}), | ||
{ virtual: true } | ||
); | ||
|
||
jest.doMock('ui/capabilities', () => ({ | ||
catalogue: {}, | ||
management: {}, | ||
navLinks: {}, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
src/legacy/core_plugins/kibana/public/home/components/sample_data/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/* | ||
* The UI and related logic for the welcome screen that *should* show only | ||
* when it is enabled (the default) and there is no Kibana-consumed data | ||
* in Elasticsearch. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { | ||
// @ts-ignore | ||
EuiCard, | ||
EuiButton, | ||
EuiButtonEmpty, | ||
} from '@elastic/eui'; | ||
|
||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
|
||
interface Props { | ||
urlBasePath: string; | ||
onDecline: () => void; | ||
onConfirm: () => void; | ||
} | ||
|
||
export function SampleDataCard({ urlBasePath, onDecline, onConfirm }: Props) { | ||
return ( | ||
<EuiCard | ||
image={`${urlBasePath}/plugins/kibana/assets/illo_dashboard.png`} | ||
textAlign="left" | ||
title={<FormattedMessage id="kbn.home.letsStartTitle" defaultMessage="Let's get started" />} | ||
description={ | ||
<FormattedMessage | ||
id="kbn.home.letsStartDescription" | ||
defaultMessage="We noticed that you don't have any data in your cluster. | ||
You can try our sample data and dashboards or jump in with your own data." | ||
/> | ||
} | ||
footer={ | ||
<footer> | ||
<EuiButton fill className="homWelcome__footerAction" onClick={onConfirm}> | ||
<FormattedMessage id="kbn.home.tryButtonLabel" defaultMessage="Try our sample data" /> | ||
</EuiButton> | ||
<EuiButtonEmpty | ||
className="homWelcome__footerAction" | ||
onClick={onDecline} | ||
data-test-subj="skipWelcomeScreen" | ||
> | ||
<FormattedMessage id="kbn.home.exploreButtonLabel" defaultMessage="Explore on my own" /> | ||
</EuiButtonEmpty> | ||
</footer> | ||
} | ||
/> | ||
); | ||
} |
23 changes: 23 additions & 0 deletions
23
src/legacy/core_plugins/kibana/public/home/components/telemetry_opt_in/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* 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. | ||
*/ | ||
import { renderTelemetryOptInCard, Props } from './telemetry_opt_in_card'; | ||
|
||
export const TelemetryOptInCard = (props: Props) => { | ||
return renderTelemetryOptInCard(props); | ||
}; |
Oops, something went wrong.