MOBILE-3163 core: Remove Classic app warning

main
Dani Palou 2019-09-19 09:34:00 +02:00
parent 56678099e0
commit 9196371f50
5 changed files with 11 additions and 64 deletions

View File

@ -1556,7 +1556,7 @@
"core.login.auth_email": "Email-based self-registration",
"core.login.authenticating": "Authenticating",
"core.login.cancel": "Cancel",
"core.login.checksiteversion": "Check that your site uses Moodle 2.4 or later.",
"core.login.checksiteversion": "Check that your site uses Moodle 3.1 or later.",
"core.login.confirmdeletesite": "Are you sure you want to delete the site {{sitename}}?",
"core.login.connect": "Connect!",
"core.login.connecttomoodle": "Connect to Moodle",
@ -1585,15 +1585,12 @@
"core.login.invalidaccount": "Please check your login details or ask your site administrator to check the site configuration.",
"core.login.invaliddate": "Invalid date",
"core.login.invalidemail": "Invalid email address",
"core.login.invalidmoodleversion": "Invalid Moodle version. The minimum version required is 2.4.",
"core.login.invalidmoodleversion": "Invalid Moodle version. The minimum version required is 3.1.",
"core.login.invalidsite": "The site URL is invalid.",
"core.login.invalidtime": "Invalid time",
"core.login.invalidurl": "Invalid URL specified",
"core.login.invalidvaluemax": "The maximum value is {{$a}}",
"core.login.invalidvaluemin": "The minimum value is {{$a}}",
"core.login.legacymoodleversion": "You are trying to connect to an unsupported Moodle version. Please download the Moodle Classic app to access this Moodle site.",
"core.login.legacymoodleversiondesktop": "You are trying to connect to <b>{{$a}}</b>.<br><br>This site is running an outdated unsupported version of Moodle which will not work with this Moodle Desktop App.<br><br>If this is your site please contact your local moodle partner to get assistance to update it.<br><br>See <a href=\"https://moodle.com/contact\">our contact page</a> to submit a request for assistance.",
"core.login.legacymoodleversiondesktopdownloadold": "<br><br>Alternatively, you can still access this site using an unsupported version of the app that can be downloaded from here.",
"core.login.localmobileunexpectedresponse": "Moodle Mobile Additional Features check returned an unexpected response. You will be authenticated using the standard mobile service.",
"core.login.loggedoutssodescription": "You have to authenticate again. You need to log in to the site in a browser window.",
"core.login.login": "Log in",

View File

@ -2,7 +2,7 @@
"auth_email": "Email-based self-registration",
"authenticating": "Authenticating",
"cancel": "Cancel",
"checksiteversion": "Check that your site uses Moodle 2.4 or later.",
"checksiteversion": "Check that your site uses Moodle 3.1 or later.",
"confirmdeletesite": "Are you sure you want to delete the site {{sitename}}?",
"connect": "Connect!",
"connecttomoodle": "Connect to Moodle",
@ -31,15 +31,12 @@
"invalidaccount": "Please check your login details or ask your site administrator to check the site configuration.",
"invaliddate": "Invalid date",
"invalidemail": "Invalid email address",
"invalidmoodleversion": "Invalid Moodle version. The minimum version required is 2.4.",
"invalidmoodleversion": "Invalid Moodle version. The minimum version required is 3.1.",
"invalidsite": "The site URL is invalid.",
"invalidtime": "Invalid time",
"invalidurl": "Invalid URL specified",
"invalidvaluemax": "The maximum value is {{$a}}",
"invalidvaluemin": "The minimum value is {{$a}}",
"legacymoodleversion": "You are trying to connect to an unsupported Moodle version. Please download the Moodle Classic app to access this Moodle site.",
"legacymoodleversiondesktop": "You are trying to connect to <b>{{$a}}</b>.<br><br>This site is running an outdated unsupported version of Moodle which will not work with this Moodle Desktop App.<br><br>If this is your site please contact your local moodle partner to get assistance to update it.<br><br>See <a href=\"https://moodle.com/contact\">our contact page</a> to submit a request for assistance.",
"legacymoodleversiondesktopdownloadold": "<br><br>Alternatively, you can still access this site using an unsupported version of the app that can be downloaded from here.",
"localmobileunexpectedresponse": "Moodle Mobile Additional Features check returned an unexpected response. You will be authenticated using the standard mobile service.",
"loggedoutssodescription": "You have to authenticate again. You need to log in to the site in a browser window.",
"login": "Log in",

View File

@ -1023,28 +1023,6 @@ export class CoreLoginHelperProvider {
(!CoreConfigConstants.skipssoconfirmation || String(CoreConfigConstants.skipssoconfirmation) === 'false');
}
/**
* Show a modal warning the user that he should use the Classic app.
*
* @param {string} message The warning message.
*/
protected showLegacyNoticeModal(message: string): void {
let link;
if (this.appProvider.isWindows()) {
link = 'https://download.moodle.org/desktop/download.php?platform=windows&version=342';
} else if (this.appProvider.isLinux()) {
link = 'https://download.moodle.org/desktop/download.php?platform=linux&version=342&arch=' +
(this.appProvider.is64Bits() ? '64' : '32');
} else if (this.platform.is('android')) {
link = 'market://details?id=com.moodle.classic';
} else if (this.platform.is('ios')) {
link = 'itms-apps://itunes.apple.com/app/id1403448117';
}
this.showDownloadAppNoticeModal(message, link);
}
/**
* Show a modal warning the user that he should use the Workplace app.
*
@ -1225,8 +1203,6 @@ export class CoreLoginHelperProvider {
this.openChangePassword(siteUrl, this.textUtils.getErrorMessageFromError(error));
} else if (error.errorcode == 'usernotconfirmed') {
this.showNotConfirmedModal(siteUrl, undefined, username, password);
} else if (error.errorcode == 'legacymoodleversion') {
this.showLegacyNoticeModal(this.textUtils.getErrorMessageFromError(error));
} else if (error.errorcode == 'connecttomoodleapp') {
this.showMoodleAppNoticeModal(this.textUtils.getErrorMessageFromError(error));
} else if (error.errorcode == 'connecttoworkplaceapp') {

View File

@ -12,7 +12,7 @@
"areyousure": "Are you sure?",
"back": "Back",
"cancel": "Cancel",
"cannotconnect": "Cannot connect: Verify that you have correctly typed the URL and that your site uses Moodle 2.4 or later.",
"cannotconnect": "Cannot connect: Verify that you have correctly typed the URL and that your site uses Moodle 3.1 or later.",
"cannotdownloadfiles": "File downloading is disabled. Please contact your site administrator.",
"captureaudio": "Record audio",
"capturedimage": "Taken picture.",

View File

@ -247,7 +247,6 @@ export class CoreSitesProvider {
protected WORKPLACE_APP = 3;
protected MOODLE_APP = 2;
protected VALID_VERSION = 1;
protected LEGACY_APP_VERSION = 0;
protected INVALID_VERSION = -1;
protected isWPApp: boolean;
@ -690,25 +689,9 @@ export class CoreSitesProvider {
*/
protected treatInvalidAppVersion(result: number, siteUrl: string, siteId?: string): Promise<any> {
let errorCode,
errorKey,
errorExtra = '',
errorKeyParams;
errorKey;
switch (result) {
case this.LEGACY_APP_VERSION:
errorKey = 'core.login.legacymoodleversion';
errorCode = 'legacymoodleversion';
if (this.appProvider.isDesktop()) {
errorKey += 'desktop';
errorKeyParams = {$a: siteUrl};
}
if (this.appProvider.isWindows() || this.appProvider.isLinux()) {
errorExtra = this.translate.instant('core.login.legacymoodleversiondesktopdownloadold');
}
break;
case this.MOODLE_APP:
errorKey = 'core.login.connecttomoodleapp';
errorCode = 'connecttomoodleapp';
@ -732,7 +715,7 @@ export class CoreSitesProvider {
return promise.then(() => {
return Promise.reject({
error: this.translate.instant(errorKey, errorKeyParams) + errorExtra,
error: this.translate.instant(errorKey),
errorcode: errorCode,
loggedout: true
});
@ -779,16 +762,14 @@ export class CoreSitesProvider {
* Check for the minimum required version.
*
* @param {any} info Site info.
* @return {number} Either VALID_VERSION, LEGACY_APP_VERSION, WORKPLACE_APP, MOODLE_APP or INVALID_VERSION.
* @return {number} Either VALID_VERSION, WORKPLACE_APP, MOODLE_APP or INVALID_VERSION.
*/
protected isValidMoodleVersion(info: any): number {
if (!info) {
return this.INVALID_VERSION;
}
const version24 = 2012120300, // Moodle 2.4 version.
release24 = '2.4',
version31 = 2016052300,
const version31 = 2016052300,
release31 = '3.1';
// Try to validate by version.
@ -797,8 +778,6 @@ export class CoreSitesProvider {
if (!isNaN(version)) {
if (version >= version31) {
return this.validateWorkplaceVersion(info);
} else if (version >= version24) {
return this.LEGACY_APP_VERSION;
}
}
}
@ -809,9 +788,6 @@ export class CoreSitesProvider {
if (release >= release31) {
return this.validateWorkplaceVersion(info);
}
if (release >= release24) {
return this.LEGACY_APP_VERSION;
}
}
// Couldn't validate it.
@ -1556,9 +1532,10 @@ export class CoreSitesProvider {
*
* @param {any} info The site info.
* @return {boolean} Whether it's a legacy Moodle.
* @deprecated since 3.7.1
*/
isLegacyMoodleByInfo(info: any): boolean {
return this.isValidMoodleVersion(info) == this.LEGACY_APP_VERSION;
return false;
}
/**