Merge pull request #2963 from dpalou/MOBILE-3798
MOBILE-3798 competency: Remove learning plans from main menumain
commit
5e321b57c2
|
@ -17,7 +17,7 @@ import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
|
||||||
import { CoreBlockOnlyTitleComponent } from '@features/block/components/only-title-block/only-title-block';
|
import { CoreBlockOnlyTitleComponent } from '@features/block/components/only-title-block/only-title-block';
|
||||||
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
|
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { AddonCompetencyMainMenuHandlerService } from '@addons/competency/services/handlers/mainmenu';
|
import { ADDON_COMPETENCY_MAIN_PAGE_NAME } from '@addons/competency/competency.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Block handler.
|
* Block handler.
|
||||||
|
@ -38,7 +38,7 @@ export class AddonBlockLearningPlansHandlerService extends CoreBlockBaseHandler
|
||||||
title: 'addon.block_learningplans.pluginname',
|
title: 'addon.block_learningplans.pluginname',
|
||||||
class: 'addon-block-learning-plans',
|
class: 'addon-block-learning-plans',
|
||||||
component: CoreBlockOnlyTitleComponent,
|
component: CoreBlockOnlyTitleComponent,
|
||||||
link: AddonCompetencyMainMenuHandlerService.PAGE_NAME,
|
link: ADDON_COMPETENCY_MAIN_PAGE_NAME,
|
||||||
navOptions: {
|
navOptions: {
|
||||||
preferCurrentTab: false,
|
preferCurrentTab: false,
|
||||||
},
|
},
|
||||||
|
|
|
@ -25,15 +25,11 @@ import { AddonCompetencyCompetencyPage } from './pages/competency/competency';
|
||||||
import { AddonCompetencyCompetencySummaryPage } from './pages/competencysummary/competencysummary';
|
import { AddonCompetencyCompetencySummaryPage } from './pages/competencysummary/competencysummary';
|
||||||
import { AddonCompetencyCourseCompetenciesPage } from './pages/coursecompetencies/coursecompetencies.page';
|
import { AddonCompetencyCourseCompetenciesPage } from './pages/coursecompetencies/coursecompetencies.page';
|
||||||
import { AddonCompetencyCourseCompetenciesPageModule } from './pages/coursecompetencies/coursecompetencies.module';
|
import { AddonCompetencyCourseCompetenciesPageModule } from './pages/coursecompetencies/coursecompetencies.module';
|
||||||
import { AddonCompetencyMainMenuHandlerService } from './services/handlers/mainmenu';
|
|
||||||
|
|
||||||
const mobileRoutes: Routes = [
|
const mobileRoutes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
pathMatch: 'full',
|
pathMatch: 'full',
|
||||||
data: {
|
|
||||||
mainMenuTabRoot: AddonCompetencyMainMenuHandlerService.PAGE_NAME,
|
|
||||||
},
|
|
||||||
component: AddonCompetencyPlanListPage,
|
component: AddonCompetencyPlanListPage,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -79,9 +75,6 @@ const tabletRoutes: Routes = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
data: {
|
|
||||||
mainMenuTabRoot: AddonCompetencyMainMenuHandlerService.PAGE_NAME,
|
|
||||||
},
|
|
||||||
component: AddonCompetencyPlanListPage,
|
component: AddonCompetencyPlanListPage,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,14 +15,12 @@
|
||||||
import { APP_INITIALIZER, NgModule, Type } from '@angular/core';
|
import { APP_INITIALIZER, NgModule, Type } from '@angular/core';
|
||||||
import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate';
|
import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate';
|
||||||
import { CoreCourseOptionsDelegate } from '@features/course/services/course-options-delegate';
|
import { CoreCourseOptionsDelegate } from '@features/course/services/course-options-delegate';
|
||||||
import { CoreMainMenuDelegate } from '@features/mainmenu/services/mainmenu-delegate';
|
|
||||||
import { CorePushNotificationsDelegate } from '@features/pushnotifications/services/push-delegate';
|
import { CorePushNotificationsDelegate } from '@features/pushnotifications/services/push-delegate';
|
||||||
import { CoreUserDelegate } from '@features/user/services/user-delegate';
|
import { CoreUserDelegate } from '@features/user/services/user-delegate';
|
||||||
import { AddonCompetencyProvider } from './services/competency';
|
import { AddonCompetencyProvider } from './services/competency';
|
||||||
import { AddonCompetencyHelperProvider } from './services/competency-helper';
|
import { AddonCompetencyHelperProvider } from './services/competency-helper';
|
||||||
import { AddonCompetencyCompetencyLinkHandler } from './services/handlers/competency-link';
|
import { AddonCompetencyCompetencyLinkHandler } from './services/handlers/competency-link';
|
||||||
import { AddonCompetencyCourseOptionHandler } from './services/handlers/course-option';
|
import { AddonCompetencyCourseOptionHandler } from './services/handlers/course-option';
|
||||||
import { AddonCompetencyMainMenuHandler, AddonCompetencyMainMenuHandlerService } from './services/handlers/mainmenu';
|
|
||||||
import { AddonCompetencyPlanLinkHandler } from './services/handlers/plan-link';
|
import { AddonCompetencyPlanLinkHandler } from './services/handlers/plan-link';
|
||||||
import { AddonCompetencyPlansLinkHandler } from './services/handlers/plans-link';
|
import { AddonCompetencyPlansLinkHandler } from './services/handlers/plans-link';
|
||||||
import { AddonCompetencyPushClickHandler } from './services/handlers/push-click';
|
import { AddonCompetencyPushClickHandler } from './services/handlers/push-click';
|
||||||
|
@ -39,16 +37,18 @@ export const ADDON_COMPETENCY_SERVICES: Type<unknown>[] = [
|
||||||
AddonCompetencyHelperProvider,
|
AddonCompetencyHelperProvider,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const ADDON_COMPETENCY_MAIN_PAGE_NAME = 'competency';
|
||||||
|
|
||||||
const mainMenuChildrenRoutes: Routes = [
|
const mainMenuChildrenRoutes: Routes = [
|
||||||
{
|
{
|
||||||
path: AddonCompetencyMainMenuHandlerService.PAGE_NAME,
|
path: ADDON_COMPETENCY_MAIN_PAGE_NAME,
|
||||||
loadChildren: () => import('./competency-lazy.module').then(m => m.AddonCompetencyLazyModule),
|
loadChildren: () => import('./competency-lazy.module').then(m => m.AddonCompetencyLazyModule),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const courseIndexRoutes: Routes = [
|
const courseIndexRoutes: Routes = [
|
||||||
{
|
{
|
||||||
path: AddonCompetencyMainMenuHandlerService.PAGE_NAME,
|
path: ADDON_COMPETENCY_MAIN_PAGE_NAME,
|
||||||
loadChildren: () => import('@addons/competency/competency-course-lazy.module').then(m => m.AddonCompetencyCourseLazyModule),
|
loadChildren: () => import('@addons/competency/competency-course-lazy.module').then(m => m.AddonCompetencyCourseLazyModule),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -56,7 +56,6 @@ const courseIndexRoutes: Routes = [
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CoreMainMenuTabRoutingModule.forChild(mainMenuChildrenRoutes),
|
CoreMainMenuTabRoutingModule.forChild(mainMenuChildrenRoutes),
|
||||||
CoreMainMenuRoutingModule.forChild({ children: mainMenuChildrenRoutes }),
|
|
||||||
CoreCourseIndexRoutingModule.forChild({ children: courseIndexRoutes }),
|
CoreCourseIndexRoutingModule.forChild({ children: courseIndexRoutes }),
|
||||||
],
|
],
|
||||||
exports: [CoreMainMenuRoutingModule],
|
exports: [CoreMainMenuRoutingModule],
|
||||||
|
@ -69,7 +68,6 @@ const courseIndexRoutes: Routes = [
|
||||||
CoreContentLinksDelegate.registerHandler(AddonCompetencyPlanLinkHandler.instance);
|
CoreContentLinksDelegate.registerHandler(AddonCompetencyPlanLinkHandler.instance);
|
||||||
CoreContentLinksDelegate.registerHandler(AddonCompetencyPlansLinkHandler.instance);
|
CoreContentLinksDelegate.registerHandler(AddonCompetencyPlansLinkHandler.instance);
|
||||||
CoreContentLinksDelegate.registerHandler(AddonCompetencyUserCompetencyLinkHandler.instance);
|
CoreContentLinksDelegate.registerHandler(AddonCompetencyUserCompetencyLinkHandler.instance);
|
||||||
CoreMainMenuDelegate.registerHandler(AddonCompetencyMainMenuHandler.instance);
|
|
||||||
CoreUserDelegate.registerHandler(AddonCompetencyUserHandler.instance);
|
CoreUserDelegate.registerHandler(AddonCompetencyUserHandler.instance);
|
||||||
CoreCourseOptionsDelegate.registerHandler(AddonCompetencyCourseOptionHandler.instance);
|
CoreCourseOptionsDelegate.registerHandler(AddonCompetencyCourseOptionHandler.instance);
|
||||||
CorePushNotificationsDelegate.registerClickHandler(AddonCompetencyPushClickHandler.instance);
|
CorePushNotificationsDelegate.registerClickHandler(AddonCompetencyPushClickHandler.instance);
|
||||||
|
|
|
@ -32,7 +32,7 @@ import { CoreNavigator } from '@services/navigator';
|
||||||
import { IonRefresher } from '@ionic/angular';
|
import { IonRefresher } from '@ionic/angular';
|
||||||
import { ContextLevel } from '@/core/constants';
|
import { ContextLevel } from '@/core/constants';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { AddonCompetencyMainMenuHandlerService } from '@addons/competency/services/handlers/mainmenu';
|
import { ADDON_COMPETENCY_MAIN_PAGE_NAME } from '@addons/competency/competency.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the competency information.
|
* Page that displays the competency information.
|
||||||
|
@ -184,7 +184,7 @@ export class AddonCompetencyCompetencyPage implements OnInit {
|
||||||
*/
|
*/
|
||||||
openCompetencySummary(competencyId: number): void {
|
openCompetencySummary(competencyId: number): void {
|
||||||
CoreNavigator.navigateToSitePath(
|
CoreNavigator.navigateToSitePath(
|
||||||
'/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME + '/summary/' + competencyId,
|
ADDON_COMPETENCY_MAIN_PAGE_NAME + '/summary/' + competencyId,
|
||||||
{
|
{
|
||||||
params: { contextLevel: this.contextLevel, contextInstanceId: this.contextInstanceId },
|
params: { contextLevel: this.contextLevel, contextInstanceId: this.contextInstanceId },
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,7 +19,7 @@ import { IonRefresher } from '@ionic/angular';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { AddonCompetencyMainMenuHandlerService } from '@addons/competency/services/handlers/mainmenu';
|
import { ADDON_COMPETENCY_MAIN_PAGE_NAME } from '@addons/competency/competency.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the competency summary.
|
* Page that displays the competency summary.
|
||||||
|
@ -102,7 +102,7 @@ export class AddonCompetencyCompetencySummaryPage implements OnInit {
|
||||||
*/
|
*/
|
||||||
openCompetencySummary(competencyId: number): void {
|
openCompetencySummary(competencyId: number): void {
|
||||||
CoreNavigator.navigateToSitePath(
|
CoreNavigator.navigateToSitePath(
|
||||||
'/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME + '/summary/' + competencyId,
|
ADDON_COMPETENCY_MAIN_PAGE_NAME + '/summary/' + competencyId,
|
||||||
{
|
{
|
||||||
params: { contextLevel: this.contextLevel, contextInstanceId: this.contextInstanceId },
|
params: { contextLevel: this.contextLevel, contextInstanceId: this.contextInstanceId },
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,8 +19,8 @@ import { CoreUserProfile } from '@features/user/services/user';
|
||||||
import { IonRefresher } from '@ionic/angular';
|
import { IonRefresher } from '@ionic/angular';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { AddonCompetencyMainMenuHandlerService } from '@addons/competency/services/handlers/mainmenu';
|
|
||||||
import { ContextLevel } from '@/core/constants';
|
import { ContextLevel } from '@/core/constants';
|
||||||
|
import { ADDON_COMPETENCY_MAIN_PAGE_NAME } from '@addons/competency/competency.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the list of competencies of a course.
|
* Page that displays the list of competencies of a course.
|
||||||
|
@ -81,7 +81,7 @@ export class AddonCompetencyCourseCompetenciesPage implements OnInit {
|
||||||
*/
|
*/
|
||||||
openCompetency(competencyId: number): void {
|
openCompetency(competencyId: number): void {
|
||||||
CoreNavigator.navigateToSitePath(
|
CoreNavigator.navigateToSitePath(
|
||||||
'/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME + '/competencies/' + competencyId,
|
ADDON_COMPETENCY_MAIN_PAGE_NAME + '/competencies/' + competencyId,
|
||||||
{
|
{
|
||||||
params: { courseId: this.courseId, userId: this.userId },
|
params: { courseId: this.courseId, userId: this.userId },
|
||||||
},
|
},
|
||||||
|
@ -94,7 +94,7 @@ export class AddonCompetencyCourseCompetenciesPage implements OnInit {
|
||||||
* @param competencyId
|
* @param competencyId
|
||||||
*/
|
*/
|
||||||
openCompetencySummary(competencyId: number): void {
|
openCompetencySummary(competencyId: number): void {
|
||||||
CoreNavigator.navigateToSitePath('/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME + '/summary/' + competencyId, {
|
CoreNavigator.navigateToSitePath(ADDON_COMPETENCY_MAIN_PAGE_NAME + '/summary/' + competencyId, {
|
||||||
params: {
|
params: {
|
||||||
contextLevel: ContextLevel.COURSE,
|
contextLevel: ContextLevel.COURSE,
|
||||||
contextInstanceId: this.courseId,
|
contextInstanceId: this.courseId,
|
||||||
|
|
|
@ -19,7 +19,7 @@ import { AddonCompetencyHelper } from '../../services/competency-helper';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreUserProfile } from '@features/user/services/user';
|
import { CoreUserProfile } from '@features/user/services/user';
|
||||||
import { IonRefresher } from '@ionic/angular';
|
import { IonRefresher } from '@ionic/angular';
|
||||||
import { AddonCompetencyMainMenuHandlerService } from '@addons/competency/services/handlers/mainmenu';
|
import { ADDON_COMPETENCY_MAIN_PAGE_NAME } from '@addons/competency/competency.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a learning plan.
|
* Page that displays a learning plan.
|
||||||
|
@ -80,7 +80,7 @@ export class AddonCompetencyPlanPage implements OnInit {
|
||||||
*/
|
*/
|
||||||
openCompetency(competencyId: number): void {
|
openCompetency(competencyId: number): void {
|
||||||
CoreNavigator.navigateToSitePath(
|
CoreNavigator.navigateToSitePath(
|
||||||
'/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME + '/competencies/' + competencyId,
|
ADDON_COMPETENCY_MAIN_PAGE_NAME + '/competencies/' + competencyId,
|
||||||
{ params: { planId: this.planId } },
|
{ params: { planId: this.planId } },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,13 +12,13 @@
|
||||||
// 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 { ADDON_COMPETENCY_MAIN_PAGE_NAME } from '@addons/competency/competency.module';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CoreContentLinksHandlerBase } from '@features/contentlinks/classes/base-handler';
|
import { CoreContentLinksHandlerBase } from '@features/contentlinks/classes/base-handler';
|
||||||
import { CoreContentLinksAction } from '@features/contentlinks/services/contentlinks-delegate';
|
import { CoreContentLinksAction } from '@features/contentlinks/services/contentlinks-delegate';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { AddonCompetency } from '../competency';
|
import { AddonCompetency } from '../competency';
|
||||||
import { AddonCompetencyMainMenuHandlerService } from './mainmenu';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler to treat links to a competency in a plan or in a course.
|
* Handler to treat links to a competency in a plan or in a course.
|
||||||
|
@ -44,7 +44,7 @@ export class AddonCompetencyCompetencyLinkHandlerService extends CoreContentLink
|
||||||
};
|
};
|
||||||
|
|
||||||
CoreNavigator.navigateToSitePath(
|
CoreNavigator.navigateToSitePath(
|
||||||
'/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME + '/competencies/' + params.competencyid,
|
ADDON_COMPETENCY_MAIN_PAGE_NAME + '/competencies/' + params.competencyid,
|
||||||
{ params: pageParams, siteId },
|
{ params: pageParams, siteId },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import { CoreCourseUserAdminOrNavOptionIndexed } from '@features/courses/service
|
||||||
import { CoreEnrolledCourseDataWithExtraInfoAndOptions } from '@features/courses/services/courses-helper';
|
import { CoreEnrolledCourseDataWithExtraInfoAndOptions } from '@features/courses/services/courses-helper';
|
||||||
import { CoreFilterHelper } from '@features/filter/services/filter-helper';
|
import { CoreFilterHelper } from '@features/filter/services/filter-helper';
|
||||||
import { ContextLevel } from '@/core/constants';
|
import { ContextLevel } from '@/core/constants';
|
||||||
import { AddonCompetencyMainMenuHandlerService } from './mainmenu';
|
import { ADDON_COMPETENCY_MAIN_PAGE_NAME } from '@addons/competency/competency.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Course nav handler.
|
* Course nav handler.
|
||||||
|
@ -75,7 +75,7 @@ export class AddonCompetencyCourseOptionHandlerService implements CoreCourseOpti
|
||||||
return {
|
return {
|
||||||
title: 'addon.competency.competencies',
|
title: 'addon.competency.competencies',
|
||||||
class: 'addon-competency-course-handler',
|
class: 'addon-competency-course-handler',
|
||||||
page: AddonCompetencyMainMenuHandlerService.PAGE_NAME,
|
page: ADDON_COMPETENCY_MAIN_PAGE_NAME,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,54 +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 { Injectable } from '@angular/core';
|
|
||||||
import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '@features/mainmenu/services/mainmenu-delegate';
|
|
||||||
import { makeSingleton } from '@singletons';
|
|
||||||
import { AddonCompetency } from '../competency';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handler to inject an option into main menu.
|
|
||||||
*/
|
|
||||||
@Injectable( { providedIn: 'root' })
|
|
||||||
export class AddonCompetencyMainMenuHandlerService implements CoreMainMenuHandler {
|
|
||||||
|
|
||||||
static readonly PAGE_NAME = 'competency';
|
|
||||||
|
|
||||||
name = 'AddonCompetency';
|
|
||||||
priority = 500;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
async isEnabled(): Promise<boolean> {
|
|
||||||
// Check the user has at least one learn plan available.
|
|
||||||
const plans = await AddonCompetency.getLearningPlans();
|
|
||||||
|
|
||||||
return plans.length > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
getDisplayData(): CoreMainMenuHandlerData {
|
|
||||||
return {
|
|
||||||
icon: 'fas-route',
|
|
||||||
title: 'addon.competency.myplans',
|
|
||||||
page: AddonCompetencyMainMenuHandlerService.PAGE_NAME,
|
|
||||||
class: 'addon-competency-handler',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
export const AddonCompetencyMainMenuHandler = makeSingleton(AddonCompetencyMainMenuHandlerService);
|
|
|
@ -12,13 +12,13 @@
|
||||||
// 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 { ADDON_COMPETENCY_MAIN_PAGE_NAME } from '@addons/competency/competency.module';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CoreContentLinksHandlerBase } from '@features/contentlinks/classes/base-handler';
|
import { CoreContentLinksHandlerBase } from '@features/contentlinks/classes/base-handler';
|
||||||
import { CoreContentLinksAction } from '@features/contentlinks/services/contentlinks-delegate';
|
import { CoreContentLinksAction } from '@features/contentlinks/services/contentlinks-delegate';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { AddonCompetency } from '../competency';
|
import { AddonCompetency } from '../competency';
|
||||||
import { AddonCompetencyMainMenuHandlerService } from './mainmenu';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler to treat links to a plan.
|
* Handler to treat links to a plan.
|
||||||
|
@ -36,7 +36,7 @@ export class AddonCompetencyPlanLinkHandlerService extends CoreContentLinksHandl
|
||||||
return [{
|
return [{
|
||||||
action: (siteId: string): void => {
|
action: (siteId: string): void => {
|
||||||
CoreNavigator.navigateToSitePath(
|
CoreNavigator.navigateToSitePath(
|
||||||
'/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME + '/' + params.id,
|
ADDON_COMPETENCY_MAIN_PAGE_NAME + '/' + params.id,
|
||||||
{ siteId },
|
{ siteId },
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,13 +12,13 @@
|
||||||
// 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 { ADDON_COMPETENCY_MAIN_PAGE_NAME } from '@addons/competency/competency.module';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CoreContentLinksHandlerBase } from '@features/contentlinks/classes/base-handler';
|
import { CoreContentLinksHandlerBase } from '@features/contentlinks/classes/base-handler';
|
||||||
import { CoreContentLinksAction } from '@features/contentlinks/services/contentlinks-delegate';
|
import { CoreContentLinksAction } from '@features/contentlinks/services/contentlinks-delegate';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { AddonCompetency } from '../competency';
|
import { AddonCompetency } from '../competency';
|
||||||
import { AddonCompetencyMainMenuHandlerService } from './mainmenu';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler to treat links to user plans.
|
* Handler to treat links to user plans.
|
||||||
|
@ -36,7 +36,7 @@ export class AddonCompetencyPlansLinkHandlerService extends CoreContentLinksHand
|
||||||
return [{
|
return [{
|
||||||
action: (siteId: string): void => {
|
action: (siteId: string): void => {
|
||||||
CoreNavigator.navigateToSitePath(
|
CoreNavigator.navigateToSitePath(
|
||||||
'/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME,
|
ADDON_COMPETENCY_MAIN_PAGE_NAME,
|
||||||
{ params: { userId: params.userid }, siteId },
|
{ params: { userId: params.userid }, siteId },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
// 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 { ADDON_COMPETENCY_MAIN_PAGE_NAME } from '@addons/competency/competency.module';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CorePushNotificationsClickHandler } from '@features/pushnotifications/services/push-delegate';
|
import { CorePushNotificationsClickHandler } from '@features/pushnotifications/services/push-delegate';
|
||||||
import { CorePushNotificationsNotificationBasicData } from '@features/pushnotifications/services/pushnotifications';
|
import { CorePushNotificationsNotificationBasicData } from '@features/pushnotifications/services/pushnotifications';
|
||||||
|
@ -20,7 +21,6 @@ import { CoreUrlUtils } from '@services/utils/url';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { AddonCompetency } from '../competency';
|
import { AddonCompetency } from '../competency';
|
||||||
import { AddonCompetencyMainMenuHandlerService } from './mainmenu';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for competencies push notifications clicks.
|
* Handler for competencies push notifications clicks.
|
||||||
|
@ -56,7 +56,7 @@ export class AddonCompetencyPushClickHandlerService implements CorePushNotificat
|
||||||
|
|
||||||
await CoreUtils.ignoreErrors(AddonCompetency.invalidateLearningPlan(planId, notification.site));
|
await CoreUtils.ignoreErrors(AddonCompetency.invalidateLearningPlan(planId, notification.site));
|
||||||
|
|
||||||
await CoreNavigator.navigateToSitePath('/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME + '/' + planId, {
|
await CoreNavigator.navigateToSitePath(ADDON_COMPETENCY_MAIN_PAGE_NAME + '/' + planId, {
|
||||||
siteId: notification.site,
|
siteId: notification.site,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ export class AddonCompetencyPushClickHandlerService implements CorePushNotificat
|
||||||
|
|
||||||
await CoreUtils.ignoreErrors(AddonCompetency.invalidateCompetencyInPlan(planId, competencyId, notification.site));
|
await CoreUtils.ignoreErrors(AddonCompetency.invalidateCompetencyInPlan(planId, competencyId, notification.site));
|
||||||
await CoreNavigator.navigateToSitePath(
|
await CoreNavigator.navigateToSitePath(
|
||||||
'/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME + '/competencies/' + competencyId,
|
ADDON_COMPETENCY_MAIN_PAGE_NAME + '/competencies/' + competencyId,
|
||||||
{
|
{
|
||||||
params: { planId, courseId, userId },
|
params: { planId, courseId, userId },
|
||||||
siteId: notification.site,
|
siteId: notification.site,
|
||||||
|
@ -87,7 +87,7 @@ export class AddonCompetencyPushClickHandlerService implements CorePushNotificat
|
||||||
|
|
||||||
await CoreUtils.ignoreErrors(AddonCompetency.invalidateLearningPlans(userId, notification.site));
|
await CoreUtils.ignoreErrors(AddonCompetency.invalidateLearningPlans(userId, notification.site));
|
||||||
|
|
||||||
await CoreNavigator.navigateToSitePath('/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME, {
|
await CoreNavigator.navigateToSitePath(ADDON_COMPETENCY_MAIN_PAGE_NAME, {
|
||||||
params: { userId },
|
params: { userId },
|
||||||
siteId: notification.site,
|
siteId: notification.site,
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,13 +12,13 @@
|
||||||
// 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 { ADDON_COMPETENCY_MAIN_PAGE_NAME } from '@addons/competency/competency.module';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CoreContentLinksHandlerBase } from '@features/contentlinks/classes/base-handler';
|
import { CoreContentLinksHandlerBase } from '@features/contentlinks/classes/base-handler';
|
||||||
import { CoreContentLinksAction } from '@features/contentlinks/services/contentlinks-delegate';
|
import { CoreContentLinksAction } from '@features/contentlinks/services/contentlinks-delegate';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { AddonCompetency } from '../competency';
|
import { AddonCompetency } from '../competency';
|
||||||
import { AddonCompetencyMainMenuHandlerService } from './mainmenu';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler to treat links to a usr competency.
|
* Handler to treat links to a usr competency.
|
||||||
|
@ -37,7 +37,7 @@ export class AddonCompetencyUserCompetencyLinkHandlerService extends CoreContent
|
||||||
return [{
|
return [{
|
||||||
action: (siteId: string): void => {
|
action: (siteId: string): void => {
|
||||||
CoreNavigator.navigateToSitePath(
|
CoreNavigator.navigateToSitePath(
|
||||||
'/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME + '/summary/' + params.id,
|
ADDON_COMPETENCY_MAIN_PAGE_NAME + '/summary/' + params.id,
|
||||||
{ siteId },
|
{ siteId },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,13 @@
|
||||||
// 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 { ADDON_COMPETENCY_MAIN_PAGE_NAME } from '@addons/competency/competency.module';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CoreUserProfile } from '@features/user/services/user';
|
import { CoreUserProfile } from '@features/user/services/user';
|
||||||
import { CoreUserProfileHandler, CoreUserDelegateService, CoreUserProfileHandlerData } from '@features/user/services/user-delegate';
|
import { CoreUserProfileHandler, CoreUserDelegateService, CoreUserProfileHandlerData } from '@features/user/services/user-delegate';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { AddonCompetency } from '../competency';
|
import { AddonCompetency } from '../competency';
|
||||||
import { AddonCompetencyMainMenuHandlerService } from './mainmenu';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Profile competencies handler.
|
* Profile competencies handler.
|
||||||
|
@ -69,7 +69,7 @@ export class AddonCompetencyUserHandlerService implements CoreUserProfileHandler
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
CoreNavigator.navigateToSitePath(
|
CoreNavigator.navigateToSitePath(
|
||||||
'/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME + '/course/' + courseId,
|
ADDON_COMPETENCY_MAIN_PAGE_NAME + '/course/' + courseId,
|
||||||
{
|
{
|
||||||
params: { userId: user.id },
|
params: { userId: user.id },
|
||||||
},
|
},
|
||||||
|
@ -85,7 +85,7 @@ export class AddonCompetencyUserHandlerService implements CoreUserProfileHandler
|
||||||
action: (event, user): void => {
|
action: (event, user): void => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
CoreNavigator.navigateToSitePath('/' + AddonCompetencyMainMenuHandlerService.PAGE_NAME, {
|
CoreNavigator.navigateToSitePath(ADDON_COMPETENCY_MAIN_PAGE_NAME, {
|
||||||
params: { userId: user.id },
|
params: { userId: user.id },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue