From cb8f9732e2881fdfbde98e01acfbbdea1f13e112 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Wed, 23 Jun 2021 15:42:45 +0200 Subject: [PATCH 1/5] MOBILE-3320 block: Avoid rendering unknown blocks --- src/core/features/block/classes/base-block-handler.ts | 10 ++-------- src/core/features/block/services/block-delegate.ts | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/core/features/block/classes/base-block-handler.ts b/src/core/features/block/classes/base-block-handler.ts index 89c0fef81..161e7e319 100644 --- a/src/core/features/block/classes/base-block-handler.ts +++ b/src/core/features/block/classes/base-block-handler.ts @@ -13,7 +13,6 @@ // limitations under the License. import { CoreCourseBlock } from '@features/course/services/course'; -import { CoreBlockPreRenderedComponent } from '../components/pre-rendered-block/pre-rendered-block'; import { CoreBlockHandler, CoreBlockHandlerData } from '../services/block-delegate'; /** @@ -48,14 +47,9 @@ export class CoreBlockBaseHandler implements CoreBlockHandler { block: CoreCourseBlock, // eslint-disable-line @typescript-eslint/no-unused-vars contextLevel: string, // eslint-disable-line @typescript-eslint/no-unused-vars instanceId: number, // eslint-disable-line @typescript-eslint/no-unused-vars - ): CoreBlockHandlerData | Promise { - + ): undefined | CoreBlockHandlerData | Promise { // To be overridden. - return { - title: '', - class: '', - component: CoreBlockPreRenderedComponent, - }; + return undefined; } } diff --git a/src/core/features/block/services/block-delegate.ts b/src/core/features/block/services/block-delegate.ts index 481fdfaa2..593b4edbb 100644 --- a/src/core/features/block/services/block-delegate.ts +++ b/src/core/features/block/services/block-delegate.ts @@ -44,7 +44,7 @@ export interface CoreBlockHandler extends CoreDelegateHandler { block: CoreCourseBlock, contextLevel: string, instanceId: number, - ): CoreBlockHandlerData | Promise; + ): undefined | CoreBlockHandlerData | Promise; } /** From a0f41718f950b01db1297d8c35ed6d7bf29ede39 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Wed, 23 Jun 2021 16:44:00 +0200 Subject: [PATCH 2/5] MOBILE-3320 forum: Fix discussion action icons --- src/addons/mod/forum/pages/discussion/discussion.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/addons/mod/forum/pages/discussion/discussion.html b/src/addons/mod/forum/pages/discussion/discussion.html index 426832a08..78b76b2dc 100644 --- a/src/addons/mod/forum/pages/discussion/discussion.html +++ b/src/addons/mod/forum/pages/discussion/discussion.html @@ -23,15 +23,15 @@ (action)="doRefresh(null, $event, true)"> Date: Wed, 23 Jun 2021 17:19:56 +0200 Subject: [PATCH 3/5] MOBILE-3320 calendar: Fix default events filter --- src/addons/calendar/components/filter/filter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/addons/calendar/components/filter/filter.ts b/src/addons/calendar/components/filter/filter.ts index 11ecb8eb8..9398c60b7 100644 --- a/src/addons/calendar/components/filter/filter.ts +++ b/src/addons/calendar/components/filter/filter.ts @@ -59,7 +59,7 @@ export class AddonCalendarFilterPopoverComponent implements OnInit { * Init the component. */ ngOnInit(): void { - this.courseId = this.filter.courseId + ''; + this.courseId = (this.filter.courseId || -1) + ''; } /** From 0e6d65599aaa7d64d6f7635bc00df7d139a42ab2 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Wed, 23 Jun 2021 17:45:22 +0200 Subject: [PATCH 4/5] MOBILE-3320 database: Fix link templates --- src/addons/mod/data/services/data-helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/addons/mod/data/services/data-helper.ts b/src/addons/mod/data/services/data-helper.ts index 5951a382d..c0a0cc74f 100644 --- a/src/addons/mod/data/services/data-helper.ts +++ b/src/addons/mod/data/services/data-helper.ts @@ -658,7 +658,7 @@ export class AddonModDataHelperProvider { // Add core-link directive to links. template = template.replace( /]*href="[^>]*)>/ig, - (match, attributes) => '