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..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 section.id) { @@ -61,20 +61,22 @@ class mobile { - - - - - - + @if (section.summary) { + + + + + + + } - - + @for (module of section.modules; track module.id) { + @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..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: @@ -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/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 diff --git a/general/development/policies/codingstyle-moodleapp.md b/general/development/policies/codingstyle-moodleapp.md index af30f94eaa..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. @@ -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 course.id) { + + + {{ 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 course.id) { + + + {{ course.title }} + + +} ```