From d2a087e6c3d3a66845c6dcce482b75f0571b00ab Mon Sep 17 00:00:00 2001 From: Alfonso Salces Date: Mon, 8 Jul 2024 09:08:26 +0200 Subject: [PATCH 1/3] Replace ngIf and ngFor directives with new control flow --- .../examples/course-formats.md | 34 +++++------ .../app/development/testing/unit-testing.md | 4 +- .../policies/codingstyle-moodleapp.md | 57 ++++++++++--------- 3 files changed, 51 insertions(+), 44 deletions(-) diff --git a/general/app/development/plugins-development-guide/examples/course-formats.md b/general/app/development/plugins-development-guide/examples/course-formats.md index 30057074a2..66a395bb1e 100644 --- a/general/app/development/plugins-development-guide/examples/course-formats.md +++ b/general/app/development/plugins-development-guide/examples/course-formats.md @@ -53,7 +53,7 @@ class mobile { ```html handlebars title="templates/mobile_course.mustache" {{=<% %>=}} - + @for (section of sections; track $index) { @@ -61,20 +61,22 @@ class mobile { - - - - - - + @if (section.summary) { + + + + + + + } - - + @for (module of section.modules; track $index) { + @if (module.visibleoncoursepage !== 0) { - - - + } + } + } ``` @@ -116,11 +118,11 @@ class mobile { Then filter the list of sections in your template: ```html - - +@for (section of sections; track $index) { + @if (section.id in CONTENT_OTHERDATA.displaysections) { - - + } +} ``` ## Using JavaScript diff --git a/general/app/development/testing/unit-testing.md b/general/app/development/testing/unit-testing.md index a640b6e52c..385f5ecf4e 100644 --- a/general/app/development/testing/unit-testing.md +++ b/general/app/development/testing/unit-testing.md @@ -138,7 +138,9 @@ Let's say you want to test the following component that render a list of user na template: `

Users List

`, }) diff --git a/general/development/policies/codingstyle-moodleapp.md b/general/development/policies/codingstyle-moodleapp.md index af30f94eaa..1731322474 100644 --- a/general/development/policies/codingstyle-moodleapp.md +++ b/general/development/policies/codingstyle-moodleapp.md @@ -444,9 +444,9 @@ In some situations, a simple method that only returns a value would be acceptabl ```html -
- -
+@if (isAdmin) { +
+} ```
@@ -454,9 +454,9 @@ In some situations, a simple method that only returns a value would be acceptabl ```html -
- -
+@if (site.isAdmin()) { +
+} ```
@@ -502,15 +502,17 @@ There is a maximum line length of 140 characters for templates. Whenever that le ```html - - - {{ course.title }} - - +@for (course of courses; track $index) { + + + {{ course.title }} + + +} ``` @@ -518,18 +520,19 @@ There is a maximum line length of 140 characters for templates. Whenever that le ```html - - - {{ course.title }} - - +@for (course of courses; track $index) { + + + {{ course.title }} + + +} ``` From 3b7ce4af1508faf4f8faa8c7ee4125372b18dc43 Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Tue, 9 Jul 2024 17:23:05 +0200 Subject: [PATCH 2/3] MOBILE-4470 Release notes 4.4.1 --- general/app_releases.md | 1 + general/app_releases/v4/v4.4.0.md | 2 +- general/app_releases/v4/v4.4.1.md | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 general/app_releases/v4/v4.4.1.md diff --git a/general/app_releases.md b/general/app_releases.md index faf51919eb..eb105d57fe 100644 --- a/general/app_releases.md +++ b/general/app_releases.md @@ -10,6 +10,7 @@ tags: | **Version name** | **Date** | |---|---| +| [Moodle App 4.4.1](./app_releases/v4/v4.4.1) | 9 July 2024 | | [Moodle App 4.4.0](./app_releases/v4/v4.4.0) | 28 June 2024 | | [Moodle App 4.3.0](./app_releases/v4/v4.3.0) | 10 November 2023 | | [Moodle App 4.2.0](./app_releases/v4/v4.2.0) | 9 June 2023 | diff --git a/general/app_releases/v4/v4.4.0.md b/general/app_releases/v4/v4.4.0.md index 87003cd959..e9d4ce2842 100644 --- a/general/app_releases/v4/v4.4.0.md +++ b/general/app_releases/v4/v4.4.0.md @@ -38,7 +38,7 @@ Release date: 28 June 2024 ### Task - [MOBILE-3947](https://tracker.moodle.org/browse/MOBILE-3947) - Upgrade to Ionic 7 and to Angular 17 -- [MOBILE-4357](https://tracker.moodle.org/browse/MOBILE-4357) - Upgrade Cordova and Android SDK to 34, cordova-android to 12 and cordova-ios to 7 +- [MOBILE-4357](https://tracker.moodle.org/browse/MOBILE-4357) - Upgrade Cordova, cordova-android to 12 and cordova-ios to 7 - [MOBILE-4449](https://tracker.moodle.org/browse/MOBILE-4449) - Use Android photo picker to avoid using READ_MEDIA_IMAGES and READ_MEDIA_VIDEO - [MOBILE-4465](https://tracker.moodle.org/browse/MOBILE-4465) - Remove deprecated 4.0 code - [MOBILE-4492](https://tracker.moodle.org/browse/MOBILE-4492) - Upgrade cordova-plugin-file to 8.0.1, cordova-plugin-media-capture and use cordova-plugin-camera diff --git a/general/app_releases/v4/v4.4.1.md b/general/app_releases/v4/v4.4.1.md new file mode 100644 index 0000000000..1150ab5636 --- /dev/null +++ b/general/app_releases/v4/v4.4.1.md @@ -0,0 +1,26 @@ +--- +title: Moodle App 4.4.1 release notes +sidebar_label: Moodle App 4.4.1 +tags: + - Moodle App + - Release notes +--- + +Release date: 9 July 2024 + +## New features and improvements + +- Android target SDK updated to 34 +- Fix bug when playing embedded videos +- Fix bug in certain courses using single activity formats + +## Complete list of issues + +### Task + +- [MOBILE-4621](https://tracker.moodle.org/browse/MOBILE-4621) - Update Android targetSdk to 34 + +### Bug + +- [MOBILE-4620](https://tracker.moodle.org/browse/MOBILE-4620) - Some courses using single activity format do not work anymore in the app +- [MOBILE-4624](https://tracker.moodle.org/browse/MOBILE-4624) - Iframes with inline styles aren't displayed in the app after 4.4 upgrade From 640758d0c7b221926dc815270e9c374d800bbbf7 Mon Sep 17 00:00:00 2001 From: Alfonso Salces Date: Wed, 10 Jul 2024 13:44:23 +0200 Subject: [PATCH 3/3] MOBILE-4612: Use ids instead index to track list elements --- .../plugins-development-guide/examples/course-formats.md | 4 ++-- general/app/development/testing/unit-testing.md | 2 +- general/development/policies/codingstyle-moodleapp.md | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/general/app/development/plugins-development-guide/examples/course-formats.md b/general/app/development/plugins-development-guide/examples/course-formats.md index 66a395bb1e..2057557314 100644 --- a/general/app/development/plugins-development-guide/examples/course-formats.md +++ b/general/app/development/plugins-development-guide/examples/course-formats.md @@ -53,7 +53,7 @@ class mobile { ```html handlebars title="templates/mobile_course.mustache" {{=<% %>=}} - @for (section of sections; track $index) { + @for (section of sections; track section.id) { @@ -70,7 +70,7 @@ class mobile { } - @for (module of section.modules; track $index) { + @for (module of section.modules; track module.id) { @if (module.visibleoncoursepage !== 0) { diff --git a/general/app/development/testing/unit-testing.md b/general/app/development/testing/unit-testing.md index 385f5ecf4e..381b4f1de5 100644 --- a/general/app/development/testing/unit-testing.md +++ b/general/app/development/testing/unit-testing.md @@ -128,7 +128,7 @@ Most services will be instantiated properly without mocks, but sometimes you may ## Testing components -Angular components have a strong graphical part, but that doesn't mean that you can't test their logic and markup rendering using unit tests with Jest. You can follow [Angular's best practices for testing components](https://angular.io/guide/testing-components-scenarios), and we also provide a couple of helpers that make things easier. +Angular components have a strong graphical part, but that doesn't mean that you can't test their logic and markup rendering using unit tests with Jest. You can follow [Angular's best practices for testing components](https://angular.dev/guide/testing/components-scenarios), and we also provide a couple of helpers that make things easier. Let's say you want to test the following component that render a list of user names: diff --git a/general/development/policies/codingstyle-moodleapp.md b/general/development/policies/codingstyle-moodleapp.md index 1731322474..f37d5cd0b5 100644 --- a/general/development/policies/codingstyle-moodleapp.md +++ b/general/development/policies/codingstyle-moodleapp.md @@ -435,7 +435,7 @@ export class MyService { ### Avoid calling methods in templates -Method calls should be avoided in template rendering, this includes structural directives such as `ngIf` or `ngFor`. +Method calls should be avoided in template rendering, including structural directives like `ngIf` or `ngFor`. The same applies to the new control flow syntax with `@if` or `@for`. Angular templates can be rendered very often, and calling methods on every render could cause some unintended performance issues. For that reason, it is usually safer to rely on values rather than methods. @@ -502,7 +502,7 @@ There is a maximum line length of 140 characters for templates. Whenever that le ```html -@for (course of courses; track $index) { +@for (course of courses; track course.id) { ```html -@for (course of courses; track $index) { +@for (course of courses; track course.id) {