From 73a72ef1300c100ce349ad63f210310e16c0eeb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 4 Jul 2024 23:27:58 +0200 Subject: [PATCH 1/5] MOBILE-4620 course: Async import main component to avoid crashes --- src/addons/mod/assign/services/handlers/module.ts | 3 ++- src/addons/mod/book/services/handlers/module.ts | 3 ++- src/addons/mod/chat/services/handlers/module.ts | 2 +- src/addons/mod/choice/services/handlers/module.ts | 3 ++- src/addons/mod/data/services/handlers/module.ts | 3 ++- src/addons/mod/feedback/services/handlers/module.ts | 3 ++- src/addons/mod/folder/services/handlers/module.ts | 3 ++- src/addons/mod/glossary/services/handlers/module.ts | 3 ++- src/addons/mod/h5pactivity/services/handlers/module.ts | 3 ++- src/addons/mod/imscp/services/handlers/module.ts | 3 ++- src/addons/mod/lesson/services/handlers/module.ts | 3 ++- src/addons/mod/lti/services/handlers/module.ts | 3 ++- src/addons/mod/page/services/handlers/module.ts | 3 ++- src/addons/mod/quiz/services/handlers/module.ts | 3 ++- src/addons/mod/resource/services/handlers/module.ts | 3 ++- src/addons/mod/scorm/services/handlers/module.ts | 3 ++- src/addons/mod/survey/services/handlers/module.ts | 2 +- src/addons/mod/url/services/handlers/module.ts | 3 ++- src/addons/mod/wiki/services/handlers/module.ts | 3 ++- src/addons/mod/workshop/services/handlers/module.ts | 2 +- src/core/features/course/services/handlers/default-module.ts | 4 +++- .../features/siteplugins/classes/handlers/module-handler.ts | 4 +++- 22 files changed, 43 insertions(+), 22 deletions(-) diff --git a/src/addons/mod/assign/services/handlers/module.ts b/src/addons/mod/assign/services/handlers/module.ts index bb8f569fd..f66f339ec 100644 --- a/src/addons/mod/assign/services/handlers/module.ts +++ b/src/addons/mod/assign/services/handlers/module.ts @@ -15,7 +15,6 @@ import { CoreConstants, ModPurpose } from '@/core/constants'; import { Injectable, Type } from '@angular/core'; import { CoreCourseModuleHandler } from '@features/course/services/module-delegate'; -import { AddonModAssignIndexComponent } from '../../components/index'; import { makeSingleton } from '@singletons'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; @@ -51,6 +50,8 @@ export class AddonModAssignModuleHandlerService extends CoreModuleHandlerBase im * @inheritdoc */ async getMainComponent(): Promise | undefined> { + const { AddonModAssignIndexComponent } = await import('../../components/index'); + return AddonModAssignIndexComponent; } diff --git a/src/addons/mod/book/services/handlers/module.ts b/src/addons/mod/book/services/handlers/module.ts index 322737a81..85abc0d02 100644 --- a/src/addons/mod/book/services/handlers/module.ts +++ b/src/addons/mod/book/services/handlers/module.ts @@ -13,7 +13,6 @@ // limitations under the License. import { Injectable, Type } from '@angular/core'; -import { AddonModBookIndexComponent } from '../../components/index'; import { AddonModBook } from '../book'; import { CoreConstants, ModPurpose } from '@/core/constants'; import { CoreCourseModuleHandler } from '@features/course/services/module-delegate'; @@ -56,6 +55,8 @@ export class AddonModBookModuleHandlerService extends CoreModuleHandlerBase impl * @inheritdoc */ async getMainComponent(): Promise | undefined> { + const { AddonModBookIndexComponent } = await import('../../components/index'); + return AddonModBookIndexComponent; } diff --git a/src/addons/mod/chat/services/handlers/module.ts b/src/addons/mod/chat/services/handlers/module.ts index 2affeeee5..52dc60dd2 100644 --- a/src/addons/mod/chat/services/handlers/module.ts +++ b/src/addons/mod/chat/services/handlers/module.ts @@ -45,7 +45,7 @@ export class AddonModChatModuleHandlerService extends CoreModuleHandlerBase impl * @inheritdoc */ async getMainComponent(): Promise> { - const { AddonModChatIndexComponent } = await import('@addons/mod/chat/components/index'); + const { AddonModChatIndexComponent } = await import('../../components/index'); return AddonModChatIndexComponent; } diff --git a/src/addons/mod/choice/services/handlers/module.ts b/src/addons/mod/choice/services/handlers/module.ts index 70e3a3834..035b7832a 100644 --- a/src/addons/mod/choice/services/handlers/module.ts +++ b/src/addons/mod/choice/services/handlers/module.ts @@ -17,7 +17,6 @@ import { Injectable, Type } from '@angular/core'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; import { CoreCourseModuleHandler } from '@features/course/services/module-delegate'; import { makeSingleton } from '@singletons'; -import { AddonModChoiceIndexComponent } from '../../components/index'; /** * Handler to support choice modules. @@ -48,6 +47,8 @@ export class AddonModChoiceModuleHandlerService extends CoreModuleHandlerBase im * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModChoiceIndexComponent } = await import('../../components/index'); + return AddonModChoiceIndexComponent; } diff --git a/src/addons/mod/data/services/handlers/module.ts b/src/addons/mod/data/services/handlers/module.ts index c170d8779..0abcdcc08 100644 --- a/src/addons/mod/data/services/handlers/module.ts +++ b/src/addons/mod/data/services/handlers/module.ts @@ -17,7 +17,6 @@ import { Injectable, Type } from '@angular/core'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; import { CoreCourseModuleHandler } from '@features/course/services/module-delegate'; import { makeSingleton } from '@singletons'; -import { AddonModDataIndexComponent } from '../../components/index'; /** * Handler to support data modules. @@ -50,6 +49,8 @@ export class AddonModDataModuleHandlerService extends CoreModuleHandlerBase impl * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModDataIndexComponent } = await import('../../components/index'); + return AddonModDataIndexComponent; } diff --git a/src/addons/mod/feedback/services/handlers/module.ts b/src/addons/mod/feedback/services/handlers/module.ts index 68e0164fe..a1495d718 100644 --- a/src/addons/mod/feedback/services/handlers/module.ts +++ b/src/addons/mod/feedback/services/handlers/module.ts @@ -16,7 +16,6 @@ import { CoreConstants, ModPurpose } from '@/core/constants'; import { Injectable, Type } from '@angular/core'; import { CoreCourseModuleHandler } from '@features/course/services/module-delegate'; import { makeSingleton } from '@singletons'; -import { AddonModFeedbackIndexComponent } from '../../components/index'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; /** @@ -48,6 +47,8 @@ export class AddonModFeedbackModuleHandlerService extends CoreModuleHandlerBase * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModFeedbackIndexComponent } = await import('../../components/index'); + return AddonModFeedbackIndexComponent; } diff --git a/src/addons/mod/folder/services/handlers/module.ts b/src/addons/mod/folder/services/handlers/module.ts index fde3b78ef..848e624ba 100644 --- a/src/addons/mod/folder/services/handlers/module.ts +++ b/src/addons/mod/folder/services/handlers/module.ts @@ -20,7 +20,6 @@ import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@features/ import { CoreNavigator } from '@services/navigator'; import { CoreDomUtils } from '@services/utils/dom'; import { makeSingleton } from '@singletons'; -import { AddonModFolderIndexComponent } from '../../components/index'; /** * Handler to support folder modules. @@ -86,6 +85,8 @@ export class AddonModFolderModuleHandlerService extends CoreModuleHandlerBase im * @inheritdoc */ async getMainComponent(): Promise | undefined> { + const { AddonModFolderIndexComponent } = await import('../../components/index'); + return AddonModFolderIndexComponent; } diff --git a/src/addons/mod/glossary/services/handlers/module.ts b/src/addons/mod/glossary/services/handlers/module.ts index a5240ab82..b4ad38a05 100644 --- a/src/addons/mod/glossary/services/handlers/module.ts +++ b/src/addons/mod/glossary/services/handlers/module.ts @@ -17,7 +17,6 @@ import { Injectable, Type } from '@angular/core'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; import { CoreCourseModuleHandler } from '@features/course/services/module-delegate'; import { makeSingleton } from '@singletons'; -import { AddonModGlossaryIndexComponent } from '../../components/index/index'; /** * Handler to support glossary modules. @@ -50,6 +49,8 @@ export class AddonModGlossaryModuleHandlerService extends CoreModuleHandlerBase * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModGlossaryIndexComponent } = await import('../../components/index'); + return AddonModGlossaryIndexComponent; } diff --git a/src/addons/mod/h5pactivity/services/handlers/module.ts b/src/addons/mod/h5pactivity/services/handlers/module.ts index 0148587d1..1470169cd 100644 --- a/src/addons/mod/h5pactivity/services/handlers/module.ts +++ b/src/addons/mod/h5pactivity/services/handlers/module.ts @@ -17,7 +17,6 @@ import { Injectable, Type } from '@angular/core'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; import { CoreCourseModuleHandler } from '@features/course/services/module-delegate'; import { makeSingleton } from '@singletons'; -import { AddonModH5PActivityIndexComponent } from '../../components/index'; import { AddonModH5PActivity } from '../h5pactivity'; /** @@ -56,6 +55,8 @@ export class AddonModH5PActivityModuleHandlerService extends CoreModuleHandlerBa * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModH5PActivityIndexComponent } = await import('../../components/index'); + return AddonModH5PActivityIndexComponent; } diff --git a/src/addons/mod/imscp/services/handlers/module.ts b/src/addons/mod/imscp/services/handlers/module.ts index 0039e6a8f..180381380 100644 --- a/src/addons/mod/imscp/services/handlers/module.ts +++ b/src/addons/mod/imscp/services/handlers/module.ts @@ -17,7 +17,6 @@ import { Injectable, Type } from '@angular/core'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; import { CoreCourseModuleHandler } from '@features/course/services/module-delegate'; import { makeSingleton } from '@singletons'; -import { AddonModImscpIndexComponent } from '../../components/index'; import { AddonModImscp } from '../imscp'; /** @@ -56,6 +55,8 @@ export class AddonModImscpModuleHandlerService extends CoreModuleHandlerBase imp * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModImscpIndexComponent } = await import('../../components/index'); + return AddonModImscpIndexComponent; } diff --git a/src/addons/mod/lesson/services/handlers/module.ts b/src/addons/mod/lesson/services/handlers/module.ts index 1bf2ec0f1..16763acc1 100644 --- a/src/addons/mod/lesson/services/handlers/module.ts +++ b/src/addons/mod/lesson/services/handlers/module.ts @@ -16,7 +16,6 @@ import { Injectable, Type } from '@angular/core'; import { CoreConstants, ModPurpose } from '@/core/constants'; import { CoreCourseModuleHandler } from '@features/course/services/module-delegate'; -import { AddonModLessonIndexComponent } from '../../components/index'; import { makeSingleton } from '@singletons'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; @@ -49,6 +48,8 @@ export class AddonModLessonModuleHandlerService extends CoreModuleHandlerBase im * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModLessonIndexComponent } = await import('../../components/index'); + return AddonModLessonIndexComponent; } diff --git a/src/addons/mod/lti/services/handlers/module.ts b/src/addons/mod/lti/services/handlers/module.ts index f683c8190..2b0eb973c 100644 --- a/src/addons/mod/lti/services/handlers/module.ts +++ b/src/addons/mod/lti/services/handlers/module.ts @@ -19,7 +19,6 @@ import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@features/ import { CoreCourseModuleData } from '@features/course/services/course-helper'; import { makeSingleton } from '@singletons'; import { AddonModLtiHelper } from '../lti-helper'; -import { AddonModLtiIndexComponent } from '../../components/index'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; import { CoreCourse } from '@features/course/services/course'; @@ -76,6 +75,8 @@ export class AddonModLtiModuleHandlerService extends CoreModuleHandlerBase imple * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModLtiIndexComponent } = await import('../../components/index'); + return AddonModLtiIndexComponent; } diff --git a/src/addons/mod/page/services/handlers/module.ts b/src/addons/mod/page/services/handlers/module.ts index 9870c74cf..a4868d08e 100644 --- a/src/addons/mod/page/services/handlers/module.ts +++ b/src/addons/mod/page/services/handlers/module.ts @@ -16,7 +16,6 @@ import { Injectable, Type } from '@angular/core'; import { AddonModPage } from '../page'; import { CoreCourseModuleHandler } from '@features/course/services/module-delegate'; import { CoreConstants, ModPurpose } from '@/core/constants'; -import { AddonModPageIndexComponent } from '../../components/index'; import { makeSingleton } from '@singletons'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; @@ -56,6 +55,8 @@ export class AddonModPageModuleHandlerService extends CoreModuleHandlerBase impl * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModPageIndexComponent } = await import('../../components/index'); + return AddonModPageIndexComponent; } diff --git a/src/addons/mod/quiz/services/handlers/module.ts b/src/addons/mod/quiz/services/handlers/module.ts index 7ca4c9022..39c563c7d 100644 --- a/src/addons/mod/quiz/services/handlers/module.ts +++ b/src/addons/mod/quiz/services/handlers/module.ts @@ -16,7 +16,6 @@ import { Injectable, Type } from '@angular/core'; import { CoreConstants, ModPurpose } from '@/core/constants'; import { CoreCourseModuleHandler } from '@features/course/services/module-delegate'; -import { AddonModQuizIndexComponent } from '../../components/index'; import { makeSingleton } from '@singletons'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; @@ -51,6 +50,8 @@ export class AddonModQuizModuleHandlerService extends CoreModuleHandlerBase impl * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModQuizIndexComponent } = await import('../../components/index'); + return AddonModQuizIndexComponent; } diff --git a/src/addons/mod/resource/services/handlers/module.ts b/src/addons/mod/resource/services/handlers/module.ts index 9c0c69a3b..5c2c2a27b 100644 --- a/src/addons/mod/resource/services/handlers/module.ts +++ b/src/addons/mod/resource/services/handlers/module.ts @@ -22,7 +22,6 @@ import { CoreCourseModulePrefetchDelegate } from '@features/course/services/modu import { CoreFileHelper } from '@services/file-helper'; import { CoreMimetypeUtils } from '@services/utils/mimetype'; import { makeSingleton, Translate } from '@singletons'; -import { AddonModResourceIndexComponent } from '../../components/index'; import { AddonModResource } from '../resource'; import { AddonModResourceHelper } from '../resource-helper'; import { CoreUtils } from '@services/utils/utils'; @@ -167,6 +166,8 @@ export class AddonModResourceModuleHandlerService extends CoreModuleHandlerBase * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModResourceIndexComponent } = await import('../../components/index'); + return AddonModResourceIndexComponent; } diff --git a/src/addons/mod/scorm/services/handlers/module.ts b/src/addons/mod/scorm/services/handlers/module.ts index ab61d2220..6c4f03061 100644 --- a/src/addons/mod/scorm/services/handlers/module.ts +++ b/src/addons/mod/scorm/services/handlers/module.ts @@ -17,7 +17,6 @@ import { Injectable, Type } from '@angular/core'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; import { CoreCourseModuleHandler } from '@features/course/services/module-delegate'; import { makeSingleton } from '@singletons'; -import { AddonModScormIndexComponent } from '../../components/index'; /** * Handler to support SCORM modules. @@ -48,6 +47,8 @@ export class AddonModScormModuleHandlerService extends CoreModuleHandlerBase imp * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModScormIndexComponent } = await import('../../components/index'); + return AddonModScormIndexComponent; } diff --git a/src/addons/mod/survey/services/handlers/module.ts b/src/addons/mod/survey/services/handlers/module.ts index a81fc018c..612f4fed6 100644 --- a/src/addons/mod/survey/services/handlers/module.ts +++ b/src/addons/mod/survey/services/handlers/module.ts @@ -46,7 +46,7 @@ export class AddonModSurveyModuleHandlerService extends CoreModuleHandlerBase im * @inheritdoc */ async getMainComponent(): Promise> { - const { AddonModSurveyIndexComponent } = await import('@addons/mod/survey/components/index'); + const { AddonModSurveyIndexComponent } = await import('../../components/index'); return AddonModSurveyIndexComponent; } diff --git a/src/addons/mod/url/services/handlers/module.ts b/src/addons/mod/url/services/handlers/module.ts index 6f4ec41b1..88c8bba52 100644 --- a/src/addons/mod/url/services/handlers/module.ts +++ b/src/addons/mod/url/services/handlers/module.ts @@ -23,7 +23,6 @@ import { CoreNavigationOptions } from '@services/navigator'; import { CoreDomUtils } from '@services/utils/dom'; import { CoreUtils } from '@services/utils/utils'; import { makeSingleton } from '@singletons'; -import { AddonModUrlIndexComponent } from '../../components/index/index'; import { AddonModUrl } from '../url'; import { AddonModUrlHelper } from '../url-helper'; import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; @@ -190,6 +189,8 @@ export class AddonModUrlModuleHandlerService extends CoreModuleHandlerBase imple * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModUrlIndexComponent } = await import('../../components/index'); + return AddonModUrlIndexComponent; } diff --git a/src/addons/mod/wiki/services/handlers/module.ts b/src/addons/mod/wiki/services/handlers/module.ts index 3bd58ebd1..682a3f398 100644 --- a/src/addons/mod/wiki/services/handlers/module.ts +++ b/src/addons/mod/wiki/services/handlers/module.ts @@ -17,7 +17,6 @@ import { Injectable, Type } from '@angular/core'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; import { CoreCourseModuleHandler } from '@features/course/services/module-delegate'; import { makeSingleton } from '@singletons'; -import { AddonModWikiIndexComponent } from '../../components/index'; /** * Handler to support wiki modules. @@ -49,6 +48,8 @@ export class AddonModWikiModuleHandlerService extends CoreModuleHandlerBase impl * @inheritdoc */ async getMainComponent(): Promise> { + const { AddonModWikiIndexComponent } = await import('../../components/index'); + return AddonModWikiIndexComponent; } diff --git a/src/addons/mod/workshop/services/handlers/module.ts b/src/addons/mod/workshop/services/handlers/module.ts index 4ec4d181c..642d4e2f3 100644 --- a/src/addons/mod/workshop/services/handlers/module.ts +++ b/src/addons/mod/workshop/services/handlers/module.ts @@ -45,7 +45,7 @@ export class AddonModWorkshopModuleHandlerService extends CoreModuleHandlerBase * @inheritdoc */ async getMainComponent(): Promise> { - const { AddonModWorkshopIndexComponent } = await import('@addons/mod/workshop/components/index'); + const { AddonModWorkshopIndexComponent } = await import('../../components/index'); return AddonModWorkshopIndexComponent; } diff --git a/src/core/features/course/services/handlers/default-module.ts b/src/core/features/course/services/handlers/default-module.ts index 2d69177e1..3b0e35b9d 100644 --- a/src/core/features/course/services/handlers/default-module.ts +++ b/src/core/features/course/services/handlers/default-module.ts @@ -18,7 +18,6 @@ import { CoreSites } from '@services/sites'; import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '../module-delegate'; import { CoreCourse } from '../course'; import { CoreCourseModuleData } from '../course-helper'; -import { CoreCourseUnsupportedModuleComponent } from '@features/course/components/unsupported-module/unsupported-module'; import { CoreNavigationOptions, CoreNavigator } from '@services/navigator'; /** @@ -79,6 +78,9 @@ export class CoreCourseModuleDefaultHandler implements CoreCourseModuleHandler { * @inheritdoc */ async getMainComponent(): Promise> { + const { CoreCourseUnsupportedModuleComponent } = + await import('@features/course/components/unsupported-module/unsupported-module'); + return CoreCourseUnsupportedModuleComponent; } diff --git a/src/core/features/siteplugins/classes/handlers/module-handler.ts b/src/core/features/siteplugins/classes/handlers/module-handler.ts index b0ee450ec..a7fc626d4 100644 --- a/src/core/features/siteplugins/classes/handlers/module-handler.ts +++ b/src/core/features/siteplugins/classes/handlers/module-handler.ts @@ -18,7 +18,6 @@ import { CoreConstants } from '@/core/constants'; import { CoreCourse } from '@features/course/services/course'; import { CoreCourseHelper, CoreCourseModuleData } from '@features/course/services/course-helper'; import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@features/course/services/module-delegate'; -import { CoreSitePluginsModuleIndexComponent } from '@features/siteplugins/components/module-index/module-index'; import { CoreSitePlugins, CoreSitePluginsContent, @@ -205,6 +204,9 @@ export class CoreSitePluginsModuleHandler extends CoreSitePluginsBaseHandler imp * @inheritdoc */ async getMainComponent(): Promise> { + const { CoreSitePluginsModuleIndexComponent } = + await import('@features/siteplugins/components/module-index/module-index'); + return CoreSitePluginsModuleIndexComponent; } From b19125dbf28bd8d3fd33d6c0032336009d43762e Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Fri, 5 Jul 2024 09:27:55 +0200 Subject: [PATCH 2/5] MOBILE-4621 android: Update targetSdk to 34 --- config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.xml b/config.xml index 5436e1801..351f55bf3 100644 --- a/config.xml +++ b/config.xml @@ -38,7 +38,7 @@ - + From 19fb636475b81f34cfed3c5bffb65e2c2e104794 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Fri, 5 Jul 2024 11:23:08 +0200 Subject: [PATCH 3/5] MOBILE-4622 core: Increase version to 4.4.1 --- config.xml | 6 +++--- moodle.config.json | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config.xml b/config.xml index 351f55bf3..cc5bc3899 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + Moodle Moodle official app Moodle Mobile team @@ -28,7 +28,7 @@ - + @@ -91,7 +91,7 @@ - 4.4.0 + 4.4.1 diff --git a/moodle.config.json b/moodle.config.json index 573067025..1edc81c88 100644 --- a/moodle.config.json +++ b/moodle.config.json @@ -1,8 +1,8 @@ { "app_id": "com.moodle.moodlemobile", "appname": "Moodle Mobile", - "versioncode": 44004, - "versionname": "4.4.0", + "versioncode": 44100, + "versionname": "4.4.1", "cache_update_frequency_usually": 420000, "cache_update_frequency_often": 1200000, "cache_update_frequency_sometimes": 3600000, diff --git a/package-lock.json b/package-lock.json index 0f749a72c..565157a1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "moodlemobile", - "version": "4.4.0", + "version": "4.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "moodlemobile", - "version": "4.4.0", + "version": "4.4.1", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index a83f3afa6..01e7676fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moodlemobile", - "version": "4.4.0", + "version": "4.4.1", "description": "The official app for Moodle.", "author": { "name": "Moodle Pty Ltd.", From 5b23097a69487a7fe86055b1ea8bbc80722dde06 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 5 Jul 2024 09:47:34 +0000 Subject: [PATCH 4/5] Update licenses --- licenses.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/licenses.json b/licenses.json index becd551e5..5529b3fce 100644 --- a/licenses.json +++ b/licenses.json @@ -5634,7 +5634,7 @@ "url": "https://github.com/ichernev", "licenseFile": "LICENSE" }, - "moodlemobile@4.4.0": { + "moodlemobile@4.4.1": { "licenses": "Apache-2.0", "repository": "https://github.com/moodlehq/moodleapp", "publisher": "Moodle Pty Ltd.", From 45a7681edaf2b7e11480c9f6a0d737b853dae382 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 8 Jul 2024 14:59:48 +0200 Subject: [PATCH 5/5] MOBILE-4624 format-text: Fix iframes with inline styles --- src/core/directives/format-text.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/core/directives/format-text.ts b/src/core/directives/format-text.ts index 8ac3ea96f..3bac96c9d 100644 --- a/src/core/directives/format-text.ts +++ b/src/core/directives/format-text.ts @@ -169,9 +169,10 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec * Apply CoreExternalContentDirective to a certain element. * * @param element Element to add the attributes to. + * @param onlyInlineStyles Whether to only handle inline styles. * @returns External content instance or undefined if siteId is not provided. */ - protected addExternalContent(element: Element): CoreExternalContentDirective | undefined { + protected addExternalContent(element: Element, onlyInlineStyles = false): CoreExternalContentDirective | undefined { if (!this.siteId) { return; } @@ -185,11 +186,13 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec extContent.url = element.getAttribute('src') ?? element.getAttribute('href') ?? element.getAttribute('xlink:href'); extContent.posterUrl = element.getAttribute('poster'); - // Remove the original attributes to avoid performing requests to untreated URLs. - element.removeAttribute('src'); - element.removeAttribute('href'); - element.removeAttribute('xlink:href'); - element.removeAttribute('poster'); + if (!onlyInlineStyles) { + // Remove the original attributes to avoid performing requests to untreated URLs. + element.removeAttribute('src'); + element.removeAttribute('href'); + element.removeAttribute('xlink:href'); + element.removeAttribute('poster'); + } extContent.ngAfterViewInit(); @@ -569,9 +572,9 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec // Handle inline styles. elementsWithInlineStyles.forEach((el: HTMLElement) => { // Only add external content for tags that haven't been treated already. - if (el.tagName != 'A' && el.tagName != 'IMG' && el.tagName != 'AUDIO' && el.tagName != 'VIDEO' - && el.tagName != 'SOURCE' && el.tagName != 'TRACK') { - this.addExternalContent(el); + if (el.tagName !== 'A' && el.tagName !== 'IMG' && el.tagName !== 'AUDIO' && el.tagName !== 'VIDEO' + && el.tagName !== 'SOURCE' && el.tagName !== 'TRACK' && el.tagName !== 'IMAGE') { + this.addExternalContent(el, true); } });