MOBILE-3905 user: Define mobile participant page
parent
b98be569ea
commit
df92c97802
|
@ -19,7 +19,6 @@ import { CoreApp } from '@services/app';
|
|||
import { CoreDomUtils } from '@services/utils/dom';
|
||||
import { CoreNavigator } from '@services/navigator';
|
||||
import { CorePageItemsListManager } from '@classes/page-items-list-manager';
|
||||
import { CoreScreen } from '@services/screen';
|
||||
import { CoreSplitViewComponent } from '@components/split-view/split-view';
|
||||
import { CoreUser, CoreUserProvider, CoreUserParticipant, CoreUserData } from '@features/user/services/user';
|
||||
import { CoreUtils } from '@services/utils/utils';
|
||||
|
@ -213,22 +212,6 @@ class CoreUserParticipantsManager extends CorePageItemsListManager<CoreUserParti
|
|||
this.courseId = courseId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
async select(participant: CoreUserParticipant | CoreUserData): Promise<void> {
|
||||
if (CoreScreen.isMobile) {
|
||||
await CoreNavigator.navigateToSitePath(
|
||||
'/user/profile',
|
||||
{ params: { userId: participant.id, courseId: this.courseId } },
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return super.select(participant);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
|
|
@ -21,6 +21,7 @@ import {
|
|||
} from '@features/course/services/course-options-delegate';
|
||||
import { CoreCourseUserAdminOrNavOptionIndexed } from '@features/courses/services/courses';
|
||||
import { CoreEnrolledCourseDataWithExtraInfoAndOptions } from '@features/courses/services/courses-helper';
|
||||
import { PARTICIPANTS_PAGE_NAME } from '@features/user/user.module';
|
||||
import { makeSingleton } from '@singletons';
|
||||
import { CoreUser } from '../user';
|
||||
|
||||
|
@ -89,7 +90,7 @@ export class CoreUserCourseOptionHandlerService implements CoreCourseOptionsHand
|
|||
return {
|
||||
title: 'core.user.participants',
|
||||
class: 'core-user-participants-handler',
|
||||
page: 'participants',
|
||||
page: PARTICIPANTS_PAGE_NAME,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -19,17 +19,19 @@ import { CoreSharedModule } from '@/core/shared.module';
|
|||
import { CoreSearchComponentsModule } from '@features/search/components/components.module';
|
||||
|
||||
import { CoreUserParticipantsPage } from './pages/participants/participants.page';
|
||||
import { conditionalRoutes } from '@/app/app-routing.module';
|
||||
import { CoreScreen } from '@services/screen';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: CoreUserParticipantsPage,
|
||||
children: [
|
||||
children: conditionalRoutes([
|
||||
{
|
||||
path: ':userId',
|
||||
loadChildren: () => import('@features/user/pages/profile/profile.module').then(m => m.CoreUserProfilePageModule),
|
||||
},
|
||||
],
|
||||
], () => CoreScreen.isTablet),
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
@ -35,6 +35,10 @@ import { CoreUserProvider } from './services/user';
|
|||
import { CoreUserHelperProvider } from './services/user-helper';
|
||||
import { CoreUserOfflineProvider } from './services/user-offline';
|
||||
import { CoreUserSyncProvider } from './services/user-sync';
|
||||
import { conditionalRoutes } from '@/app/app-routing.module';
|
||||
import { CoreScreen } from '@services/screen';
|
||||
import { COURSE_PAGE_NAME } from '@features/course/course.module';
|
||||
import { COURSE_INDEX_PATH } from '@features/course/course-lazy.module';
|
||||
|
||||
export const CORE_USER_SERVICES: Type<unknown>[] = [
|
||||
CoreUserDelegateService,
|
||||
|
@ -45,16 +49,24 @@ export const CORE_USER_SERVICES: Type<unknown>[] = [
|
|||
CoreUserSyncProvider,
|
||||
];
|
||||
|
||||
export const PARTICIPANTS_PAGE_NAME = 'participants';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: 'user',
|
||||
loadChildren: () => import('@features/user/user-lazy.module').then(m => m.CoreUserLazyModule),
|
||||
},
|
||||
...conditionalRoutes([
|
||||
{
|
||||
path: `${COURSE_PAGE_NAME}/${COURSE_INDEX_PATH}/${PARTICIPANTS_PAGE_NAME}/:userId`,
|
||||
loadChildren: () => import('@features/user/pages/profile/profile.module').then(m => m.CoreUserProfilePageModule),
|
||||
},
|
||||
], () => CoreScreen.isMobile),
|
||||
];
|
||||
|
||||
const courseIndexRoutes: Routes = [
|
||||
{
|
||||
path: 'participants',
|
||||
path: PARTICIPANTS_PAGE_NAME,
|
||||
loadChildren: () => import('@features/user/user-course-lazy.module').then(m => m.CoreUserCourseLazyModule),
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue