From 4d5c18459c3bb03c2b9af1f57e4b1fb4b0da3de9 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Wed, 12 Apr 2023 13:08:22 +0200 Subject: [PATCH] MOBILE-4301 core: Drop core.sitenotfound string String dropped in favour of core.cannotconnect --- scripts/langindex.json | 1 - src/core/features/login/pages/site/site.ts | 6 +----- src/core/features/login/tests/behat/basic_usage.feature | 4 ++-- src/core/lang.json | 1 - src/core/services/utils/dom.ts | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/scripts/langindex.json b/scripts/langindex.json index ff29240d8..7d047dfb4 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -2395,7 +2395,6 @@ "core.sitehome.sitehome": "moodle", "core.sitehome.sitenews": "moodle", "core.sitemaintenance": "admin", - "core.sitenotfound": "local_moodlemobileapp", "core.sitenotfoundhelp": "local_moodlemobileapp", "core.siteunavailablehelp": "local_moodlemobileapp", "core.size": "moodle", diff --git a/src/core/features/login/pages/site/site.ts b/src/core/features/login/pages/site/site.ts index 2edce7904..b2dcde554 100644 --- a/src/core/features/login/pages/site/site.ts +++ b/src/core/features/login/pages/site/site.ts @@ -436,11 +436,7 @@ export class CoreLoginSitePage implements OnInit { ].filter(button => !!button); const alertElement = await CoreDomUtils.showAlertWithOptions({ - header: errorTitle ?? ( - siteExists - ? Translate.instant('core.cannotconnect') - : Translate.instant('core.sitenotfound') - ), + header: errorTitle ?? Translate.instant('core.cannotconnect'), message: errorMessage ?? Translate.instant('core.sitenotfoundhelp'), buttons: buttons as AlertButton[], }); diff --git a/src/core/features/login/tests/behat/basic_usage.feature b/src/core/features/login/tests/behat/basic_usage.feature index f7d7a55d1..c7421a7c1 100755 --- a/src/core/features/login/tests/behat/basic_usage.feature +++ b/src/core/features/login/tests/behat/basic_usage.feature @@ -45,7 +45,7 @@ Feature: Test basic usage of login in app When I launch the app And I set the field "Your site" to "wrongsiteaddress" in the app And I press "Connect to your site" in the app - Then I should find "Site not found" in the app + Then I should find "Can't connect to site" in the app Scenario: Add a non existing account from accounts switcher When I enter the app @@ -56,7 +56,7 @@ Feature: Test basic usage of login in app And I wait the app to restart And I set the field "Your site" to "wrongsiteaddress" in the app And I press "Connect to your site" in the app - Then I should find "Site not found" in the app + Then I should find "Can't connect to site" in the app Scenario: Log out from the app Given I entered the app as "student1" diff --git a/src/core/lang.json b/src/core/lang.json index c432d45d7..df0f2b72f 100644 --- a/src/core/lang.json +++ b/src/core/lang.json @@ -283,7 +283,6 @@ "showmore": "Show more...", "site": "Site", "sitemaintenance": "The site is undergoing maintenance and is currently not available", - "sitenotfound": "Site not found", "sitenotfoundhelp": "We can't find the site you entered. Please check for typos or try again later. If you keep seeing this message, contact your school or learning provider.", "siteunavailablehelp": "The site \"{{site}}\" is not available right now. Please try again later or contact your school or learning provider.", "size": "Size", diff --git a/src/core/services/utils/dom.ts b/src/core/services/utils/dom.ts index 57f430892..8ed22d9ce 100644 --- a/src/core/services/utils/dom.ts +++ b/src/core/services/utils/dom.ts @@ -1369,7 +1369,7 @@ export class CoreDomUtilsProvider { if (typeof error !== 'string' && 'title' in error && error.title) { alertOptions.header = error.title || undefined; } else if (message === Translate.instant('core.sitenotfoundhelp')) { - alertOptions.header = Translate.instant('core.sitenotfound'); + alertOptions.header = Translate.instant('core.cannotconnect'); } else if (this.isSiteUnavailableError(message)) { alertOptions.header = CoreSites.isLoggedIn() ? Translate.instant('core.connectionlost')