forked from CIT/Vmeda.Online
		
	MOBILE-3639 siteplugins: Fix module routes
This commit is contained in:
		
							parent
							
								
									36c2e45921
								
							
						
					
					
						commit
						a568365344
					
				@ -100,7 +100,7 @@ export class CoreSitePluginsUserProfileHandler extends CoreSitePluginsBaseHandle
 | 
			
		||||
                const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
 | 
			
		||||
 | 
			
		||||
                CoreNavigator.navigateToSitePath(
 | 
			
		||||
                    `siteplugins/${this.plugin.component}/${this.handlerSchema.method}/${hash}`,
 | 
			
		||||
                    `siteplugins/content/${this.plugin.component}/${this.handlerSchema.method}/${hash}`,
 | 
			
		||||
                    {
 | 
			
		||||
                        params: {
 | 
			
		||||
                            title: this.title,
 | 
			
		||||
 | 
			
		||||
@ -60,7 +60,7 @@ export class CoreSitePluginsOnlyTitleBlockComponent  extends CoreBlockBaseCompon
 | 
			
		||||
        const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
 | 
			
		||||
 | 
			
		||||
        CoreNavigator.navigateToSitePath(
 | 
			
		||||
            `siteplugins/${handler.plugin.component}/${handler.handlerSchema.method}/${hash}`,
 | 
			
		||||
            `siteplugins/content/${handler.plugin.component}/${handler.handlerSchema.method}/${hash}`,
 | 
			
		||||
            {
 | 
			
		||||
                params: {
 | 
			
		||||
                    title: this.title,
 | 
			
		||||
 | 
			
		||||
@ -153,7 +153,7 @@ export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck {
 | 
			
		||||
        args = args || {};
 | 
			
		||||
        const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
 | 
			
		||||
 | 
			
		||||
        CoreNavigator.navigateToSitePath(`siteplugins/${component}/${method}/${hash}`, {
 | 
			
		||||
        CoreNavigator.navigateToSitePath(`siteplugins/content/${component}/${method}/${hash}`, {
 | 
			
		||||
            params: {
 | 
			
		||||
                title,
 | 
			
		||||
                args,
 | 
			
		||||
 | 
			
		||||
@ -103,7 +103,7 @@ export class CoreSitePluginsCallWSNewContentDirective extends CoreSitePluginsCal
 | 
			
		||||
            const method = this.method || this.parentContent?.method;
 | 
			
		||||
            const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
 | 
			
		||||
 | 
			
		||||
            CoreNavigator.navigateToSitePath(`siteplugins/${component}/${method}/${hash}`, {
 | 
			
		||||
            CoreNavigator.navigateToSitePath(`siteplugins/content/${component}/${method}/${hash}`, {
 | 
			
		||||
                params: {
 | 
			
		||||
                    title: this.title || this.parentContent?.pageTitle,
 | 
			
		||||
                    args,
 | 
			
		||||
 | 
			
		||||
@ -100,7 +100,7 @@ export class CoreSitePluginsNewContentDirective implements OnInit {
 | 
			
		||||
                const method = this.method || this.parentContent?.method;
 | 
			
		||||
                const hash = <string> Md5.hashAsciiStr(JSON.stringify(args));
 | 
			
		||||
 | 
			
		||||
                CoreNavigator.navigateToSitePath(`siteplugins/${component}/${method}/${hash}`, {
 | 
			
		||||
                CoreNavigator.navigateToSitePath(`siteplugins/content/${component}/${method}/${hash}`, {
 | 
			
		||||
                    params: {
 | 
			
		||||
                        title: this.title || this.parentContent?.pageTitle,
 | 
			
		||||
                        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 = [
 | 
			
		||||
    {
 | 
			
		||||
        path: 'siteplugins',
 | 
			
		||||
        loadChildren: () => import('@features/siteplugins/siteplugins-lazy.module').then(m => m.CoreSitePluginsLazyModule),
 | 
			
		||||
        path: 'siteplugins/content/:component/:method/:hash',
 | 
			
		||||
        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({
 | 
			
		||||
    imports: [
 | 
			
		||||
        CoreMainMenuTabRoutingModule.forChild(routes),
 | 
			
		||||
        CoreMainMenuTabRoutingModule.forChild(moduleRoutes.concat(routes)),
 | 
			
		||||
        CoreCourseIndexRoutingModule.forChild({ children: courseIndexRoutes }),
 | 
			
		||||
        CoreMainMenuHomeRoutingModule.forChild({ children: routes }),
 | 
			
		||||
        CoreSitePluginsComponentsModule,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user