MOBILE-4270 core: Standardize page modules

main
Noel De Martin 2023-01-25 11:08:36 +01:00
parent ce9e2013de
commit 98d332138a
194 changed files with 749 additions and 2564 deletions

View File

@ -19,8 +19,8 @@ import { conditionalRoutes } from '@/app/app-routing.module';
import { CoreScreen } from '@services/screen'; import { CoreScreen } from '@services/screen';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonBadgesIssuedBadgePage } from './pages/issued-badge/issued-badge.page'; import { AddonBadgesIssuedBadgePage } from './pages/issued-badge/issued-badge';
import { AddonBadgesUserBadgesPage } from './pages/user-badges/user-badges.page'; import { AddonBadgesUserBadgesPage } from './pages/user-badges/user-badges';
const mobileRoutes: Routes = [ const mobileRoutes: Routes = [
{ {

View File

@ -73,4 +73,4 @@ import { AddonBlockTimelineModule } from './timeline/timeline.module';
AddonBlockTimelineModule, AddonBlockTimelineModule,
], ],
}) })
export class AddonBlockModule { } export class AddonBlockModule {}

View File

@ -24,6 +24,12 @@ import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.modu
import { AddonBlogMainMenuHandlerService } from './services/handlers/mainmenu'; import { AddonBlogMainMenuHandlerService } from './services/handlers/mainmenu';
import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module'; import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module';
/**
* Build module routes.
*
* @param injector Injector.
* @returns Routes.
*/
function buildRoutes(injector: Injector): Routes { function buildRoutes(injector: Injector): Routes {
return [ return [
...buildTabMainRoutes(injector, { ...buildTabMainRoutes(injector, {

View File

@ -15,7 +15,7 @@
import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; import { APP_INITIALIZER, NgModule, Type } from '@angular/core';
import { Routes } from '@angular/router'; import { Routes } from '@angular/router';
import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate';
import { CoreCourseIndexRoutingModule } from '@features/course/pages/index/index-routing.module'; import { CoreCourseIndexRoutingModule } from '@features/course/course-routing.module';
import { CoreCourseOptionsDelegate } from '@features/course/services/course-options-delegate'; import { CoreCourseOptionsDelegate } from '@features/course/services/course-options-delegate';
import { CoreMainMenuRoutingModule } from '@features/mainmenu/mainmenu-routing.module'; import { CoreMainMenuRoutingModule } from '@features/mainmenu/mainmenu-routing.module';
import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module';

View File

@ -12,39 +12,49 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { AddonCalendarComponentsModule } from '@addons/calendar/components/components.module';
import { AddonCalendarDayPage } from '@addons/calendar/pages/day/day';
import { AddonCalendarEditEventPage } from '@addons/calendar/pages/edit-event/edit-event';
import { AddonCalendarEventPage } from '@addons/calendar/pages/event/event';
import { AddonCalendarIndexPage } from '@addons/calendar/pages/index';
import { AddonCalendarSettingsPage } from '@addons/calendar/pages/settings/settings';
import { Injector, NgModule } from '@angular/core'; import { Injector, NgModule } from '@angular/core';
import { RouterModule, ROUTES, Routes } from '@angular/router'; import { RouterModule, ROUTES, Routes } from '@angular/router';
import { CoreEditorComponentsModule } from '@features/editor/components/components.module';
import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module';
import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module'; import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module';
import { AddonCalendarMainMenuHandlerService } from './services/handlers/mainmenu'; import { AddonCalendarMainMenuHandlerService } from './services/handlers/mainmenu';
/**
* Build module routes.
*
* @param injector Injector.
* @returns Routes.
*/
function buildRoutes(injector: Injector): Routes { function buildRoutes(injector: Injector): Routes {
return [ return [
{ {
path: 'index', path: 'index',
data: { data: { mainMenuTabRoot: AddonCalendarMainMenuHandlerService.PAGE_NAME },
mainMenuTabRoot: AddonCalendarMainMenuHandlerService.PAGE_NAME, component: AddonCalendarIndexPage,
},
loadChildren: () => import('@addons/calendar/pages/index/index.module').then(m => m.AddonCalendarIndexPageModule),
}, },
{ {
path: 'calendar-settings', path: 'calendar-settings',
loadChildren: () => component: AddonCalendarSettingsPage,
import('@addons/calendar/pages/settings/settings.module').then(m => m.AddonCalendarSettingsPageModule),
}, },
{ {
path: 'day', path: 'day',
loadChildren: () => component: AddonCalendarDayPage,
import('@addons/calendar/pages/day/day.module').then(m => m.AddonCalendarDayPageModule),
}, },
{ {
path: 'event/:id', path: 'event/:id',
loadChildren: () => import('@addons/calendar/pages/event/event.module').then(m => m.AddonCalendarEventPageModule), component: AddonCalendarEventPage,
}, },
{ {
path: 'edit/:eventId', path: 'edit/:eventId',
loadChildren: () => component: AddonCalendarEditEventPage,
import('@addons/calendar/pages/edit-event/edit-event.module').then(m => m.AddonCalendarEditEventPageModule),
}, },
...buildTabMainRoutes(injector, { ...buildTabMainRoutes(injector, {
redirectTo: 'index', redirectTo: 'index',
@ -54,7 +64,20 @@ function buildRoutes(injector: Injector): Routes {
} }
@NgModule({ @NgModule({
imports: [
CoreSharedModule,
AddonCalendarComponentsModule,
CoreMainMenuComponentsModule,
CoreEditorComponentsModule,
],
exports: [RouterModule], exports: [RouterModule],
declarations: [
AddonCalendarDayPage,
AddonCalendarEditEventPage,
AddonCalendarEventPage,
AddonCalendarIndexPage,
AddonCalendarSettingsPage,
],
providers: [ providers: [
{ {
provide: ROUTES, provide: ROUTES,
@ -64,4 +87,4 @@ function buildRoutes(injector: Injector): Routes {
}, },
], ],
}) })
export class AddonCalendarLazyModule { } export class AddonCalendarLazyModule {}

View File

@ -1,43 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreEditorComponentsModule } from '@features/editor/components/components.module';
import { AddonCalendarEditEventPage } from './edit-event.page';
import { CanLeaveGuard } from '@guards/can-leave';
const routes: Routes = [
{
path: '',
component: AddonCalendarEditEventPage,
canDeactivate: [CanLeaveGuard],
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
CoreEditorComponentsModule,
],
declarations: [
AddonCalendarEditEventPage,
],
exports: [RouterModule],
})
export class AddonCalendarEditEventPageModule {}

View File

@ -1,41 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonCalendarComponentsModule } from '../../components/components.module';
import { AddonCalendarEventPage } from './event.page';
const routes: Routes = [
{
path: '',
component: AddonCalendarEventPage,
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
AddonCalendarComponentsModule,
],
declarations: [
AddonCalendarEventPage,
],
exports: [RouterModule],
})
export class AddonCalendarEventPageModule {}

View File

@ -1,43 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonCalendarComponentsModule } from '../../components/components.module';
import { AddonCalendarIndexPage } from './index.page';
import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module';
const routes: Routes = [
{
path: '',
component: AddonCalendarIndexPage,
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
AddonCalendarComponentsModule,
CoreMainMenuComponentsModule,
],
declarations: [
AddonCalendarIndexPage,
],
exports: [RouterModule],
})
export class AddonCalendarIndexPageModule {}

View File

@ -1,38 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AddonCalendarSettingsPage } from './settings';
import { CoreSharedModule } from '@/core/shared.module';
const routes: Routes = [
{
path: '',
component: AddonCalendarSettingsPage,
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
],
declarations: [
AddonCalendarSettingsPage,
],
exports: [RouterModule],
})
export class AddonCalendarSettingsPageModule {}

View File

@ -29,7 +29,7 @@ import { AddonCompetencyUserHandler } from './services/handlers/user';
import { Routes } from '@angular/router'; import { Routes } from '@angular/router';
import { CoreMainMenuRoutingModule } from '@features/mainmenu/mainmenu-routing.module'; import { CoreMainMenuRoutingModule } from '@features/mainmenu/mainmenu-routing.module';
import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module';
import { CoreCourseIndexRoutingModule } from '@features/course/pages/index/index-routing.module'; import { CoreCourseIndexRoutingModule } from '@features/course/course-routing.module';
import { COURSE_PAGE_NAME } from '@features/course/course.module'; import { COURSE_PAGE_NAME } from '@features/course/course.module';
import { PARTICIPANTS_PAGE_NAME } from '@features/user/user.module'; import { PARTICIPANTS_PAGE_NAME } from '@features/user/user.module';

View File

@ -15,7 +15,7 @@
import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; import { APP_INITIALIZER, NgModule, Type } from '@angular/core';
import { Routes } from '@angular/router'; import { Routes } from '@angular/router';
import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate';
import { CoreCourseIndexRoutingModule } from '@features/course/pages/index/index-routing.module'; import { CoreCourseIndexRoutingModule } from '@features/course/course-routing.module';
import { CoreCourseOptionsDelegate } from '@features/course/services/course-options-delegate'; import { CoreCourseOptionsDelegate } from '@features/course/services/course-options-delegate';
import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module';
import { CoreUserDelegate } from '@features/user/services/user-delegate'; import { CoreUserDelegate } from '@features/user/services/user-delegate';

View File

@ -47,4 +47,4 @@ import { AddonFilterUrlToLinkModule } from './urltolink/urltolink.module';
AddonFilterUrlToLinkModule, AddonFilterUrlToLinkModule,
], ],
}) })
export class AddonFilterModule { } export class AddonFilterModule {}

View File

@ -22,18 +22,22 @@ import {
AddonMessageOutputAirnotifierHandlerService, AddonMessageOutputAirnotifierHandlerService,
} from './services/handlers/messageoutput'; } from './services/handlers/messageoutput';
import { AddonMessageOutputAirnotifier } from './services/airnotifier'; import { AddonMessageOutputAirnotifier } from './services/airnotifier';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonMessageOutputAirnotifierDevicesPage } from '@addons/messageoutput/airnotifier/pages/devices/devices';
const routes: Routes = [ const routes: Routes = [
{ {
path: AddonMessageOutputAirnotifierHandlerService.PAGE_NAME, path: AddonMessageOutputAirnotifierHandlerService.PAGE_NAME,
loadChildren: () => import('./pages/devices/devices.module').then( m => m.AddonMessageOutputAirnotifierDevicesPageModule), component: AddonMessageOutputAirnotifierDevicesPage,
}, },
]; ];
@NgModule({ @NgModule({
declarations: [ declarations: [
AddonMessageOutputAirnotifierDevicesPage,
], ],
imports: [ imports: [
CoreSharedModule,
CoreMainMenuTabRoutingModule.forChild(routes), CoreMainMenuTabRoutingModule.forChild(routes),
], ],
providers: [ providers: [

View File

@ -1,38 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonMessageOutputAirnotifierDevicesPage } from './devices';
const routes: Routes = [
{
path: '',
component: AddonMessageOutputAirnotifierDevicesPage,
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
],
declarations: [
AddonMessageOutputAirnotifierDevicesPage,
],
exports: [RouterModule],
})
export class AddonMessageOutputAirnotifierDevicesPageModule {}

View File

@ -12,55 +12,112 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { conditionalRoutes } from '@/app/app-routing.module';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonMessagesContacts35Page } from '@addons/messages/pages/contacts-35/contacts';
import { AddonMessagesContactsPage } from '@addons/messages/pages/contacts/contacts';
import { AddonMessagesDiscussionPage } from '@addons/messages/pages/discussion/discussion';
import { AddonMessagesDiscussions35Page } from '@addons/messages/pages/discussions-35/discussions';
import { AddonMessagesGroupConversationsPage } from '@addons/messages/pages/group-conversations/group-conversations';
import { AddonMessagesSearchPage } from '@addons/messages/pages/search/search';
import { AddonMessagesMainMenuHandlerService } from '@addons/messages/services/handlers/mainmenu';
import { Injector, NgModule } from '@angular/core'; import { Injector, NgModule } from '@angular/core';
import { Route, RouterModule, ROUTES, Routes } from '@angular/router'; import { Route, RouterModule, ROUTES, Routes } from '@angular/router';
import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module';
import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module'; import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module';
import { CoreSearchComponentsModule } from '@features/search/components/components.module';
import { CoreScreen } from '@services/screen';
import { AddonMessagesIndexGuard } from './guards'; import { AddonMessagesIndexGuard } from './guards';
export const DISCUSSION_ROUTES: Route[] = [ /**
{ * Build module routes.
path: 'discussion/user/:userId', *
loadChildren: () => import('./pages/discussion/discussion.module') * @param injector Injector.
.then(m => m.AddonMessagesDiscussionPageModule), * @returns Routes.
}, */
{
path: 'discussion/:conversationId',
loadChildren: () => import('./pages/discussion/discussion.module')
.then(m => m.AddonMessagesDiscussionPageModule),
},
];
function buildRoutes(injector: Injector): Routes { function buildRoutes(injector: Injector): Routes {
return [ const discussionRoutes: Route[] = [
{ {
path: 'index', // 3.5. path: 'discussion/user/:userId',
loadChildren: () => component: AddonMessagesDiscussionPage,
import('./pages/discussions-35/discussions.module').then(m => m.AddonMessagesDiscussions35PageModule), },
{
path: 'discussion/:conversationId',
component: AddonMessagesDiscussionPage,
},
];
const mobileRoutes: Routes = [
{
path: 'contacts', // 3.6 or greater.
component: AddonMessagesContactsPage,
},
{
path: 'index',
data: { mainMenuTabRoot: AddonMessagesMainMenuHandlerService.PAGE_NAME },
component: AddonMessagesDiscussions35Page,
}, },
{ {
path: 'contacts-35', // 3.5. path: 'contacts-35', // 3.5.
loadChildren: () => import('./pages/contacts-35/contacts.module').then(m => m.AddonMessagesContacts35PageModule), component: AddonMessagesContacts35Page,
}, },
{ {
path: 'group-conversations', // 3.6 or greater. path: 'group-conversations', // 3.6 or greater.
loadChildren: () => import('./pages/group-conversations/group-conversations.module') data: { mainMenuTabRoot: AddonMessagesMainMenuHandlerService.PAGE_NAME },
.then(m => m.AddonMessagesGroupConversationsPageModule), component: AddonMessagesGroupConversationsPage,
}, },
...DISCUSSION_ROUTES,
{ {
path: 'search', path: 'search',
loadChildren: () => import('./pages/search/search.module') component: AddonMessagesSearchPage,
.then(m => m.AddonMessagesSearchPageModule),
}, },
]
.reduce((routes, mobileRoute) => [
...routes,
mobileRoute,
...discussionRoutes.map(discussionRoute => ({
...discussionRoute,
path: `${mobileRoute.path}/${discussionRoute.path}`,
})),
], []);
const tabletRoutes: Routes = [
{ {
path: 'contacts', // 3.6 or greater. path: 'contacts', // 3.6 or greater.
loadChildren: () => import('./pages/contacts/contacts.module') component: AddonMessagesContactsPage,
.then(m => m.AddonMessagesContactsPageModule), children: discussionRoutes,
}, },
{
path: 'index',
data: { mainMenuTabRoot: AddonMessagesMainMenuHandlerService.PAGE_NAME },
component: AddonMessagesDiscussions35Page,
children: discussionRoutes,
},
{
path: 'contacts-35', // 3.5.
component: AddonMessagesContacts35Page,
children: discussionRoutes,
},
{
path: 'group-conversations', // 3.6 or greater.
data: { mainMenuTabRoot: AddonMessagesMainMenuHandlerService.PAGE_NAME },
component: AddonMessagesGroupConversationsPage,
children: discussionRoutes,
},
{
path: 'search',
component: AddonMessagesSearchPage,
children: discussionRoutes,
},
];
return [
...conditionalRoutes(mobileRoutes, () => CoreScreen.isMobile),
...conditionalRoutes(tabletRoutes, () => CoreScreen.isTablet),
...discussionRoutes,
{ {
path: 'message-settings', path: 'message-settings',
loadChildren: () => import('./pages/settings/settings.module').then(m => m.AddonMessagesSettingsPageModule), loadChildren: () => import('./messages-settings-lazy.module').then(m => m.AddonMessagesSettingsLazyModule),
}, },
...buildTabMainRoutes(injector, { ...buildTabMainRoutes(injector, {
canActivate: [AddonMessagesIndexGuard], canActivate: [AddonMessagesIndexGuard],
@ -69,6 +126,19 @@ function buildRoutes(injector: Injector): Routes {
} }
@NgModule({ @NgModule({
imports: [
CoreSharedModule,
CoreSearchComponentsModule,
CoreMainMenuComponentsModule,
],
declarations: [
AddonMessagesContacts35Page,
AddonMessagesContactsPage,
AddonMessagesDiscussionPage,
AddonMessagesDiscussions35Page,
AddonMessagesGroupConversationsPage,
AddonMessagesSearchPage,
],
exports: [RouterModule], exports: [RouterModule],
providers: [ providers: [
{ {
@ -79,4 +149,4 @@ function buildRoutes(injector: Injector): Routes {
}, },
], ],
}) })
export class AddonMessagesLazyModule { } export class AddonMessagesLazyModule {}

View File

@ -16,8 +16,7 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonMessagesSettingsPage } from '@addons/messages/pages/settings/settings';
import { AddonMessagesSettingsPage } from './settings.page';
const routes: Routes = [ const routes: Routes = [
{ {
@ -36,4 +35,4 @@ const routes: Routes = [
], ],
exports: [RouterModule], exports: [RouterModule],
}) })
export class AddonMessagesSettingsPageModule {} export class AddonMessagesSettingsLazyModule {}

View File

@ -36,7 +36,7 @@ import { NgZone } from '@singletons';
import { CoreNetwork } from '@services/network'; import { CoreNetwork } from '@services/network';
import { AddonMessagesSync, AddonMessagesSyncProvider } from './services/messages-sync'; import { AddonMessagesSync, AddonMessagesSyncProvider } from './services/messages-sync';
import { AddonMessagesSyncCronHandler } from './services/handlers/sync-cron'; import { AddonMessagesSyncCronHandler } from './services/handlers/sync-cron';
import { CoreSitePreferencesRoutingModule } from '@features/settings/pages/site/site-routing'; import { CoreSitePreferencesRoutingModule } from '@features/settings/settings-site-routing.module';
import { AddonMessagesProvider } from './services/messages'; import { AddonMessagesProvider } from './services/messages';
import { AddonMessagesOfflineProvider } from './services/messages-offline'; import { AddonMessagesOfflineProvider } from './services/messages-offline';
@ -55,7 +55,7 @@ const mainMenuChildrenRoutes: Routes = [
const preferencesRoutes: Routes = [ const preferencesRoutes: Routes = [
{ {
path: AddonMessagesSettingsHandlerService.PAGE_NAME, path: AddonMessagesSettingsHandlerService.PAGE_NAME,
loadChildren: () => import('./pages/settings/settings.module').then(m => m.AddonMessagesSettingsPageModule), loadChildren: () => import('./messages-settings-lazy.module').then(m => m.AddonMessagesSettingsLazyModule),
}, },
]; ];

View File

@ -1,58 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { conditionalRoutes } from '@/app/app-routing.module';
import { DISCUSSION_ROUTES } from '@addons/messages/messages-lazy.module';
import { CoreScreen } from '@services/screen';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreSearchComponentsModule } from '@features/search/components/components.module';
import { AddonMessagesContacts35Page } from './contacts.page';
const mobileRoutes: Routes = [
{
path: '',
component: AddonMessagesContacts35Page,
},
...DISCUSSION_ROUTES,
];
const tabletRoutes: Routes = [
{
path: '',
component: AddonMessagesContacts35Page,
children: DISCUSSION_ROUTES,
},
];
const routes: Routes = [
...conditionalRoutes(mobileRoutes, () => CoreScreen.isMobile),
...conditionalRoutes(tabletRoutes, () => CoreScreen.isTablet),
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
CoreSearchComponentsModule,
],
declarations: [
AddonMessagesContacts35Page,
],
exports: [RouterModule],
})
export class AddonMessagesContacts35PageModule {}

View File

@ -1,56 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { conditionalRoutes } from '@/app/app-routing.module';
import { DISCUSSION_ROUTES } from '@addons/messages/messages-lazy.module';
import { CoreScreen } from '@services/screen';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonMessagesContactsPage } from './contacts.page';
const mobileRoutes: Routes = [
{
path: '',
component: AddonMessagesContactsPage,
},
...DISCUSSION_ROUTES,
];
const tabletRoutes: Routes = [
{
path: '',
component: AddonMessagesContactsPage,
children: DISCUSSION_ROUTES,
},
];
const routes: Routes = [
...conditionalRoutes(mobileRoutes, () => CoreScreen.isMobile),
...conditionalRoutes(tabletRoutes, () => CoreScreen.isTablet),
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
],
declarations: [
AddonMessagesContactsPage,
],
exports: [RouterModule],
})
export class AddonMessagesContactsPageModule {}

View File

@ -1,41 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonMessagesDiscussionPage } from './discussion.page';
import { AddonMessagesComponentsModule } from '@addons/messages/components/components.module';
const routes: Routes = [
{
path: '',
component: AddonMessagesDiscussionPage,
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
AddonMessagesComponentsModule,
],
declarations: [
AddonMessagesDiscussionPage,
],
exports: [RouterModule],
})
export class AddonMessagesDiscussionPageModule {}

View File

@ -1,67 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreScreen } from '@services/screen';
import { conditionalRoutes } from '@/app/app-routing.module';
import { DISCUSSION_ROUTES } from '@addons/messages/messages-lazy.module';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreSearchComponentsModule } from '@features/search/components/components.module';
import { AddonMessagesDiscussions35Page } from './discussions.page';
import { AddonMessagesMainMenuHandlerService } from '@addons/messages/services/handlers/mainmenu';
import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module';
const mobileRoutes: Routes = [
{
path: '',
data: {
mainMenuTabRoot: AddonMessagesMainMenuHandlerService.PAGE_NAME,
},
component: AddonMessagesDiscussions35Page,
},
...DISCUSSION_ROUTES,
];
const tabletRoutes: Routes = [
{
path: '',
data: {
mainMenuTabRoot: AddonMessagesMainMenuHandlerService.PAGE_NAME,
},
component: AddonMessagesDiscussions35Page,
children: DISCUSSION_ROUTES,
},
];
const routes: Routes = [
...conditionalRoutes(mobileRoutes, () => CoreScreen.isMobile),
...conditionalRoutes(tabletRoutes, () => CoreScreen.isTablet),
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
CoreSearchComponentsModule,
CoreMainMenuComponentsModule,
],
declarations: [
AddonMessagesDiscussions35Page,
],
exports: [RouterModule],
})
export class AddonMessagesDiscussions35PageModule {}

View File

@ -1,65 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { conditionalRoutes } from '@/app/app-routing.module';
import { DISCUSSION_ROUTES } from '@addons/messages/messages-lazy.module';
import { CoreScreen } from '@services/screen';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonMessagesGroupConversationsPage } from './group-conversations.page';
import { AddonMessagesMainMenuHandlerService } from '@addons/messages/services/handlers/mainmenu';
import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module';
const mobileRoutes: Routes = [
{
path: '',
data: {
mainMenuTabRoot: AddonMessagesMainMenuHandlerService.PAGE_NAME,
},
component: AddonMessagesGroupConversationsPage,
},
...DISCUSSION_ROUTES,
];
const tabletRoutes: Routes = [
{
path: '',
data: {
mainMenuTabRoot: AddonMessagesMainMenuHandlerService.PAGE_NAME,
},
component: AddonMessagesGroupConversationsPage,
children: DISCUSSION_ROUTES,
},
];
const routes: Routes = [
...conditionalRoutes(mobileRoutes, () => CoreScreen.isMobile),
...conditionalRoutes(tabletRoutes, () => CoreScreen.isTablet),
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
CoreMainMenuComponentsModule,
],
declarations: [
AddonMessagesGroupConversationsPage,
],
exports: [RouterModule],
})
export class AddonMessagesGroupConversationsPageModule {}

View File

@ -1,58 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreScreen } from '@services/screen';
import { conditionalRoutes } from '@/app/app-routing.module';
import { DISCUSSION_ROUTES } from '@addons/messages/messages-lazy.module';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreSearchComponentsModule } from '@features/search/components/components.module';
import { AddonMessagesSearchPage } from './search.page';
const mobileRoutes: Routes = [
{
path: '',
component: AddonMessagesSearchPage,
},
...DISCUSSION_ROUTES,
];
const tabletRoutes: Routes = [
{
path: '',
component: AddonMessagesSearchPage,
children: DISCUSSION_ROUTES,
},
];
const routes: Routes = [
...conditionalRoutes(mobileRoutes, () => CoreScreen.isMobile),
...conditionalRoutes(tabletRoutes, () => CoreScreen.isTablet),
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
CoreSearchComponentsModule,
],
declarations: [
AddonMessagesSearchPage,
],
exports: [RouterModule],
})
export class AddonMessagesSearchPageModule {}

View File

@ -20,8 +20,8 @@ import { CanLeaveGuard } from '@guards/can-leave';
import { CoreScreen } from '@services/screen'; import { CoreScreen } from '@services/screen';
import { AddonModAssignComponentsModule } from './components/components.module'; import { AddonModAssignComponentsModule } from './components/components.module';
import { AddonModAssignEditPage } from './pages/edit/edit'; import { AddonModAssignEditPage } from './pages/edit/edit';
import { AddonModAssignIndexPage } from './pages/index/index.page'; import { AddonModAssignIndexPage } from './pages/index';
import { AddonModAssignSubmissionListPage } from './pages/submission-list/submission-list.page'; import { AddonModAssignSubmissionListPage } from './pages/submission-list/submission-list';
import { AddonModAssignSubmissionReviewPage } from './pages/submission-review/submission-review'; import { AddonModAssignSubmissionReviewPage } from './pages/submission-review/submission-review';
const commonRoutes: Routes = [ const commonRoutes: Routes = [

View File

@ -24,4 +24,4 @@ import { AddonModAssignFeedbackFileModule } from './file/file.module';
AddonModAssignFeedbackFileModule, AddonModAssignFeedbackFileModule,
], ],
}) })
export class AddonModAssignFeedbackModule { } export class AddonModAssignFeedbackModule {}

View File

@ -24,4 +24,4 @@ import { AddonModAssignSubmissionOnlineTextModule } from './onlinetext/onlinetex
AddonModAssignSubmissionOnlineTextModule, AddonModAssignSubmissionOnlineTextModule,
], ],
}) })
export class AddonModAssignSubmissionModule { } export class AddonModAssignSubmissionModule {}

View File

@ -16,7 +16,9 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonModBookComponentsModule } from './components/components.module'; import { AddonModBookComponentsModule } from './components/components.module';
import { AddonModBookIndexPage } from './pages/index/index.page'; import { AddonModBookIndexPage } from './pages/index';
import { CoreTagComponentsModule } from '@features/tag/components/components.module';
import { AddonModBookContentsPage } from '@addons/mod/book/pages/contents/contents';
const routes: Routes = [ const routes: Routes = [
{ {
@ -25,7 +27,7 @@ const routes: Routes = [
}, },
{ {
path: ':courseId/:cmId/contents', path: ':courseId/:cmId/contents',
loadChildren: () => import('./pages/contents/contents.module').then(m => m.AddonModBookContentsPageModule), component: AddonModBookContentsPage,
}, },
]; ];
@ -34,9 +36,11 @@ const routes: Routes = [
RouterModule.forChild(routes), RouterModule.forChild(routes),
CoreSharedModule, CoreSharedModule,
AddonModBookComponentsModule, AddonModBookComponentsModule,
CoreTagComponentsModule,
], ],
declarations: [ declarations: [
AddonModBookIndexPage, AddonModBookIndexPage,
AddonModBookContentsPage,
], ],
}) })
export class AddonModBookLazyModule {} export class AddonModBookLazyModule {}

View File

@ -1,40 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonModBookContentsPage } from './contents';
import { CoreTagComponentsModule } from '@features/tag/components/components.module';
const routes: Routes = [
{
path: '',
component: AddonModBookContentsPage,
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
CoreTagComponentsModule,
],
declarations: [
AddonModBookContentsPage,
],
exports: [RouterModule],
})
export class AddonModBookContentsPageModule {}

View File

@ -42,4 +42,4 @@ import { AddonModDataFieldUrlModule } from './url/url.module';
AddonModDataFieldUrlModule, AddonModDataFieldUrlModule,
], ],
}) })
export class AddonModDataFieldModule { } export class AddonModDataFieldModule {}

View File

@ -20,6 +20,10 @@ import { AddonModFeedbackIndexPage } from './pages/index/index';
import { AddonModFeedbackAttemptsPage } from './pages/attempts/attempts'; import { AddonModFeedbackAttemptsPage } from './pages/attempts/attempts';
import { conditionalRoutes } from '@/app/app-routing.module'; import { conditionalRoutes } from '@/app/app-routing.module';
import { CoreScreen } from '@services/screen'; import { CoreScreen } from '@services/screen';
import { AddonModFeedbackAttemptPage } from '@addons/mod/feedback/pages/attempt/attempt';
import { AddonModFeedbackFormPage } from '@addons/mod/feedback/pages/form/form';
import { CanLeaveGuard } from '@guards/can-leave';
import { AddonModFeedbackNonRespondentsPage } from '@addons/mod/feedback/pages/nonrespondents/nonrespondents';
const commonRoutes: Routes = [ const commonRoutes: Routes = [
{ {
@ -28,12 +32,12 @@ const commonRoutes: Routes = [
}, },
{ {
path: ':courseId/:cmId/form', path: ':courseId/:cmId/form',
loadChildren: () => import('./pages/form/form.module').then(m => m.AddonModFeedbackFormPageModule), component: AddonModFeedbackFormPage,
canDeactivate: [CanLeaveGuard],
}, },
{ {
path: ':courseId/:cmId/nonrespondents', path: ':courseId/:cmId/nonrespondents',
loadChildren: () => import('./pages/nonrespondents/nonrespondents.module') component: AddonModFeedbackNonRespondentsPage,
.then(m => m.AddonModFeedbackNonRespondentsPageModule),
}, },
]; ];
@ -45,7 +49,7 @@ const mobileRoutes: Routes = [
}, },
{ {
path: ':courseId/:cmId/attempts/:attemptId', path: ':courseId/:cmId/attempts/:attemptId',
loadChildren: () => import('./pages/attempt/attempt.module').then(m => m.AddonModFeedbackAttemptPageModule), component: AddonModFeedbackAttemptPage,
}, },
]; ];
@ -57,7 +61,7 @@ const tabletRoutes: Routes = [
children: [ children: [
{ {
path: ':attemptId', path: ':attemptId',
loadChildren: () => import('./pages/attempt/attempt.module').then(m => m.AddonModFeedbackAttemptPageModule), component: AddonModFeedbackAttemptPage,
}, },
], ],
}, },
@ -75,8 +79,11 @@ const routes: Routes = [
AddonModFeedbackComponentsModule, AddonModFeedbackComponentsModule,
], ],
declarations: [ declarations: [
AddonModFeedbackIndexPage,
AddonModFeedbackAttemptsPage, AddonModFeedbackAttemptsPage,
AddonModFeedbackFormPage,
AddonModFeedbackIndexPage,
AddonModFeedbackNonRespondentsPage,
AddonModFeedbackAttemptPage,
], ],
}) })
export class AddonModFeedbackLazyModule {} export class AddonModFeedbackLazyModule {}

View File

@ -1,37 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { CoreSharedModule } from '@/core/shared.module';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AddonModFeedbackAttemptPage } from './attempt';
const routes: Routes = [
{
path: '',
component: AddonModFeedbackAttemptPage,
},
];
@NgModule({
declarations: [
AddonModFeedbackAttemptPage,
],
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
],
exports: [RouterModule],
})
export class AddonModFeedbackAttemptPageModule {}

View File

@ -1,39 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { CoreSharedModule } from '@/core/shared.module';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CanLeaveGuard } from '@guards/can-leave';
import { AddonModFeedbackFormPage } from './form';
const routes: Routes = [
{
path: '',
component: AddonModFeedbackFormPage,
canDeactivate: [CanLeaveGuard],
},
];
@NgModule({
declarations: [
AddonModFeedbackFormPage,
],
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
],
exports: [RouterModule],
})
export class AddonModFeedbackFormPageModule {}

View File

@ -1,37 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { CoreSharedModule } from '@/core/shared.module';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AddonModFeedbackNonRespondentsPage } from './nonrespondents';
const routes: Routes = [
{
path: '',
component: AddonModFeedbackNonRespondentsPage,
},
];
@NgModule({
declarations: [
AddonModFeedbackNonRespondentsPage,
],
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
],
exports: [RouterModule],
})
export class AddonModFeedbackNonRespondentsPageModule {}

View File

@ -18,7 +18,7 @@ import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonModFolderComponentsModule } from './components/components.module'; import { AddonModFolderComponentsModule } from './components/components.module';
import { AddonModFolderIndexPage } from './pages/index/index.page'; import { AddonModFolderIndexPage } from './pages/index';
const routes: Routes = [ const routes: Routes = [
{ {

View File

@ -15,7 +15,7 @@
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { CoreCourseModuleMainActivityPage } from '@features/course/classes/main-activity-page'; import { CoreCourseModuleMainActivityPage } from '@features/course/classes/main-activity-page';
import { CoreNavigator } from '@services/navigator'; import { CoreNavigator } from '@services/navigator';
import { AddonModFolderIndexComponent } from '../../components/index'; import { AddonModFolderIndexComponent } from '../../components/index/index';
import { AddonModFolderFolder } from '../../services/folder'; import { AddonModFolderFolder } from '../../services/folder';
import { AddonModFolderFolderFormattedData } from '../../services/folder-helper'; import { AddonModFolderFolderFormattedData } from '../../services/folder-helper';

View File

@ -50,7 +50,7 @@ import { AddonModForumPostOptionsMenuComponent } from '../post-options-menu/post
import { CoreRatingInfo } from '@features/rating/services/rating'; import { CoreRatingInfo } from '@features/rating/services/rating';
import { CoreForms } from '@singletons/form'; import { CoreForms } from '@singletons/form';
import { CoreFileEntry } from '@services/file-helper'; import { CoreFileEntry } from '@services/file-helper';
import { AddonModForumSharedPostFormData } from '../../pages/discussion/discussion.page'; import { AddonModForumSharedPostFormData } from '../../pages/discussion/discussion';
import { CoreDom } from '@singletons/dom'; import { CoreDom } from '@singletons/dom';
/** /**

View File

@ -18,8 +18,7 @@ import { RouterModule, Routes } from '@angular/router';
import { AddonModForumComponentsModule } from '@addons/mod/forum/components/components.module'; import { AddonModForumComponentsModule } from '@addons/mod/forum/components/components.module';
import { CanLeaveGuard } from '@guards/can-leave'; import { CanLeaveGuard } from '@guards/can-leave';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonModForumDiscussionPage } from '@addons/mod/forum/pages/discussion/discussion';
import { AddonModForumDiscussionPage } from './discussion.page';
const routes: Routes = [{ const routes: Routes = [{
path: '', path: '',
@ -37,4 +36,4 @@ const routes: Routes = [{
AddonModForumDiscussionPage, AddonModForumDiscussionPage,
], ],
}) })
export class AddonForumDiscussionPageModule {} export class AddonForumDiscussionLazyModule {}

View File

@ -20,7 +20,7 @@ import { CoreScreen } from '@services/screen';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonModForumComponentsModule } from './components/components.module'; import { AddonModForumComponentsModule } from './components/components.module';
import { AddonModForumIndexPage } from './pages/index/index.page'; import { AddonModForumIndexPage } from './pages/index';
const mobileRoutes: Routes = [ const mobileRoutes: Routes = [
{ {
@ -29,15 +29,15 @@ const mobileRoutes: Routes = [
}, },
{ {
path: ':courseId/:cmId/new/:timeCreated', path: ':courseId/:cmId/new/:timeCreated',
loadChildren: () => import('./pages/new-discussion/new-discussion.module').then(m => m.AddonForumNewDiscussionPageModule), loadChildren: () => import('./forum-new-discussion-lazy.module').then(m => m.AddonForumNewDiscussionLazyModule),
}, },
{ {
path: ':courseId/:cmId/:discussionId', path: ':courseId/:cmId/:discussionId',
loadChildren: () => import('./pages/discussion/discussion.module').then(m => m.AddonForumDiscussionPageModule), loadChildren: () => import('./forum-discussion-lazy.module').then(m => m.AddonForumDiscussionLazyModule),
}, },
{ {
path: 'discussion/:discussionId', // Only for discussion link handling. path: 'discussion/:discussionId', // Only for discussion link handling.
loadChildren: () => import('./pages/discussion/discussion.module').then(m => m.AddonForumDiscussionPageModule), loadChildren: () => import('./forum-discussion-lazy.module').then(m => m.AddonForumDiscussionLazyModule),
}, },
]; ];
@ -48,13 +48,11 @@ const tabletRoutes: Routes = [
children: [ children: [
{ {
path: 'new/:timeCreated', path: 'new/:timeCreated',
loadChildren: () => import('./pages/new-discussion/new-discussion.module') loadChildren: () => import('./forum-new-discussion-lazy.module').then(m => m.AddonForumNewDiscussionLazyModule),
.then(m => m.AddonForumNewDiscussionPageModule),
}, },
{ {
path: ':discussionId', path: ':discussionId',
loadChildren: () => import('./pages/discussion/discussion.module').then(m => m.AddonForumDiscussionPageModule), loadChildren: () => import('./forum-discussion-lazy.module').then(m => m.AddonForumDiscussionLazyModule),
}, },
], ],
}, },

View File

@ -19,8 +19,7 @@ import { AddonModForumComponentsModule } from '@addons/mod/forum/components/comp
import { CanLeaveGuard } from '@guards/can-leave'; import { CanLeaveGuard } from '@guards/can-leave';
import { CoreEditorComponentsModule } from '@features/editor/components/components.module'; import { CoreEditorComponentsModule } from '@features/editor/components/components.module';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonModForumNewDiscussionPage } from '@addons/mod/forum/pages/new-discussion/new-discussion';
import { AddonModForumNewDiscussionPage } from './new-discussion.page';
const routes: Routes = [{ const routes: Routes = [{
path: '', path: '',
@ -39,4 +38,4 @@ const routes: Routes = [{
AddonModForumNewDiscussionPage, AddonModForumNewDiscussionPage,
], ],
}) })
export class AddonForumNewDiscussionPageModule {} export class AddonForumNewDiscussionLazyModule {}

View File

@ -17,7 +17,7 @@ import { Routes } from '@angular/router';
import { conditionalRoutes } from '@/app/app-routing.module'; import { conditionalRoutes } from '@/app/app-routing.module';
import { CORE_SITE_SCHEMAS } from '@services/sites'; import { CORE_SITE_SCHEMAS } from '@services/sites';
import { CoreCourseContentsRoutingModule } from '@features/course/pages/contents/contents-routing.module'; import { CoreCourseContentsRoutingModule } from '@features/course/course-contents-routing.module';
import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate';
import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module';
import { CoreScreen } from '@services/screen'; import { CoreScreen } from '@services/screen';
@ -55,7 +55,7 @@ export const ADDON_MOD_FORUM_SERVICES: Type<unknown>[] = [
const mainMenuRoutes: Routes = [ const mainMenuRoutes: Routes = [
{ {
path: `${AddonModForumModuleHandlerService.PAGE_NAME}/discussion/:discussionId`, path: `${AddonModForumModuleHandlerService.PAGE_NAME}/discussion/:discussionId`,
loadChildren: () => import('./pages/discussion/discussion.module').then(m => m.AddonForumDiscussionPageModule), loadChildren: () => import('./forum-discussion-lazy.module').then(m => m.AddonForumDiscussionLazyModule),
data: { swipeEnabled: false }, data: { swipeEnabled: false },
}, },
{ {
@ -66,13 +66,12 @@ const mainMenuRoutes: Routes = [
[ [
{ {
path: `${COURSE_CONTENTS_PATH}/${AddonModForumModuleHandlerService.PAGE_NAME}/new/:timeCreated`, path: `${COURSE_CONTENTS_PATH}/${AddonModForumModuleHandlerService.PAGE_NAME}/new/:timeCreated`,
loadChildren: () => import('./pages/new-discussion/new-discussion.module') loadChildren: () => import('./forum-new-discussion-lazy.module').then(m => m.AddonForumNewDiscussionLazyModule),
.then(m => m.AddonForumNewDiscussionPageModule),
data: { discussionsPathPrefix: `${AddonModForumModuleHandlerService.PAGE_NAME}/` }, data: { discussionsPathPrefix: `${AddonModForumModuleHandlerService.PAGE_NAME}/` },
}, },
{ {
path: `${COURSE_CONTENTS_PATH}/${AddonModForumModuleHandlerService.PAGE_NAME}/:discussionId`, path: `${COURSE_CONTENTS_PATH}/${AddonModForumModuleHandlerService.PAGE_NAME}/:discussionId`,
loadChildren: () => import('./pages/discussion/discussion.module').then(m => m.AddonForumDiscussionPageModule), loadChildren: () => import('./forum-discussion-lazy.module').then(m => m.AddonForumDiscussionLazyModule),
data: { discussionsPathPrefix: `${AddonModForumModuleHandlerService.PAGE_NAME}/` }, data: { discussionsPathPrefix: `${AddonModForumModuleHandlerService.PAGE_NAME}/` },
}, },
], ],
@ -84,13 +83,12 @@ const courseContentsRoutes: Routes = conditionalRoutes(
[ [
{ {
path: `${AddonModForumModuleHandlerService.PAGE_NAME}/new/:timeCreated`, path: `${AddonModForumModuleHandlerService.PAGE_NAME}/new/:timeCreated`,
loadChildren: () => import('./pages/new-discussion/new-discussion.module') loadChildren: () => import('./forum-new-discussion-lazy.module').then(m => m.AddonForumNewDiscussionLazyModule),
.then(m => m.AddonForumNewDiscussionPageModule),
data: { discussionsPathPrefix: `${AddonModForumModuleHandlerService.PAGE_NAME}/` }, data: { discussionsPathPrefix: `${AddonModForumModuleHandlerService.PAGE_NAME}/` },
}, },
{ {
path: `${AddonModForumModuleHandlerService.PAGE_NAME}/:discussionId`, path: `${AddonModForumModuleHandlerService.PAGE_NAME}/:discussionId`,
loadChildren: () => import('./pages/discussion/discussion.module').then(m => m.AddonForumDiscussionPageModule), loadChildren: () => import('./forum-discussion-lazy.module').then(m => m.AddonForumDiscussionLazyModule),
data: { discussionsPathPrefix: `${AddonModForumModuleHandlerService.PAGE_NAME}/` }, data: { discussionsPathPrefix: `${AddonModForumModuleHandlerService.PAGE_NAME}/` },
}, },
], ],

View File

@ -15,7 +15,7 @@
import { Component, ViewChild } from '@angular/core'; import { Component, ViewChild } from '@angular/core';
import { CoreCourseModuleMainActivityPage } from '@features/course/classes/main-activity-page'; import { CoreCourseModuleMainActivityPage } from '@features/course/classes/main-activity-page';
import { AddonModForumIndexComponent } from '../../components/index'; import { AddonModForumIndexComponent } from '../../components/index/index';
@Component({ @Component({
selector: 'page-addon-mod-forum-index', selector: 'page-addon-mod-forum-index',

View File

@ -13,11 +13,11 @@
// limitations under the License. // limitations under the License.
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { AddonModGlossaryEditPage } from './edit';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { CoreEditorComponentsModule } from '@features/editor/components/components.module'; import { CoreEditorComponentsModule } from '@features/editor/components/components.module';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { CanLeaveGuard } from '@guards/can-leave'; import { CanLeaveGuard } from '@guards/can-leave';
import { AddonModGlossaryEditPage } from '@addons/mod/glossary/pages/edit/edit';
const routes: Routes = [{ const routes: Routes = [{
path: '', path: '',
@ -35,4 +35,4 @@ const routes: Routes = [{
CoreEditorComponentsModule, CoreEditorComponentsModule,
], ],
}) })
export class AddonModGlossaryEditPageModule {} export class AddonModGlossaryEditLazyModule {}

View File

@ -14,11 +14,11 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonModGlossaryEntryPage } from './entry';
import { CoreCommentsComponentsModule } from '@features/comments/components/components.module'; import { CoreCommentsComponentsModule } from '@features/comments/components/components.module';
import { CoreRatingComponentsModule } from '@features/rating/components/components.module'; import { CoreRatingComponentsModule } from '@features/rating/components/components.module';
import { CoreTagComponentsModule } from '@features/tag/components/components.module'; import { CoreTagComponentsModule } from '@features/tag/components/components.module';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { AddonModGlossaryEntryPage } from '@addons/mod/glossary/pages/entry/entry';
const routes: Routes = [{ const routes: Routes = [{
path: '', path: '',
@ -37,4 +37,4 @@ const routes: Routes = [{
CoreTagComponentsModule, CoreTagComponentsModule,
], ],
}) })
export class AddonModGlossaryEntryPageModule {} export class AddonModGlossaryEntryLazyModule {}

View File

@ -28,11 +28,11 @@ const mobileRoutes: Routes = [
}, },
{ {
path: ':courseId/:cmId/entry/:entryId', path: ':courseId/:cmId/entry/:entryId',
loadChildren: () => import('./pages/entry/entry.module').then(m => m.AddonModGlossaryEntryPageModule), loadChildren: () => import('./glossary-entry-lazy.module').then(m => m.AddonModGlossaryEntryLazyModule),
}, },
{ {
path: ':courseId/:cmId/edit/:timecreated', path: ':courseId/:cmId/edit/:timecreated',
loadChildren: () => import('./pages/edit/edit.module').then(m => m.AddonModGlossaryEditPageModule), loadChildren: () => import('./glossary-edit-lazy.module').then(m => m.AddonModGlossaryEditLazyModule),
}, },
]; ];
@ -43,11 +43,11 @@ const tabletRoutes: Routes = [
children: [ children: [
{ {
path: 'entry/:entryId', path: 'entry/:entryId',
loadChildren: () => import('./pages/entry/entry.module').then(m => m.AddonModGlossaryEntryPageModule), loadChildren: () => import('./glossary-entry-lazy.module').then(m => m.AddonModGlossaryEntryLazyModule),
}, },
{ {
path: 'edit/:timecreated', path: 'edit/:timecreated',
loadChildren: () => import('./pages/edit/edit.module').then(m => m.AddonModGlossaryEditPageModule), loadChildren: () => import('./glossary-edit-lazy.module').then(m => m.AddonModGlossaryEditLazyModule),
}, },
], ],
}, },

View File

@ -17,7 +17,7 @@ import { APP_INITIALIZER, NgModule, Type } from '@angular/core';
import { Routes } from '@angular/router'; import { Routes } from '@angular/router';
import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate';
import { COURSE_CONTENTS_PATH } from '@features/course/course.module'; import { COURSE_CONTENTS_PATH } from '@features/course/course.module';
import { CoreCourseContentsRoutingModule } from '@features/course/pages/contents/contents-routing.module'; import { CoreCourseContentsRoutingModule } from '@features/course/course-contents-routing.module';
import { CoreCourseHelper } from '@features/course/services/course-helper'; import { CoreCourseHelper } from '@features/course/services/course-helper';
import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate';
import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate';
@ -51,12 +51,12 @@ export const ADDON_MOD_GLOSSARY_SERVICES: Type<unknown>[] = [
const mainMenuRoutes: Routes = [ const mainMenuRoutes: Routes = [
{ {
path: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/entry/:entryId`, path: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/entry/:entryId`,
loadChildren: () => import('./pages/entry/entry.module').then(m => m.AddonModGlossaryEntryPageModule), loadChildren: () => import('./glossary-entry-lazy.module').then(m => m.AddonModGlossaryEntryLazyModule),
data: { swipeEnabled: false }, data: { swipeEnabled: false },
}, },
{ {
path: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/edit/:timecreated`, path: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/edit/:timecreated`,
loadChildren: () => import('./pages/edit/edit.module').then(m => m.AddonModGlossaryEditPageModule), loadChildren: () => import('./glossary-edit-lazy.module').then(m => m.AddonModGlossaryEditLazyModule),
data: { swipeEnabled: false }, data: { swipeEnabled: false },
}, },
{ {
@ -67,12 +67,12 @@ const mainMenuRoutes: Routes = [
[ [
{ {
path: `${COURSE_CONTENTS_PATH}/${AddonModGlossaryModuleHandlerService.PAGE_NAME}/entry/:entryId`, path: `${COURSE_CONTENTS_PATH}/${AddonModGlossaryModuleHandlerService.PAGE_NAME}/entry/:entryId`,
loadChildren: () => import('./pages/entry/entry.module').then(m => m.AddonModGlossaryEntryPageModule), loadChildren: () => import('./glossary-entry-lazy.module').then(m => m.AddonModGlossaryEntryLazyModule),
data: { glossaryPathPrefix: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/` }, data: { glossaryPathPrefix: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/` },
}, },
{ {
path: `${COURSE_CONTENTS_PATH}/${AddonModGlossaryModuleHandlerService.PAGE_NAME}/edit/:timecreated`, path: `${COURSE_CONTENTS_PATH}/${AddonModGlossaryModuleHandlerService.PAGE_NAME}/edit/:timecreated`,
loadChildren: () => import('./pages/edit/edit.module').then(m => m.AddonModGlossaryEditPageModule), loadChildren: () => import('./glossary-edit-lazy.module').then(m => m.AddonModGlossaryEditLazyModule),
data: { glossaryPathPrefix: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/` }, data: { glossaryPathPrefix: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/` },
}, },
], ],
@ -84,12 +84,12 @@ const courseContentsRoutes: Routes = conditionalRoutes(
[ [
{ {
path: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/entry/:entryId`, path: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/entry/:entryId`,
loadChildren: () => import('./pages/entry/entry.module').then(m => m.AddonModGlossaryEntryPageModule), loadChildren: () => import('./glossary-entry-lazy.module').then(m => m.AddonModGlossaryEntryLazyModule),
data: { glossaryPathPrefix: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/` }, data: { glossaryPathPrefix: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/` },
}, },
{ {
path: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/edit/:timecreated`, path: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/edit/:timecreated`,
loadChildren: () => import('./pages/edit/edit.module').then(m => m.AddonModGlossaryEditPageModule), loadChildren: () => import('./glossary-edit-lazy.module').then(m => m.AddonModGlossaryEditLazyModule),
data: { glossaryPathPrefix: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/` }, data: { glossaryPathPrefix: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/` },
}, },
], ],

View File

@ -19,6 +19,9 @@ import { CoreSharedModule } from '@/core/shared.module';
import { CanLeaveGuard } from '@guards/can-leave'; import { CanLeaveGuard } from '@guards/can-leave';
import { AddonModH5PActivityComponentsModule } from './components/components.module'; import { AddonModH5PActivityComponentsModule } from './components/components.module';
import { AddonModH5PActivityIndexPage } from './pages/index/index'; import { AddonModH5PActivityIndexPage } from './pages/index/index';
import { AddonModH5PActivityUserAttemptsPage } from '@addons/mod/h5pactivity/pages/user-attempts/user-attempts';
import { AddonModH5PActivityAttemptResultsPage } from '@addons/mod/h5pactivity/pages/attempt-results/attempt-results';
import { AddonModH5PActivityUsersAttemptsPage } from '@addons/mod/h5pactivity/pages/users-attempts/users-attempts';
const routes: Routes = [ const routes: Routes = [
{ {
@ -28,18 +31,15 @@ const routes: Routes = [
}, },
{ {
path: ':courseId/:cmId/userattempts/:userId', path: ':courseId/:cmId/userattempts/:userId',
loadChildren: () => import('./pages/user-attempts/user-attempts.module') component: AddonModH5PActivityUserAttemptsPage,
.then( m => m.AddonModH5PActivityUserAttemptsPageModule),
}, },
{ {
path: ':courseId/:cmId/attemptresults/:attemptId', path: ':courseId/:cmId/attemptresults/:attemptId',
loadChildren: () => import('./pages/attempt-results/attempt-results.module') component: AddonModH5PActivityAttemptResultsPage,
.then( m => m.AddonModH5PActivityAttemptResultsPageModule),
}, },
{ {
path: ':courseId/:cmId/users', path: ':courseId/:cmId/users',
loadChildren: () => import('./pages/users-attempts/users-attempts.module') component: AddonModH5PActivityUsersAttemptsPage,
.then( m => m.AddonModH5PActivityUsersAttemptsPageModule),
}, },
]; ];
@ -51,6 +51,9 @@ const routes: Routes = [
], ],
declarations: [ declarations: [
AddonModH5PActivityIndexPage, AddonModH5PActivityIndexPage,
AddonModH5PActivityUserAttemptsPage,
AddonModH5PActivityAttemptResultsPage,
AddonModH5PActivityUsersAttemptsPage,
], ],
}) })
export class AddonModH5PActivityLazyModule {} export class AddonModH5PActivityLazyModule {}

View File

@ -1,38 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonModH5PActivityAttemptResultsPage } from './attempt-results';
const routes: Routes = [
{
path: '',
component: AddonModH5PActivityAttemptResultsPage,
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
],
declarations: [
AddonModH5PActivityAttemptResultsPage,
],
exports: [RouterModule],
})
export class AddonModH5PActivityAttemptResultsPageModule {}

View File

@ -1,38 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonModH5PActivityUserAttemptsPage } from './user-attempts';
const routes: Routes = [
{
path: '',
component: AddonModH5PActivityUserAttemptsPage,
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
],
declarations: [
AddonModH5PActivityUserAttemptsPage,
],
exports: [RouterModule],
})
export class AddonModH5PActivityUserAttemptsPageModule {}

View File

@ -1,38 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonModH5PActivityUsersAttemptsPage } from './users-attempts';
const routes: Routes = [
{
path: '',
component: AddonModH5PActivityUsersAttemptsPage,
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
],
declarations: [
AddonModH5PActivityUsersAttemptsPage,
],
exports: [RouterModule],
})
export class AddonModH5PActivityUsersAttemptsPageModule {}

View File

@ -17,7 +17,8 @@ import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonModImscpComponentsModule } from './components/components.module'; import { AddonModImscpComponentsModule } from './components/components.module';
import { AddonModImscpIndexPage } from './pages/index/index.page'; import { AddonModImscpIndexPage } from './pages/index/index';
import { AddonModImscpViewPage } from '@addons/mod/imscp/pages/view/view';
const routes: Routes = [ const routes: Routes = [
{ {
@ -26,7 +27,7 @@ const routes: Routes = [
}, },
{ {
path: ':courseId/:cmId/view', path: ':courseId/:cmId/view',
loadChildren: () => import('./pages/view/view.module').then(m => m.AddonModImscpViewPageModule), component: AddonModImscpViewPage,
}, },
]; ];
@ -38,6 +39,7 @@ const routes: Routes = [
], ],
declarations: [ declarations: [
AddonModImscpIndexPage, AddonModImscpIndexPage,
AddonModImscpViewPage,
], ],
}) })
export class AddonModImscpLazyModule {} export class AddonModImscpLazyModule {}

View File

@ -1,38 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonModImscpViewPage } from './view';
const routes: Routes = [
{
path: '',
component: AddonModImscpViewPage,
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
],
declarations: [
AddonModImscpViewPage,
],
exports: [RouterModule],
})
export class AddonModImscpViewPageModule {}

View File

@ -15,7 +15,7 @@
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { ModalController } from '@singletons'; import { ModalController } from '@singletons';
import { AddonModLessonPlayerPage } from '../../pages/player/player.page'; import { AddonModLessonPlayerPage } from '../../pages/player/player';
/** /**
* Modal that renders the lesson menu and media file. * Modal that renders the lesson menu and media file.

View File

@ -18,7 +18,11 @@ import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonModLessonComponentsModule } from './components/components.module'; import { AddonModLessonComponentsModule } from './components/components.module';
import { AddonModLessonIndexPage } from './pages/index/index.page'; import { AddonModLessonIndexPage } from './pages/index';
import { CoreEditorComponentsModule } from '@features/editor/components/components.module';
import { AddonModLessonPlayerPage } from '@addons/mod/lesson/pages/player/player';
import { CanLeaveGuard } from '@guards/can-leave';
import { AddonModLessonUserRetakePage } from '@addons/mod/lesson/pages/user-retake/user-retake';
const routes: Routes = [ const routes: Routes = [
{ {
@ -27,11 +31,12 @@ const routes: Routes = [
}, },
{ {
path: ':courseId/:cmId/player', path: ':courseId/:cmId/player',
loadChildren: () => import('./pages/player/player.module').then( m => m.AddonModLessonPlayerPageModule), component: AddonModLessonPlayerPage,
canDeactivate: [CanLeaveGuard],
}, },
{ {
path: ':courseId/:cmId/user-retake/:userId', path: ':courseId/:cmId/user-retake/:userId',
loadChildren: () => import('./pages/user-retake/user-retake.module').then( m => m.AddonModLessonUserRetakePageModule), component: AddonModLessonUserRetakePage,
}, },
]; ];
@ -39,10 +44,13 @@ const routes: Routes = [
imports: [ imports: [
RouterModule.forChild(routes), RouterModule.forChild(routes),
CoreSharedModule, CoreSharedModule,
CoreEditorComponentsModule,
AddonModLessonComponentsModule, AddonModLessonComponentsModule,
], ],
declarations: [ declarations: [
AddonModLessonIndexPage, AddonModLessonIndexPage,
AddonModLessonPlayerPage,
AddonModLessonUserRetakePage,
], ],
}) })
export class AddonModLessonLazyModule {} export class AddonModLessonLazyModule {}

View File

@ -1,42 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonModLessonPlayerPage } from './player.page';
import { CoreEditorComponentsModule } from '@features/editor/components/components.module';
import { CanLeaveGuard } from '@guards/can-leave';
const routes: Routes = [
{
path: '',
component: AddonModLessonPlayerPage,
canDeactivate: [CanLeaveGuard],
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
CoreEditorComponentsModule,
],
declarations: [
AddonModLessonPlayerPage,
],
exports: [RouterModule],
})
export class AddonModLessonPlayerPageModule {}

View File

@ -1,38 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonModLessonUserRetakePage } from './user-retake.page';
const routes: Routes = [
{
path: '',
component: AddonModLessonUserRetakePage,
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
],
declarations: [
AddonModLessonUserRetakePage,
],
exports: [RouterModule],
})
export class AddonModLessonUserRetakePageModule {}

View File

@ -16,7 +16,7 @@ import { CoreSharedModule } from '@/core/shared.module';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { AddonModLtiComponentsModule } from './components/components.module'; import { AddonModLtiComponentsModule } from './components/components.module';
import { AddonModLtiIndexPage } from './pages/index/index.page'; import { AddonModLtiIndexPage } from './pages/index';
const routes: Routes = [ const routes: Routes = [
{ {

View File

@ -65,4 +65,4 @@ import { AddonModWorkshopModule } from './workshop/workshop.module';
AddonModWorkshopModule, AddonModWorkshopModule,
], ],
}) })
export class AddonModModule { } export class AddonModModule {}

View File

@ -17,7 +17,7 @@ import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonModPageComponentsModule } from './components/components.module'; import { AddonModPageComponentsModule } from './components/components.module';
import { AddonModPageIndexPage } from './pages/index/index.page'; import { AddonModPageIndexPage } from './pages/index';
const routes: Routes = [ const routes: Routes = [
{ {

View File

@ -37,4 +37,4 @@ import { AddonModQuizAccessTimeLimitModule } from './timelimit/timelimit.module'
AddonModQuizAccessTimeLimitModule, AddonModQuizAccessTimeLimitModule,
], ],
}) })
export class AddonModQuizAccessRulesModule { } export class AddonModQuizAccessRulesModule {}

View File

@ -1,38 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonModQuizAttemptPage } from './attempt.page';
const routes: Routes = [
{
path: '',
component: AddonModQuizAttemptPage,
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
],
declarations: [
AddonModQuizAttemptPage,
],
exports: [RouterModule],
})
export class AddonModQuizAttemptPageModule {}

View File

@ -1,42 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { CoreSharedModule } from '@/core/shared.module';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreQuestionComponentsModule } from '@features/question/components/components.module';
import { CanLeaveGuard } from '@guards/can-leave';
import { AddonModQuizPlayerPage } from './player.page';
const routes: Routes = [
{
path: '',
component: AddonModQuizPlayerPage,
canDeactivate: [CanLeaveGuard],
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
CoreQuestionComponentsModule,
],
declarations: [
AddonModQuizPlayerPage,
],
exports: [RouterModule],
})
export class AddonModQuizPlayerPageModule {}

View File

@ -1,40 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed 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 { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreQuestionComponentsModule } from '@features/question/components/components.module';
import { AddonModQuizReviewPage } from './review.page';
const routes: Routes = [
{
path: '',
component: AddonModQuizReviewPage,
},
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
CoreQuestionComponentsModule,
],
declarations: [
AddonModQuizReviewPage,
],
exports: [RouterModule],
})
export class AddonModQuizReviewPageModule {}

View File

@ -18,7 +18,12 @@ import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonModQuizComponentsModule } from './components/components.module'; import { AddonModQuizComponentsModule } from './components/components.module';
import { AddonModQuizIndexPage } from './pages/index/index.page'; import { AddonModQuizIndexPage } from './pages/index';
import { AddonModQuizAttemptPage } from '@addons/mod/quiz/pages/attempt/attempt';
import { CoreQuestionComponentsModule } from '@features/question/components/components.module';
import { AddonModQuizPlayerPage } from '@addons/mod/quiz/pages/player/player';
import { CanLeaveGuard } from '@guards/can-leave';
import { AddonModQuizReviewPage } from '@addons/mod/quiz/pages/review/review';
const routes: Routes = [ const routes: Routes = [
{ {
@ -27,15 +32,16 @@ const routes: Routes = [
}, },
{ {
path: ':courseId/:cmId/player', path: ':courseId/:cmId/player',
loadChildren: () => import('./pages/player/player.module').then( m => m.AddonModQuizPlayerPageModule), component: AddonModQuizPlayerPage,
canDeactivate: [CanLeaveGuard],
}, },
{ {
path: ':courseId/:cmId/attempt/:attemptId', path: ':courseId/:cmId/attempt/:attemptId',
loadChildren: () => import('./pages/attempt/attempt.module').then( m => m.AddonModQuizAttemptPageModule), component: AddonModQuizAttemptPage,
}, },
{ {
path: ':courseId/:cmId/review/:attemptId', path: ':courseId/:cmId/review/:attemptId',
loadChildren: () => import('./pages/review/review.module').then( m => m.AddonModQuizReviewPageModule), component: AddonModQuizReviewPage,
}, },
]; ];
@ -44,9 +50,13 @@ const routes: Routes = [
RouterModule.forChild(routes), RouterModule.forChild(routes),
CoreSharedModule, CoreSharedModule,
AddonModQuizComponentsModule, AddonModQuizComponentsModule,
CoreQuestionComponentsModule,
], ],
declarations: [ declarations: [
AddonModQuizIndexPage, AddonModQuizIndexPage,
AddonModQuizAttemptPage,
AddonModQuizPlayerPage,
AddonModQuizReviewPage,
], ],
}) })
export class AddonModQuizLazyModule {} export class AddonModQuizLazyModule {}

View File

@ -16,7 +16,7 @@ import { CoreSharedModule } from '@/core/shared.module';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { AddonModResourceComponentsModule } from './components/components.module'; import { AddonModResourceComponentsModule } from './components/components.module';
import { AddonModResourceIndexPage } from './pages/index/index.page'; import { AddonModResourceIndexPage } from './pages/index';
const routes: Routes = [ const routes: Routes = [
{ {

View File

@ -16,7 +16,7 @@ import { CoreSharedModule } from '@/core/shared.module';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { AddonModUrlComponentsModule } from './components/components.module'; import { AddonModUrlComponentsModule } from './components/components.module';
import { AddonModUrlIndexPage } from './pages/index/index.page'; import { AddonModUrlIndexPage } from './pages/index';
const routes: Routes = [ const routes: Routes = [
{ {

View File

@ -17,7 +17,7 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { CoreCommentsComponentsModule } from '@features/comments/components/components.module'; import { CoreCommentsComponentsModule } from '@features/comments/components/components.module';
import { CoreTagComponentsModule } from '@features/tag/components/components.module'; import { CoreTagComponentsModule } from '@features/tag/components/components.module';
import { AddonNotesListPage } from './pages/list/list.page'; import { AddonNotesListPage } from './pages/list/list';
const routes: Routes = [ const routes: Routes = [
{ {

View File

@ -27,7 +27,7 @@ import { NOTES_OFFLINE_SITE_SCHEMA } from './services/database/notes';
import { AddonNotesComponentsModule } from './components/components.module'; import { AddonNotesComponentsModule } from './components/components.module';
import { Routes } from '@angular/router'; import { Routes } from '@angular/router';
import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module';
import { CoreCourseIndexRoutingModule } from '@features/course/pages/index/index-routing.module'; import { CoreCourseIndexRoutingModule } from '@features/course/course-routing.module';
// List of providers (without handlers). // List of providers (without handlers).
export const ADDON_NOTES_SERVICES: Type<unknown>[] = [ export const ADDON_NOTES_SERVICES: Type<unknown>[] = [

View File

@ -13,33 +13,45 @@
// limitations under the License. // limitations under the License.
import { conditionalRoutes } from '@/app/app-routing.module'; import { conditionalRoutes } from '@/app/app-routing.module';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonNotificationsListPage } from '@addons/notifications/pages/list/list';
import { AddonNotificationsNotificationPage } from '@addons/notifications/pages/notification/notification';
import { Injector, NgModule } from '@angular/core'; import { Injector, NgModule } from '@angular/core';
import { RouterModule, ROUTES, Routes } from '@angular/router'; import { RouterModule, ROUTES, Routes } from '@angular/router';
import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module';
import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module'; import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module';
import { CoreScreen } from '@services/screen'; import { CoreScreen } from '@services/screen';
import { AddonNotificationsMainMenuHandlerService } from './services/handlers/mainmenu'; import { AddonNotificationsMainMenuHandlerService } from './services/handlers/mainmenu';
/**
* Build module routes.
*
* @param injector Injector.
* @returns Routes.
*/
function buildRoutes(injector: Injector): Routes { function buildRoutes(injector: Injector): Routes {
return [ return [
{ {
path: 'list', path: 'list',
data: { data: { mainMenuTabRoot: AddonNotificationsMainMenuHandlerService.PAGE_NAME },
mainMenuTabRoot: AddonNotificationsMainMenuHandlerService.PAGE_NAME, component: AddonNotificationsListPage,
}, children: conditionalRoutes([
loadChildren: () => import('./pages/list/list.module').then(m => m.AddonNotificationsListPageModule), {
path: ':id',
component: AddonNotificationsNotificationPage,
},
], () => CoreScreen.isTablet),
}, },
...conditionalRoutes([ ...conditionalRoutes([
{ {
path: 'list/:id', path: 'list/:id',
loadChildren: () => import('./pages/notification/notification.module') component: AddonNotificationsNotificationPage,
.then(m => m.AddonNotificationsNotificationPageModule),
}, },
], () => CoreScreen.isMobile), ], () => CoreScreen.isMobile),
{ {
path: 'notification', path: 'notification',
loadChildren: () => import('./pages/notification/notification.module') component: AddonNotificationsNotificationPage,
.then(m => m.AddonNotificationsNotificationPageModule),
}, },
...buildTabMainRoutes(injector, { ...buildTabMainRoutes(injector, {
redirectTo: 'list', redirectTo: 'list',
@ -49,6 +61,14 @@ function buildRoutes(injector: Injector): Routes {
} }
@NgModule({ @NgModule({
imports: [
CoreSharedModule,
CoreMainMenuComponentsModule,
],
declarations: [
AddonNotificationsListPage,
AddonNotificationsNotificationPage,
],
exports: [RouterModule], exports: [RouterModule],
providers: [ providers: [
{ {

View File

@ -16,7 +16,7 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonNotificationsSettingsPage } from './settings'; import { AddonNotificationsSettingsPage } from '@addons/notifications/pages/settings/settings';
const routes: Routes = [ const routes: Routes = [
{ {
@ -35,4 +35,4 @@ const routes: Routes = [
], ],
exports: [RouterModule], exports: [RouterModule],
}) })
export class AddonNotificationsSettingsPageModule {} export class AddonNotificationsSettingsLazyModule {}

Some files were not shown because too many files have changed in this diff Show More