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 { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CorePageItemsListManager } from '@classes/page-items-list-manager';
|
import { CorePageItemsListManager } from '@classes/page-items-list-manager';
|
||||||
import { CoreScreen } from '@services/screen';
|
|
||||||
import { CoreSplitViewComponent } from '@components/split-view/split-view';
|
import { CoreSplitViewComponent } from '@components/split-view/split-view';
|
||||||
import { CoreUser, CoreUserProvider, CoreUserParticipant, CoreUserData } from '@features/user/services/user';
|
import { CoreUser, CoreUserProvider, CoreUserParticipant, CoreUserData } from '@features/user/services/user';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
|
@ -213,22 +212,6 @@ class CoreUserParticipantsManager extends CorePageItemsListManager<CoreUserParti
|
||||||
this.courseId = courseId;
|
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
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -21,6 +21,7 @@ import {
|
||||||
} from '@features/course/services/course-options-delegate';
|
} from '@features/course/services/course-options-delegate';
|
||||||
import { CoreCourseUserAdminOrNavOptionIndexed } from '@features/courses/services/courses';
|
import { CoreCourseUserAdminOrNavOptionIndexed } from '@features/courses/services/courses';
|
||||||
import { CoreEnrolledCourseDataWithExtraInfoAndOptions } from '@features/courses/services/courses-helper';
|
import { CoreEnrolledCourseDataWithExtraInfoAndOptions } from '@features/courses/services/courses-helper';
|
||||||
|
import { PARTICIPANTS_PAGE_NAME } from '@features/user/user.module';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { CoreUser } from '../user';
|
import { CoreUser } from '../user';
|
||||||
|
|
||||||
|
@ -89,7 +90,7 @@ export class CoreUserCourseOptionHandlerService implements CoreCourseOptionsHand
|
||||||
return {
|
return {
|
||||||
title: 'core.user.participants',
|
title: 'core.user.participants',
|
||||||
class: 'core-user-participants-handler',
|
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 { CoreSearchComponentsModule } from '@features/search/components/components.module';
|
||||||
|
|
||||||
import { CoreUserParticipantsPage } from './pages/participants/participants.page';
|
import { CoreUserParticipantsPage } from './pages/participants/participants.page';
|
||||||
|
import { conditionalRoutes } from '@/app/app-routing.module';
|
||||||
|
import { CoreScreen } from '@services/screen';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: CoreUserParticipantsPage,
|
component: CoreUserParticipantsPage,
|
||||||
children: [
|
children: conditionalRoutes([
|
||||||
{
|
{
|
||||||
path: ':userId',
|
path: ':userId',
|
||||||
loadChildren: () => import('@features/user/pages/profile/profile.module').then(m => m.CoreUserProfilePageModule),
|
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 { CoreUserHelperProvider } from './services/user-helper';
|
||||||
import { CoreUserOfflineProvider } from './services/user-offline';
|
import { CoreUserOfflineProvider } from './services/user-offline';
|
||||||
import { CoreUserSyncProvider } from './services/user-sync';
|
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>[] = [
|
export const CORE_USER_SERVICES: Type<unknown>[] = [
|
||||||
CoreUserDelegateService,
|
CoreUserDelegateService,
|
||||||
|
@ -45,16 +49,24 @@ export const CORE_USER_SERVICES: Type<unknown>[] = [
|
||||||
CoreUserSyncProvider,
|
CoreUserSyncProvider,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const PARTICIPANTS_PAGE_NAME = 'participants';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: 'user',
|
path: 'user',
|
||||||
loadChildren: () => import('@features/user/user-lazy.module').then(m => m.CoreUserLazyModule),
|
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 = [
|
const courseIndexRoutes: Routes = [
|
||||||
{
|
{
|
||||||
path: 'participants',
|
path: PARTICIPANTS_PAGE_NAME,
|
||||||
loadChildren: () => import('@features/user/user-course-lazy.module').then(m => m.CoreUserCourseLazyModule),
|
loadChildren: () => import('@features/user/user-course-lazy.module').then(m => m.CoreUserCourseLazyModule),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue