From c6f73af200bbd26ef81221dda4d761378272ae7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 15 Oct 2024 11:11:18 +0200 Subject: [PATCH] MOBILE-4616 reportbuilder: Only show report builder on user menu --- .../services/handlers/reportbuilder.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/core/features/reportbuilder/services/handlers/reportbuilder.ts b/src/core/features/reportbuilder/services/handlers/reportbuilder.ts index e5109ea97d7..af8d9afa082 100644 --- a/src/core/features/reportbuilder/services/handlers/reportbuilder.ts +++ b/src/core/features/reportbuilder/services/handlers/reportbuilder.ts @@ -17,6 +17,7 @@ import { CoreUserProfileHandlerType, CoreUserProfileHandler, CoreUserProfileHandlerData, + CoreUserDelegateContext, } from '@features/user/services/user-delegate'; import { CoreNavigator } from '@services/navigator'; import { makeSingleton } from '@singletons'; @@ -42,6 +43,18 @@ export class CoreReportBuilderHandlerService implements CoreUserProfileHandler { return await CoreReportBuilder.isEnabled(); } + /** + * @inheritdoc + */ + async isEnabledForContext(context: CoreUserDelegateContext): Promise { + // Custom reports only available in user menu. + if (context !== CoreUserDelegateContext.USER_MENU) { + return false; + } + + return this.isEnabled(); + } + /** * @inheritdoc */