-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide welcome page privacy statement on cloud instances #128237
Hide welcome page privacy statement on cloud instances #128237
Conversation
Pinging @elastic/kibana-core (Team:Core) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elastic/platform-deployment-management changes lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a test NIT
const mockInitializerContext = coreMock.createPluginInitializerContext(); | ||
const home = homePluginMock.createSetupContract(); | ||
const screenshotMode = screenshotModePluginMock.createSetupContract(); | ||
const cloud = cloudMock.createSetup(); | ||
|
||
describe('TelemetryPublicPlugin', () => { | ||
beforeEach(() => jest.clearAllMocks()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually try to avoid using clearAllMocks
to avoid cleaning potentially pre-feeded mocks from outside (and overall to properly reconstruct the test's sanbox between every test)
describe('stuff', () => {
let mockInitializerContext: ReturnType<typeof coreMock.createPluginInitializerContext>;
let home: ReturnType<typeof homePluginMock.createSetupContract>;
let screenshotMode: ReturnType<typeof screenshotModePluginMock.createSetupContract>;
let cloud: ReturnType<typeof cloudMock.createSetup>;
beforeEach(() => {
mockInitializerContext = coreMock.createPluginInitializerContext();
home = homePluginMock.createSetupContract();
screenshotMode = screenshotModePluginMock.createSetupContract();
cloud = cloudMock.createSetup();
});
it('do some stuff', () => { ... })
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fully on board with adding if statements based on isCloudEnabled
or not. I'd rather build this logic based on a config we already have like telemetry.allowChangingOptInStatus
or add a new config for Cloud to set to hide the notice rather than using these special if statements based on environment.
💚 Build SucceededMetrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: cc @gsoldevila |
@@ -87,6 +88,7 @@ export interface TelemetryPluginStart { | |||
interface TelemetryPluginSetupDependencies { | |||
screenshotMode: ScreenshotModePluginSetup; | |||
home?: HomePublicPluginSetup; | |||
cloud?: CloudSetup; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are missing the changes in the kibana.json
manifest to declare cloud
as an optional dependency
Fair point! Using |
Fair point! Using |
Solves #110638
Updates the welcome page interstitial to show the privacy statement notice if and only if we are not on a cloud instance.