From 88db3d5816c1c4f5db88d509f502f1935d92e098 Mon Sep 17 00:00:00 2001 From: Mark Johnson Date: Fri, 2 Aug 2019 15:53:08 +0100 Subject: [PATCH 1/2] MOBILE-3113 course formats: Give the user the option to reload if format plugins fail to initialise --- src/core/course/providers/course.ts | 7 ++++++- src/core/courses/lang/en.json | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core/course/providers/course.ts b/src/core/course/providers/course.ts index f812ef2b6..d15793574 100644 --- a/src/core/course/providers/course.ts +++ b/src/core/course/providers/course.ts @@ -981,7 +981,12 @@ export class CoreCourseProvider { } }).catch(() => { // The site plugin failed to load. The user needs to restart the app to try loading it again. - this.domUtils.showErrorModal('core.courses.errorloadplugins', true); + const message = this.translate.instant('core.courses.errorloadplugins'); + const reload = this.translate.instant('core.courses.reload'); + const ignore = this.translate.instant('core.courses.ignore'); + this.domUtils.showConfirm(message, '', reload, ignore).then(() => { + window.location.reload(); + }); }); } else { // No custom format plugin. We don't need to wait for anything. diff --git a/src/core/courses/lang/en.json b/src/core/courses/lang/en.json index 9409f2ee0..ef69785f5 100644 --- a/src/core/courses/lang/en.json +++ b/src/core/courses/lang/en.json @@ -11,11 +11,12 @@ "enrolme": "Enrol me", "errorloadcategories": "An error occurred while loading categories.", "errorloadcourses": "An error occurred while loading courses.", - "errorloadplugins": "The plugins required by this course could not be loaded correctly. Please restart the app to try again.", + "errorloadplugins": "The plugins required by this course could not be loaded correctly. Please reload the app to try again.", "errorsearching": "An error occurred while searching.", "errorselfenrol": "An error occurred while self enrolling.", "filtermycourses": "Filter my courses", "frontpage": "Front page", + "ignore": "Ignore", "hidecourse": "Hide from view", "mycourses": "My courses", "nocourses": "No course information to show.", @@ -26,6 +27,7 @@ "password": "Enrolment key", "paymentrequired": "This course requires a payment for entry.", "paypalaccepted": "PayPal payments accepted", + "reload": "Reload", "removefromfavourites": "Unstar this course", "search": "Search", "searchcourses": "Search courses", @@ -34,4 +36,4 @@ "sendpaymentbutton": "Send payment via PayPal", "show": "Show this course", "totalcoursesearchresults": "Total courses: {{$a}}" -} \ No newline at end of file +} From c07e948e58f96857f44d6a8d801049f42a420b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 12 Aug 2019 16:14:33 +0200 Subject: [PATCH 2/2] MOBILE-3113 lang: Add new strings to index --- scripts/langindex.json | 2 ++ src/assets/lang/en.json | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/langindex.json b/scripts/langindex.json index a8e23425b..454c21834 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -1413,6 +1413,7 @@ "core.courses.filtermycourses": "local_moodlemobileapp", "core.courses.frontpage": "admin", "core.courses.hidecourse": "block_myoverview", + "core.courses.ignore": "admin", "core.courses.mycourses": "moodle", "core.courses.mymoodle": "admin", "core.courses.nocourses": "my", @@ -1423,6 +1424,7 @@ "core.courses.password": "local_moodlemobileapp", "core.courses.paymentrequired": "moodle", "core.courses.paypalaccepted": "enrol_paypal", + "core.courses.reload": "moodle", "core.courses.removefromfavourites": "block_myoverview", "core.courses.search": "moodle", "core.courses.searchcourses": "moodle", diff --git a/src/assets/lang/en.json b/src/assets/lang/en.json index 6d03d0b22..54e78480c 100644 --- a/src/assets/lang/en.json +++ b/src/assets/lang/en.json @@ -1403,12 +1403,13 @@ "core.courses.enrolme": "Enrol me", "core.courses.errorloadcategories": "An error occurred while loading categories.", "core.courses.errorloadcourses": "An error occurred while loading courses.", - "core.courses.errorloadplugins": "The plugins required by this course could not be loaded correctly. Please restart the app to try again.", + "core.courses.errorloadplugins": "The plugins required by this course could not be loaded correctly. Please reload the app to try again.", "core.courses.errorsearching": "An error occurred while searching.", "core.courses.errorselfenrol": "An error occurred while self enrolling.", "core.courses.filtermycourses": "Filter my courses", "core.courses.frontpage": "Front page", "core.courses.hidecourse": "Hide from view", + "core.courses.ignore": "Ignore", "core.courses.mycourses": "My courses", "core.courses.mymoodle": "Dashboard", "core.courses.nocourses": "No course information to show.", @@ -1419,6 +1420,7 @@ "core.courses.password": "Enrolment key", "core.courses.paymentrequired": "This course requires a payment for entry.", "core.courses.paypalaccepted": "PayPal payments accepted", + "core.courses.reload": "Reload", "core.courses.removefromfavourites": "Unstar this course", "core.courses.search": "Search", "core.courses.searchcourses": "Search courses",