diff --git a/src/addons/messages/tests/behat/basic_usage.feature b/src/addons/messages/tests/behat/basic_usage.feature index eb3621b0f..db30ff172 100755 --- a/src/addons/messages/tests/behat/basic_usage.feature +++ b/src/addons/messages/tests/behat/basic_usage.feature @@ -280,7 +280,6 @@ Feature: Test basic usage of messages in app Then I should find "Teacher teacher" in the app And I should find "Student1 student1" in the app - @ionic7_failure Scenario: User blocking feature Given I entered the course "Course 1" as "student2" in the app When I press "Participants" in the app @@ -318,7 +317,6 @@ Feature: Test basic usage of messages in app Then I should find "test message" in the app But I should not find "You are unable to message this user" in the app - @ionic7_failure Scenario: Mute Unmute conversations Given I entered the course "Course 1" as "student1" in the app When I press "Participants" in the app diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 869d3af27..b75eaba23 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -169,6 +169,20 @@ export function conditionalRoutes(routes: Routes, condition: () => boolean): Rou }); } +/** + * Check whether a route does not have any content. + * + * @param route Route. + * @returns Whether the route doesn't have any content. + */ +export function isEmptyRoute(route: Route): boolean { + return !('component' in route) + && !('loadComponent' in route) + && !('children' in route) + && !('loadChildren' in route) + && !('redirectTo' in route); +} + /** * Resolve module routes. * diff --git a/src/core/features/mainmenu/mainmenu-tab-routing.module.ts b/src/core/features/mainmenu/mainmenu-tab-routing.module.ts index 6218138f1..952582c39 100644 --- a/src/core/features/mainmenu/mainmenu-tab-routing.module.ts +++ b/src/core/features/mainmenu/mainmenu-tab-routing.module.ts @@ -15,7 +15,7 @@ import { InjectionToken, Injector, ModuleWithProviders, NgModule } from '@angular/core'; import { Route, Routes } from '@angular/router'; -import { ModuleRoutesConfig, resolveModuleRoutes } from '@/app/app-routing.module'; +import { ModuleRoutesConfig, isEmptyRoute, resolveModuleRoutes } from '@/app/app-routing.module'; const MAIN_MENU_TAB_ROUTES = new InjectionToken('MAIN_MENU_TAB_ROUTES'); const modulesPaths: Record> = {}; @@ -71,6 +71,8 @@ export function buildTabMainRoutes(injector: Injector, mainRoute: Route): Routes if (isRootRoute && !('redirectTo' in mainRoute)) { mainRoute.children = mainRoute.children || []; mainRoute.children = mainRoute.children.concat(routes.children); + } else if (isEmptyRoute(mainRoute)) { + return []; } return isRootRoute