MOBILE-3639 siteplugins: Fix module routes
parent
36c2e45921
commit
a568365344
|
@ -100,7 +100,7 @@ export class CoreSitePluginsUserProfileHandler extends CoreSitePluginsBaseHandle
|
||||||
const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
|
const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
|
||||||
|
|
||||||
CoreNavigator.navigateToSitePath(
|
CoreNavigator.navigateToSitePath(
|
||||||
`siteplugins/${this.plugin.component}/${this.handlerSchema.method}/${hash}`,
|
`siteplugins/content/${this.plugin.component}/${this.handlerSchema.method}/${hash}`,
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
title: this.title,
|
title: this.title,
|
||||||
|
|
|
@ -60,7 +60,7 @@ export class CoreSitePluginsOnlyTitleBlockComponent extends CoreBlockBaseCompon
|
||||||
const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
|
const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
|
||||||
|
|
||||||
CoreNavigator.navigateToSitePath(
|
CoreNavigator.navigateToSitePath(
|
||||||
`siteplugins/${handler.plugin.component}/${handler.handlerSchema.method}/${hash}`,
|
`siteplugins/content/${handler.plugin.component}/${handler.handlerSchema.method}/${hash}`,
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
title: this.title,
|
title: this.title,
|
||||||
|
|
|
@ -153,7 +153,7 @@ export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck {
|
||||||
args = args || {};
|
args = args || {};
|
||||||
const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
|
const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
|
||||||
|
|
||||||
CoreNavigator.navigateToSitePath(`siteplugins/${component}/${method}/${hash}`, {
|
CoreNavigator.navigateToSitePath(`siteplugins/content/${component}/${method}/${hash}`, {
|
||||||
params: {
|
params: {
|
||||||
title,
|
title,
|
||||||
args,
|
args,
|
||||||
|
|
|
@ -103,7 +103,7 @@ export class CoreSitePluginsCallWSNewContentDirective extends CoreSitePluginsCal
|
||||||
const method = this.method || this.parentContent?.method;
|
const method = this.method || this.parentContent?.method;
|
||||||
const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
|
const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
|
||||||
|
|
||||||
CoreNavigator.navigateToSitePath(`siteplugins/${component}/${method}/${hash}`, {
|
CoreNavigator.navigateToSitePath(`siteplugins/content/${component}/${method}/${hash}`, {
|
||||||
params: {
|
params: {
|
||||||
title: this.title || this.parentContent?.pageTitle,
|
title: this.title || this.parentContent?.pageTitle,
|
||||||
args,
|
args,
|
||||||
|
|
|
@ -100,7 +100,7 @@ export class CoreSitePluginsNewContentDirective implements OnInit {
|
||||||
const method = this.method || this.parentContent?.method;
|
const method = this.method || this.parentContent?.method;
|
||||||
const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
|
const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
|
||||||
|
|
||||||
CoreNavigator.navigateToSitePath(`siteplugins/${component}/${method}/${hash}`, {
|
CoreNavigator.navigateToSitePath(`siteplugins/content/${component}/${method}/${hash}`, {
|
||||||
params: {
|
params: {
|
||||||
title: this.title || this.parentContent?.pageTitle,
|
title: this.title || this.parentContent?.pageTitle,
|
||||||
args,
|
args,
|
||||||
|
|
|
@ -1,32 +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';
|
|
||||||
|
|
||||||
const routes: Routes = [
|
|
||||||
{
|
|
||||||
path: 'module/:courseId/:cmId',
|
|
||||||
loadChildren: () => import('./pages/module-index/module-index.module').then( m => m.CoreSitePluginsModuleIndexPageModule),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: ':component/:method/:hash',
|
|
||||||
loadChildren: () => import('./pages/plugin-page/plugin-page.module').then( m => m.CoreSitePluginsPluginPageModule),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [RouterModule.forChild(routes)],
|
|
||||||
})
|
|
||||||
export class CoreSitePluginsLazyModule {}
|
|
|
@ -23,8 +23,8 @@ import { CoreSitePluginsHelper } from './services/siteplugins-helper';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: 'siteplugins',
|
path: 'siteplugins/content/:component/:method/:hash',
|
||||||
loadChildren: () => import('@features/siteplugins/siteplugins-lazy.module').then(m => m.CoreSitePluginsLazyModule),
|
loadChildren: () => import('./pages/plugin-page/plugin-page.module').then( m => m.CoreSitePluginsPluginPageModule),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -36,9 +36,16 @@ const courseIndexRoutes: Routes = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const moduleRoutes: Routes = [
|
||||||
|
{
|
||||||
|
path: 'siteplugins/module/:courseId/:cmId',
|
||||||
|
loadChildren: () => import('./pages/module-index/module-index.module').then( m => m.CoreSitePluginsModuleIndexPageModule),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CoreMainMenuTabRoutingModule.forChild(routes),
|
CoreMainMenuTabRoutingModule.forChild(moduleRoutes.concat(routes)),
|
||||||
CoreCourseIndexRoutingModule.forChild({ children: courseIndexRoutes }),
|
CoreCourseIndexRoutingModule.forChild({ children: courseIndexRoutes }),
|
||||||
CoreMainMenuHomeRoutingModule.forChild({ children: routes }),
|
CoreMainMenuHomeRoutingModule.forChild({ children: routes }),
|
||||||
CoreSitePluginsComponentsModule,
|
CoreSitePluginsComponentsModule,
|
||||||
|
|
Loading…
Reference in New Issue