Skip to content

Commit

Permalink
[Telemetry] Permanently hide the telemetry notice on dismissal (elast…
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored Jun 19, 2023
1 parent 9fc9947 commit 14c5fff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/plugins/telemetry/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ export function registerRoutes(options: RegisterRoutesParams) {
registerTelemetryConfigRoutes(options);
registerTelemetryUsageStatsRoutes(router, telemetryCollectionManager, isDev, getSecurity);
registerTelemetryOptInStatsRoutes(router, telemetryCollectionManager);
registerTelemetryUserHasSeenNotice(router);
registerTelemetryUserHasSeenNotice(router, options.currentKibanaVersion);
registerTelemetryLastReported(router, savedObjectsInternalClient$);
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
updateTelemetrySavedObject,
} from '../saved_objects';

export function registerTelemetryUserHasSeenNotice(router: IRouter) {
export function registerTelemetryUserHasSeenNotice(router: IRouter, currentKibanaVersion: string) {
router.put(
{
path: '/api/telemetry/v2/userHasSeenNotice',
Expand All @@ -31,6 +31,9 @@ export function registerTelemetryUserHasSeenNotice(router: IRouter) {
const updatedAttributes: TelemetrySavedObjectAttributes = {
...telemetrySavedObject,
userHasSeenNotice: true,
// We need to store that the user was notified in this version.
// Otherwise, it'll continuously show the banner if previously opted-out.
lastVersionChecked: currentKibanaVersion,
};
await updateTelemetrySavedObject(soClient, updatedAttributes);

Expand Down

0 comments on commit 14c5fff

Please sign in to comment.