MOBILE-3970 course: Change course preview page name to course summary

main
Pau Ferrer Ocaña 2022-02-14 10:50:46 +01:00
parent f22fec5e97
commit d26e39861b
11 changed files with 18 additions and 17 deletions

View File

@ -32,9 +32,9 @@ const routes: Routes = [
loadChildren: () => import('./pages/list-mod-type/list-mod-type.module').then(m => m.CoreCourseListModTypePageModule), loadChildren: () => import('./pages/list-mod-type/list-mod-type.module').then(m => m.CoreCourseListModTypePageModule),
}, },
{ {
path: ':courseId/preview', path: ':courseId/summary',
loadChildren: () => loadChildren: () =>
import('./pages/preview/preview.module').then(m => m.CoreCoursePreviewPageModule), import('./pages/course-summary/course-summary.module').then(m => m.CoreCourseSummaryPageModule),
}, },
]; ];

View File

@ -16,12 +16,12 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { CoreCoursePreviewPage } from './preview.page'; import { CoreCourseSummaryPage } from './course-summary';
const routes: Routes = [ const routes: Routes = [
{ {
path: '', path: '',
component: CoreCoursePreviewPage, component: CoreCourseSummaryPage,
}, },
]; ];
@NgModule({ @NgModule({
@ -29,7 +29,7 @@ const routes: Routes = [
CoreSharedModule, CoreSharedModule,
], ],
declarations: [ declarations: [
CoreCoursePreviewPage, CoreCourseSummaryPage,
], ],
}) })
export class CoreCoursePreviewPageComponentModule { } export class CoreCoursePreviewPageComponentModule { }
@ -42,4 +42,4 @@ export class CoreCoursePreviewPageComponentModule { }
], ],
exports: [RouterModule], exports: [RouterModule],
}) })
export class CoreCoursePreviewPageModule { } export class CoreCourseSummaryPageModule { }

View File

@ -39,14 +39,14 @@ import { CoreCourseWithImageAndColor } from '@features/courses/services/courses-
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
/** /**
* Page that allows "previewing" a course and enrolling in it if enabled and not enrolled. * Page that shows the summary of a course including buttons to enrol and other available options.
*/ */
@Component({ @Component({
selector: 'page-core-course-preview', selector: 'page-core-course-summary',
templateUrl: 'preview.html', templateUrl: 'course-summary.html',
styleUrls: ['preview.scss'], styleUrls: ['course-summary.scss'],
}) })
export class CoreCoursePreviewPage implements OnInit, OnDestroy { export class CoreCourseSummaryPage implements OnInit, OnDestroy {
@Input() course?: CoreCourseSummaryData; @Input() course?: CoreCourseSummaryData;
@Input() courseId = 0; @Input() courseId = 0;

View File

@ -19,7 +19,7 @@ import { resolveModuleRoutes } from '@/app/app-routing.module';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { CoreCourseIndexPage } from '.'; import { CoreCourseIndexPage } from '.';
import { COURSE_INDEX_ROUTES } from './index-routing.module'; import { COURSE_INDEX_ROUTES } from './index-routing.module';
import { CoreCoursePreviewPageComponentModule } from '../preview/preview.module'; import { CoreCoursePreviewPageComponentModule } from '../course-summary/course-summary.module';
function buildRoutes(injector: Injector): Routes { function buildRoutes(injector: Injector): Routes {
const routes = resolveModuleRoutes(injector, COURSE_INDEX_ROUTES); const routes = resolveModuleRoutes(injector, COURSE_INDEX_ROUTES);

View File

@ -28,7 +28,7 @@ import { CoreNavigator } from '@services/navigator';
import { CONTENTS_PAGE_NAME } from '@features/course/course.module'; import { CONTENTS_PAGE_NAME } from '@features/course/course.module';
import { CoreDomUtils } from '@services/utils/dom'; import { CoreDomUtils } from '@services/utils/dom';
import { CoreCollapsibleHeaderDirective } from '@directives/collapsible-header'; import { CoreCollapsibleHeaderDirective } from '@directives/collapsible-header';
import { CoreCoursePreviewPage } from '../preview/preview.page'; import { CoreCourseSummaryPage } from '../course-summary/course-summary';
/** /**
* Page that displays the list of courses the user is enrolled in. * Page that displays the list of courses the user is enrolled in.
@ -281,7 +281,7 @@ export class CoreCourseIndexPage implements OnInit, OnDestroy {
} }
CoreDomUtils.openSideModal<void>({ CoreDomUtils.openSideModal<void>({
component: CoreCoursePreviewPage, component: CoreCourseSummaryPage,
componentProps: { componentProps: {
courseId: this.course.id, courseId: this.course.id,
course: this.course, course: this.course,

View File

@ -171,7 +171,7 @@ export class CoreCoursesCourseListItemComponent implements OnInit, OnDestroy, On
CoreCourseHelper.openCourse(this.course); CoreCourseHelper.openCourse(this.course);
} else { } else {
CoreNavigator.navigateToSitePath( CoreNavigator.navigateToSitePath(
`/course/${this.course.id}/preview`, `/course/${this.course.id}/summary`,
{ params: { course: this.course } }, { params: { course: this.course } },
); );
} }

View File

@ -66,7 +66,7 @@ export class CoreCoursesEnrolPushClickHandlerService implements CorePushNotifica
params.selectedTab = 'participants'; // @todo: Set this when participants is done. params.selectedTab = 'participants'; // @todo: Set this when participants is done.
} else if (!result.enrolled) { } else if (!result.enrolled) {
// User not enrolled anymore, open the preview page. // User not enrolled anymore, open the preview page.
page += '/preview'; page += '/summary';
} }
await CoreNavigator.navigateToSitePath(page, { params, siteId: notification.site }); await CoreNavigator.navigateToSitePath(page, { params, siteId: notification.site });

View File

@ -79,7 +79,7 @@ export class CoreCoursesRequestPushClickHandlerService implements CorePushNotifi
if (!result.enrolled) { if (!result.enrolled) {
// User not enrolled (shouldn't happen), open the preview page. // User not enrolled (shouldn't happen), open the preview page.
page += '/preview'; page += '/summary';
} }
await CoreNavigator.navigateToSitePath(page, { params, siteId: notification.site }); await CoreNavigator.navigateToSitePath(page, { params, siteId: notification.site });

View File

@ -18,6 +18,7 @@ information provided here is intended especially for developers.
- CoreCourseHelperProvider.openCourse parameters changed, now it admits CoreNavigationOptions + siteId on the same object that includes Params passed to page. - CoreCourseHelperProvider.openCourse parameters changed, now it admits CoreNavigationOptions + siteId on the same object that includes Params passed to page.
- displaySectionSelector has been deprecated on CoreCourseFormatHandler, use displayCourseIndex instead. - displaySectionSelector has been deprecated on CoreCourseFormatHandler, use displayCourseIndex instead.
- Most of the functions or callbacks that handle redirects/deeplinks have been modified to accept an object instead of just path + options. E.g.: CoreLoginHelper.isSiteLoggedOut, CoreLoginHelper.openBrowserForSSOLogin, CoreLoginHelper.openBrowserForOAuthLogin, CoreLoginHelper.prepareForSSOLogin, CoreApp.storeRedirect, CoreSites.loadSite. - Most of the functions or callbacks that handle redirects/deeplinks have been modified to accept an object instead of just path + options. E.g.: CoreLoginHelper.isSiteLoggedOut, CoreLoginHelper.openBrowserForSSOLogin, CoreLoginHelper.openBrowserForOAuthLogin, CoreLoginHelper.prepareForSSOLogin, CoreApp.storeRedirect, CoreSites.loadSite.
- Course preview page route has changed from course/:courseId/preview to course/:courseId/summary to match with the page name and characteristics.
=== 3.9.5 === === 3.9.5 ===