diff --git a/config.xml b/config.xml index 2e7bff97e..fe07ba0f1 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + Moodle Moodle official app Moodle Mobile team @@ -241,7 +241,7 @@ - 3.9.1 + 3.9.2 YES diff --git a/desktop/assets/windows/AppXManifest.xml b/desktop/assets/windows/AppXManifest.xml index 285654c06..3aa37e33a 100644 --- a/desktop/assets/windows/AppXManifest.xml +++ b/desktop/assets/windows/AppXManifest.xml @@ -6,7 +6,7 @@ + Version="3.9.2.0" /> Moodle Desktop Moodle Pty Ltd. diff --git a/package-lock.json b/package-lock.json index 7623fa790..4075a47e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "moodlemobile", - "version": "3.9.0", + "version": "3.9.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -6236,7 +6236,8 @@ "ansi-regex": { "version": "2.1.1", "resolved": false, - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "optional": true }, "aproba": { "version": "1.2.0", @@ -6257,12 +6258,14 @@ "balanced-match": { "version": "1.0.0", "resolved": false, - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "optional": true }, "brace-expansion": { "version": "1.1.11", "resolved": false, "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6277,17 +6280,20 @@ "code-point-at": { "version": "1.1.0", "resolved": false, - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "optional": true }, "concat-map": { "version": "0.0.1", "resolved": false, - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "optional": true }, "console-control-strings": { "version": "1.1.0", "resolved": false, - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -6412,7 +6418,8 @@ "inherits": { "version": "2.0.3", "resolved": false, - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "optional": true }, "ini": { "version": "1.3.5", @@ -6424,6 +6431,7 @@ "version": "1.0.0", "resolved": false, "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -6438,6 +6446,7 @@ "version": "3.0.4", "resolved": false, "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -6481,6 +6490,7 @@ "version": "0.5.1", "resolved": false, "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "optional": true, "requires": { "minimist": "0.0.8" }, @@ -6488,7 +6498,8 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "optional": true } } }, @@ -6587,7 +6598,8 @@ "number-is-nan": { "version": "1.0.1", "resolved": false, - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "optional": true }, "object-assign": { "version": "4.1.1", @@ -6599,6 +6611,7 @@ "version": "1.4.0", "resolved": false, "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "optional": true, "requires": { "wrappy": "1" } @@ -6720,6 +6733,7 @@ "version": "1.0.2", "resolved": false, "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -6739,6 +6753,7 @@ "version": "3.0.1", "resolved": false, "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -6794,7 +6809,8 @@ "wrappy": { "version": "1.0.2", "resolved": false, - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "optional": true }, "yallist": { "version": "3.0.3", @@ -7278,7 +7294,8 @@ "version": "2.1.1", "resolved": false, "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -7302,13 +7319,15 @@ "version": "1.0.0", "resolved": false, "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "resolved": false, "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -7325,19 +7344,22 @@ "version": "1.1.0", "resolved": false, "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "resolved": false, "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "resolved": false, "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -7468,7 +7490,8 @@ "version": "2.0.3", "resolved": false, "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -7482,6 +7505,7 @@ "resolved": false, "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -7498,6 +7522,7 @@ "resolved": false, "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -7506,13 +7531,15 @@ "version": "0.0.8", "resolved": false, "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "resolved": false, "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -7533,6 +7560,7 @@ "resolved": false, "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -7621,7 +7649,8 @@ "version": "1.0.1", "resolved": false, "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -7635,6 +7664,7 @@ "resolved": false, "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -7730,7 +7760,8 @@ "version": "5.1.2", "resolved": false, "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -7772,6 +7803,7 @@ "resolved": false, "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -7793,6 +7825,7 @@ "resolved": false, "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -7841,13 +7874,15 @@ "version": "1.0.2", "resolved": false, "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "resolved": false, "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true + "dev": true, + "optional": true } } }, @@ -14909,7 +14944,8 @@ "version": "2.1.1", "resolved": false, "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -14933,13 +14969,15 @@ "version": "1.0.0", "resolved": false, "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "resolved": false, "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -14956,19 +14994,22 @@ "version": "1.1.0", "resolved": false, "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "resolved": false, "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "resolved": false, "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -15099,7 +15140,8 @@ "version": "2.0.3", "resolved": false, "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -15113,6 +15155,7 @@ "resolved": false, "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -15129,6 +15172,7 @@ "resolved": false, "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -15137,13 +15181,15 @@ "version": "0.0.8", "resolved": false, "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "resolved": false, "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -15164,6 +15210,7 @@ "resolved": false, "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -15252,7 +15299,8 @@ "version": "1.0.1", "resolved": false, "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -15266,6 +15314,7 @@ "resolved": false, "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -15361,7 +15410,8 @@ "version": "5.1.2", "resolved": false, "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -15403,6 +15453,7 @@ "resolved": false, "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -15424,6 +15475,7 @@ "resolved": false, "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -15472,13 +15524,15 @@ "version": "1.0.2", "resolved": false, "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "resolved": false, "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true + "dev": true, + "optional": true } } }, diff --git a/package.json b/package.json index 1d3792c31..bd73881a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moodlemobile", - "version": "3.9.1", + "version": "3.9.2", "description": "The official app for Moodle.", "author": { "name": "Moodle Pty Ltd.", @@ -253,7 +253,7 @@ "category": "public.app-category.education", "icon": "resources/desktop/icon.icns", "target": "mas", - "bundleVersion": "3.9.1", + "bundleVersion": "3.9.2", "extendInfo": { "ElectronTeamID": "2NU57U5PAW" } diff --git a/scripts/functions.sh b/scripts/functions.sh index c875be20f..f90399189 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -1,7 +1,6 @@ #!/bin/bash LANGPACKSFOLDER='../../moodle-langpacks' -stepnumber=$1 function check_success_exit { if [ $? -ne 0 ]; then diff --git a/scripts/lang_functions.php b/scripts/lang_functions.php index 7025faa8e..ea94ec3d1 100644 --- a/scripts/lang_functions.php +++ b/scripts/lang_functions.php @@ -186,7 +186,7 @@ function build_lang($lang, $keys) { $local = 0; $langparts = explode('-', $lang, 2); - $parentname = $langparts[0] ?? ""; + $parentname = $langparts[0] ? $langparts[0] : ""; $parent = ""; echo "Processing $lang"; @@ -307,8 +307,6 @@ function detect_lang($lang, $keys) { $langname = $string['thislanguage']; $title .= " ".$langname." -D"; - - // Add the translation to the array. foreach ($keys as $key => $value) { $string = get_translation_strings($langfoldername, $value->file); diff --git a/scripts/langindex.json b/scripts/langindex.json index 2a5ecb26b..fe23eb125 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -1557,6 +1557,7 @@ "core.errorsomedatanotdownloaded": "local_moodlemobileapp", "core.errorsync": "local_moodlemobileapp", "core.errorsyncblocked": "local_moodlemobileapp", + "core.errorurlschemeinvalidsite": "local_moodlemobileapp", "core.explanationdigitalminor": "moodle", "core.favourites": "moodle", "core.filename": "repository", @@ -2096,6 +2097,7 @@ "core.tag.errorareanotsupported": "local_moodlemobileapp", "core.tag.inalltagcoll": "tag", "core.tag.itemstaggedwith": "tag", + "core.tag.noresultsfor": "tag", "core.tag.notagsfound": "tag", "core.tag.searchtags": "tag", "core.tag.showingfirsttags": "tag", diff --git a/src/addon/block/myoverview/providers/block-handler.ts b/src/addon/block/myoverview/providers/block-handler.ts index 976c3c046..089bfb058 100644 --- a/src/addon/block/myoverview/providers/block-handler.ts +++ b/src/addon/block/myoverview/providers/block-handler.ts @@ -37,7 +37,7 @@ export class AddonBlockMyOverviewHandler extends CoreBlockBaseHandler { * @return Whether or not the handler is enabled on a site level. */ isEnabled(): boolean | Promise { - return this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.6') || + return (this.sitesProvider.getCurrentSite() && this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.6')) || !this.coursesProvider.isMyCoursesDisabledInSite(); } diff --git a/src/addon/block/timeline/providers/block-handler.ts b/src/addon/block/timeline/providers/block-handler.ts index 1b5044146..55b201bc3 100644 --- a/src/addon/block/timeline/providers/block-handler.ts +++ b/src/addon/block/timeline/providers/block-handler.ts @@ -41,7 +41,9 @@ export class AddonBlockTimelineHandler extends CoreBlockBaseHandler { */ isEnabled(): boolean | Promise { return this.timelineProvider.isAvailable().then((enabled) => { - return enabled && (this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.6') || + const currentSite = this.sitesProvider.getCurrentSite(); + + return enabled && ((currentSite && currentSite.isVersionGreaterEqualThan('3.6')) || !this.coursesProvider.isMyCoursesDisabledInSite()); }); } diff --git a/src/addon/calendar/components/calendar/calendar.ts b/src/addon/calendar/components/calendar/calendar.ts index 23ffe640f..1881b860e 100644 --- a/src/addon/calendar/components/calendar/calendar.ts +++ b/src/addon/calendar/components/calendar/calendar.ts @@ -222,7 +222,7 @@ export class AddonCalendarCalendarComponent implements OnInit, OnChanges, DoChec let isPast = true; this.weeks.forEach((week) => { - week.days.some((day) => { + week.days.forEach((day) => { day.istoday = day.mday == currentDay; day.ispast = isPast && !day.istoday; isPast = day.ispast; @@ -231,11 +231,7 @@ export class AddonCalendarCalendarComponent implements OnInit, OnChanges, DoChec day.events.forEach((event) => { event.ispast = this.isEventPast(event); }); - - return true; } - - return day.istoday; }); }); } diff --git a/src/addon/calendar/providers/calendar.ts b/src/addon/calendar/providers/calendar.ts index ed3891a00..5d40bbd31 100644 --- a/src/addon/calendar/providers/calendar.ts +++ b/src/addon/calendar/providers/calendar.ts @@ -393,7 +393,7 @@ export class AddonCalendarProvider { site = site || this.sitesProvider.getCurrentSite(); // The WS to create/edit events requires a fix that was integrated in 3.7.1. - return site.isVersionGreaterEqualThan('3.7.1'); + return site && site.isVersionGreaterEqualThan('3.7.1'); } /** diff --git a/src/addon/filter/multilang/providers/handler.ts b/src/addon/filter/multilang/providers/handler.ts index 8f809624a..229182791 100644 --- a/src/addon/filter/multilang/providers/handler.ts +++ b/src/addon/filter/multilang/providers/handler.ts @@ -83,6 +83,6 @@ export class AddonFilterMultilangHandler extends CoreFilterDefaultHandler { */ shouldBeApplied(options: CoreFilterFormatTextOptions, site?: CoreSite): boolean { // The filter should be applied if site is older than 3.7 or the WS didn't filter the text. - return options.wsNotFiltered || !site.isVersionGreaterEqualThan('3.7'); + return options.wsNotFiltered || (site && !site.isVersionGreaterEqualThan('3.7')); } } diff --git a/src/addon/mod/assign/components/index/index.ts b/src/addon/mod/assign/components/index/index.ts index 8d8fb9985..b47535c64 100644 --- a/src/addon/mod/assign/components/index/index.ts +++ b/src/addon/mod/assign/components/index/index.ts @@ -207,9 +207,10 @@ export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityCo // Check if groupmode is enabled to avoid showing wrong numbers. return this.groupsProvider.getActivityGroupInfo(this.assign.cmid, false).then((groupInfo) => { + const currentSite = this.sitesProvider.getCurrentSite(); this.groupInfo = groupInfo; this.showNumbers = groupInfo.groups.length == 0 || - this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.5'); + (currentSite && currentSite.isVersionGreaterEqualThan('3.5')); return this.setGroup(this.groupsProvider.validateGroupId(this.group, groupInfo)); }); @@ -258,8 +259,10 @@ export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityCo } } + const currentSite = this.sitesProvider.getCurrentSite(); + this.needsGradingAvalaible = response.gradingsummary && response.gradingsummary.submissionsneedgradingcount > 0 && - this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.2'); + currentSite && currentSite.isVersionGreaterEqualThan('3.2'); }); } diff --git a/src/addon/mod/assign/submission/onlinetext/providers/handler.ts b/src/addon/mod/assign/submission/onlinetext/providers/handler.ts index c2b80fc2d..572d61735 100644 --- a/src/addon/mod/assign/submission/onlinetext/providers/handler.ts +++ b/src/addon/mod/assign/submission/onlinetext/providers/handler.ts @@ -225,7 +225,7 @@ export class AddonModAssignSubmissionOnlineTextHandler implements AddonModAssign // Bug was fixed in 3.1.1 minor release and in 3.2. const currentSite = this.sitesProvider.getCurrentSite(); - return currentSite.isVersionGreaterEqualThan('3.1.1') || currentSite.checkIfAppUsesLocalMobile(); + return currentSite && (currentSite.isVersionGreaterEqualThan('3.1.1') || currentSite.checkIfAppUsesLocalMobile()); } /** diff --git a/src/addon/mod/forum/providers/forum.ts b/src/addon/mod/forum/providers/forum.ts index 3e5f6f956..2c9d03cdb 100644 --- a/src/addon/mod/forum/providers/forum.ts +++ b/src/addon/mod/forum/providers/forum.ts @@ -291,7 +291,8 @@ export class AddonModForumProvider { * @return True if fixed, false otherwise. */ isAllParticipantsFixed(): boolean { - return this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan(['3.1.5', '3.2.2']); + return this.sitesProvider.getCurrentSite() && + this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan(['3.1.5', '3.2.2']); } /** @@ -543,7 +544,7 @@ export class AddonModForumProvider { isDiscussionListSortingAvailable(site?: CoreSite): boolean { site = site || this.sitesProvider.getCurrentSite(); - return site.isVersionGreaterEqualThan('3.7'); + return site && site.isVersionGreaterEqualThan('3.7'); } /** diff --git a/src/addon/mod/forum/providers/prefetch-handler.ts b/src/addon/mod/forum/providers/prefetch-handler.ts index bf741d780..00af16f83 100644 --- a/src/addon/mod/forum/providers/prefetch-handler.ts +++ b/src/addon/mod/forum/providers/prefetch-handler.ts @@ -87,7 +87,8 @@ export class AddonModForumPrefetchHandler extends CoreCourseActivityPrefetchHand */ protected getPostsFiles(posts: any[]): any[] { let files = []; - const getInlineFiles = this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.2'); + const getInlineFiles = this.sitesProvider.getCurrentSite() && + this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.2'); posts.forEach((post) => { if (post.attachments && post.attachments.length) { diff --git a/src/addon/mod/glossary/providers/prefetch-handler.ts b/src/addon/mod/glossary/providers/prefetch-handler.ts index 30bdf4903..c202a88e6 100644 --- a/src/addon/mod/glossary/providers/prefetch-handler.ts +++ b/src/addon/mod/glossary/providers/prefetch-handler.ts @@ -86,7 +86,8 @@ export class AddonModGlossaryPrefetchHandler extends CoreCourseActivityPrefetchH */ protected getFilesFromGlossaryAndEntries(module: any, glossary: any, entries: any[]): any[] { let files = this.getIntroFilesFromInstance(module, glossary); - const getInlineFiles = this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.2'); + const getInlineFiles = this.sitesProvider.getCurrentSite() && + this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.2'); // Get entries files. entries.forEach((entry) => { diff --git a/src/addon/mod/quiz/providers/prefetch-handler.ts b/src/addon/mod/quiz/providers/prefetch-handler.ts index 5ec4d9cbf..f1832e11d 100644 --- a/src/addon/mod/quiz/providers/prefetch-handler.ts +++ b/src/addon/mod/quiz/providers/prefetch-handler.ts @@ -110,8 +110,9 @@ export class AddonModQuizPrefetchHandler extends CoreCourseActivityPrefetchHandl */ protected getAttemptsFeedbackFiles(quiz: any, attempts: any[]): Promise { // We have quiz data, now we'll get specific data for each attempt. - const promises = [], - getInlineFiles = this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.2'); + const promises = []; + const getInlineFiles = this.sitesProvider.getCurrentSite() && + this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.2'); let files = []; attempts.forEach((attempt) => { diff --git a/src/addon/mod/resource/providers/helper.ts b/src/addon/mod/resource/providers/helper.ts index cdbf17270..62a00e511 100644 --- a/src/addon/mod/resource/providers/helper.ts +++ b/src/addon/mod/resource/providers/helper.ts @@ -104,8 +104,10 @@ export class AddonModResourceHelperProvider { * @return Whether the resource should be displayed embeded. */ isDisplayedEmbedded(module: any, display: number): boolean { + const currentSite = this.sitesProvider.getCurrentSite(); + if ((!module.contents.length && !module.contentsinfo) || !this.fileProvider.isAvailable() || - (!this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.7') && this.isNextcloudFile(module))) { + (currentSite && !currentSite.isVersionGreaterEqualThan('3.7') && this.isNextcloudFile(module))) { return false; } diff --git a/src/addon/mod/resource/providers/prefetch-handler.ts b/src/addon/mod/resource/providers/prefetch-handler.ts index 27c52989d..17f775cce 100644 --- a/src/addon/mod/resource/providers/prefetch-handler.ts +++ b/src/addon/mod/resource/providers/prefetch-handler.ts @@ -147,7 +147,7 @@ export class AddonModResourcePrefetchHandler extends CoreCourseResourcePrefetchH * @return Promise resolved with true if downloadable, resolved with false otherwise. */ isDownloadable(module: any, courseId: number): Promise { - if (this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.7')) { + if (this.sitesProvider.getCurrentSite() && this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.7')) { // Nextcloud files are downloadable from 3.7 onwards. return Promise.resolve(true); } diff --git a/src/addon/mod/scorm/pages/player/player.html b/src/addon/mod/scorm/pages/player/player.html index 6d7874bad..e26b99e1d 100644 --- a/src/addon/mod/scorm/pages/player/player.html +++ b/src/addon/mod/scorm/pages/player/player.html @@ -13,7 +13,7 @@ - +

{{ errorMessage | translate }}

diff --git a/src/addon/mod/scorm/pages/player/player.ts b/src/addon/mod/scorm/pages/player/player.ts index 2b689387d..a21bd9e58 100644 --- a/src/addon/mod/scorm/pages/player/player.ts +++ b/src/addon/mod/scorm/pages/player/player.ts @@ -17,7 +17,7 @@ import { IonicPage, NavParams, ModalController } from 'ionic-angular'; import { CoreEventsProvider } from '@providers/events'; import { CoreSitesProvider } from '@providers/sites'; import { CoreSyncProvider } from '@providers/sync'; -import { CoreDomUtilsProvider } from '@providers/utils/dom'; +import { CoreDomUtils } from '@providers/utils/dom'; import { CoreTimeUtilsProvider } from '@providers/utils/time'; import { CoreIonTabsComponent } from '@components/ion-tabs/ion-tabs'; import { AddonModScormProvider, AddonModScormAttemptCountResult } from '../../providers/scorm'; @@ -46,6 +46,8 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy { src: string; // Iframe src. errorMessage: string; // Error message. accessInfo: any; // Access information. + scormWidth: null; // Width applied to scorm iframe. + scormHeight: null; // Height applied to scorm iframe. protected siteId: string; protected mode: string; // Mode to play the SCORM. @@ -65,11 +67,18 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy { protected launchPrevObserver: any; protected goOfflineObserver: any; - constructor(navParams: NavParams, protected modalCtrl: ModalController, protected eventsProvider: CoreEventsProvider, - protected sitesProvider: CoreSitesProvider, protected syncProvider: CoreSyncProvider, - protected domUtils: CoreDomUtilsProvider, protected timeUtils: CoreTimeUtilsProvider, - protected scormProvider: AddonModScormProvider, protected scormHelper: AddonModScormHelperProvider, - protected scormSyncProvider: AddonModScormSyncProvider, protected tabs: CoreIonTabsComponent) { + constructor( + navParams: NavParams, + protected modalCtrl: ModalController, + protected eventsProvider: CoreEventsProvider, + protected sitesProvider: CoreSitesProvider, + protected syncProvider: CoreSyncProvider, + protected timeUtils: CoreTimeUtilsProvider, + protected scormProvider: AddonModScormProvider, + protected scormHelper: AddonModScormHelperProvider, + protected scormSyncProvider: AddonModScormSyncProvider, + protected tabs: CoreIonTabsComponent + ) { this.scorm = navParams.get('scorm') || {}; this.mode = navParams.get('mode') || AddonModScormProvider.MODENORMAL; @@ -95,12 +104,14 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy { if (this.scorm.popup) { this.tabs.changeVisibility(false); - // If we receive a value <= 100 we need to assume it's a percentage. - if (this.scorm.width <= 100) { - this.scorm.width = this.scorm.width + '%'; - } - if (this.scorm.height <= 100) { - this.scorm.height = this.scorm.height + '%'; + // If we receive a value > 100 we assume it's a fixed pixel size. + if (this.scorm.width > 100) { + this.scormWidth = this.scorm.width; + + // Only get fixed size on height if width is also fixed. + if (this.scorm.height > 100) { + this.scormHeight = this.scorm.height; + } } } @@ -111,7 +122,7 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy { const promise = this.newAttempt ? this.setStartTime(this.currentSco.id) : Promise.resolve(); return promise.catch((error) => { - this.domUtils.showErrorModalDefault(error, 'addon.mod_scorm.errorgetscorm', true); + CoreDomUtils.instance.showErrorModalDefault(error, 'addon.mod_scorm.errorgetscorm', true); }).finally(() => { // Load SCO. this.loadSco(this.currentSco); @@ -152,7 +163,7 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy { // Wait a bit to prevent collisions between this store and SCORM API's store. setTimeout(() => { this.scormHelper.convertAttemptToOffline(this.scorm, this.attempt).catch((error) => { - this.domUtils.showErrorModalDefault(error, 'core.error', true); + CoreDomUtils.instance.showErrorModalDefault(error, 'core.error', true); }).then(() => { this.refreshToc(); }); @@ -248,7 +259,7 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy { return Promise.all(promises); }); }).catch((error) => { - this.domUtils.showErrorModalDefault(error, 'addon.mod_scorm.errorgetscorm', true); + CoreDomUtils.instance.showErrorModalDefault(error, 'addon.mod_scorm.errorgetscorm', true); }); }); } @@ -372,7 +383,7 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy { return this.scormProvider.saveTracks(sco.id, this.attempt, tracks, this.scorm, true); }).catch((error) => { - this.domUtils.showErrorModalDefault(error, 'core.error', true); + CoreDomUtils.instance.showErrorModalDefault(error, 'core.error', true); }); } }); @@ -432,7 +443,7 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy { }).then(() => { return this.fetchToc(); }).catch((error) => { - this.domUtils.showErrorModalDefault(error, 'addon.mod_scorm.errorgetscorm', true); + CoreDomUtils.instance.showErrorModalDefault(error, 'addon.mod_scorm.errorgetscorm', true); }); } diff --git a/src/addon/mod/workshop/components/index/addon-mod-workshop-index.html b/src/addon/mod/workshop/components/index/addon-mod-workshop-index.html index c10216d25..f662c02ae 100644 --- a/src/addon/mod/workshop/components/index/addon-mod-workshop-index.html +++ b/src/addon/mod/workshop/components/index/addon-mod-workshop-index.html @@ -112,7 +112,7 @@

{{ 'addon.mod_workshop.publishedsubmissions' | translate }}

- + @@ -134,7 +134,7 @@

{{ 'addon.mod_workshop.assignedassessmentsnone' | translate }}

- + @@ -156,7 +156,7 @@ - + diff --git a/src/addon/mod/workshop/components/submission/addon-mod-workshop-submission.html b/src/addon/mod/workshop/components/submission/addon-mod-workshop-submission.html index 70b4e7063..b0b54fde5 100644 --- a/src/addon/mod/workshop/components/submission/addon-mod-workshop-submission.html +++ b/src/addon/mod/workshop/components/submission/addon-mod-workshop-submission.html @@ -1,6 +1,6 @@
- +

{{profile.fullname}}

@@ -21,7 +21,7 @@ {{ 'core.notsent' | translate }} {{ 'core.deletedoffline' | translate }} -
+ diff --git a/src/addon/mod/workshop/components/submission/submission.scss b/src/addon/mod/workshop/components/submission/submission.scss index 6775a13ac..6b67768d9 100644 --- a/src/addon/mod/workshop/components/submission/submission.scss +++ b/src/addon/mod/workshop/components/submission/submission.scss @@ -1,4 +1,13 @@ -ion-app.app-root addon-mod-workshop-submission, -ion-app.app-root .card.with-borders addon-mod-workshop-submission { - @include core-as-items(); +ion-app.app-root addon-mod-workshop-submission .addon-workshop-submission-title { + + &.item-ios { + border-bottom: $list-ios-header-border-bottom; + } + &.item-md { + border-bottom: 1px solid $list-md-border-color; + } + + &:last-child { + border: 0; + } } \ No newline at end of file diff --git a/src/app/app.scss b/src/app/app.scss index 51e512502..05557bc56 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -113,8 +113,8 @@ ion-app.app-root { @include core-as-items(); } - .card.with-borders .item, - .list.with-borders .item { + .card.with-borders > .item, + .list.with-borders > .item { @include core-items(); } diff --git a/src/assets/lang/en.json b/src/assets/lang/en.json index 3ffb8ef88..97ac15926 100644 --- a/src/assets/lang/en.json +++ b/src/assets/lang/en.json @@ -2095,6 +2095,7 @@ "core.tag.errorareanotsupported": "This tag area is not supported by the app.", "core.tag.inalltagcoll": "Everywhere", "core.tag.itemstaggedwith": "{{$a.tagarea}} tagged with \"{{$a.tag}}\"", + "core.tag.noresultsfor": "No results for \"{{$a}}\"", "core.tag.notagsfound": "No tags matching \"{{$a}}\" found", "core.tag.searchtags": "Search tags", "core.tag.showingfirsttags": "Showing {{$a}} most popular tags", diff --git a/src/components/iframe/iframe.scss b/src/components/iframe/iframe.scss index 782a554cb..d99e54aae 100644 --- a/src/components/iframe/iframe.scss +++ b/src/components/iframe/iframe.scss @@ -1,4 +1,9 @@ ion-app.app-root core-iframe { + + > div { + max-width: 100%; + max-height: 100%; + } iframe { border: 0; display: block; diff --git a/src/components/ion-tabs/core-ion-tabs.html b/src/components/ion-tabs/core-ion-tabs.html index 5a4dda4b3..64b7f007e 100644 --- a/src/components/ion-tabs/core-ion-tabs.html +++ b/src/components/ion-tabs/core-ion-tabs.html @@ -7,7 +7,7 @@
-
+
diff --git a/src/components/ion-tabs/ion-tabs.scss b/src/components/ion-tabs/ion-tabs.scss index e64b20c00..a2dec8b91 100644 --- a/src/components/ion-tabs/ion-tabs.scss +++ b/src/components/ion-tabs/ion-tabs.scss @@ -27,6 +27,9 @@ ion-app.app-root core-ion-tabs { .ion-page > ion-content > .scroll-content { margin-bottom: $navbar-md-height; } + .tabshidden .ion-page > ion-content > .scroll-content { + margin-bottom: 0; + } } &[tabsplacement="side"] { diff --git a/src/config.json b/src/config.json index b3b686edd..6445b756a 100644 --- a/src/config.json +++ b/src/config.json @@ -2,8 +2,8 @@ "app_id": "com.moodle.moodlemobile", "appname": "Moodle Mobile", "desktopappname": "Moodle Desktop", - "versioncode": 3910, - "versionname": "3.9.1", + "versioncode": 3920, + "versionname": "3.9.2", "cache_update_frequency_usually": 420000, "cache_update_frequency_often": 1200000, "cache_update_frequency_sometimes": 3600000, diff --git a/src/core/course/providers/course.ts b/src/core/course/providers/course.ts index 98c551149..5a734cd76 100644 --- a/src/core/course/providers/course.ts +++ b/src/core/course/providers/course.ts @@ -122,7 +122,7 @@ export class CoreCourseProvider { canGetCourseBlocks(site?: CoreSite): boolean { site = site || this.sitesProvider.getCurrentSite(); - return site.isVersionGreaterEqualThan('3.7') && site.wsAvailable('core_block_get_course_blocks'); + return site && site.isVersionGreaterEqualThan('3.7') && site.wsAvailable('core_block_get_course_blocks'); } /** @@ -135,7 +135,7 @@ export class CoreCourseProvider { canRequestStealthModules(site?: CoreSite): boolean { site = site || this.sitesProvider.getCurrentSite(); - return site.isVersionGreaterEqualThan(['3.4.6', '3.5.3']); + return site && site.isVersionGreaterEqualThan(['3.4.6', '3.5.3']); } /** diff --git a/src/core/course/providers/sync.ts b/src/core/course/providers/sync.ts index ef5ea7462..f62b9c48a 100644 --- a/src/core/course/providers/sync.ts +++ b/src/core/course/providers/sync.ts @@ -197,7 +197,9 @@ export class CoreCourseSyncProvider extends CoreSyncBaseProvider { if (result.updated) { // Update data. return this.courseProvider.invalidateSections(courseId, siteId).then(() => { - if (this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.6')) { + const currentSite = this.sitesProvider.getCurrentSite(); + + if (currentSite && currentSite.isVersionGreaterEqualThan('3.6')) { return this.courseProvider.getSections(courseId, false, true, undefined, siteId); } else { return this.courseProvider.getActivitiesCompletionStatus(courseId, siteId); diff --git a/src/core/courses/pages/course-preview/course-preview.ts b/src/core/courses/pages/course-preview/course-preview.ts index 4ca797ecf..28f6d62ee 100644 --- a/src/core/courses/pages/course-preview/course-preview.ts +++ b/src/core/courses/pages/course-preview/course-preview.ts @@ -235,7 +235,7 @@ export class CoreCoursesCoursePreviewPage implements OnDestroy { }); }); }).finally(() => { - if (!this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.7')) { + if (this.sitesProvider.getCurrentSite() && !this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.7')) { return this.coursesProvider.isGetCoursesByFieldAvailableInSite().then((available) => { if (available) { return this.coursesProvider.getCourseByField('id', this.course.id).then((course) => { @@ -402,7 +402,7 @@ export class CoreCoursesCoursePreviewPage implements OnDestroy { promises.push(this.coursesProvider.invalidateCourse(this.course.id)); promises.push(this.coursesProvider.invalidateCourseEnrolmentMethods(this.course.id)); promises.push(this.courseOptionsDelegate.clearAndInvalidateCoursesOptions(this.course.id)); - if (this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.7')) { + if (this.sitesProvider.getCurrentSite() && !this.sitesProvider.getCurrentSite().isVersionGreaterEqualThan('3.7')) { promises.push(this.coursesProvider.invalidateCoursesByField('id', this.course.id)); } if (this.guestInstanceId) { diff --git a/src/core/courses/providers/helper.ts b/src/core/courses/providers/helper.ts index d7ac68a4b..5898d00a3 100644 --- a/src/core/courses/providers/helper.ts +++ b/src/core/courses/providers/helper.ts @@ -114,7 +114,7 @@ export class CoreCoursesHelperProvider { promises = [], colors = []; - if (site.isVersionGreaterEqualThan('3.8')) { + if (site && site.isVersionGreaterEqualThan('3.8')) { promises.push(site.getConfig().then((configs) => { for (let x = 0; x < 10; x++) { colors[x] = configs['core_admin_coursecolor' + (x + 1)] || null; diff --git a/src/core/fileuploader/providers/file-handler.ts b/src/core/fileuploader/providers/file-handler.ts index 257110258..54c689ebe 100644 --- a/src/core/fileuploader/providers/file-handler.ts +++ b/src/core/fileuploader/providers/file-handler.ts @@ -64,12 +64,10 @@ export class CoreFileUploaderFileHandler implements CoreFileUploaderHandler { * @return Data. */ getData(): CoreFileUploaderHandlerData { - const isIOS = this.platform.is('ios'); - const handler: CoreFileUploaderHandlerData = { - title: isIOS ? 'core.fileuploader.more' : 'core.fileuploader.file', + title: 'core.fileuploader.file', class: 'core-fileuploader-file-handler', - icon: isIOS ? 'more' : 'folder', + icon: 'folder', }; if (this.appProvider.isMobile()) { @@ -98,7 +96,6 @@ export class CoreFileUploaderFileHandler implements CoreFileUploaderHandler { input.addEventListener('change', (evt: Event) => { const file = input.files[0]; - let fileName; input.value = ''; // Unset input. if (!file) { @@ -113,17 +110,8 @@ export class CoreFileUploaderFileHandler implements CoreFileUploaderHandler { return; } - fileName = file.name; - if (isIOS) { - // Check the name of the file and add a timestamp if needed (take picture). - const matches = fileName.match(/image\.(jpe?g|png)/); - if (matches) { - fileName = 'image_' + this.timeUtils.readableTimestamp() + '.' + matches[1]; - } - } - // Upload the picked file. - this.uploaderHelper.uploadFileObject(file, maxSize, upload, allowOffline, fileName).then((result) => { + this.uploaderHelper.uploadFileObject(file, maxSize, upload, allowOffline, file.name).then((result) => { this.uploaderHelper.fileUploaded(result); }).catch((error) => { this.domUtils.showErrorModalDefault(error, diff --git a/src/core/fileuploader/providers/helper.ts b/src/core/fileuploader/providers/helper.ts index c3a5d7d44..4064c3829 100644 --- a/src/core/fileuploader/providers/helper.ts +++ b/src/core/fileuploader/providers/helper.ts @@ -65,8 +65,12 @@ export class CoreFileUploaderHelperProvider { */ async chooseAndUploadFile(maxSize: number, upload?: boolean, allowOffline?: boolean, mimetypes?: string[]): Promise { + const modal = this.domUtils.showModalLoading(); + const result = await this.fileChooser.getFile(mimetypes ? mimetypes.join(',') : undefined); + modal.dismiss(); + if (!result) { // User canceled. throw this.domUtils.createCanceledError(); @@ -87,10 +91,6 @@ export class CoreFileUploaderHelperProvider { const options = this.fileUploaderProvider.getFileUploadOptions(result.uri, result.name, result.mediaType, true); if (upload) { - const size = await this.fileProvider.getExternalFileSize(result.uri); - - await this.confirmUploadFile(size, false, allowOffline); - return this.uploadFile(result.uri, maxSize, true, options); } else { return this.copyToTmpFolder(result.uri, false, maxSize, undefined, options); diff --git a/src/core/login/pages/credentials/credentials.ts b/src/core/login/pages/credentials/credentials.ts index 180aa315e..88d59bcb8 100644 --- a/src/core/login/pages/credentials/credentials.ts +++ b/src/core/login/pages/credentials/credentials.ts @@ -249,6 +249,9 @@ export class CoreLoginCredentialsPage { this.loginHelper.treatUserTokenError(siteUrl, error, username, password); if (error.loggedout) { this.navCtrl.setRoot('CoreLoginSitesPage'); + } else if (error.errorcode == 'forcepasswordchangenotice') { + // Reset password field. + this.credForm.controls.password.reset(); } }).finally(() => { modal.dismiss(); diff --git a/src/core/login/pages/forgotten-password/forgotten-password.html b/src/core/login/pages/forgotten-password/forgotten-password.html index 81905e4d4..68c04bd5b 100644 --- a/src/core/login/pages/forgotten-password/forgotten-password.html +++ b/src/core/login/pages/forgotten-password/forgotten-password.html @@ -25,7 +25,7 @@
- + diff --git a/src/core/login/pages/forgotten-password/forgotten-password.ts b/src/core/login/pages/forgotten-password/forgotten-password.ts index 212840455..762b5fa96 100644 --- a/src/core/login/pages/forgotten-password/forgotten-password.ts +++ b/src/core/login/pages/forgotten-password/forgotten-password.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, ViewChild, ElementRef } from '@angular/core'; -import { IonicPage, NavController, NavParams } from 'ionic-angular'; +import { IonicPage, NavController, NavParams, Platform } from 'ionic-angular'; import { TranslateService } from '@ngx-translate/core'; import { CoreEventsProvider } from '@providers/events'; import { CoreSitesProvider } from '@providers/sites'; @@ -35,10 +35,12 @@ export class CoreLoginForgottenPasswordPage { myForm: FormGroup; siteUrl: string; + autoFocus: boolean; constructor(protected navCtrl: NavController, navParams: NavParams, fb: FormBuilder, + platform: Platform, protected translate: TranslateService, protected loginHelper: CoreLoginHelperProvider, protected domUtils: CoreDomUtilsProvider, @@ -46,6 +48,7 @@ export class CoreLoginForgottenPasswordPage { protected sitesProvider: CoreSitesProvider) { this.siteUrl = navParams.get('siteUrl'); + this.autoFocus = platform.is('tablet'); this.myForm = fb.group({ field: ['username', Validators.required], value: [navParams.get('username') || '', Validators.required] diff --git a/src/core/login/pages/reconnect/reconnect.ts b/src/core/login/pages/reconnect/reconnect.ts index 9b5a84f01..b9f56eeb6 100644 --- a/src/core/login/pages/reconnect/reconnect.ts +++ b/src/core/login/pages/reconnect/reconnect.ts @@ -221,6 +221,9 @@ export class CoreLoginReconnectPage { if (error.loggedout) { this.cancel(); + } else if (error.errorcode == 'forcepasswordchangenotice') { + // Reset password field. + this.credForm.controls.password.reset(); } }).finally(() => { modal.dismiss(); diff --git a/src/core/login/pages/site/site.html b/src/core/login/pages/site/site.html index 714f8ad38..ccf57c53d 100644 --- a/src/core/login/pages/site/site.html +++ b/src/core/login/pages/site/site.html @@ -20,13 +20,13 @@

{{ 'core.login.siteaddress' | translate }}

- +

{{ 'core.login.siteaddress' | translate }}

- +