Compare commits
	
		
			No commits in common. "44a6d1747f94bdff767dd6ebdc32b917000b5631" and "11753a420f4b736a68b14770032c04436d45ca9f" have entirely different histories.
		
	
	
		
			44a6d1747f
			...
			11753a420f
		
	
		
							
								
								
									
										2
									
								
								.github/workflows/testing.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/testing.yml
									
									
									
									
										vendored
									
									
								
							| @ -69,7 +69,7 @@ jobs: | |||||||
|         cat circular-dependencies |         cat circular-dependencies | ||||||
|         lines=$(cat circular-dependencies | wc -l) |         lines=$(cat circular-dependencies | wc -l) | ||||||
|         echo "Total circular dependencies: $lines" |         echo "Total circular dependencies: $lines" | ||||||
|         test $lines -eq 93 |         test $lines -eq 90 | ||||||
|     - name: JavaScript code compatibility |     - name: JavaScript code compatibility | ||||||
|       run: | |       run: | | ||||||
|         npx check-es-compat www/*.js --polyfills="\{Array,String,TypedArray\}.prototype.at,Object.hasOwn" |         npx check-es-compat www/*.js --polyfills="\{Array,String,TypedArray\}.prototype.at,Object.hasOwn" | ||||||
|  | |||||||
							
								
								
									
										13
									
								
								config.xml
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								config.xml
									
									
									
									
									
								
							| @ -1,9 +1,8 @@ | |||||||
| <?xml version='1.0' encoding='utf-8'?> | <?xml version='1.0' encoding='utf-8'?> | ||||||
| <widget android-packageName="com.vmeda.online" android-versionCode="50000" id="com.vmeda.online" ios-CFBundleVersion="5.0.0.0" version="5.0.0" versionCode="50000" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0"> | <widget android-versionCode="50000" id="com.moodle.moodlemobile" ios-CFBundleVersion="5.0.0.0" version="5.0.0" versionCode="50000" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0"> | ||||||
|     <name>ВМедА Онлайн</name> |     <name>Moodle</name> | ||||||
|     <description>ВМедА Онлайн</description> |     <description>Moodle official app</description> | ||||||
|     <icon src="resources/android/icon/logo.png" /> |     <author email="mobile@moodle.com" href="http://moodle.com">Moodle Mobile team</author> | ||||||
|     <author email="mobile@vmeda.org" href="https://online.vmeda.org">Военная Медицинская Академия им. Кирова</author> |  | ||||||
|     <content src="index.html" /> |     <content src="index.html" /> | ||||||
|     <access origin="*" /> |     <access origin="*" /> | ||||||
|     <access launch-external="yes" origin="tel:*" /> |     <access launch-external="yes" origin="tel:*" /> | ||||||
| @ -63,6 +62,10 @@ | |||||||
|         <preference name="AndroidWindowSplashScreenBackground" value="#FFFFFF" /> |         <preference name="AndroidWindowSplashScreenBackground" value="#FFFFFF" /> | ||||||
|         <preference name="AndroidWindowSplashScreenIconBackgroundColor" value="#FFFFFF" /> |         <preference name="AndroidWindowSplashScreenIconBackgroundColor" value="#FFFFFF" /> | ||||||
|         <resource-file src="google-services.json" target="app/google-services.json" /> |         <resource-file src="google-services.json" target="app/google-services.json" /> | ||||||
|  |         <resource-file src="resources/android/icon/drawable-ldpi-smallicon.png" target="app/src/main/res/mipmap-ldpi/smallicon.png" /> | ||||||
|  |         <resource-file src="resources/android/icon/drawable-mdpi-smallicon.png" target="app/src/main/res/mipmap-mdpi/smallicon.png" /> | ||||||
|  |         <resource-file src="resources/android/icon/drawable-hdpi-smallicon.png" target="app/src/main/res/mipmap-hdpi/smallicon.png" /> | ||||||
|  |         <resource-file src="resources/android/icon/drawable-xhdpi-smallicon.png" target="app/src/main/res/mipmap-xhdpi/smallicon.png" /> | ||||||
|         <resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" /> |         <resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" /> | ||||||
|         <resource-file src="resources/android/xml/backup_rules.xml" target="app/src/main/res/xml/backup_rules.xml" /> |         <resource-file src="resources/android/xml/backup_rules.xml" target="app/src/main/res/xml/backup_rules.xml" /> | ||||||
|         <edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application"> |         <edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application"> | ||||||
|  | |||||||
| @ -10,7 +10,7 @@ | |||||||
|       "client_info": { |       "client_info": { | ||||||
|         "mobilesdk_app_id": "1:111111111111:android:1111111111111111", |         "mobilesdk_app_id": "1:111111111111:android:1111111111111111", | ||||||
|         "android_client_info": { |         "android_client_info": { | ||||||
|           "package_name": "com.vmeda.online" |           "package_name": "com.moodle.moodlemobile" | ||||||
|         } |         } | ||||||
|       }, |       }, | ||||||
|       "oauth_client": [ |       "oauth_client": [ | ||||||
| @ -42,4 +42,4 @@ | |||||||
|     } |     } | ||||||
|   ], |   ], | ||||||
|   "configuration_version": "1" |   "configuration_version": "1" | ||||||
| } | } | ||||||
| @ -1,5 +1,5 @@ | |||||||
| { | { | ||||||
|   "name": "vmedaonline", |   "name": "moodlemobile", | ||||||
|   "integrations": { |   "integrations": { | ||||||
|     "cordova": {} |     "cordova": {} | ||||||
|   }, |   }, | ||||||
|  | |||||||
| @ -1,16 +1,71 @@ | |||||||
| { | { | ||||||
|     "app_id": "com.vmeda.online", |     "app_id": "com.moodle.moodlemobile", | ||||||
|     "appname": "ВМедА Онлайн", |     "appname": "Moodle Mobile", | ||||||
|     "versioncode": 50000, |     "versioncode": 50000, | ||||||
|     "versionname": "5.0.0", |     "versionname": "5.0.0", | ||||||
|     "cache_update_frequency_usually": 420000, |     "cache_update_frequency_usually": 420000, | ||||||
|     "cache_update_frequency_often": 1200000, |     "cache_update_frequency_often": 1200000, | ||||||
|     "cache_update_frequency_sometimes": 3600000, |     "cache_update_frequency_sometimes": 3600000, | ||||||
|     "cache_update_frequency_rarely": 43200000, |     "cache_update_frequency_rarely": 43200000, | ||||||
|     "default_lang": "ru", |     "default_lang": "en", | ||||||
|     "languages": { |     "languages": { | ||||||
|  |         "af": "Afrikaans", | ||||||
|  |         "ar": "العربية", | ||||||
|  |         "az": "Azərbaycanca", | ||||||
|  |         "bg": "Български", | ||||||
|  |         "ca": "Català", | ||||||
|  |         "cs": "Čeština", | ||||||
|  |         "da": "Dansk", | ||||||
|  |         "de": "Deutsch", | ||||||
|  |         "de-du": "Deutsch (du)", | ||||||
|  |         "el": "Ελληνικά", | ||||||
|         "en": "English", |         "en": "English", | ||||||
|         "ru": "Русский" |         "en-us": "English (United States)", | ||||||
|  |         "es": "Español - Internacional", | ||||||
|  |         "es-mx": "Español - México", | ||||||
|  |         "eu": "Euskara", | ||||||
|  |         "fa": "فارسی", | ||||||
|  |         "fi": "Suomi", | ||||||
|  |         "fr": "Français", | ||||||
|  |         "gl": "Galego", | ||||||
|  |         "he": "עברית", | ||||||
|  |         "hi": "हिंदी", | ||||||
|  |         "hr": "Hrvatski", | ||||||
|  |         "hsb": "Hornjoserbsce", | ||||||
|  |         "hu": "magyar", | ||||||
|  |         "hy": "Հայերեն", | ||||||
|  |         "id": "Bahasa Indonesia", | ||||||
|  |         "it": "Italiano", | ||||||
|  |         "ja": "日本語", | ||||||
|  |         "km": "ខ្មែរ", | ||||||
|  |         "kn": "ಕನ್ನಡ", | ||||||
|  |         "ko": "한국어", | ||||||
|  |         "lo": "ລາວ", | ||||||
|  |         "lt": "Lietuvių", | ||||||
|  |         "lv": "Latviešu", | ||||||
|  |         "mn": "Монгол", | ||||||
|  |         "mr": "मराठी", | ||||||
|  |         "nl": "Nederlands", | ||||||
|  |         "no": "Norsk", | ||||||
|  |         "pl": "Polski", | ||||||
|  |         "ps": "لیسي", | ||||||
|  |         "pt": "Português - Portugal", | ||||||
|  |         "pt-br": "Português - Brasil", | ||||||
|  |         "ro": "Română", | ||||||
|  |         "ru": "Русский", | ||||||
|  |         "sl": "Slovenščina", | ||||||
|  |         "sq": "Shqip", | ||||||
|  |         "sr-cr": "Српски", | ||||||
|  |         "sr-lt": "Srpski", | ||||||
|  |         "sv": "Svenska", | ||||||
|  |         "szl": "Ślōnski", | ||||||
|  |         "tg": "Тоҷикӣ", | ||||||
|  |         "tr": "Türkçe", | ||||||
|  |         "uk": "Українська", | ||||||
|  |         "uz": "O'zbekcha", | ||||||
|  |         "vi": "Vietnamese", | ||||||
|  |         "zh-cn": "简体中文", | ||||||
|  |         "zh-tw": "正體中文" | ||||||
|     }, |     }, | ||||||
|     "wsservice": "moodle_mobile_app", |     "wsservice": "moodle_mobile_app", | ||||||
|     "demo_sites": { |     "demo_sites": { | ||||||
| @ -32,15 +87,13 @@ | |||||||
|         "high": 120 |         "high": 120 | ||||||
|     }, |     }, | ||||||
|     "customurlscheme": "moodlemobile", |     "customurlscheme": "moodlemobile", | ||||||
|     "sites": [{ |     "sites": [], | ||||||
|         "url": "https://online.vmeda.org" |  | ||||||
|     }], |  | ||||||
|     "multisitesdisplay": "", |     "multisitesdisplay": "", | ||||||
|     "sitefindersettings": {}, |     "sitefindersettings": {}, | ||||||
|     "onlyallowlistedsites": false, |     "onlyallowlistedsites": false, | ||||||
|     "forcedefaultlanguage": false, |     "forcedefaultlanguage": false, | ||||||
|     "privacypolicy": "https://moodle.net/moodle-app-privacy/", |     "privacypolicy": "https://moodle.net/moodle-app-privacy/", | ||||||
|     "notificoncolor": "#007aff", |     "notificoncolor": "#f98012", | ||||||
|     "enableanalytics": false, |     "enableanalytics": false, | ||||||
|     "enableonboarding": true, |     "enableonboarding": true, | ||||||
|     "forceColorScheme": "", |     "forceColorScheme": "", | ||||||
| @ -48,7 +101,7 @@ | |||||||
|     "showTopLogo": "hidden", |     "showTopLogo": "hidden", | ||||||
|     "ioswebviewscheme": "moodleappfs", |     "ioswebviewscheme": "moodleappfs", | ||||||
|     "appstores": { |     "appstores": { | ||||||
|         "android": "com.vmeda.online", |         "android": "com.moodle.moodlemobile", | ||||||
|         "ios": "id633359593" |         "ios": "id633359593" | ||||||
|     }, |     }, | ||||||
|     "wsrequestqueuelimit": 10, |     "wsrequestqueuelimit": 10, | ||||||
|  | |||||||
							
								
								
									
										8442
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										8442
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										16
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								package.json
									
									
									
									
									
								
							| @ -72,7 +72,7 @@ | |||||||
|         "@awesome-cordova-plugins/sqlite": "^6.9.0", |         "@awesome-cordova-plugins/sqlite": "^6.9.0", | ||||||
|         "@awesome-cordova-plugins/status-bar": "^6.9.0", |         "@awesome-cordova-plugins/status-bar": "^6.9.0", | ||||||
|         "@awesome-cordova-plugins/web-intent": "^6.9.0", |         "@awesome-cordova-plugins/web-intent": "^6.9.0", | ||||||
|         "@ionic/angular": "^8.4.1", |         "@ionic/angular": "^8.3.1", | ||||||
|         "@ionic/cordova-builders": "^11.0.0", |         "@ionic/cordova-builders": "^11.0.0", | ||||||
|         "@moodlehq/cordova-plugin-advanced-http": "3.3.1-moodle.1", |         "@moodlehq/cordova-plugin-advanced-http": "3.3.1-moodle.1", | ||||||
|         "@moodlehq/cordova-plugin-camera": "7.0.0-moodle.1", |         "@moodlehq/cordova-plugin-camera": "7.0.0-moodle.1", | ||||||
| @ -81,7 +81,6 @@ | |||||||
|         "@moodlehq/cordova-plugin-inappbrowser": "6.0.0-moodle.1", |         "@moodlehq/cordova-plugin-inappbrowser": "6.0.0-moodle.1", | ||||||
|         "@moodlehq/cordova-plugin-intent": "2.2.0-moodle.3", |         "@moodlehq/cordova-plugin-intent": "2.2.0-moodle.3", | ||||||
|         "@moodlehq/cordova-plugin-ionic-webview": "5.0.0-moodle.5", |         "@moodlehq/cordova-plugin-ionic-webview": "5.0.0-moodle.5", | ||||||
|         "@moodlehq/cordova-plugin-media-capture": "5.0.0-moodle.1", |  | ||||||
|         "@moodlehq/cordova-plugin-qrscanner": "3.0.1-moodle.5", |         "@moodlehq/cordova-plugin-qrscanner": "3.0.1-moodle.5", | ||||||
|         "@moodlehq/cordova-plugin-statusbar": "4.0.0-moodle.3", |         "@moodlehq/cordova-plugin-statusbar": "4.0.0-moodle.3", | ||||||
|         "@moodlehq/cordova-plugin-zip": "3.1.0-moodle.1", |         "@moodlehq/cordova-plugin-zip": "3.1.0-moodle.1", | ||||||
| @ -94,7 +93,7 @@ | |||||||
|         "@types/dom-mediacapture-record": "1.0.7", |         "@types/dom-mediacapture-record": "1.0.7", | ||||||
|         "chart.js": "^2.9.4", |         "chart.js": "^2.9.4", | ||||||
|         "cordova": "^12.0.0", |         "cordova": "^12.0.0", | ||||||
|         "cordova-android": "13.0.0", |         "cordova-android": "^13.0.0", | ||||||
|         "cordova-clipboard": "^1.3.0", |         "cordova-clipboard": "^1.3.0", | ||||||
|         "cordova-ios": "^7.1.1", |         "cordova-ios": "^7.1.1", | ||||||
|         "cordova-plugin-add-swift-support": "^2.0.2", |         "cordova-plugin-add-swift-support": "^2.0.2", | ||||||
| @ -107,6 +106,7 @@ | |||||||
|         "cordova-plugin-geolocation": "^5.0.0", |         "cordova-plugin-geolocation": "^5.0.0", | ||||||
|         "cordova-plugin-ionic-keyboard": "^2.2.0", |         "cordova-plugin-ionic-keyboard": "^2.2.0", | ||||||
|         "cordova-plugin-local-notification": "1.0.0", |         "cordova-plugin-local-notification": "1.0.0", | ||||||
|  |         "cordova-plugin-media-capture": "^5.0.0", | ||||||
|         "cordova-plugin-network-information": "^3.0.0", |         "cordova-plugin-network-information": "^3.0.0", | ||||||
|         "cordova-plugin-prevent-override": "^1.0.1", |         "cordova-plugin-prevent-override": "^1.0.1", | ||||||
|         "cordova-plugin-screen-orientation": "^3.0.4", |         "cordova-plugin-screen-orientation": "^3.0.4", | ||||||
| @ -182,12 +182,12 @@ | |||||||
|         "vinyl": "^3.0.0" |         "vinyl": "^3.0.0" | ||||||
|     }, |     }, | ||||||
|     "engines": { |     "engines": { | ||||||
|         "node": ">=v20.18 <21" |         "node": ">=18.18.2 <19" | ||||||
|     }, |     }, | ||||||
|     "cordova": { |     "cordova": { | ||||||
|         "platforms": [ |         "platforms": [ | ||||||
|             "ios", |             "android", | ||||||
|             "android" |             "ios" | ||||||
|         ], |         ], | ||||||
|         "plugins": { |         "plugins": { | ||||||
|             "@moodlehq/cordova-plugin-advanced-http": { |             "@moodlehq/cordova-plugin-advanced-http": { | ||||||
| @ -201,7 +201,6 @@ | |||||||
|             "@moodlehq/cordova-plugin-inappbrowser": {}, |             "@moodlehq/cordova-plugin-inappbrowser": {}, | ||||||
|             "@moodlehq/cordova-plugin-intent": {}, |             "@moodlehq/cordova-plugin-intent": {}, | ||||||
|             "@moodlehq/cordova-plugin-ionic-webview": {}, |             "@moodlehq/cordova-plugin-ionic-webview": {}, | ||||||
|             "@moodlehq/cordova-plugin-media-capture": {}, |  | ||||||
|             "@moodlehq/cordova-plugin-qrscanner": {}, |             "@moodlehq/cordova-plugin-qrscanner": {}, | ||||||
|             "@moodlehq/cordova-plugin-statusbar": {}, |             "@moodlehq/cordova-plugin-statusbar": {}, | ||||||
|             "@moodlehq/cordova-plugin-zip": {}, |             "@moodlehq/cordova-plugin-zip": {}, | ||||||
| @ -228,6 +227,7 @@ | |||||||
|             "cordova-plugin-local-notification": { |             "cordova-plugin-local-notification": { | ||||||
|                 "ANDROID_SUPPORT_V4_VERSION": "26.+" |                 "ANDROID_SUPPORT_V4_VERSION": "26.+" | ||||||
|             }, |             }, | ||||||
|  |             "cordova-plugin-media-capture": {}, | ||||||
|             "cordova-plugin-moodleapp": {}, |             "cordova-plugin-moodleapp": {}, | ||||||
|             "cordova-plugin-network-information": {}, |             "cordova-plugin-network-information": {}, | ||||||
|             "cordova-plugin-prevent-override": {}, |             "cordova-plugin-prevent-override": {}, | ||||||
| @ -238,4 +238,4 @@ | |||||||
|             "nl.kingsquare.cordova.background-audio": {} |             "nl.kingsquare.cordova.background-audio": {} | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| diff --git a/node_modules/@ionic/core/components/popover.js b/node_modules/@ionic/core/components/popover.js
 | diff --git a/node_modules/@ionic/core/components/popover.js b/node_modules/@ionic/core/components/popover.js
 | ||||||
| index 394d7e6..1f36f24 100644
 | index ec31d43..6be0b28 100644
 | ||||||
| --- a/node_modules/@ionic/core/components/popover.js
 | --- a/node_modules/@ionic/core/components/popover.js
 | ||||||
| +++ b/node_modules/@ionic/core/components/popover.js
 | +++ b/node_modules/@ionic/core/components/popover.js
 | ||||||
| @@ -763,8 +763,10 @@ const iosEnterAnimation = (baseEl, opts) => {
 | @@ -763,8 +763,10 @@ const iosEnterAnimation = (baseEl, opts) => {
 | ||||||
| @ -29,7 +29,7 @@ index 394d7e6..1f36f24 100644 | |||||||
|      const contentEl = root.querySelector('.popover-content'); |      const contentEl = root.querySelector('.popover-content'); | ||||||
|      const referenceSizeEl = trigger || ((_a = ev === null || ev === void 0 ? void 0 : ev.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (ev === null || ev === void 0 ? void 0 : ev.target); |      const referenceSizeEl = trigger || ((_a = ev === null || ev === void 0 ? void 0 : ev.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (ev === null || ev === void 0 ? void 0 : ev.target); | ||||||
| diff --git a/node_modules/@ionic/core/dist/cjs/ion-popover.cjs.entry.js b/node_modules/@ionic/core/dist/cjs/ion-popover.cjs.entry.js
 | diff --git a/node_modules/@ionic/core/dist/cjs/ion-popover.cjs.entry.js b/node_modules/@ionic/core/dist/cjs/ion-popover.cjs.entry.js
 | ||||||
| index 004effa..84389bf 100644
 | index 2e169dc..ddd9daa 100644
 | ||||||
| --- a/node_modules/@ionic/core/dist/cjs/ion-popover.cjs.entry.js
 | --- a/node_modules/@ionic/core/dist/cjs/ion-popover.cjs.entry.js
 | ||||||
| +++ b/node_modules/@ionic/core/dist/cjs/ion-popover.cjs.entry.js
 | +++ b/node_modules/@ionic/core/dist/cjs/ion-popover.cjs.entry.js
 | ||||||
| @@ -769,8 +769,10 @@ const iosEnterAnimation = (baseEl, opts) => {
 | @@ -769,8 +769,10 @@ const iosEnterAnimation = (baseEl, opts) => {
 | ||||||
| @ -93,7 +93,7 @@ index 603923a..ff10a25 100644 | |||||||
|      const contentEl = root.querySelector('.popover-content'); |      const contentEl = root.querySelector('.popover-content'); | ||||||
|      const referenceSizeEl = trigger || ((_a = ev === null || ev === void 0 ? void 0 : ev.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (ev === null || ev === void 0 ? void 0 : ev.target); |      const referenceSizeEl = trigger || ((_a = ev === null || ev === void 0 ? void 0 : ev.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (ev === null || ev === void 0 ? void 0 : ev.target); | ||||||
| diff --git a/node_modules/@ionic/core/dist/esm/ion-popover.entry.js b/node_modules/@ionic/core/dist/esm/ion-popover.entry.js
 | diff --git a/node_modules/@ionic/core/dist/esm/ion-popover.entry.js b/node_modules/@ionic/core/dist/esm/ion-popover.entry.js
 | ||||||
| index 9b06217..70b4015 100644
 | index a88d216..bc09959 100644
 | ||||||
| --- a/node_modules/@ionic/core/dist/esm/ion-popover.entry.js
 | --- a/node_modules/@ionic/core/dist/esm/ion-popover.entry.js
 | ||||||
| +++ b/node_modules/@ionic/core/dist/esm/ion-popover.entry.js
 | +++ b/node_modules/@ionic/core/dist/esm/ion-popover.entry.js
 | ||||||
| @@ -765,8 +765,10 @@ const iosEnterAnimation = (baseEl, opts) => {
 | @@ -765,8 +765,10 @@ const iosEnterAnimation = (baseEl, opts) => {
 | ||||||
| @ -123,10 +123,10 @@ index 9b06217..70b4015 100644 | |||||||
|      const contentEl = root.querySelector('.popover-content'); |      const contentEl = root.querySelector('.popover-content'); | ||||||
|      const referenceSizeEl = trigger || ((_a = ev === null || ev === void 0 ? void 0 : ev.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (ev === null || ev === void 0 ? void 0 : ev.target); |      const referenceSizeEl = trigger || ((_a = ev === null || ev === void 0 ? void 0 : ev.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (ev === null || ev === void 0 ? void 0 : ev.target); | ||||||
| diff --git a/node_modules/@ionic/core/hydrate/index.js b/node_modules/@ionic/core/hydrate/index.js
 | diff --git a/node_modules/@ionic/core/hydrate/index.js b/node_modules/@ionic/core/hydrate/index.js
 | ||||||
| index c3d2d8e..bc40d4f 100644
 | index 06501b6..a6ee24e 100644
 | ||||||
| --- a/node_modules/@ionic/core/hydrate/index.js
 | --- a/node_modules/@ionic/core/hydrate/index.js
 | ||||||
| +++ b/node_modules/@ionic/core/hydrate/index.js
 | +++ b/node_modules/@ionic/core/hydrate/index.js
 | ||||||
| @@ -23882,8 +23882,10 @@ const iosEnterAnimation$1 = (baseEl, opts) => {
 | @@ -23747,8 +23747,10 @@ const iosEnterAnimation$1 = (baseEl, opts) => {
 | ||||||
|      const { event: ev, size, trigger, reference, side, align } = opts; |      const { event: ev, size, trigger, reference, side, align } = opts; | ||||||
|      const doc = baseEl.ownerDocument; |      const doc = baseEl.ownerDocument; | ||||||
|      const isRTL = doc.dir === 'rtl'; |      const isRTL = doc.dir === 'rtl'; | ||||||
| @ -139,7 +139,7 @@ index c3d2d8e..bc40d4f 100644 | |||||||
|      const root = getElementRoot(baseEl); |      const root = getElementRoot(baseEl); | ||||||
|      const contentEl = root.querySelector('.popover-content'); |      const contentEl = root.querySelector('.popover-content'); | ||||||
|      const arrowEl = root.querySelector('.popover-arrow'); |      const arrowEl = root.querySelector('.popover-arrow'); | ||||||
| @@ -24003,8 +24005,10 @@ const mdEnterAnimation$1 = (baseEl, opts) => {
 | @@ -23868,8 +23870,10 @@ const mdEnterAnimation$1 = (baseEl, opts) => {
 | ||||||
|      const { event: ev, size, trigger, reference, side, align } = opts; |      const { event: ev, size, trigger, reference, side, align } = opts; | ||||||
|      const doc = baseEl.ownerDocument; |      const doc = baseEl.ownerDocument; | ||||||
|      const isRTL = doc.dir === 'rtl'; |      const isRTL = doc.dir === 'rtl'; | ||||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 20 KiB | 
| @ -1561,9 +1561,9 @@ | |||||||
|   "core.completion-alt-manual-n-override": "completion", |   "core.completion-alt-manual-n-override": "completion", | ||||||
|   "core.completion-alt-manual-y": "completion", |   "core.completion-alt-manual-y": "completion", | ||||||
|   "core.completion-alt-manual-y-override": "completion", |   "core.completion-alt-manual-y-override": "completion", | ||||||
|  |   "core.confirmcanceledit": "local_moodlemobileapp", | ||||||
|   "core.confirmdeletefile": "repository", |   "core.confirmdeletefile": "repository", | ||||||
|   "core.confirmleavepagedescription": "local_moodlemobileapp", |   "core.confirmleaveunknownchanges": "local_moodlemobileapp", | ||||||
|   "core.confirmleavepagetitle": "local_moodlemobileapp", |  | ||||||
|   "core.confirmloss": "local_moodlemobileapp", |   "core.confirmloss": "local_moodlemobileapp", | ||||||
|   "core.confirmopeninbrowser": "local_moodlemobileapp", |   "core.confirmopeninbrowser": "local_moodlemobileapp", | ||||||
|   "core.confirmremoveselectedfile": "local_moodlemobileapp", |   "core.confirmremoveselectedfile": "local_moodlemobileapp", | ||||||
| @ -2091,7 +2091,6 @@ | |||||||
|   "core.lastmodified": "moodle", |   "core.lastmodified": "moodle", | ||||||
|   "core.lastsync": "local_moodlemobileapp", |   "core.lastsync": "local_moodlemobileapp", | ||||||
|   "core.layoutgrid": "workshopform_rubric", |   "core.layoutgrid": "workshopform_rubric", | ||||||
|   "core.leave": "local_moodlemobileapp", |  | ||||||
|   "core.list": "moodle", |   "core.list": "moodle", | ||||||
|   "core.listsep": "langconfig", |   "core.listsep": "langconfig", | ||||||
|   "core.loading": "moodle", |   "core.loading": "moodle", | ||||||
|  | |||||||
| @ -13,13 +13,13 @@ | |||||||
| // limitations under the License.
 | // limitations under the License.
 | ||||||
| 
 | 
 | ||||||
| import { Component, OnInit } from '@angular/core'; | import { Component, OnInit } from '@angular/core'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { ActivatedRoute } from '@angular/router'; | import { ActivatedRoute } from '@angular/router'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { AddonBadges, AddonBadgesBadgeClass } from '../../services/badges'; | import { AddonBadges, AddonBadgesBadgeClass } from '../../services/badges'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays a badge class. |  * Page that displays a badge class. | ||||||
| @ -71,7 +71,7 @@ export class AddonBadgesBadgeClassPage implements OnInit { | |||||||
| 
 | 
 | ||||||
|             this.logView(this.badge); |             this.logView(this.badge); | ||||||
|         } catch (message) { |         } catch (message) { | ||||||
|             CoreAlerts.showError(message, { default: 'Error getting badge data.' }); |             CoreDomUtils.showErrorModalDefault(message, 'Error getting badge data.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -14,6 +14,7 @@ | |||||||
| 
 | 
 | ||||||
| import { Component, OnDestroy, OnInit } from '@angular/core'; | import { Component, OnDestroy, OnInit } from '@angular/core'; | ||||||
| import { CoreTimeUtils } from '@services/utils/time'; | import { CoreTimeUtils } from '@services/utils/time'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
| import { CoreUser } from '@features/user/services/user'; | import { CoreUser } from '@features/user/services/user'; | ||||||
| import { AddonBadges, AddonBadgesUserBadge } from '../../services/badges'; | import { AddonBadges, AddonBadgesUserBadge } from '../../services/badges'; | ||||||
| @ -27,7 +28,6 @@ import { CoreRoutedItemsManagerSourcesTracker } from '@classes/items-management/ | |||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreSharedModule } from '@/core/shared.module'; | import { CoreSharedModule } from '@/core/shared.module'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays an issued badge. |  * Page that displays an issued badge. | ||||||
| @ -141,7 +141,7 @@ export class AddonBadgesIssuedBadgePage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             this.logView(badge); |             this.logView(badge); | ||||||
|         } catch (message) { |         } catch (message) { | ||||||
|             CoreAlerts.showError(message, { default: 'Error getting badge data.' }); |             CoreDomUtils.showErrorModalDefault(message, 'Error getting badge data.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -15,6 +15,7 @@ | |||||||
| import { AfterViewInit, Component, OnDestroy, ViewChild } from '@angular/core'; | import { AfterViewInit, Component, OnDestroy, ViewChild } from '@angular/core'; | ||||||
| import { AddonBadges, AddonBadgesUserBadge } from '../../services/badges'; | import { AddonBadges, AddonBadgesUserBadge } from '../../services/badges'; | ||||||
| import { CoreTimeUtils } from '@services/utils/time'; | import { CoreTimeUtils } from '@services/utils/time'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreSplitViewComponent } from '@components/split-view/split-view'; | import { CoreSplitViewComponent } from '@components/split-view/split-view'; | ||||||
| @ -25,7 +26,6 @@ import { CoreRoutedItemsManagerSourcesTracker } from '@classes/items-management/ | |||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the list of calendar events. |  * Page that displays the list of calendar events. | ||||||
| @ -112,7 +112,7 @@ export class AddonBadgesUserBadgesPage implements AfterViewInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (message) { |         } catch (message) { | ||||||
|             CoreAlerts.showError(message, { default: 'Error loading badges' }); |             CoreDomUtils.showErrorModalDefault(message, 'Error loading badges'); | ||||||
| 
 | 
 | ||||||
|             this.badges.reset(); |             this.badges.reset(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -27,6 +27,7 @@ import { CoreCourseOptionsDelegate } from '@features/course/services/course-opti | |||||||
| import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component'; | import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component'; | ||||||
| import { CoreSite } from '@classes/sites/site'; | import { CoreSite } from '@classes/sites/site'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreText } from '@singletons/text'; | import { CoreText } from '@singletons/text'; | ||||||
| import { AddonCourseCompletion } from '@addons/coursecompletion/services/coursecompletion'; | import { AddonCourseCompletion } from '@addons/coursecompletion/services/coursecompletion'; | ||||||
| import { IonSearchbar } from '@ionic/angular'; | import { IonSearchbar } from '@ionic/angular'; | ||||||
| @ -42,8 +43,6 @@ import { | |||||||
|     CORE_COURSES_STATE_FAVOURITE, |     CORE_COURSES_STATE_FAVOURITE, | ||||||
|     CORE_COURSES_STATE_HIDDEN, |     CORE_COURSES_STATE_HIDDEN, | ||||||
| } from '@features/courses/constants'; | } from '@features/courses/constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| import { Translate } from '@singletons'; |  | ||||||
| 
 | 
 | ||||||
| const FILTER_PRIORITY: AddonBlockMyOverviewTimeFilters[] = | const FILTER_PRIORITY: AddonBlockMyOverviewTimeFilters[] = | ||||||
|     ['all', 'inprogress', 'future', 'past', 'favourite', 'allincludinghidden', 'hidden', 'custom']; |     ['all', 'inprogress', 'future', 'past', 'favourite', 'allincludinghidden', 'hidden', 'custom']; | ||||||
| @ -505,7 +504,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|             await CoreCourseHelper.prefetchCourses(this.filteredCourses, this.prefetchCoursesData); |             await CoreCourseHelper.prefetchCourses(this.filteredCourses, this.prefetchCoursesData); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             if (!this.isDestroyed) { |             if (!this.isDestroyed) { | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('core.course.errordownloadingcourse') }); |                 CoreDomUtils.showErrorModalDefault(error, 'core.course.errordownloadingcourse', true); | ||||||
|                 this.prefetchCoursesData.icon = initialIcon; |                 this.prefetchCoursesData.icon = initialIcon; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @ -567,7 +566,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem | |||||||
|                         throw error; // Pass the error to the caller so it's treated there.
 |                         throw error; // Pass the error to the caller so it's treated there.
 | ||||||
|                     } |                     } | ||||||
| 
 | 
 | ||||||
|                     CoreAlerts.showError(error, { default: this.fetchContentDefaultError }); |                     CoreDomUtils.showErrorModalDefault(error, this.fetchContentDefaultError); | ||||||
|                 } finally { |                 } finally { | ||||||
|                     if (!alreadyLoading) { |                     if (!alreadyLoading) { | ||||||
|                         // Only set loaded to true if there was no other data being loaded.
 |                         // Only set loaded to true if there was no other data being loaded.
 | ||||||
|  | |||||||
| @ -20,7 +20,7 @@ import { | |||||||
|     AddonBlockRecentlyAccessedItemsItemCalculatedData, |     AddonBlockRecentlyAccessedItemsItemCalculatedData, | ||||||
| } from '../../services/recentlyaccesseditems'; | } from '../../services/recentlyaccesseditems'; | ||||||
| import { CoreText } from '@singletons/text'; | import { CoreText } from '@singletons/text'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreUtils } from '@singletons/utils'; | import { CoreUtils } from '@singletons/utils'; | ||||||
| import { CoreSharedModule } from '@/core/shared.module'; | import { CoreSharedModule } from '@/core/shared.module'; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -14,7 +14,7 @@ | |||||||
| 
 | 
 | ||||||
| import { Component, Input, Output, EventEmitter, OnInit, HostBinding } from '@angular/core'; | import { Component, Input, Output, EventEmitter, OnInit, HostBinding } from '@angular/core'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreText } from '@singletons/text'; | import { CoreText } from '@singletons/text'; | ||||||
| import { CoreEnrolledCourseDataWithOptions } from '@features/courses/services/courses-helper'; | import { CoreEnrolledCourseDataWithOptions } from '@features/courses/services/courses-helper'; | ||||||
| import { AddonBlockTimelineDayEvents } from '@addons/block/timeline/classes/section'; | import { AddonBlockTimelineDayEvents } from '@addons/block/timeline/classes/section'; | ||||||
|  | |||||||
| @ -17,6 +17,7 @@ import { CoreSites } from '@services/sites'; | |||||||
| import { ICoreBlockComponent } from '@features/block/classes/base-block-component'; | import { ICoreBlockComponent } from '@features/block/classes/base-block-component'; | ||||||
| import { AddonBlockTimeline } from '../../services/timeline'; | import { AddonBlockTimeline } from '../../services/timeline'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreCoursesHelper, CoreEnrolledCourseDataWithOptions } from '@features/courses/services/courses-helper'; | import { CoreCoursesHelper, CoreEnrolledCourseDataWithOptions } from '@features/courses/services/courses-helper'; | ||||||
| import { CoreCourses } from '@features/courses/services/courses'; | import { CoreCourses } from '@features/courses/services/courses'; | ||||||
| import { CoreCourseOptionsDelegate } from '@features/course/services/course-options-delegate'; | import { CoreCourseOptionsDelegate } from '@features/course/services/course-options-delegate'; | ||||||
| @ -29,7 +30,6 @@ import { CoreLogger } from '@singletons/logger'; | |||||||
| import { CoreSharedModule } from '@/core/shared.module'; | import { CoreSharedModule } from '@/core/shared.module'; | ||||||
| import { CoreSearchComponentsModule } from '@features/search/components/components.module'; | import { CoreSearchComponentsModule } from '@features/search/components/components.module'; | ||||||
| import { AddonBlockTimelineEventsComponent } from '../events/events'; | import { AddonBlockTimelineEventsComponent } from '../events/events'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Component to render a timeline block. |  * Component to render a timeline block. | ||||||
| @ -211,7 +211,9 @@ export class AddonBlockTimelineComponent implements OnInit, ICoreBlockComponent | |||||||
|             catchError(error => { |             catchError(error => { | ||||||
|                 // An error ocurred in the function, log the error and just resolve the observable so the workflow continues.
 |                 // An error ocurred in the function, log the error and just resolve the observable so the workflow continues.
 | ||||||
|                 this.logger.error(error); |                 this.logger.error(error); | ||||||
|                 CoreAlerts.showError(error, { default: this.fetchContentDefaultError }); | 
 | ||||||
|  |                 // Error getting data, fail.
 | ||||||
|  |                 CoreDomUtils.showErrorModalDefault(error, this.fetchContentDefaultError, true); | ||||||
| 
 | 
 | ||||||
|                 return of([] as AddonBlockTimelineSection[]); |                 return of([] as AddonBlockTimelineSection[]); | ||||||
|             }), |             }), | ||||||
|  | |||||||
| @ -35,18 +35,19 @@ import { CoreEditorComponentsModule } from '@features/editor/components/componen | |||||||
| import { CoreFileUploader, CoreFileUploaderStoreFilesResult } from '@features/fileuploader/services/fileuploader'; | import { CoreFileUploader, CoreFileUploaderStoreFilesResult } from '@features/fileuploader/services/fileuploader'; | ||||||
| import { CoreTagComponentsModule } from '@features/tag/components/components.module'; | import { CoreTagComponentsModule } from '@features/tag/components/components.module'; | ||||||
| import { CanLeave } from '@guards/can-leave'; | import { CanLeave } from '@guards/can-leave'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreNetwork } from '@services/network'; | import { CoreNetwork } from '@services/network'; | ||||||
| import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | ||||||
| import { CoreSync } from '@services/sync'; | import { CoreSync } from '@services/sync'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreWSError } from '@classes/errors/wserror'; | import { CoreWSError } from '@classes/errors/wserror'; | ||||||
|  | import { Translate } from '@singletons'; | ||||||
| import { CoreEvents } from '@singletons/events'; | import { CoreEvents } from '@singletons/events'; | ||||||
| import { CoreForms } from '@singletons/form'; | import { CoreForms } from '@singletons/form'; | ||||||
| import { CoreFileEntry } from '@services/file-helper'; | import { CoreFileEntry } from '@services/file-helper'; | ||||||
| import { CoreTimeUtils } from '@services/utils/time'; | import { CoreTimeUtils } from '@services/utils/time'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'addon-blog-edit-entry', |     selector: 'addon-blog-edit-entry', | ||||||
| @ -163,7 +164,7 @@ export default class AddonBlogEditEntryPage implements CanLeave, OnInit, OnDestr | |||||||
|                     this.associatedCourse = course; |                     this.associatedCourse = course; | ||||||
|                 } |                 } | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 CoreAlerts.showError(error, { default: 'Error getting associations, they may not be displayed correctly.' }); |                 CoreDomUtils.showErrorModalDefault(error, 'Error getting associations, they may not be displayed correctly.'); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -203,7 +204,7 @@ export default class AddonBlogEditEntryPage implements CanLeave, OnInit, OnDestr | |||||||
|                 this.associatedModule = await CoreCourse.getModule(this.modId); |                 this.associatedModule = await CoreCourse.getModule(this.modId); | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error retrieving data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error retrieving data.'); | ||||||
|             this.forceLeave = true; |             this.forceLeave = true; | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
| @ -337,7 +338,7 @@ export default class AddonBlogEditEntryPage implements CanLeave, OnInit, OnDestr | |||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 if (CoreWSError.isWebServiceError(error)) { |                 if (CoreWSError.isWebServiceError(error)) { | ||||||
|                     // It's a WebService error, the user cannot send the message so don't store it.
 |                     // It's a WebService error, the user cannot send the message so don't store it.
 | ||||||
|                     CoreAlerts.showError(error, { default: 'Error updating entry.' }); |                     CoreDomUtils.showErrorModalDefault(error, 'Error updating entry.'); | ||||||
| 
 | 
 | ||||||
|                     return; |                     return; | ||||||
|                 } |                 } | ||||||
| @ -362,7 +363,7 @@ export default class AddonBlogEditEntryPage implements CanLeave, OnInit, OnDestr | |||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             if (CoreWSError.isWebServiceError(error)) { |             if (CoreWSError.isWebServiceError(error)) { | ||||||
|                 // It's a WebService error, the user cannot send the message so don't store it.
 |                 // It's a WebService error, the user cannot send the message so don't store it.
 | ||||||
|                 CoreAlerts.showError(error, { default: 'Error creating entry.' }); |                 CoreDomUtils.showErrorModalDefault(error, 'Error creating entry.'); | ||||||
| 
 | 
 | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
| @ -411,7 +412,7 @@ export default class AddonBlogEditEntryPage implements CanLeave, OnInit, OnDestr | |||||||
| 
 | 
 | ||||||
|         if ((!this.entry && this.hasDataChangedForNewEntry) || (this.entry && this.hasDataChangedForEdit)) { |         if ((!this.entry && this.hasDataChangedForNewEntry) || (this.entry && this.hasDataChangedForEdit)) { | ||||||
|             // Modified, confirm user wants to go back.
 |             // Modified, confirm user wants to go back.
 | ||||||
|             await CoreAlerts.confirmLeaveWithChanges(); |             await CoreDomUtils.showConfirm(Translate.instant('core.confirmcanceledit')); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         CoreForms.triggerFormCancelledEvent(this.formElement, CoreSites.getCurrentSiteId()); |         CoreForms.triggerFormCancelledEvent(this.formElement, CoreSites.getCurrentSiteId()); | ||||||
|  | |||||||
| @ -34,16 +34,15 @@ import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | |||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreNetwork } from '@services/network'; | import { CoreNetwork } from '@services/network'; | ||||||
| import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreUrl } from '@singletons/url'; | import { CoreUrl } from '@singletons/url'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreArray } from '@singletons/array'; | import { CoreArray } from '@singletons/array'; | ||||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CorePopovers } from '@services/overlays/popovers'; | import { CorePopovers } from '@services/popovers'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { Subscription } from 'rxjs'; | import { Subscription } from 'rxjs'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| import { Translate } from '@singletons'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the list of blog entries. |  * Page that displays the list of blog entries. | ||||||
| @ -237,7 +236,7 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy { | |||||||
|                 const result = await AddonBlogSync.syncEntriesForSite(CoreSites.getCurrentSiteId()); |                 const result = await AddonBlogSync.syncEntriesForSite(CoreSites.getCurrentSiteId()); | ||||||
| 
 | 
 | ||||||
|                 if (result.warnings && result.warnings.length) { |                 if (result.warnings && result.warnings.length) { | ||||||
|                     CoreAlerts.show({ message: result.warnings[0] }); |                     CoreDomUtils.showAlert(undefined, result.warnings[0]); | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 if (result.updated) { |                 if (result.updated) { | ||||||
| @ -245,7 +244,7 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy { | |||||||
|                 } |                 } | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 if (showSyncErrors) { |                 if (showSyncErrors) { | ||||||
|                     CoreAlerts.showError(error, { default: Translate.instant('core.errorsync') }); |                     CoreDomUtils.showErrorModalDefault(error, 'core.errorsync', true); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @ -282,7 +281,7 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy { | |||||||
|             this.pageLoaded++; |             this.pageLoaded++; | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.blog.errorloadentries') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.blog.errorloadentries', true); | ||||||
|             this.loadMoreError = true; // Set to prevent infinite calls with infinite-loading.
 |             this.loadMoreError = true; // Set to prevent infinite calls with infinite-loading.
 | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded.set(true); |             this.loaded.set(true); | ||||||
| @ -339,7 +338,7 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy { | |||||||
|             this.filter.userid = !enabled ? undefined : this.currentUserId; |             this.filter.userid = !enabled ? undefined : this.currentUserId; | ||||||
|             await this.fetchEntries(true); |             await this.fetchEntries(true); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.blog.errorloadentries') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.blog.errorloadentries', true); | ||||||
|             this.onlyMyEntries = !enabled; |             this.onlyMyEntries = !enabled; | ||||||
|             this.filter.userid = !enabled ? this.currentUserId : undefined; |             this.filter.userid = !enabled ? this.currentUserId : undefined; | ||||||
|         } finally { |         } finally { | ||||||
| @ -419,7 +418,7 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy { | |||||||
|      */ |      */ | ||||||
|     async deleteEntry(entryToRemove: AddonBlogOfflinePostFormatted | AddonBlogPostFormatted): Promise<void> { |     async deleteEntry(entryToRemove: AddonBlogOfflinePostFormatted | AddonBlogPostFormatted): Promise<void> { | ||||||
|         try { |         try { | ||||||
|             await CoreAlerts.confirmDelete(Translate.instant('addon.blog.blogdeleteconfirm', { $a: entryToRemove.subject })); |             await CoreDomUtils.showDeleteConfirm('addon.blog.blogdeleteconfirm', { $a: entryToRemove.subject }); | ||||||
|         } catch { |         } catch { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @ -435,7 +434,7 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             CoreEvents.trigger(ADDON_BLOG_ENTRY_UPDATED); |             CoreEvents.trigger(ADDON_BLOG_ENTRY_UPDATED); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.blog.errorloadentries') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.blog.errorloadentries', true); | ||||||
|         } finally { |         } finally { | ||||||
|             loading.dismiss(); |             loading.dismiss(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -26,7 +26,6 @@ import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/comp | |||||||
| 
 | 
 | ||||||
| import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module'; | import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module'; | ||||||
| import { ADDON_CALENDAR_PAGE_NAME } from './constants'; | import { ADDON_CALENDAR_PAGE_NAME } from './constants'; | ||||||
| import { canLeaveGuard } from '@guards/can-leave'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Build module routes. |  * Build module routes. | ||||||
| @ -56,7 +55,6 @@ function buildRoutes(injector: Injector): Routes { | |||||||
|         { |         { | ||||||
|             path: 'edit/:eventId', |             path: 'edit/:eventId', | ||||||
|             component: AddonCalendarEditEventPage, |             component: AddonCalendarEditEventPage, | ||||||
|             canDeactivate: [canLeaveGuard], |  | ||||||
|         }, |         }, | ||||||
|         ...buildTabMainRoutes(injector, { |         ...buildTabMainRoutes(injector, { | ||||||
|             redirectTo: 'index', |             redirectTo: 'index', | ||||||
|  | |||||||
| @ -27,6 +27,7 @@ import { | |||||||
| } from '@angular/core'; | } from '@angular/core'; | ||||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreTimeUtils } from '@services/utils/time'; | import { CoreTimeUtils } from '@services/utils/time'; | ||||||
| import { CoreArray } from '@singletons/array'; | import { CoreArray } from '@singletons/array'; | ||||||
| import { | import { | ||||||
| @ -53,7 +54,6 @@ import { CoreTime } from '@singletons/time'; | |||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { toBoolean } from '@/core/transforms/boolean'; | import { toBoolean } from '@/core/transforms/boolean'; | ||||||
| import { ADDON_CALENDAR_UNDELETED_EVENT_EVENT } from '@addons/calendar/constants'; | import { ADDON_CALENDAR_UNDELETED_EVENT_EVENT } from '@addons/calendar/constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Component that displays a calendar. |  * Component that displays a calendar. | ||||||
| @ -204,7 +204,7 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.calendar.errorloadevents') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.calendar.errorloadevents', true); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         this.loaded = true; |         this.loaded = true; | ||||||
| @ -358,7 +358,7 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro | |||||||
| 
 | 
 | ||||||
|             this.swipeSlidesComponent.slideToItem(item); |             this.swipeSlidesComponent.slideToItem(item); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.calendar.errorloadevents') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.calendar.errorloadevents', true); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -15,6 +15,7 @@ | |||||||
| import { Component, OnDestroy, OnInit, Input, DoCheck, Output, EventEmitter, KeyValueDiffers, KeyValueDiffer } from '@angular/core'; | import { Component, OnDestroy, OnInit, Input, DoCheck, Output, EventEmitter, KeyValueDiffers, KeyValueDiffer } from '@angular/core'; | ||||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { | import { | ||||||
|     AddonCalendarEventToDisplay, |     AddonCalendarEventToDisplay, | ||||||
|     AddonCalendar, |     AddonCalendar, | ||||||
| @ -28,7 +29,6 @@ import { CoreUrl } from '@singletons/url'; | |||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { ADDON_CALENDAR_UNDELETED_EVENT_EVENT } from '@addons/calendar/constants'; | import { ADDON_CALENDAR_UNDELETED_EVENT_EVENT } from '@addons/calendar/constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Component that displays upcoming events. |  * Component that displays upcoming events. | ||||||
| @ -174,7 +174,7 @@ export class AddonCalendarUpcomingEventsComponent implements OnInit, DoCheck, On | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.calendar.errorloadevents') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.calendar.errorloadevents', true); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         this.loaded = true; |         this.loaded = true; | ||||||
|  | |||||||
| @ -16,6 +16,7 @@ import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; | |||||||
| import { CoreNetwork } from '@services/network'; | import { CoreNetwork } from '@services/network'; | ||||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreTimeUtils } from '@services/utils/time'; | import { CoreTimeUtils } from '@services/utils/time'; | ||||||
| import { | import { | ||||||
|     AddonCalendar, |     AddonCalendar, | ||||||
| @ -45,7 +46,7 @@ import { AddonCalendarEventsSource } from '@addons/calendar/classes/events-sourc | |||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreUrl } from '@singletons/url'; | import { CoreUrl } from '@singletons/url'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreModals } from '@services/overlays/modals'; | import { CoreModals } from '@services/modals'; | ||||||
| import { | import { | ||||||
|     ADDON_CALENDAR_AUTO_SYNCED, |     ADDON_CALENDAR_AUTO_SYNCED, | ||||||
|     ADDON_CALENDAR_DELETED_EVENT_EVENT, |     ADDON_CALENDAR_DELETED_EVENT_EVENT, | ||||||
| @ -58,7 +59,6 @@ import { | |||||||
|     AddonCalendarEventType, |     AddonCalendarEventType, | ||||||
| } from '@addons/calendar/constants'; | } from '@addons/calendar/constants'; | ||||||
| import { CoreObject } from '@singletons/object'; | import { CoreObject } from '@singletons/object'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the calendar events for a certain day. |  * Page that displays the calendar events for a certain day. | ||||||
| @ -277,7 +277,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.calendar.errorloadevents') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.calendar.errorloadevents', true); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         this.loaded = true; |         this.loaded = true; | ||||||
| @ -343,7 +343,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { | |||||||
|             const result = await AddonCalendarSync.syncEvents(); |             const result = await AddonCalendarSync.syncEvents(); | ||||||
| 
 | 
 | ||||||
|             if (result.warnings && result.warnings.length) { |             if (result.warnings && result.warnings.length) { | ||||||
|                 CoreAlerts.show({ message: result.warnings[0] }); |                 CoreDomUtils.showAlert(undefined, result.warnings[0]); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             if (result.updated) { |             if (result.updated) { | ||||||
| @ -357,7 +357,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { | |||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             if (showErrors) { |             if (showErrors) { | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('core.errorsync') }); |                 CoreDomUtils.showErrorModalDefault(error, 'core.errorsync', true); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @ -454,7 +454,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             this.swipeSlidesComponent.slideToItem(currentDay); |             this.swipeSlidesComponent.slideToItem(currentDay); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.calendar.errorloadevents') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.calendar.errorloadevents', true); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -18,6 +18,7 @@ import { CoreEvents } from '@singletons/events'; | |||||||
| import { CoreGroup, CoreGroups } from '@services/groups'; | import { CoreGroup, CoreGroups } from '@services/groups'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
| import { CoreSync } from '@services/sync'; | import { CoreSync } from '@services/sync'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreTimeUtils } from '@services/utils/time'; | import { CoreTimeUtils } from '@services/utils/time'; | ||||||
| import { CoreUtils } from '@singletons/utils'; | import { CoreUtils } from '@singletons/utils'; | ||||||
| import { CoreCategoryData, CoreCourses, CoreCourseSearchedData, CoreEnrolledCourseData } from '@features/courses/services/courses'; | import { CoreCategoryData, CoreCourses, CoreCourseSearchedData, CoreEnrolledCourseData } from '@features/courses/services/courses'; | ||||||
| @ -49,11 +50,10 @@ import { | |||||||
|     AddonCalendarEventType, |     AddonCalendarEventType, | ||||||
| } from '@addons/calendar/constants'; | } from '@addons/calendar/constants'; | ||||||
| import { ContextLevel } from '@/core/constants'; | import { ContextLevel } from '@/core/constants'; | ||||||
| import { CorePopovers } from '@services/overlays/popovers'; | import { CorePopovers } from '@services/popovers'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { REMINDERS_DISABLED, CoreRemindersUnits } from '@features/reminders/constants'; | import { REMINDERS_DISABLED, CoreRemindersUnits } from '@features/reminders/constants'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays a form to create/edit an event. |  * Page that displays a form to create/edit an event. | ||||||
| @ -253,7 +253,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { | |||||||
| 
 | 
 | ||||||
|             this.eventTypes = eventTypes; |             this.eventTypes = eventTypes; | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting data.'); | ||||||
|             this.error = true; |             this.error = true; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @ -421,7 +421,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { | |||||||
| 
 | 
 | ||||||
|             this.groupControl.setValue(null); |             this.groupControl.setValue(null); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting data.'); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         modal.dismiss(); |         modal.dismiss(); | ||||||
| @ -475,7 +475,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { | |||||||
| 
 | 
 | ||||||
|         if (error) { |         if (error) { | ||||||
|             // Show error and stop.
 |             // Show error and stop.
 | ||||||
|             CoreAlerts.showError(Translate.instant(error)); |             CoreDomUtils.showErrorModal(Translate.instant(error)); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @ -548,7 +548,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { | |||||||
| 
 | 
 | ||||||
|             this.returnToList(event); |             this.returnToList(event); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error sending data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error sending data.'); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         modal.dismiss(); |         modal.dismiss(); | ||||||
| @ -593,7 +593,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { | |||||||
|     async canLeave(): Promise<boolean> { |     async canLeave(): Promise<boolean> { | ||||||
|         if (AddonCalendarHelper.hasEventDataChanged(this.form.value, this.originalData)) { |         if (AddonCalendarHelper.hasEventDataChanged(this.form.value, this.originalData)) { | ||||||
|             // Show confirmation if some data has been modified.
 |             // Show confirmation if some data has been modified.
 | ||||||
|             await CoreAlerts.confirmLeaveWithChanges(); |             await CoreDomUtils.showConfirm(Translate.instant('core.confirmcanceledit')); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         CoreForms.triggerFormCancelledEvent(this.formElement, this.currentSite.getId()); |         CoreForms.triggerFormCancelledEvent(this.formElement, this.currentSite.getId()); | ||||||
|  | |||||||
| @ -13,6 +13,7 @@ | |||||||
| // limitations under the License.
 | // limitations under the License.
 | ||||||
| 
 | 
 | ||||||
| import { Component, OnDestroy, OnInit } from '@angular/core'; | import { Component, OnDestroy, OnInit } from '@angular/core'; | ||||||
|  | import { AlertOptions } from '@ionic/core'; | ||||||
| import { | import { | ||||||
|     AddonCalendar, |     AddonCalendar, | ||||||
|     AddonCalendarEventToDisplay, |     AddonCalendarEventToDisplay, | ||||||
| @ -22,6 +23,7 @@ import { AddonCalendarOffline } from '../../services/calendar-offline'; | |||||||
| import { AddonCalendarSync, AddonCalendarSyncEvents } from '../../services/calendar-sync'; | import { AddonCalendarSync, AddonCalendarSyncEvents } from '../../services/calendar-sync'; | ||||||
| import { CoreNetwork } from '@services/network'; | import { CoreNetwork } from '@services/network'; | ||||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreText } from '@singletons/text'; | import { CoreText } from '@singletons/text'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
| import { CoreCourse } from '@features/course/services/course'; | import { CoreCourse } from '@features/course/services/course'; | ||||||
| @ -39,9 +41,9 @@ import { CoreReminders } from '@features/reminders/services/reminders'; | |||||||
| import { CoreLocalNotifications } from '@services/local-notifications'; | import { CoreLocalNotifications } from '@services/local-notifications'; | ||||||
| import { CorePlatform } from '@services/platform'; | import { CorePlatform } from '@services/platform'; | ||||||
| import { CoreConfig } from '@services/config'; | import { CoreConfig } from '@services/config'; | ||||||
| import { CoreToasts, ToastDuration } from '@services/overlays/toasts'; | import { CoreToasts, ToastDuration } from '@services/toasts'; | ||||||
| import { CorePopovers } from '@services/overlays/popovers'; | import { CorePopovers } from '@services/popovers'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreUrl } from '@singletons/url'; | import { CoreUrl } from '@singletons/url'; | ||||||
| import { | import { | ||||||
|     ADDON_CALENDAR_AUTO_SYNCED, |     ADDON_CALENDAR_AUTO_SYNCED, | ||||||
| @ -53,7 +55,6 @@ import { | |||||||
|     ADDON_CALENDAR_UNDELETED_EVENT_EVENT, |     ADDON_CALENDAR_UNDELETED_EVENT_EVENT, | ||||||
| } from '@addons/calendar/constants'; | } from '@addons/calendar/constants'; | ||||||
| import { REMINDERS_DEFAULT_NOTIFICATION_TIME_CHANGED } from '@features/reminders/constants'; | import { REMINDERS_DEFAULT_NOTIFICATION_TIME_CHANGED } from '@features/reminders/constants'; | ||||||
| import { CoreAlerts, CoreAlertsConfirmOptions } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays a single calendar event. |  * Page that displays a single calendar event. | ||||||
| @ -190,7 +191,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|         try { |         try { | ||||||
|             this.eventId = CoreNavigator.getRequiredRouteNumberParam('id'); |             this.eventId = CoreNavigator.getRequiredRouteNumberParam('id'); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
| 
 | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
| @ -242,7 +243,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|                 if (this.eventId < 0) { |                 if (this.eventId < 0) { | ||||||
|                     // It's an offline event, but it wasn't found. Shouldn't happen.
 |                     // It's an offline event, but it wasn't found. Shouldn't happen.
 | ||||||
|                     CoreAlerts.showError('Event not found.'); |                     CoreDomUtils.showErrorModal('Event not found.'); | ||||||
|                     CoreNavigator.back(); |                     CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|                     return; |                     return; | ||||||
| @ -317,7 +318,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             await Promise.all(promises); |             await Promise.all(promises); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.calendar.errorloadevent') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.calendar.errorloadevent', true); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         this.eventLoaded = true; |         this.eventLoaded = true; | ||||||
| @ -356,7 +357,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|         try { |         try { | ||||||
|             const result = await AddonCalendarSync.syncEvents(); |             const result = await AddonCalendarSync.syncEvents(); | ||||||
|             if (result.warnings && result.warnings.length) { |             if (result.warnings && result.warnings.length) { | ||||||
|                 CoreAlerts.show({ message: result.warnings[0] }); |                 CoreDomUtils.showAlert(undefined, result.warnings[0]); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             if (result.deleted && result.deleted.indexOf(this.eventId) != -1) { |             if (result.deleted && result.deleted.indexOf(this.eventId) != -1) { | ||||||
| @ -379,7 +380,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             if (showErrors) { |             if (showErrors) { | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('core.errorsync') }); |                 CoreDomUtils.showErrorModalDefault(error, 'core.errorsync', true); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| @ -426,7 +427,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|         e.stopPropagation(); |         e.stopPropagation(); | ||||||
| 
 | 
 | ||||||
|         try { |         try { | ||||||
|             await CoreAlerts.confirmDelete(Translate.instant('core.areyousure')); |             await CoreDomUtils.showDeleteConfirm(); | ||||||
| 
 | 
 | ||||||
|             const modal = await CoreLoadings.show('core.deleting', true); |             const modal = await CoreLoadings.show('core.deleting', true); | ||||||
| 
 | 
 | ||||||
| @ -434,7 +435,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|                 await CoreReminders.removeReminder(id); |                 await CoreReminders.removeReminder(id); | ||||||
|                 await this.loadReminders(); |                 await this.loadReminders(); | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 CoreAlerts.showError(error, { default: 'Error deleting reminder' }); |                 CoreDomUtils.showErrorModalDefault(error, 'Error deleting reminder'); | ||||||
|             } finally { |             } finally { | ||||||
|                 modal.dismiss(); |                 modal.dismiss(); | ||||||
|             } |             } | ||||||
| @ -499,10 +500,9 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         const title = Translate.instant('addon.calendar.deleteevent'); | ||||||
|  |         const options: AlertOptions = {}; | ||||||
|         let message: string; |         let message: string; | ||||||
|         const options: CoreAlertsConfirmOptions = { |  | ||||||
|             header: Translate.instant('addon.calendar.deleteevent'), |  | ||||||
|         }; |  | ||||||
| 
 | 
 | ||||||
|         if (this.event.eventcount > 1) { |         if (this.event.eventcount > 1) { | ||||||
|             // It's a repeated event.
 |             // It's a repeated event.
 | ||||||
| @ -534,7 +534,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|         let deleteAll = false; |         let deleteAll = false; | ||||||
|         try { |         try { | ||||||
|             deleteAll = await CoreAlerts.confirm(message, options); |             deleteAll = await CoreDomUtils.showConfirm(message, title, undefined, undefined, options); | ||||||
|         } catch { |         } catch { | ||||||
|             // User canceled.
 |             // User canceled.
 | ||||||
|             return; |             return; | ||||||
| @ -583,7 +583,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|                 this.event.deleted = true; |                 this.event.deleted = true; | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error deleting event.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error deleting event.'); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         modal.dismiss(); |         modal.dismiss(); | ||||||
| @ -611,7 +611,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { | |||||||
|             this.event.deleted = false; |             this.event.deleted = false; | ||||||
| 
 | 
 | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error undeleting event.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error undeleting event.'); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         modal.dismiss(); |         modal.dismiss(); | ||||||
|  | |||||||
| @ -16,12 +16,13 @@ import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; | |||||||
| import { CoreNetwork } from '@services/network'; | import { CoreNetwork } from '@services/network'; | ||||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreCoursesHelper } from '@features/courses/services/courses-helper'; | import { CoreCoursesHelper } from '@features/courses/services/courses-helper'; | ||||||
| import { AddonCalendar } from '../../services/calendar'; | import { AddonCalendar } from '../../services/calendar'; | ||||||
| import { AddonCalendarOffline } from '../../services/calendar-offline'; | import { AddonCalendarOffline } from '../../services/calendar-offline'; | ||||||
| import { AddonCalendarSync } from '../../services/calendar-sync'; | import { AddonCalendarSync } from '../../services/calendar-sync'; | ||||||
| import { AddonCalendarFilter, AddonCalendarHelper } from '../../services/calendar-helper'; | import { AddonCalendarFilter, AddonCalendarHelper } from '../../services/calendar-helper'; | ||||||
| import { NgZone, Translate } from '@singletons'; | import { NgZone } from '@singletons'; | ||||||
| import { Subscription } from 'rxjs'; | import { Subscription } from 'rxjs'; | ||||||
| import { CoreEnrolledCourseData } from '@features/courses/services/courses'; | import { CoreEnrolledCourseData } from '@features/courses/services/courses'; | ||||||
| import { ActivatedRoute, Params } from '@angular/router'; | import { ActivatedRoute, Params } from '@angular/router'; | ||||||
| @ -29,7 +30,7 @@ import { AddonCalendarCalendarComponent } from '../../components/calendar/calend | |||||||
| import { AddonCalendarUpcomingEventsComponent } from '../../components/upcoming-events/upcoming-events'; | import { AddonCalendarUpcomingEventsComponent } from '../../components/upcoming-events/upcoming-events'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreConstants } from '@/core/constants'; | import { CoreConstants } from '@/core/constants'; | ||||||
| import { CoreModals } from '@services/overlays/modals'; | import { CoreModals } from '@services/modals'; | ||||||
| import { | import { | ||||||
|     ADDON_CALENDAR_AUTO_SYNCED, |     ADDON_CALENDAR_AUTO_SYNCED, | ||||||
|     ADDON_CALENDAR_DELETED_EVENT_EVENT, |     ADDON_CALENDAR_DELETED_EVENT_EVENT, | ||||||
| @ -40,7 +41,6 @@ import { | |||||||
|     ADDON_CALENDAR_NEW_EVENT_EVENT, |     ADDON_CALENDAR_NEW_EVENT_EVENT, | ||||||
|     ADDON_CALENDAR_UNDELETED_EVENT_EVENT, |     ADDON_CALENDAR_UNDELETED_EVENT_EVENT, | ||||||
| } from '@addons/calendar/constants'; | } from '@addons/calendar/constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the calendar events. |  * Page that displays the calendar events. | ||||||
| @ -207,7 +207,7 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy { | |||||||
|             try { |             try { | ||||||
|                 const result = await AddonCalendarSync.syncEvents(); |                 const result = await AddonCalendarSync.syncEvents(); | ||||||
|                 if (result.warnings && result.warnings.length) { |                 if (result.warnings && result.warnings.length) { | ||||||
|                     CoreAlerts.show({ message: result.warnings[0] }); |                     CoreDomUtils.showAlert(undefined, result.warnings[0]); | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 if (result.updated) { |                 if (result.updated) { | ||||||
| @ -222,7 +222,7 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy { | |||||||
|                 } |                 } | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 if (showErrors) { |                 if (showErrors) { | ||||||
|                     CoreAlerts.showError(error, { default: Translate.instant('core.errorsync') }); |                     CoreDomUtils.showErrorModalDefault(error, 'core.errorsync', true); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @ -255,7 +255,7 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             await Promise.all(promises); |             await Promise.all(promises); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.calendar.errorloadevents') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.calendar.errorloadevents', true); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         this.loaded = true; |         this.loaded = true; | ||||||
|  | |||||||
| @ -13,7 +13,7 @@ | |||||||
| // limitations under the License.
 | // limitations under the License.
 | ||||||
| 
 | 
 | ||||||
| import { Component, OnInit } from '@angular/core'; | import { Component, OnInit } from '@angular/core'; | ||||||
| import { CorePopovers } from '@services/overlays/popovers'; | import { CorePopovers } from '@services/popovers'; | ||||||
| import { | import { | ||||||
|     CoreReminders, |     CoreReminders, | ||||||
|     CoreRemindersService, |     CoreRemindersService, | ||||||
|  | |||||||
| @ -13,6 +13,7 @@ | |||||||
| // limitations under the License.
 | // limitations under the License.
 | ||||||
| 
 | 
 | ||||||
| import { AfterViewInit, Component, OnDestroy, ViewChild } from '@angular/core'; | import { AfterViewInit, Component, OnDestroy, ViewChild } from '@angular/core'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreSplitViewComponent } from '@components/split-view/split-view'; | import { CoreSplitViewComponent } from '@components/split-view/split-view'; | ||||||
| import { | import { | ||||||
|     AddonCompetencyDataForPlanPageCompetency, |     AddonCompetencyDataForPlanPageCompetency, | ||||||
| @ -29,7 +30,6 @@ import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | |||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { ContextLevel } from '@/core/constants'; | import { ContextLevel } from '@/core/constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the list of competencies of a learning plan. |  * Page that displays the list of competencies of a learning plan. | ||||||
| @ -111,7 +111,7 @@ export class AddonCompetencyCompetenciesPage implements AfterViewInit, OnDestroy | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting competencies data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting competencies data.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -17,6 +17,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; | |||||||
| import { CoreCourseModuleSummary } from '@features/course/services/course'; | import { CoreCourseModuleSummary } from '@features/course/services/course'; | ||||||
| import { CoreUserSummary } from '@features/user/services/user'; | import { CoreUserSummary } from '@features/user/services/user'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { | import { | ||||||
|     AddonCompetencyDataForUserCompetencySummaryWSResponse, |     AddonCompetencyDataForUserCompetencySummaryWSResponse, | ||||||
| @ -40,7 +41,6 @@ import { AddonCompetencyCourseCompetenciesSource } from '@addons/competency/clas | |||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreUrl } from '@singletons/url'; | import { CoreUrl } from '@singletons/url'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the competency information. |  * Page that displays the competency information. | ||||||
| @ -86,7 +86,8 @@ export class AddonCompetencyCompetencyPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             this.competencies = new AddonCompetencyCompetenciesSwipeManager(source); |             this.competencies = new AddonCompetencyCompetenciesSwipeManager(source); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -162,7 +163,7 @@ export class AddonCompetencyCompetencyPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting competency data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting competency data.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -16,11 +16,11 @@ import { Component, OnInit } from '@angular/core'; | |||||||
| import { ContextLevel } from '@/core/constants'; | import { ContextLevel } from '@/core/constants'; | ||||||
| import { AddonCompetencySummary, AddonCompetency } from '@addons/competency/services/competency'; | import { AddonCompetencySummary, AddonCompetency } from '@addons/competency/services/competency'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { ADDON_COMPETENCY_SUMMARY_PAGE } from '@addons/competency/constants'; | import { ADDON_COMPETENCY_SUMMARY_PAGE } from '@addons/competency/constants'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the competency summary. |  * Page that displays the competency summary. | ||||||
| @ -71,7 +71,8 @@ export class AddonCompetencyCompetencySummaryPage implements OnInit { | |||||||
|             this.contextLevel = CoreNavigator.getRouteParam<ContextLevel>('contextLevel'); |             this.contextLevel = CoreNavigator.getRouteParam<ContextLevel>('contextLevel'); | ||||||
|             this.contextInstanceId = CoreNavigator.getRouteNumberParam('contextInstanceId'); |             this.contextInstanceId = CoreNavigator.getRouteNumberParam('contextInstanceId'); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -102,7 +103,7 @@ export class AddonCompetencyCompetencySummaryPage implements OnInit { | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting competency summary data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting competency summary data.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -19,6 +19,7 @@ import { | |||||||
| } from '@addons/competency/services/competency'; | } from '@addons/competency/services/competency'; | ||||||
| import { CoreUserProfile } from '@features/user/services/user'; | import { CoreUserProfile } from '@features/user/services/user'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { ContextLevel } from '@/core/constants'; | import { ContextLevel } from '@/core/constants'; | ||||||
| import { ADDON_COMPETENCY_SUMMARY_PAGE } from '@addons/competency/constants'; | import { ADDON_COMPETENCY_SUMMARY_PAGE } from '@addons/competency/constants'; | ||||||
| import { CoreListItemsManager } from '@classes/items-management/list-items-manager'; | import { CoreListItemsManager } from '@classes/items-management/list-items-manager'; | ||||||
| @ -28,7 +29,6 @@ import { CoreTime } from '@singletons/time'; | |||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the list of competencies of a course. |  * Page that displays the list of competencies of a course. | ||||||
| @ -59,7 +59,7 @@ export class AddonCompetencyCourseCompetenciesPage implements OnInit, OnDestroy | |||||||
| 
 | 
 | ||||||
|             this.competencies = new CoreListItemsManager(source, AddonCompetencyCourseCompetenciesPage); |             this.competencies = new CoreListItemsManager(source, AddonCompetencyCourseCompetenciesPage); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -121,7 +121,7 @@ export class AddonCompetencyCourseCompetenciesPage implements OnInit, OnDestroy | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting course competencies data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting course competencies data.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -13,6 +13,7 @@ | |||||||
| // limitations under the License.
 | // limitations under the License.
 | ||||||
| 
 | 
 | ||||||
| import { Component, OnDestroy, OnInit } from '@angular/core'; | import { Component, OnDestroy, OnInit } from '@angular/core'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { AddonCompetencyDataForPlanPageCompetency, AddonCompetencyDataForPlanPageWSResponse } from '../../services/competency'; | import { AddonCompetencyDataForPlanPageCompetency, AddonCompetencyDataForPlanPageWSResponse } from '../../services/competency'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreUserProfile } from '@features/user/services/user'; | import { CoreUserProfile } from '@features/user/services/user'; | ||||||
| @ -23,7 +24,6 @@ import { CoreListItemsManager } from '@classes/items-management/list-items-manag | |||||||
| import { AddonCompetencyPlanCompetenciesSource } from '@addons/competency/classes/competency-plan-competencies-source'; | import { AddonCompetencyPlanCompetenciesSource } from '@addons/competency/classes/competency-plan-competencies-source'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays a learning plan. |  * Page that displays a learning plan. | ||||||
| @ -57,7 +57,8 @@ export class AddonCompetencyPlanPage implements OnInit, OnDestroy { | |||||||
|             this.competencies = new CoreListItemsManager(competenciesSource, AddonCompetencyPlanPage); |             this.competencies = new CoreListItemsManager(competenciesSource, AddonCompetencyPlanPage); | ||||||
|             this.plans = new CoreSwipeNavigationItemsManager(plansSource); |             this.plans = new CoreSwipeNavigationItemsManager(plansSource); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -100,7 +101,7 @@ export class AddonCompetencyPlanPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting learning plan data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting learning plan data.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -13,6 +13,7 @@ | |||||||
| // limitations under the License.
 | // limitations under the License.
 | ||||||
| 
 | 
 | ||||||
| import { AfterViewInit, Component, OnDestroy, ViewChild } from '@angular/core'; | import { AfterViewInit, Component, OnDestroy, ViewChild } from '@angular/core'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreSplitViewComponent } from '@components/split-view/split-view'; | import { CoreSplitViewComponent } from '@components/split-view/split-view'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { AddonCompetencyPlanFormatted, AddonCompetencyPlansSource } from '@addons/competency/classes/competency-plans-source'; | import { AddonCompetencyPlanFormatted, AddonCompetencyPlansSource } from '@addons/competency/classes/competency-plans-source'; | ||||||
| @ -22,7 +23,6 @@ import { CoreTime } from '@singletons/time'; | |||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the list of learning plans. |  * Page that displays the list of learning plans. | ||||||
| @ -76,7 +76,7 @@ export class AddonCompetencyPlanListPage implements AfterViewInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting learning plans data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting learning plans data.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -19,12 +19,12 @@ import { | |||||||
| import { Component, OnInit } from '@angular/core'; | import { Component, OnInit } from '@angular/core'; | ||||||
| import { CoreUser, CoreUserProfile } from '@features/user/services/user'; | import { CoreUser, CoreUserProfile } from '@features/user/services/user'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the course completion report. |  * Page that displays the course completion report. | ||||||
| @ -69,7 +69,8 @@ export class AddonCourseCompletionReportPage implements OnInit { | |||||||
|             this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); |             this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); | ||||||
|             this.userId = CoreNavigator.getRouteNumberParam('userId') || CoreSites.getCurrentSiteUserId(); |             this.userId = CoreNavigator.getRouteNumberParam('userId') || CoreSites.getCurrentSiteUserId(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -101,7 +102,7 @@ export class AddonCourseCompletionReportPage implements OnInit { | |||||||
|                 // Not enrolled error, probably a teacher.
 |                 // Not enrolled error, probably a teacher.
 | ||||||
|                 this.tracked = false; |                 this.tracked = false; | ||||||
|             } else { |             } else { | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('addon.coursecompletion.couldnotloadreport') }); |                 CoreDomUtils.showErrorModalDefault(error, 'addon.coursecompletion.couldnotloadreport', true); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @ -130,7 +131,7 @@ export class AddonCourseCompletionReportPage implements OnInit { | |||||||
| 
 | 
 | ||||||
|             await this.refreshCompletion(); |             await this.refreshCompletion(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -22,10 +22,10 @@ import { | |||||||
| import { makeSingleton } from '@singletons'; | import { makeSingleton } from '@singletons'; | ||||||
| import { AddonEnrolGuest } from './guest'; | import { AddonEnrolGuest } from './guest'; | ||||||
| import { CorePasswordModalResponse } from '@components/password-modal/password-modal'; | import { CorePasswordModalResponse } from '@components/password-modal/password-modal'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreWSError } from '@classes/errors/wserror'; | import { CoreWSError } from '@classes/errors/wserror'; | ||||||
| import { CoreEnrol, CoreEnrolEnrolmentMethod } from '@features/enrol/services/enrol'; | import { CoreEnrol, CoreEnrolEnrolmentMethod } from '@features/enrol/services/enrol'; | ||||||
| import { CorePrompts } from '@services/overlays/prompts'; | import { CoreModals } from '@services/modals'; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Enrol handler. |  * Enrol handler. | ||||||
| @ -119,7 +119,7 @@ export class AddonEnrolGuestHandlerService implements CoreEnrolGuestHandler { | |||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         try { |         try { | ||||||
|             const response = await CorePrompts.promptPassword<CorePasswordModalResponse>({ |             const response = await CoreModals.promptPassword<CorePasswordModalResponse>({ | ||||||
|                 title: method.name, |                 title: method.name, | ||||||
|                 validator: validatePassword, |                 validator: validatePassword, | ||||||
|             }); |             }); | ||||||
|  | |||||||
| @ -17,11 +17,11 @@ import { CoreEnrolAction, CoreEnrolSelfHandler, CoreEnrolInfoIcon } from '@featu | |||||||
| import { Translate, makeSingleton } from '@singletons'; | import { Translate, makeSingleton } from '@singletons'; | ||||||
| import { AddonEnrolSelf } from './self'; | import { AddonEnrolSelf } from './self'; | ||||||
| import { CorePasswordModalResponse } from '@components/password-modal/password-modal'; | import { CorePasswordModalResponse } from '@components/password-modal/password-modal'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreEnrol, CoreEnrolEnrolmentMethod } from '@features/enrol/services/enrol'; | import { CoreEnrol, CoreEnrolEnrolmentMethod } from '@features/enrol/services/enrol'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreModals } from '@services/modals'; | ||||||
|  | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CORE_COURSES_ENROL_INVALID_KEY } from '@features/courses/constants'; | import { CORE_COURSES_ENROL_INVALID_KEY } from '@features/courses/constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| import { CorePrompts } from '@services/overlays/prompts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Enrol handler. |  * Enrol handler. | ||||||
| @ -87,10 +87,11 @@ export class AddonEnrolSelfHandlerService implements CoreEnrolSelfHandler { | |||||||
|         // Don't allow self access if it requires a password if not supported.
 |         // Don't allow self access if it requires a password if not supported.
 | ||||||
|         if (!info.enrolpassword) { |         if (!info.enrolpassword) { | ||||||
|             try { |             try { | ||||||
|                 await CoreAlerts.confirm(Translate.instant('addon.enrol_self.confirmselfenrol'), { |                 await CoreDomUtils.showConfirm( | ||||||
|                     header: method.name, |                     Translate.instant('addon.enrol_self.confirmselfenrol'), | ||||||
|                     okText: Translate.instant('core.courses.enrolme'), |                     method.name, | ||||||
|                 }); |                     Translate.instant('core.courses.enrolme'), | ||||||
|  |                 ); | ||||||
|             } catch { |             } catch { | ||||||
|                 // User cancelled.
 |                 // User cancelled.
 | ||||||
|                 return false; |                 return false; | ||||||
| @ -125,7 +126,7 @@ export class AddonEnrolSelfHandlerService implements CoreEnrolSelfHandler { | |||||||
|                     response.validated = false; |                     response.validated = false; | ||||||
|                     response.error = error.message; |                     response.error = error.message; | ||||||
|                 } else { |                 } else { | ||||||
|                     CoreAlerts.showError(error, { default: Translate.instant('addon.enrol_self.errorselfenrol') }); |                     CoreDomUtils.showErrorModalDefault(error, 'addon.enrol_self.errorselfenrol', true); | ||||||
| 
 | 
 | ||||||
|                     throw error; |                     throw error; | ||||||
|                 } |                 } | ||||||
| @ -146,7 +147,7 @@ export class AddonEnrolSelfHandlerService implements CoreEnrolSelfHandler { | |||||||
| 
 | 
 | ||||||
|         if (!response.validated) { |         if (!response.validated) { | ||||||
|             try { |             try { | ||||||
|                 const response = await CorePrompts.promptPassword({ |                 const response = await CoreModals.promptPassword({ | ||||||
|                     validator: validatePassword, |                     validator: validatePassword, | ||||||
|                     title: method.name, |                     title: method.name, | ||||||
|                     placeholder: 'addon.enrol_self.password', |                     placeholder: 'addon.enrol_self.password', | ||||||
|  | |||||||
| @ -13,10 +13,11 @@ | |||||||
| // limitations under the License.
 | // limitations under the License.
 | ||||||
| 
 | 
 | ||||||
| import { Component, OnDestroy, OnInit } from '@angular/core'; | import { Component, OnDestroy, OnInit } from '@angular/core'; | ||||||
|  | 
 | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CorePushNotifications } from '@features/pushnotifications/services/pushnotifications'; | import { CorePushNotifications } from '@features/pushnotifications/services/pushnotifications'; | ||||||
| import { AddonMessageOutputAirnotifier, AddonMessageOutputAirnotifierDevice } from '../../services/airnotifier'; | import { AddonMessageOutputAirnotifier, AddonMessageOutputAirnotifierDevice } from '../../services/airnotifier'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the list of devices. |  * Page that displays the list of devices. | ||||||
| @ -49,7 +50,7 @@ export class AddonMessageOutputAirnotifierDevicesPage implements OnInit, OnDestr | |||||||
|             const devices = await AddonMessageOutputAirnotifier.getUserDevices(); |             const devices = await AddonMessageOutputAirnotifier.getUserDevices(); | ||||||
|             this.formatDevices(devices); |             this.formatDevices(devices); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
| @ -147,7 +148,7 @@ export class AddonMessageOutputAirnotifierDevicesPage implements OnInit, OnDestr | |||||||
|             this.updateDevicesAfterDelay(); |             this.updateDevicesAfterDelay(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             // Show error and revert change.
 |             // Show error and revert change.
 | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|             device.enable = !device.enable; |             device.enable = !device.enable; | ||||||
|         } finally { |         } finally { | ||||||
|             device.updating = false; |             device.updating = false; | ||||||
|  | |||||||
| @ -21,10 +21,10 @@ import { CoreError } from '@classes/errors/error'; | |||||||
| import { CoreWSError } from '@classes/errors/wserror'; | import { CoreWSError } from '@classes/errors/wserror'; | ||||||
| import { makeSingleton, Translate } from '@singletons'; | import { makeSingleton, Translate } from '@singletons'; | ||||||
| import { CoreEvents, CoreEventSiteData } from '@singletons/events'; | import { CoreEvents, CoreEventSiteData } from '@singletons/events'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreOpener } from '@singletons/opener'; | import { CoreOpener } from '@singletons/opener'; | ||||||
| import { CorePath } from '@singletons/path'; | import { CorePath } from '@singletons/path'; | ||||||
| import { CoreSiteWSPreSets } from '@classes/sites/authenticated-site'; | import { CoreSiteWSPreSets } from '@classes/sites/authenticated-site'; | ||||||
| import { CorePrompts } from '@services/overlays/prompts'; |  | ||||||
| 
 | 
 | ||||||
| const ROOT_CACHE_KEY = 'mmaMessageOutputAirnotifier:'; | const ROOT_CACHE_KEY = 'mmaMessageOutputAirnotifier:'; | ||||||
| 
 | 
 | ||||||
| @ -200,35 +200,34 @@ export class AddonMessageOutputAirnotifierProvider { | |||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             // Warn the admin.
 |             // Warn the admin.
 | ||||||
|             const dontShowAgain = await CorePrompts.show( |             const dontShowAgain = await CoreDomUtils.showPrompt( | ||||||
|                 Translate.instant('addon.messageoutput_airnotifier.pushdisabledwarning'), |                 Translate.instant('addon.messageoutput_airnotifier.pushdisabledwarning'), | ||||||
|  |                 undefined, | ||||||
|  |                 Translate.instant('core.dontshowagain'), | ||||||
|                 'checkbox', |                 'checkbox', | ||||||
|                 { |                 [ | ||||||
|                     placeholderOrLabel: Translate.instant('core.dontshowagain'), |                     { | ||||||
|                     buttons: [ |                         text: Translate.instant('core.ok'), | ||||||
|                         { |                     }, | ||||||
|                             text: Translate.instant('core.ok'), |                     { | ||||||
|                         }, |                         text: Translate.instant('core.goto', { $a: Translate.instant('core.settings.settings') }), | ||||||
|                         { |                         handler: (data, resolve) => { | ||||||
|                             text: Translate.instant('core.goto', { $a: Translate.instant('core.settings.settings') }), |                             resolve(data[0]); | ||||||
|                             handler: (data, resolve) => { |  | ||||||
|                                 resolve(data[0]); |  | ||||||
| 
 | 
 | ||||||
|                                 const url = CorePath.concatenatePaths( |                             const url = CorePath.concatenatePaths( | ||||||
|                                     site.getURL(), |                                 site.getURL(), | ||||||
|                                     site.isVersionGreaterEqualThan('3.11') ? |                                 site.isVersionGreaterEqualThan('3.11') ? | ||||||
|                                         'message/output/airnotifier/checkconfiguration.php' : |                                     'message/output/airnotifier/checkconfiguration.php' : | ||||||
|                                         'admin/message.php', |                                     'admin/message.php', | ||||||
|                                 ); |                             ); | ||||||
| 
 | 
 | ||||||
|                                 // Don't try auto-login, admins cannot use it.
 |                             // Don't try auto-login, admins cannot use it.
 | ||||||
|                                 CoreOpener.openInBrowser(url, { |                             CoreOpener.openInBrowser(url, { | ||||||
|                                     showBrowserWarning: false, |                                 showBrowserWarning: false, | ||||||
|                                 }); |                             }); | ||||||
|                             }, |  | ||||||
|                         }, |                         }, | ||||||
|                     ], |                     }, | ||||||
|                 }, |                 ], | ||||||
|             ); |             ); | ||||||
| 
 | 
 | ||||||
|             if (dontShowAgain) { |             if (dontShowAgain) { | ||||||
|  | |||||||
| @ -18,9 +18,9 @@ import { | |||||||
|     AddonMessagesConversationMember, |     AddonMessagesConversationMember, | ||||||
|     AddonMessages, |     AddonMessages, | ||||||
| } from '../../services/messages'; | } from '../../services/messages'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { ActivatedRoute } from '@angular/router'; | import { ActivatedRoute } from '@angular/router'; | ||||||
| import { ModalController } from '@singletons'; | import { ModalController } from '@singletons'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Component that displays the list of conversations, including group conversations. |  * Component that displays the list of conversations, including group conversations. | ||||||
| @ -67,7 +67,7 @@ export class AddonMessagesConversationInfoComponent implements OnInit { | |||||||
|             // Now get the members.
 |             // Now get the members.
 | ||||||
|             await this.fetchMembers(); |             await this.fetchMembers(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting members.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting members.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -102,7 +102,7 @@ export class AddonMessagesConversationInfoComponent implements OnInit { | |||||||
|         try { |         try { | ||||||
|             await this.fetchMembers(true); |             await this.fetchMembers(true); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting members.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting members.'); | ||||||
|             this.loadMoreError = true; |             this.loadMoreError = true; | ||||||
|         } finally { |         } finally { | ||||||
|             infiniteComplete && infiniteComplete(); |             infiniteComplete && infiniteComplete(); | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ import { | |||||||
|     AddonMessagesGetContactsContact, |     AddonMessagesGetContactsContact, | ||||||
|     AddonMessages, |     AddonMessages, | ||||||
| } from '../../services/messages'; | } from '../../services/messages'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||||
| import { ActivatedRoute } from '@angular/router'; | import { ActivatedRoute } from '@angular/router'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| @ -28,7 +29,6 @@ import { CoreNavigator } from '@services/navigator'; | |||||||
| import { CoreSplitViewComponent } from '@components/split-view/split-view'; | import { CoreSplitViewComponent } from '@components/split-view/split-view'; | ||||||
| import { CoreKeyboard } from '@singletons/keyboard'; | import { CoreKeyboard } from '@singletons/keyboard'; | ||||||
| import { ADDON_MESSAGES_MEMBER_INFO_CHANGED_EVENT } from '@addons/messages/constants'; | import { ADDON_MESSAGES_MEMBER_INFO_CHANGED_EVENT } from '@addons/messages/constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the list of contacts. |  * Page that displays the list of contacts. | ||||||
| @ -163,7 +163,7 @@ export class AddonMessagesContacts35Page implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             this.clearSearch(); |             this.clearSearch(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.messages.errorwhileretrievingcontacts') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.messages.errorwhileretrievingcontacts', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -233,7 +233,7 @@ export class AddonMessagesContacts35Page implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             this.contacts.search = this.sortUsers(result); |             this.contacts.search = this.sortUsers(result); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.messages.errorwhileretrievingcontacts') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.messages.errorwhileretrievingcontacts', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -21,10 +21,9 @@ import { | |||||||
| } from '../../services/messages'; | } from '../../services/messages'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreScreen } from '@services/screen'; | import { CoreScreen } from '@services/screen'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreSplitViewComponent } from '@components/split-view/split-view'; | import { CoreSplitViewComponent } from '@components/split-view/split-view'; | ||||||
| import { ADDON_MESSAGES_CONTACT_REQUESTS_COUNT_EVENT, ADDON_MESSAGES_MEMBER_INFO_CHANGED_EVENT } from '@addons/messages/constants'; | import { ADDON_MESSAGES_CONTACT_REQUESTS_COUNT_EVENT, ADDON_MESSAGES_MEMBER_INFO_CHANGED_EVENT } from '@addons/messages/constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| import { Translate } from '@singletons'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays contacts and contact requests. |  * Page that displays contacts and contact requests. | ||||||
| @ -178,7 +177,7 @@ export class AddonMessagesContactsPage implements OnInit, OnDestroy { | |||||||
|             this.confirmedCanLoadMore = result.canLoadMore; |             this.confirmedCanLoadMore = result.canLoadMore; | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             this.confirmedLoadMoreError = true; |             this.confirmedLoadMoreError = true; | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.messages.errorwhileretrievingcontacts') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.messages.errorwhileretrievingcontacts', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -204,7 +203,7 @@ export class AddonMessagesContactsPage implements OnInit, OnDestroy { | |||||||
|             this.requestsCanLoadMore = result.canLoadMore; |             this.requestsCanLoadMore = result.canLoadMore; | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             this.requestsLoadMoreError = true; |             this.requestsLoadMoreError = true; | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.messages.errorwhileretrievingcontacts') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.messages.errorwhileretrievingcontacts', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -14,6 +14,7 @@ | |||||||
| 
 | 
 | ||||||
| import { AfterViewInit, Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core'; | import { AfterViewInit, Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core'; | ||||||
| import { IonContent } from '@ionic/angular'; | import { IonContent } from '@ionic/angular'; | ||||||
|  | import { AlertOptions } from '@ionic/core'; | ||||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
| import { | import { | ||||||
| @ -27,6 +28,7 @@ import { | |||||||
| import { AddonMessagesOffline, AddonMessagesOfflineMessagesDBRecordFormatted } from '../../services/messages-offline'; | import { AddonMessagesOffline, AddonMessagesOfflineMessagesDBRecordFormatted } from '../../services/messages-offline'; | ||||||
| import { AddonMessagesSync } from '../../services/messages-sync'; | import { AddonMessagesSync } from '../../services/messages-sync'; | ||||||
| import { CoreUser } from '@features/user/services/user'; | import { CoreUser } from '@features/user/services/user'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreLogger } from '@singletons/logger'; | import { CoreLogger } from '@singletons/logger'; | ||||||
| import { CoreInfiniteLoadingComponent } from '@components/infinite-loading/infinite-loading'; | import { CoreInfiniteLoadingComponent } from '@components/infinite-loading/infinite-loading'; | ||||||
| @ -42,8 +44,8 @@ import { CoreDom } from '@singletons/dom'; | |||||||
| import { CoreKeyboard } from '@singletons/keyboard'; | import { CoreKeyboard } from '@singletons/keyboard'; | ||||||
| import { CoreText } from '@singletons/text'; | import { CoreText } from '@singletons/text'; | ||||||
| import { CoreWait } from '@singletons/wait'; | import { CoreWait } from '@singletons/wait'; | ||||||
| import { CoreModals } from '@services/overlays/modals'; | import { CoreModals } from '@services/modals'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { | import { | ||||||
|     ADDON_MESSAGES_AUTO_SYNCED, |     ADDON_MESSAGES_AUTO_SYNCED, | ||||||
|     ADDON_MESSAGES_LIMIT_MESSAGES, |     ADDON_MESSAGES_LIMIT_MESSAGES, | ||||||
| @ -56,7 +58,6 @@ import { | |||||||
|     AddonMessagesMessageConversationType, |     AddonMessagesMessageConversationType, | ||||||
|     AddonMessagesUpdateConversationAction, |     AddonMessagesUpdateConversationAction, | ||||||
| } from '@addons/messages/constants'; | } from '@addons/messages/constants'; | ||||||
| import { CoreAlerts, CoreAlertsConfirmOptions } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays a message discussion page. |  * Page that displays a message discussion page. | ||||||
| @ -142,7 +143,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
| 
 | 
 | ||||||
|                 // Show first warning if any.
 |                 // Show first warning if any.
 | ||||||
|                 if (data.warnings && data.warnings[0]) { |                 if (data.warnings && data.warnings[0]) { | ||||||
|                     CoreAlerts.show({ message: data.warnings[0] }); |                     CoreDomUtils.showAlert(undefined, data.warnings[0]); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         }, this.siteId); |         }, this.siteId); | ||||||
| @ -263,7 +264,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|         try { |         try { | ||||||
|             const syncResult = await AddonMessagesSync.syncDiscussion(this.conversationId, this.userId); |             const syncResult = await AddonMessagesSync.syncDiscussion(this.conversationId, this.userId); | ||||||
|             if (syncResult.warnings && syncResult.warnings[0]) { |             if (syncResult.warnings && syncResult.warnings[0]) { | ||||||
|                 CoreAlerts.show({ message: syncResult.warnings[0] }); |                 CoreDomUtils.showAlert(undefined, syncResult.warnings[0]); | ||||||
|             } |             } | ||||||
|         } catch { |         } catch { | ||||||
|             // Ignore errors;
 |             // Ignore errors;
 | ||||||
| @ -349,7 +350,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
| 
 | 
 | ||||||
|             await Promise.all(promises); |             await Promise.all(promises); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.messages.errorwhileretrievingmessages') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.messages.errorwhileretrievingmessages', true); | ||||||
|         } finally { |         } finally { | ||||||
|             this.checkCanDelete(); |             this.checkCanDelete(); | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
| @ -952,7 +953,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|         const canDeleteAll = this.conversation && this.conversation.candeletemessagesforallusers; |         const canDeleteAll = this.conversation && this.conversation.candeletemessagesforallusers; | ||||||
|         const langKey = message.pending || canDeleteAll || this.isSelf ? 'core.areyousure' : |         const langKey = message.pending || canDeleteAll || this.isSelf ? 'core.areyousure' : | ||||||
|             'addon.messages.deletemessageconfirmation'; |             'addon.messages.deletemessageconfirmation'; | ||||||
|         const options: CoreAlertsConfirmOptions = {}; |         const options: AlertOptions = {}; | ||||||
| 
 | 
 | ||||||
|         if (canDeleteAll && !message.pending) { |         if (canDeleteAll && !message.pending) { | ||||||
|             // Show delete for all checkbox.
 |             // Show delete for all checkbox.
 | ||||||
| @ -966,7 +967,13 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         try { |         try { | ||||||
|             const data = await CoreAlerts.confirm<boolean[]>(Translate.instant(langKey), options); |             const data: boolean[] = await CoreDomUtils.showConfirm( | ||||||
|  |                 Translate.instant(langKey), | ||||||
|  |                 undefined, | ||||||
|  |                 undefined, | ||||||
|  |                 undefined, | ||||||
|  |                 options, | ||||||
|  |             ); | ||||||
| 
 | 
 | ||||||
|             const modal = await CoreLoadings.show('core.deleting', true); |             const modal = await CoreLoadings.show('core.deleting', true); | ||||||
| 
 | 
 | ||||||
| @ -982,7 +989,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|                 modal.dismiss(); |                 modal.dismiss(); | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.messages.errordeletemessage') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.messages.errordeletemessage', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -1030,7 +1037,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 this.loadMoreError = true; // Set to prevent infinite calls with infinite-loading.
 |                 this.loadMoreError = true; // Set to prevent infinite calls with infinite-loading.
 | ||||||
|                 this.pagesLoaded--; |                 this.pagesLoaded--; | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('addon.messages.errorwhileretrievingmessages') }); |                 CoreDomUtils.showErrorModalDefault(error, 'addon.messages.errorwhileretrievingmessages', true); | ||||||
|             } finally { |             } finally { | ||||||
|                 infiniteComplete && infiniteComplete(); |                 infiniteComplete && infiniteComplete(); | ||||||
|             } |             } | ||||||
| @ -1185,7 +1192,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|                 // We want the user to be able to send multiple messages without the keyboard being closed.
 |                 // We want the user to be able to send multiple messages without the keyboard being closed.
 | ||||||
|                 CoreKeyboard.close(); |                 CoreKeyboard.close(); | ||||||
| 
 | 
 | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('addon.messages.messagenotsent') }); |                 CoreDomUtils.showErrorModalDefault(error, 'addon.messages.messagenotsent', true); | ||||||
|                 this.removeMessage(message.hash!); |                 this.removeMessage(message.hash!); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @ -1309,7 +1316,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|                 value: this.conversation.isfavourite, |                 value: this.conversation.isfavourite, | ||||||
|             }, this.siteId); |             }, this.siteId); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error changing favourite state.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error changing favourite state.'); | ||||||
|         } finally { |         } finally { | ||||||
|             this.favouriteIcon = 'fas-star'; |             this.favouriteIcon = 'fas-star'; | ||||||
|             done && done(); |             done && done(); | ||||||
| @ -1342,7 +1349,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|             }, this.siteId); |             }, this.siteId); | ||||||
| 
 | 
 | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error changing muted state.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error changing muted state.'); | ||||||
|         } finally { |         } finally { | ||||||
|             this.muteIcon = this.conversation.ismuted ? 'fas-bell' : 'fas-bell-slash'; |             this.muteIcon = this.conversation.ismuted ? 'fas-bell' : 'fas-bell-slash'; | ||||||
|             done && done(); |             done && done(); | ||||||
| @ -1397,16 +1404,16 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (this.otherMember.canmessageevenifblocked) { |         if (this.otherMember.canmessageevenifblocked) { | ||||||
|             CoreAlerts.showError(Translate.instant('addon.messages.cantblockuser', { $a: this.otherMember.fullname })); |             CoreDomUtils.showErrorModal(Translate.instant('addon.messages.cantblockuser', { $a: this.otherMember.fullname })); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         try { |         const template = Translate.instant('addon.messages.blockuserconfirm', { $a: this.otherMember.fullname }); | ||||||
|             await CoreAlerts.confirm(Translate.instant('addon.messages.blockuserconfirm', { $a: this.otherMember.fullname }), { |         const okText = Translate.instant('addon.messages.blockuser'); | ||||||
|                 okText: Translate.instant('addon.messages.blockuser'), |  | ||||||
|             }); |  | ||||||
| 
 | 
 | ||||||
|  |         try { | ||||||
|  |             await CoreDomUtils.showConfirm(template, undefined, okText); | ||||||
|             this.blockIcon = CoreConstants.ICON_LOADING; |             this.blockIcon = CoreConstants.ICON_LOADING; | ||||||
| 
 | 
 | ||||||
|             const modal = await CoreLoadings.show('core.sending', true); |             const modal = await CoreLoadings.show('core.sending', true); | ||||||
| @ -1420,7 +1427,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|                     this.showLoadingModal = false; |                     this.showLoadingModal = false; | ||||||
|                 } |                 } | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('core.error') }); |                 CoreDomUtils.showErrorModalDefault(error, 'core.error', true); | ||||||
|             } finally { |             } finally { | ||||||
|                 this.blockIcon = this.otherMember.isblocked ? 'fas-user-check' : 'fas-user-lock'; |                 this.blockIcon = this.otherMember.isblocked ? 'fas-user-check' : 'fas-user-lock'; | ||||||
|             } |             } | ||||||
| @ -1442,7 +1449,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|         const confirmMessage = 'addon.messages.' + (this.isSelf ? 'deleteallselfconfirm' : 'deleteallconfirm'); |         const confirmMessage = 'addon.messages.' + (this.isSelf ? 'deleteallselfconfirm' : 'deleteallconfirm'); | ||||||
| 
 | 
 | ||||||
|         try { |         try { | ||||||
|             await CoreAlerts.confirmDelete(Translate.instant(confirmMessage)); |             await CoreDomUtils.showDeleteConfirm(confirmMessage); | ||||||
|             this.deleteIcon = CoreConstants.ICON_LOADING; |             this.deleteIcon = CoreConstants.ICON_LOADING; | ||||||
| 
 | 
 | ||||||
|             try { |             try { | ||||||
| @ -1463,7 +1470,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|                     done && done(); |                     done && done(); | ||||||
|                 } |                 } | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 CoreAlerts.showError(error, { default: 'Error deleting conversation.' }); |                 CoreDomUtils.showErrorModalDefault(error, 'Error deleting conversation.'); | ||||||
|             } finally { |             } finally { | ||||||
|                 this.deleteIcon = 'fas-trash'; |                 this.deleteIcon = 'fas-trash'; | ||||||
|             } |             } | ||||||
| @ -1483,10 +1490,11 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|             throw new CoreError('No member selected to be unblocked.'); |             throw new CoreError('No member selected to be unblocked.'); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         const template = Translate.instant('addon.messages.unblockuserconfirm', { $a: this.otherMember.fullname }); | ||||||
|  |         const okText = Translate.instant('addon.messages.unblockuser'); | ||||||
|  | 
 | ||||||
|         try { |         try { | ||||||
|             await CoreAlerts.confirm(Translate.instant('addon.messages.unblockuserconfirm', { $a: this.otherMember.fullname }), { |             await CoreDomUtils.showConfirm(template, undefined, okText); | ||||||
|                 okText: Translate.instant('addon.messages.unblockuser'), |  | ||||||
|             }); |  | ||||||
| 
 | 
 | ||||||
|             this.blockIcon = CoreConstants.ICON_LOADING; |             this.blockIcon = CoreConstants.ICON_LOADING; | ||||||
| 
 | 
 | ||||||
| @ -1501,7 +1509,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|                     this.showLoadingModal = false; |                     this.showLoadingModal = false; | ||||||
|                 } |                 } | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('core.error') }); |                 CoreDomUtils.showErrorModalDefault(error, 'core.error', true); | ||||||
|             } finally { |             } finally { | ||||||
|                 this.blockIcon = this.otherMember.isblocked ? 'fas-user-check' : 'fas-user-lock'; |                 this.blockIcon = this.otherMember.isblocked ? 'fas-user-check' : 'fas-user-lock'; | ||||||
|             } |             } | ||||||
| @ -1521,10 +1529,11 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|             throw new CoreError('No member selected to be requested.'); |             throw new CoreError('No member selected to be requested.'); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         const template = Translate.instant('addon.messages.addcontactconfirm', { $a: this.otherMember.fullname }); | ||||||
|  |         const okText = Translate.instant('core.add'); | ||||||
|  | 
 | ||||||
|         try { |         try { | ||||||
|             await CoreAlerts.confirm(Translate.instant('addon.messages.addcontactconfirm', { $a: this.otherMember.fullname }), { |             await CoreDomUtils.showConfirm(template, undefined, okText); | ||||||
|                 okText: Translate.instant('core.add'), |  | ||||||
|             }); |  | ||||||
| 
 | 
 | ||||||
|             this.addRemoveIcon = CoreConstants.ICON_LOADING; |             this.addRemoveIcon = CoreConstants.ICON_LOADING; | ||||||
| 
 | 
 | ||||||
| @ -1539,7 +1548,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|                     this.showLoadingModal = false; |                     this.showLoadingModal = false; | ||||||
|                 } |                 } | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('core.error') }); |                 CoreDomUtils.showErrorModalDefault(error, 'core.error', true); | ||||||
|             } finally { |             } finally { | ||||||
|                 this.addRemoveIcon = 'fas-user-plus'; |                 this.addRemoveIcon = 'fas-user-plus'; | ||||||
|             } |             } | ||||||
| @ -1570,7 +1579,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|                 this.showLoadingModal = false; |                 this.showLoadingModal = false; | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.error') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.error', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -1596,7 +1605,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|                 this.showLoadingModal = false; |                 this.showLoadingModal = false; | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.error') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.error', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -1611,10 +1620,11 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|             throw new CoreError('No member selected to be removed.'); |             throw new CoreError('No member selected to be removed.'); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         const template = Translate.instant('addon.messages.removecontactconfirm', { $a: this.otherMember.fullname }); | ||||||
|  |         const okText = Translate.instant('core.remove'); | ||||||
|  | 
 | ||||||
|         try { |         try { | ||||||
|             await CoreAlerts.confirm(Translate.instant('addon.messages.removecontactconfirm', { $a: this.otherMember.fullname }), { |             await CoreDomUtils.showConfirm(template, undefined, okText); | ||||||
|                 okText: Translate.instant('core.remove'), |  | ||||||
|             }); |  | ||||||
| 
 | 
 | ||||||
|             this.addRemoveIcon = CoreConstants.ICON_LOADING; |             this.addRemoveIcon = CoreConstants.ICON_LOADING; | ||||||
| 
 | 
 | ||||||
| @ -1629,7 +1639,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView | |||||||
|                     this.showLoadingModal = false; |                     this.showLoadingModal = false; | ||||||
|                 } |                 } | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('core.error') }); |                 CoreDomUtils.showErrorModalDefault(error, 'core.error', true); | ||||||
|             } finally { |             } finally { | ||||||
|                 this.addRemoveIcon = 'fas-user-plus'; |                 this.addRemoveIcon = 'fas-user-plus'; | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ import { | |||||||
|     AddonMessagesDiscussion, |     AddonMessagesDiscussion, | ||||||
|     AddonMessagesMessageAreaContact, |     AddonMessagesMessageAreaContact, | ||||||
| } from '../../services/messages'; | } from '../../services/messages'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreUtils } from '@singletons/utils'; | import { CoreUtils } from '@singletons/utils'; | ||||||
| import { ActivatedRoute, Params } from '@angular/router'; | import { ActivatedRoute, Params } from '@angular/router'; | ||||||
| import { CorePushNotificationsNotificationBasicData } from '@features/pushnotifications/services/pushnotifications'; | import { CorePushNotificationsNotificationBasicData } from '@features/pushnotifications/services/pushnotifications'; | ||||||
| @ -33,7 +34,6 @@ import { CoreSplitViewComponent } from '@components/split-view/split-view'; | |||||||
| import { CoreKeyboard } from '@singletons/keyboard'; | import { CoreKeyboard } from '@singletons/keyboard'; | ||||||
| import { ADDON_MESSAGES_NEW_MESSAGE_EVENT, ADDON_MESSAGES_READ_CHANGED_EVENT } from '@addons/messages/constants'; | import { ADDON_MESSAGES_NEW_MESSAGE_EVENT, ADDON_MESSAGES_READ_CHANGED_EVENT } from '@addons/messages/constants'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the list of discussions. |  * Page that displays the list of discussions. | ||||||
| @ -207,7 +207,7 @@ export class AddonMessagesDiscussions35Page implements OnInit, OnDestroy { | |||||||
|         try { |         try { | ||||||
|             await Promise.all(promises); |             await Promise.all(promises); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.messages.errorwhileretrievingdiscussions') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.messages.errorwhileretrievingdiscussions', true); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         this.loaded = true; |         this.loaded = true; | ||||||
| @ -241,7 +241,7 @@ export class AddonMessagesDiscussions35Page implements OnInit, OnDestroy { | |||||||
|             this.search.showResults = true; |             this.search.showResults = true; | ||||||
|             this.search.results = searchResults.messages; |             this.search.results = searchResults.messages; | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.messages.errorwhileretrievingmessages') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.messages.errorwhileretrievingmessages', true); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         this.loaded = true; |         this.loaded = true; | ||||||
|  | |||||||
| @ -26,6 +26,7 @@ import { | |||||||
|     AddonMessagesOffline, |     AddonMessagesOffline, | ||||||
|     AddonMessagesOfflineAnyMessagesFormatted, |     AddonMessagesOfflineAnyMessagesFormatted, | ||||||
| } from '../../services/messages-offline'; | } from '../../services/messages-offline'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreUser } from '@features/user/services/user'; | import { CoreUser } from '@features/user/services/user'; | ||||||
| import { CorePushNotificationsDelegate } from '@features/pushnotifications/services/push-delegate'; | import { CorePushNotificationsDelegate } from '@features/pushnotifications/services/push-delegate'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| @ -48,7 +49,6 @@ import { | |||||||
|     AddonMessagesMessageConversationType, |     AddonMessagesMessageConversationType, | ||||||
|     AddonMessagesUpdateConversationAction, |     AddonMessagesUpdateConversationAction, | ||||||
| } from '@addons/messages/constants'; | } from '@addons/messages/constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| const enum AddonMessagesGroupConversationOptionNames { | const enum AddonMessagesGroupConversationOptionNames { | ||||||
|     FAVOURITES = 'favourites', |     FAVOURITES = 'favourites', | ||||||
| @ -381,7 +381,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
|             // Load the data for the expanded option.
 |             // Load the data for the expanded option.
 | ||||||
|             await this.fetchDataForExpandedOption(); |             await this.fetchDataForExpandedOption(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.messages.errorwhileretrievingdiscussions') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.messages.errorwhileretrievingdiscussions', true); | ||||||
|         } |         } | ||||||
|         this.loaded = true; |         this.loaded = true; | ||||||
|     } |     } | ||||||
| @ -611,7 +611,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
|         try { |         try { | ||||||
|             await this.fetchDataForOption(option, true); |             await this.fetchDataForOption(option, true); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.messages.errorwhileretrievingdiscussions') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.messages.errorwhileretrievingdiscussions', true); | ||||||
|             option.loadMoreError = true; |             option.loadMoreError = true; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| @ -793,7 +793,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|         // Pass getCounts=true to update the counts everytime the user expands an option.
 |         // Pass getCounts=true to update the counts everytime the user expands an option.
 | ||||||
|         this.expandOption(option, true).catch((error) => { |         this.expandOption(option, true).catch((error) => { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.messages.errorwhileretrievingdiscussions') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.messages.errorwhileretrievingdiscussions', true); | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ import { | |||||||
|     AddonMessagesMessageAreaContact, |     AddonMessagesMessageAreaContact, | ||||||
|     AddonMessages, |     AddonMessages, | ||||||
| } from '../../services/messages'; | } from '../../services/messages'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreScreen } from '@services/screen'; | import { CoreScreen } from '@services/screen'; | ||||||
| import { CoreSplitViewComponent } from '@components/split-view/split-view'; | import { CoreSplitViewComponent } from '@components/split-view/split-view'; | ||||||
| @ -29,8 +30,6 @@ import { | |||||||
|     ADDON_MESSAGES_LIMIT_SEARCH, |     ADDON_MESSAGES_LIMIT_SEARCH, | ||||||
|     ADDON_MESSAGES_LIMIT_INITIAL_USER_SEARCH, |     ADDON_MESSAGES_LIMIT_INITIAL_USER_SEARCH, | ||||||
| } from '@addons/messages/constants'; | } from '@addons/messages/constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| import { Translate } from '@singletons'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page for searching users. |  * Page for searching users. | ||||||
| @ -226,7 +225,7 @@ export class AddonMessagesSearchPage implements OnDestroy { | |||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.messages.errorwhileretrievingusers') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.messages.errorwhileretrievingusers', true); | ||||||
| 
 | 
 | ||||||
|             if (loadMore == 'messages') { |             if (loadMore == 'messages') { | ||||||
|                 this.messages.loadMoreError = true; |                 this.messages.loadMoreError = true; | ||||||
|  | |||||||
| @ -23,13 +23,13 @@ import { CoreUser } from '@features/user/services/user'; | |||||||
| import { CoreConfig } from '@services/config'; | import { CoreConfig } from '@services/config'; | ||||||
| import { CoreEvents } from '@singletons/events'; | import { CoreEvents } from '@singletons/events'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreConstants } from '@/core/constants'; | import { CoreConstants } from '@/core/constants'; | ||||||
| import { AddonNotificationsPreferencesNotificationProcessorState } from '@addons/notifications/services/notifications'; | import { AddonNotificationsPreferencesNotificationProcessorState } from '@addons/notifications/services/notifications'; | ||||||
| import { CorePlatform } from '@services/platform'; | import { CorePlatform } from '@services/platform'; | ||||||
| import { CoreErrorHelper } from '@services/error-helper'; | import { CoreErrorHelper } from '@services/error-helper'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { ADDON_MESSAGES_NOTIFICATION_PREFERENCES_KEY, AddonMessagesMessagePrivacy } from '@addons/messages/constants'; | import { ADDON_MESSAGES_NOTIFICATION_PREFERENCES_KEY, AddonMessagesMessagePrivacy } from '@addons/messages/constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the messages settings page. |  * Page that displays the messages settings page. | ||||||
| @ -118,7 +118,7 @@ export class AddonMessagesSettingsPage implements OnInit, OnDestroy { | |||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|         } finally { |         } finally { | ||||||
|             this.preferencesLoaded = true; |             this.preferencesLoaded = true; | ||||||
|         } |         } | ||||||
| @ -171,7 +171,7 @@ export class AddonMessagesSettingsPage implements OnInit, OnDestroy { | |||||||
|             this.previousContactableValue = this.contactablePrivacy; |             this.previousContactableValue = this.contactablePrivacy; | ||||||
|         } catch (message) { |         } catch (message) { | ||||||
|             // Show error and revert change.
 |             // Show error and revert change.
 | ||||||
|             CoreAlerts.showError(message); |             CoreDomUtils.showErrorModal(message); | ||||||
|             this.contactablePrivacy = this.previousContactableValue; |             this.contactablePrivacy = this.previousContactableValue; | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
| @ -214,7 +214,7 @@ export class AddonMessagesSettingsPage implements OnInit, OnDestroy { | |||||||
|             this.updatePreferencesAfterDelay(); |             this.updatePreferencesAfterDelay(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             // Show error and revert change.
 |             // Show error and revert change.
 | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|             processor.enabled = !processor.enabled; |             processor.enabled = !processor.enabled; | ||||||
|         } finally { |         } finally { | ||||||
|             notification.updating = false; |             notification.updating = false; | ||||||
| @ -249,7 +249,7 @@ export class AddonMessagesSettingsPage implements OnInit, OnDestroy { | |||||||
|             this.updatePreferencesAfterDelay(); |             this.updatePreferencesAfterDelay(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             // Show error and revert change.
 |             // Show error and revert change.
 | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|             processorState.checked = !processorState.checked; |             processorState.checked = !processorState.checked; | ||||||
|         } finally { |         } finally { | ||||||
|             notification['updating'+state] = false; |             notification['updating'+state] = false; | ||||||
|  | |||||||
| @ -15,7 +15,7 @@ | |||||||
| import { Component, Input } from '@angular/core'; | import { Component, Input } from '@angular/core'; | ||||||
| import { CoreCanceledError } from '@classes/errors/cancelederror'; | import { CoreCanceledError } from '@classes/errors/cancelederror'; | ||||||
| import { CoreError } from '@classes/errors/error'; | import { CoreError } from '@classes/errors/error'; | ||||||
| import { CoreModals } from '@services/overlays/modals'; | import { CoreModals } from '@services/modals'; | ||||||
| import { AddonModAssignFeedbackCommentsTextData } from '../feedback/comments/services/handler'; | import { AddonModAssignFeedbackCommentsTextData } from '../feedback/comments/services/handler'; | ||||||
| import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../services/assign'; | import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../services/assign'; | ||||||
| import { toBoolean } from '@/core/transforms/boolean'; | import { toBoolean } from '@/core/transforms/boolean'; | ||||||
|  | |||||||
| @ -14,14 +14,14 @@ | |||||||
| 
 | 
 | ||||||
| import { Component, Input, ViewChild, ElementRef } from '@angular/core'; | import { Component, Input, ViewChild, ElementRef } from '@angular/core'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreFormFields, CoreForms } from '@singletons/form'; | import { CoreFormFields, CoreForms } from '@singletons/form'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { ModalController } from '@singletons'; | import { ModalController, Translate } from '@singletons'; | ||||||
| import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../../services/assign'; | import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../../services/assign'; | ||||||
| import { AddonModAssignFeedbackDelegate } from '../../services/feedback-delegate'; | import { AddonModAssignFeedbackDelegate } from '../../services/feedback-delegate'; | ||||||
| import { CoreSharedModule } from '@/core/shared.module'; | import { CoreSharedModule } from '@/core/shared.module'; | ||||||
| import { AddonModAssignComponentsModule } from '../components.module'; | import { AddonModAssignComponentsModule } from '../components.module'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Modal that allows editing a feedback plugin. |  * Modal that allows editing a feedback plugin. | ||||||
| @ -50,7 +50,7 @@ export class AddonModAssignEditFeedbackModalComponent { | |||||||
|     async closeModal(): Promise<void> { |     async closeModal(): Promise<void> { | ||||||
|         const changed = await this.hasDataChanged(); |         const changed = await this.hasDataChanged(); | ||||||
|         if (changed) { |         if (changed) { | ||||||
|             await CoreAlerts.confirmLeaveWithChanges(); |             await CoreDomUtils.showConfirm(Translate.instant('core.confirmcanceledit')); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         CoreForms.triggerFormCancelledEvent(this.formElement, CoreSites.getCurrentSiteId()); |         CoreForms.triggerFormCancelledEvent(this.formElement, CoreSites.getCurrentSiteId()); | ||||||
|  | |||||||
| @ -22,6 +22,7 @@ import { IonContent } from '@ionic/angular'; | |||||||
| import { CoreGroupInfo, CoreGroups } from '@services/groups'; | import { CoreGroupInfo, CoreGroups } from '@services/groups'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreTimeUtils } from '@services/utils/time'; | import { CoreTimeUtils } from '@services/utils/time'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| @ -52,7 +53,6 @@ import { | |||||||
|     ADDON_MOD_ASSIGN_WARN_GROUPS_OPTIONAL, |     ADDON_MOD_ASSIGN_WARN_GROUPS_OPTIONAL, | ||||||
|     ADDON_MOD_ASSIGN_WARN_GROUPS_REQUIRED, |     ADDON_MOD_ASSIGN_WARN_GROUPS_REQUIRED, | ||||||
| } from '../../constants'; | } from '../../constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Component that displays an assignment. |  * Component that displays an assignment. | ||||||
| @ -397,7 +397,8 @@ export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityCo | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (syncEventData.warnings && syncEventData.warnings.length) { |         if (syncEventData.warnings && syncEventData.warnings.length) { | ||||||
|             CoreAlerts.show({ message: syncEventData.warnings[0] }); |             // Show warnings.
 | ||||||
|  |             CoreDomUtils.showAlert(undefined, syncEventData.warnings[0]); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         return true; |         return true; | ||||||
|  | |||||||
| @ -39,6 +39,7 @@ import { CoreSplitViewComponent } from '@components/split-view/split-view'; | |||||||
| import { CoreGradesFormattedItem, CoreGradesHelper } from '@features/grades/services/grades-helper'; | import { CoreGradesFormattedItem, CoreGradesHelper } from '@features/grades/services/grades-helper'; | ||||||
| import { CoreMenuItem, CoreUtils } from '@singletons/utils'; | import { CoreMenuItem, CoreUtils } from '@singletons/utils'; | ||||||
| import { AddonModAssignHelper, AddonModAssignSubmissionFormatted } from '../../services/assign-helper'; | import { AddonModAssignHelper, AddonModAssignSubmissionFormatted } from '../../services/assign-helper'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CoreText } from '@singletons/text'; | import { CoreText } from '@singletons/text'; | ||||||
| import { CoreCourse, CoreCourseModuleGradeInfo, CoreCourseModuleGradeOutcome } from '@features/course/services/course'; | import { CoreCourse, CoreCourseModuleGradeInfo, CoreCourseModuleGradeOutcome } from '@features/course/services/course'; | ||||||
| @ -68,9 +69,8 @@ import { | |||||||
|     ADDON_MOD_ASSIGN_UNLIMITED_ATTEMPTS, |     ADDON_MOD_ASSIGN_UNLIMITED_ATTEMPTS, | ||||||
| } from '../../constants'; | } from '../../constants'; | ||||||
| import { CoreViewer } from '@features/viewer/services/viewer'; | import { CoreViewer } from '@features/viewer/services/viewer'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Component that displays an assignment submission. |  * Component that displays an assignment submission. | ||||||
| @ -296,7 +296,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can | |||||||
| 
 | 
 | ||||||
|         if (modified) { |         if (modified) { | ||||||
|             // Modified, confirm user wants to go back.
 |             // Modified, confirm user wants to go back.
 | ||||||
|             await CoreAlerts.confirmLeaveWithChanges(); |             await CoreDomUtils.showConfirm(Translate.instant('core.confirmcanceledit')); | ||||||
| 
 | 
 | ||||||
|             await this.discardDrafts(); |             await this.discardDrafts(); | ||||||
|         } |         } | ||||||
| @ -315,7 +315,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (!CoreNetwork.isOnline()) { |         if (!CoreNetwork.isOnline()) { | ||||||
|             CoreAlerts.showError(Translate.instant('core.networkerrormsg')); |             CoreDomUtils.showErrorModal('core.networkerrormsg', true); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @ -363,7 +363,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can | |||||||
|                 await this.invalidateAndRefresh(true); |                 await this.invalidateAndRefresh(true); | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.error') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.error', true); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
| @ -388,11 +388,12 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can | |||||||
|     async goToEdit(afterCopyPrevious = false): Promise<void> { |     async goToEdit(afterCopyPrevious = false): Promise<void> { | ||||||
|         if (!afterCopyPrevious && this.assign?.timelimit && (!this.userSubmission || !this.userSubmission.timestarted)) { |         if (!afterCopyPrevious && this.assign?.timelimit && (!this.userSubmission || !this.userSubmission.timestarted)) { | ||||||
|             try { |             try { | ||||||
|                 await CoreAlerts.confirm( |                 await CoreDomUtils.showConfirm( | ||||||
|                     Translate.instant('addon.mod_assign.confirmstart', { |                     Translate.instant('addon.mod_assign.confirmstart', { | ||||||
|                         $a: CoreTime.formatTime(this.assign.timelimit), |                         $a: CoreTime.formatTime(this.assign.timelimit), | ||||||
|                     }), |                     }), | ||||||
|                     { okText: Translate.instant('addon.mod_assign.beginassignment') }, |                     undefined, | ||||||
|  |                     Translate.instant('addon.mod_assign.beginassignment'), | ||||||
|                 ); |                 ); | ||||||
|             } catch { |             } catch { | ||||||
|                 return; // User canceled.
 |                 return; // User canceled.
 | ||||||
| @ -420,7 +421,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can | |||||||
|             'addon.mod_assign.removesubmissionconfirmwithtimelimit' : |             'addon.mod_assign.removesubmissionconfirmwithtimelimit' : | ||||||
|             'addon.mod_assign.removesubmissionconfirm'; |             'addon.mod_assign.removesubmissionconfirm'; | ||||||
|         try { |         try { | ||||||
|             await CoreAlerts.confirmDelete(Translate.instant(message)); |             await CoreDomUtils.showDeleteConfirm(message); | ||||||
|         } catch { |         } catch { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @ -444,7 +445,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can | |||||||
|                 CoreSites.getCurrentSiteId(), |                 CoreSites.getCurrentSiteId(), | ||||||
|             ); |             ); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error removing submission.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error removing submission.'); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
| @ -649,7 +650,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can | |||||||
| 
 | 
 | ||||||
|             await Promise.all(promises); |             await Promise.all(promises); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting assigment data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting assigment data.'); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
| @ -935,14 +936,14 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (this.assign.requiresubmissionstatement && !acceptStatement) { |         if (this.assign.requiresubmissionstatement && !acceptStatement) { | ||||||
|             CoreAlerts.showError(Translate.instant('addon.mod_assign.acceptsubmissionstatement')); |             CoreDomUtils.showErrorModal('addon.mod_assign.acceptsubmissionstatement', true); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         try { |         try { | ||||||
|             // Ask for confirmation. @todo plugin precheck_submission
 |             // Ask for confirmation. @todo plugin precheck_submission
 | ||||||
|             await CoreAlerts.confirm(Translate.instant('addon.mod_assign.confirmsubmission')); |             await CoreDomUtils.showConfirm(Translate.instant('addon.mod_assign.confirmsubmission')); | ||||||
| 
 | 
 | ||||||
|             const modal = await CoreLoadings.show('core.sending', true); |             const modal = await CoreLoadings.show('core.sending', true); | ||||||
| 
 | 
 | ||||||
| @ -962,7 +963,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can | |||||||
|                     userId: this.currentUserId, |                     userId: this.currentUserId, | ||||||
|                 }, this.siteId); |                 }, this.siteId); | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('core.error') }); |                 CoreDomUtils.showErrorModalDefault(error, 'core.error', true); | ||||||
|             } finally { |             } finally { | ||||||
|                 modal.dismiss(); |                 modal.dismiss(); | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ import { CanLeave } from '@guards/can-leave'; | |||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | ||||||
| import { CoreSync } from '@services/sync'; | import { CoreSync } from '@services/sync'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreFormFields, CoreForms } from '@singletons/form'; | import { CoreFormFields, CoreForms } from '@singletons/form'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CoreEvents } from '@singletons/events'; | import { CoreEvents } from '@singletons/events'; | ||||||
| @ -44,10 +45,9 @@ import { | |||||||
|     ADDON_MOD_ASSIGN_SUBMISSION_SAVED_EVENT, |     ADDON_MOD_ASSIGN_SUBMISSION_SAVED_EVENT, | ||||||
|     ADDON_MOD_ASSIGN_SUBMITTED_FOR_GRADING_EVENT, |     ADDON_MOD_ASSIGN_SUBMITTED_FOR_GRADING_EVENT, | ||||||
| } from '../../constants'; | } from '../../constants'; | ||||||
| import { CoreToasts, ToastDuration } from '@services/overlays/toasts'; | import { CoreToasts, ToastDuration } from '@services/toasts'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that allows adding or editing an assigment submission. |  * Page that allows adding or editing an assigment submission. | ||||||
| @ -101,7 +101,8 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave { | |||||||
|             this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); |             this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); | ||||||
|             this.isBlind = !!CoreNavigator.getRouteNumberParam('blindId'); |             this.isBlind = !!CoreNavigator.getRouteNumberParam('blindId'); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -125,7 +126,7 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave { | |||||||
|         // Check if data has changed.
 |         // Check if data has changed.
 | ||||||
|         const changed = await this.hasDataChanged(); |         const changed = await this.hasDataChanged(); | ||||||
|         if (changed) { |         if (changed) { | ||||||
|             await CoreAlerts.confirmLeaveWithChanges(); |             await CoreDomUtils.showConfirm(Translate.instant('core.confirmcanceledit')); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // Nothing has changed or user confirmed to leave. Clear temporary data from plugins.
 |         // Nothing has changed or user confirmed to leave. Clear temporary data from plugins.
 | ||||||
| @ -245,7 +246,7 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave { | |||||||
|                 url: `/mod/assign/view.php?action=editsubmission&id=${this.moduleId}`, |                 url: `/mod/assign/view.php?action=editsubmission&id=${this.moduleId}`, | ||||||
|             }); |             }); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting assigment data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting assigment data.'); | ||||||
| 
 | 
 | ||||||
|             // Leave the player.
 |             // Leave the player.
 | ||||||
|             this.leaveWithoutCheck(); |             this.leaveWithoutCheck(); | ||||||
| @ -375,7 +376,7 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave { | |||||||
|             await this.saveSubmission(); |             await this.saveSubmission(); | ||||||
|             this.leaveWithoutCheck(); |             this.leaveWithoutCheck(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error saving submission.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error saving submission.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -19,6 +19,7 @@ import { CoreSplitViewComponent } from '@components/split-view/split-view'; | |||||||
| import { CoreGroupInfo } from '@services/groups'; | import { CoreGroupInfo } from '@services/groups'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||||
| import { | import { | ||||||
| @ -33,7 +34,6 @@ import { | |||||||
| } from '../../services/assign-sync'; | } from '../../services/assign-sync'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { ADDON_MOD_ASSIGN_AUTO_SYNCED, ADDON_MOD_ASSIGN_GRADED_EVENT, ADDON_MOD_ASSIGN_MANUAL_SYNCED } from '../../constants'; | import { ADDON_MOD_ASSIGN_AUTO_SYNCED, ADDON_MOD_ASSIGN_GRADED_EVENT, ADDON_MOD_ASSIGN_MANUAL_SYNCED } from '../../constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays a list of submissions of an assignment. |  * Page that displays a list of submissions of an assignment. | ||||||
| @ -107,7 +107,8 @@ export class AddonModAssignSubmissionListPage implements AfterViewInit, OnDestro | |||||||
|                 AddonModAssignSubmissionListPage, |                 AddonModAssignSubmissionListPage, | ||||||
|             ); |             ); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -183,7 +184,7 @@ export class AddonModAssignSubmissionListPage implements AfterViewInit, OnDestro | |||||||
|                 url: `/mod/assign/view.php?id=${this.assign.cmid}&action=grading`, |                 url: `/mod/assign/view.php?id=${this.assign.cmid}&action=grading`, | ||||||
|             }); |             }); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting assigment data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting assigment data.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -20,13 +20,13 @@ import { CoreCourse } from '@features/course/services/course'; | |||||||
| import { CanLeave } from '@guards/can-leave'; | import { CanLeave } from '@guards/can-leave'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreScreen } from '@services/screen'; | import { CoreScreen } from '@services/screen'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { AddonModAssignListFilterName, AddonModAssignSubmissionsSource } from '../../classes/submissions-source'; | import { AddonModAssignListFilterName, AddonModAssignSubmissionsSource } from '../../classes/submissions-source'; | ||||||
| import { AddonModAssignSubmissionComponent } from '../../components/submission/submission'; | import { AddonModAssignSubmissionComponent } from '../../components/submission/submission'; | ||||||
| import { AddonModAssign, AddonModAssignAssign } from '../../services/assign'; | import { AddonModAssign, AddonModAssignAssign } from '../../services/assign'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays a submission. |  * Page that displays a submission. | ||||||
| @ -99,7 +99,8 @@ export class AddonModAssignSubmissionReviewPage implements OnInit, OnDestroy, Ca | |||||||
| 
 | 
 | ||||||
|                 this.submissions.start(); |                 this.submissions.start(); | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 CoreAlerts.showError(error); |                 CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|                 CoreNavigator.back(); |                 CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|                 return; |                 return; | ||||||
| @ -230,7 +231,7 @@ export class AddonModAssignSubmissionReviewPage implements OnInit, OnDestroy, Ca | |||||||
|                 CoreNavigator.back(); |                 CoreNavigator.back(); | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.error') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.error', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ import { IonContent } from '@ionic/angular'; | |||||||
| import { CoreApp } from '@services/app'; | import { CoreApp } from '@services/app'; | ||||||
| import { CoreGroupInfo, CoreGroups } from '@services/groups'; | import { CoreGroupInfo, CoreGroups } from '@services/groups'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreText } from '@singletons/text'; | import { CoreText } from '@singletons/text'; | ||||||
| import { CoreTimeUtils } from '@services/utils/time'; | import { CoreTimeUtils } from '@services/utils/time'; | ||||||
| import { CoreArray } from '@singletons/array'; | import { CoreArray } from '@singletons/array'; | ||||||
| @ -31,11 +32,10 @@ import { | |||||||
|     AddonModBBBRecordingPlaybackTypes, |     AddonModBBBRecordingPlaybackTypes, | ||||||
| } from '../../services/bigbluebuttonbn'; | } from '../../services/bigbluebuttonbn'; | ||||||
| import { ADDON_MOD_BBB_COMPONENT } from '../../constants'; | import { ADDON_MOD_BBB_COMPONENT } from '../../constants'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { convertTextToHTMLElement } from '@/core/utils/create-html-element'; | import { convertTextToHTMLElement } from '@/core/utils/create-html-element'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreOpener } from '@singletons/opener'; | import { CoreOpener } from '@singletons/opener'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Component that displays a Big Blue Button activity. |  * Component that displays a Big Blue Button activity. | ||||||
| @ -287,7 +287,7 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo | |||||||
| 
 | 
 | ||||||
|             await this.fetchRecordings(); |             await this.fetchRecordings(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|         } finally { |         } finally { | ||||||
|             this.showLoading = false; |             this.showLoading = false; | ||||||
|         } |         } | ||||||
| @ -313,7 +313,7 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo | |||||||
| 
 | 
 | ||||||
|             this.updateMeetingInfo(true); |             this.updateMeetingInfo(true); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
| @ -330,10 +330,11 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         try { |         try { | ||||||
|             await CoreAlerts.confirm(Translate.instant('addon.mod_bigbluebuttonbn.end_session_confirm'), { |             await CoreDomUtils.showConfirm( | ||||||
|                 header: Translate.instant('addon.mod_bigbluebuttonbn.end_session_confirm_title'), |                 Translate.instant('addon.mod_bigbluebuttonbn.end_session_confirm'), | ||||||
|                 okText: Translate.instant('core.yes'), |                 Translate.instant('addon.mod_bigbluebuttonbn.end_session_confirm_title'), | ||||||
|             }); |                 Translate.instant('core.yes'), | ||||||
|  |             ); | ||||||
|         } catch { |         } catch { | ||||||
|             // User canceled.
 |             // User canceled.
 | ||||||
|             return; |             return; | ||||||
| @ -346,7 +347,7 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo | |||||||
| 
 | 
 | ||||||
|             this.updateMeetingInfo(); |             this.updateMeetingInfo(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -24,6 +24,7 @@ import { CoreCourseModulePrefetchDelegate } from '@features/course/services/modu | |||||||
| import { CoreTag, CoreTagItem } from '@features/tag/services/tag'; | import { CoreTag, CoreTagItem } from '@features/tag/services/tag'; | ||||||
| import { CoreNetwork } from '@services/network'; | import { CoreNetwork } from '@services/network'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreErrorHelper } from '@services/error-helper'; | import { CoreErrorHelper } from '@services/error-helper'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| @ -36,8 +37,7 @@ import { | |||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreUrl } from '@singletons/url'; | import { CoreUrl } from '@singletons/url'; | ||||||
| import { ADDON_MOD_BOOK_COMPONENT, AddonModBookNavStyle } from '../../constants'; | import { ADDON_MOD_BOOK_COMPONENT, AddonModBookNavStyle } from '../../constants'; | ||||||
| import { CoreModals } from '@services/overlays/modals'; | import { CoreModals } from '@services/modals'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays a book contents. |  * Page that displays a book contents. | ||||||
| @ -79,7 +79,8 @@ export class AddonModBookContentsPage implements OnInit, OnDestroy { | |||||||
|             this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); |             this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); | ||||||
|             this.initialChapterId = CoreNavigator.getRouteNumberParam('chapterId'); |             this.initialChapterId = CoreNavigator.getRouteNumberParam('chapterId'); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -135,7 +136,7 @@ export class AddonModBookContentsPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             await source.load(); |             await source.load(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.course.errorgetmodule', true); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -14,11 +14,11 @@ | |||||||
| import { Component, Input, OnDestroy, OnInit } from '@angular/core'; | import { Component, Input, OnDestroy, OnInit } from '@angular/core'; | ||||||
| import { CoreNetwork } from '@services/network'; | import { CoreNetwork } from '@services/network'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
| import { ModalController, NgZone, Translate } from '@singletons'; | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
|  | import { ModalController, NgZone } from '@singletons'; | ||||||
| import { Subscription } from 'rxjs'; | import { Subscription } from 'rxjs'; | ||||||
| import { AddonModChat, AddonModChatUser } from '../../services/chat'; | import { AddonModChat, AddonModChatUser } from '../../services/chat'; | ||||||
| import { CoreSharedModule } from '@/core/shared.module'; | import { CoreSharedModule } from '@/core/shared.module'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * MMdal that displays the chat session users. |  * MMdal that displays the chat session users. | ||||||
| @ -63,7 +63,7 @@ export class AddonModChatUsersModalComponent implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             this.users = data.users; |             this.users = data.users; | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_chat.errorwhilegettingchatusers') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_chat.errorwhilegettingchatusers', true); | ||||||
|         } finally { |         } finally { | ||||||
|             this.usersLoaded = true; |             this.usersLoaded = true; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -19,6 +19,7 @@ import { IonContent } from '@ionic/angular'; | |||||||
| import { CoreNetwork } from '@services/network'; | import { CoreNetwork } from '@services/network'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { NgZone, Translate } from '@singletons'; | import { NgZone, Translate } from '@singletons'; | ||||||
| import { CoreEvents } from '@singletons/events'; | import { CoreEvents } from '@singletons/events'; | ||||||
| @ -30,9 +31,8 @@ import { CoreTime } from '@singletons/time'; | |||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreKeyboard } from '@singletons/keyboard'; | import { CoreKeyboard } from '@singletons/keyboard'; | ||||||
| import { CoreWait } from '@singletons/wait'; | import { CoreWait } from '@singletons/wait'; | ||||||
| import { CoreModals } from '@services/overlays/modals'; | import { CoreModals } from '@services/modals'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays a chat session. |  * Page that displays a chat session. | ||||||
| @ -108,7 +108,7 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave { | |||||||
|             this.startPolling(); |             this.startPolling(); | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_chat.errorwhileconnecting') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_chat.errorwhileconnecting', true); | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
| @ -294,7 +294,7 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave { | |||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 // Fail again. Stop polling if needed.
 |                 // Fail again. Stop polling if needed.
 | ||||||
|                 this.stopPolling(); |                 this.stopPolling(); | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('addon.mod_chat.errorwhileretrievingmessages') }); |                 CoreDomUtils.showErrorModalDefault(error, 'addon.mod_chat.errorwhileretrievingmessages', true); | ||||||
| 
 | 
 | ||||||
|                 throw error; |                 throw error; | ||||||
|             } |             } | ||||||
| @ -331,7 +331,7 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave { | |||||||
|             CoreKeyboard.close(); |             CoreKeyboard.close(); | ||||||
| 
 | 
 | ||||||
|             this.newMessage = text; |             this.newMessage = text; | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_chat.errorwhilesendingmessage') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_chat.errorwhilesendingmessage', true); | ||||||
|         } finally { |         } finally { | ||||||
|             this.sending = false; |             this.sending = false; | ||||||
|         } |         } | ||||||
| @ -380,7 +380,7 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave { | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // Modified, confirm user wants to go back.
 |         // Modified, confirm user wants to go back.
 | ||||||
|         await CoreAlerts.confirm(Translate.instant('addon.mod_chat.confirmloss')); |         await CoreDomUtils.showConfirm(Translate.instant('addon.mod_chat.confirmloss')); | ||||||
| 
 | 
 | ||||||
|         return true; |         return true; | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -16,13 +16,13 @@ import { Component, OnInit } from '@angular/core'; | |||||||
| import { CoreUser } from '@features/user/services/user'; | import { CoreUser } from '@features/user/services/user'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { AddonModChat } from '../../services/chat'; | import { AddonModChat } from '../../services/chat'; | ||||||
| import { AddonModChatFormattedSessionMessage, AddonModChatHelper } from '../../services/chat-helper'; | import { AddonModChatFormattedSessionMessage, AddonModChatHelper } from '../../services/chat-helper'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays list of chat session messages. |  * Page that displays list of chat session messages. | ||||||
| @ -75,7 +75,8 @@ export class AddonModChatSessionMessagesPage implements OnInit { | |||||||
|             this.chatId = CoreNavigator.getRequiredRouteNumberParam('chatId'); |             this.chatId = CoreNavigator.getRequiredRouteNumberParam('chatId'); | ||||||
|             this.groupId = CoreNavigator.getRouteNumberParam('groupId') || 0; |             this.groupId = CoreNavigator.getRouteNumberParam('groupId') || 0; | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -118,7 +119,7 @@ export class AddonModChatSessionMessagesPage implements OnInit { | |||||||
| 
 | 
 | ||||||
|             this.messages[this.messages.length - 1].showTail = true; |             this.messages[this.messages.length - 1].showTail = true; | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.errorloadingcontent') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.errorloadingcontent', true); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -18,14 +18,14 @@ import { CoreRoutedItemsManagerSourcesTracker } from '@classes/items-management/ | |||||||
| import { CoreSplitViewComponent } from '@components/split-view/split-view'; | import { CoreSplitViewComponent } from '@components/split-view/split-view'; | ||||||
| import { CoreGroupInfo } from '@services/groups'; | import { CoreGroupInfo } from '@services/groups'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { AddonModChatSessionFormatted, AddonModChatSessionsSource } from '../../classes/chat-sessions-source'; | import { AddonModChatSessionFormatted, AddonModChatSessionsSource } from '../../classes/chat-sessions-source'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { AddonModChat } from '@addons/mod/chat/services/chat'; | import { AddonModChat } from '@addons/mod/chat/services/chat'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays list of chat sessions. |  * Page that displays list of chat sessions. | ||||||
| @ -73,7 +73,8 @@ export class AddonModChatSessionsPage implements OnInit, AfterViewInit, OnDestro | |||||||
| 
 | 
 | ||||||
|             this.sessions = new CoreListItemsManager(source, AddonModChatSessionsPage); |             this.sessions = new CoreListItemsManager(source, AddonModChatSessionsPage); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -118,7 +119,7 @@ export class AddonModChatSessionsPage implements OnInit, AfterViewInit, OnDestro | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.errorloadingcontent') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.errorloadingcontent', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -131,7 +132,7 @@ export class AddonModChatSessionsPage implements OnInit, AfterViewInit, OnDestro | |||||||
|         try { |         try { | ||||||
|             await this.sessions.reload(); |             await this.sessions.reload(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.errorloadingcontent') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.errorloadingcontent', true); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -18,6 +18,7 @@ import { CoreCourseModuleMainActivityComponent } from '@features/course/classes/ | |||||||
| import { CoreCourseContentsPage } from '@features/course/pages/contents/contents'; | import { CoreCourseContentsPage } from '@features/course/pages/contents/contents'; | ||||||
| import { IonContent } from '@ionic/angular'; | import { IonContent } from '@ionic/angular'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreTimeUtils } from '@services/utils/time'; | import { CoreTimeUtils } from '@services/utils/time'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CoreEvents } from '@singletons/events'; | import { CoreEvents } from '@singletons/events'; | ||||||
| @ -40,8 +41,7 @@ import { | |||||||
|     ADDON_MOD_CHOICE_PUBLISH_ANONYMOUS, |     ADDON_MOD_CHOICE_PUBLISH_ANONYMOUS, | ||||||
|     AddonModChoiceShowResults, |     AddonModChoiceShowResults, | ||||||
| } from '../../constants'; | } from '../../constants'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Component that displays a choice. |  * Component that displays a choice. | ||||||
| @ -370,7 +370,7 @@ export class AddonModChoiceIndexComponent extends CoreCourseModuleMainActivityCo | |||||||
| 
 | 
 | ||||||
|         // Only show confirm if choice doesn't allow update.
 |         // Only show confirm if choice doesn't allow update.
 | ||||||
|         if (!this.choice.allowupdate) { |         if (!this.choice.allowupdate) { | ||||||
|             await CoreAlerts.confirm(Translate.instant('core.areyousure')); |             await CoreDomUtils.showConfirm(Translate.instant('core.areyousure')); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         const responses: number[] = []; |         const responses: number[] = []; | ||||||
| @ -401,7 +401,7 @@ export class AddonModChoiceIndexComponent extends CoreCourseModuleMainActivityCo | |||||||
| 
 | 
 | ||||||
|             await this.dataUpdated(online); |             await this.dataUpdated(online); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_choice.cannotsubmit') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_choice.cannotsubmit', true); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
| @ -416,7 +416,7 @@ export class AddonModChoiceIndexComponent extends CoreCourseModuleMainActivityCo | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         try { |         try { | ||||||
|             await CoreAlerts.confirmDelete(Translate.instant('core.areyousure')); |             await CoreDomUtils.showDeleteConfirm(); | ||||||
|         } catch { |         } catch { | ||||||
|             // User cancelled.
 |             // User cancelled.
 | ||||||
|             return; |             return; | ||||||
| @ -434,7 +434,7 @@ export class AddonModChoiceIndexComponent extends CoreCourseModuleMainActivityCo | |||||||
|             // Refresh the data. Don't call dataUpdated because deleting an answer doesn't mark the choice as outdated.
 |             // Refresh the data. Don't call dataUpdated because deleting an answer doesn't mark the choice as outdated.
 | ||||||
|             await this.refreshContent(false); |             await this.refreshContent(false); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_choice.cannotsubmit') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_choice.cannotsubmit', true); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -26,7 +26,7 @@ import { | |||||||
| } from '../../services/data'; | } from '../../services/data'; | ||||||
| import { AddonModDataHelper } from '../../services/data-helper'; | import { AddonModDataHelper } from '../../services/data-helper'; | ||||||
| import { AddonModDataOffline } from '../../services/data-offline'; | import { AddonModDataOffline } from '../../services/data-offline'; | ||||||
| import { CorePopovers } from '@services/overlays/popovers'; | import { CorePopovers } from '@services/popovers'; | ||||||
| import { AddonModDataActionsMenuItem } from '../actionsmenu/actionsmenu'; | import { AddonModDataActionsMenuItem } from '../actionsmenu/actionsmenu'; | ||||||
| import { | import { | ||||||
|     ADDON_MOD_DATA_ENTRY_CHANGED, |     ADDON_MOD_DATA_ENTRY_CHANGED, | ||||||
|  | |||||||
| @ -51,11 +51,9 @@ import { | |||||||
|     AddonModDataTemplateType, |     AddonModDataTemplateType, | ||||||
|     AddonModDataTemplateMode, |     AddonModDataTemplateMode, | ||||||
| } from '../../constants'; | } from '../../constants'; | ||||||
| import { CoreModals } from '@services/overlays/modals'; | import { CoreModals } from '@services/modals'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreObject } from '@singletons/object'; | import { CoreObject } from '@singletons/object'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| import { Translate } from '@singletons'; |  | ||||||
| 
 | 
 | ||||||
| const contentToken = '<!-- CORE-DATABASE-CONTENT-GOES-HERE -->'; | const contentToken = '<!-- CORE-DATABASE-CONTENT-GOES-HERE -->'; | ||||||
| 
 | 
 | ||||||
| @ -438,7 +436,7 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp | |||||||
| 
 | 
 | ||||||
|             this.logSearch?.(); |             this.logSearch?.(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.course.errorgetmodule', true); | ||||||
|         } finally { |         } finally { | ||||||
|             this.showLoading = false; |             this.showLoading = false; | ||||||
|         } |         } | ||||||
| @ -486,7 +484,7 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp | |||||||
|         try { |         try { | ||||||
|             await this.fetchEntriesData(); |             await this.fetchEntriesData(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.course.errorgetmodule', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -19,10 +19,10 @@ import { FormBuilder } from '@angular/forms'; | |||||||
| import { SafeUrl } from '@angular/platform-browser'; | import { SafeUrl } from '@angular/platform-browser'; | ||||||
| import { CoreAnyError } from '@classes/errors/error'; | import { CoreAnyError } from '@classes/errors/error'; | ||||||
| import { CoreGeolocation, CoreGeolocationError, CoreGeolocationErrorReason } from '@services/geolocation'; | import { CoreGeolocation, CoreGeolocationError, CoreGeolocationErrorReason } from '@services/geolocation'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; |  | ||||||
| import { CorePlatform } from '@services/platform'; | import { CorePlatform } from '@services/platform'; | ||||||
| import { DomSanitizer, Translate } from '@singletons'; | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
|  | import { DomSanitizer } from '@singletons'; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Component to render data latlong field. |  * Component to render data latlong field. | ||||||
| @ -140,12 +140,12 @@ export class AddonModDataFieldLatlongComponent extends AddonModDataFieldPluginBa | |||||||
|      */ |      */ | ||||||
|     protected showLocationErrorModal(error: CoreAnyError | CoreGeolocationError): void { |     protected showLocationErrorModal(error: CoreAnyError | CoreGeolocationError): void { | ||||||
|         if (error instanceof CoreGeolocationError) { |         if (error instanceof CoreGeolocationError) { | ||||||
|             CoreAlerts.showError(Translate.instant(this.getGeolocationErrorMessage(error))); |             CoreDomUtils.showErrorModal(this.getGeolocationErrorMessage(error), true); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         CoreAlerts.showError(error, { default: 'Error getting location' }); |         CoreDomUtils.showErrorModalDefault(error, 'Error getting location'); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  | |||||||
| @ -21,6 +21,7 @@ import { IonContent } from '@ionic/angular'; | |||||||
| import { CoreGroupInfo, CoreGroups } from '@services/groups'; | import { CoreGroupInfo, CoreGroups } from '@services/groups'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreForms } from '@singletons/form'; | import { CoreForms } from '@singletons/form'; | ||||||
| import { CoreUtils } from '@singletons/utils'; | import { CoreUtils } from '@singletons/utils'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| @ -43,10 +44,9 @@ import { CoreText } from '@singletons/text'; | |||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { ADDON_MOD_DATA_COMPONENT, ADDON_MOD_DATA_ENTRY_CHANGED, AddonModDataTemplateType } from '../../constants'; | import { ADDON_MOD_DATA_COMPONENT, ADDON_MOD_DATA_ENTRY_CHANGED, AddonModDataTemplateType } from '../../constants'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreWSError } from '@classes/errors/wserror'; | import { CoreWSError } from '@classes/errors/wserror'; | ||||||
| import { CoreArray } from '@singletons/array'; | import { CoreArray } from '@singletons/array'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the view edit page. |  * Page that displays the view edit page. | ||||||
| @ -126,7 +126,7 @@ export class AddonModDataEditPage implements OnInit { | |||||||
|             this.entryId = CoreNavigator.getRouteNumberParam('entryId') || undefined; |             this.entryId = CoreNavigator.getRouteNumberParam('entryId') || undefined; | ||||||
|             this.selectedGroup = CoreNavigator.getRouteNumberParam('group') || 0; |             this.selectedGroup = CoreNavigator.getRouteNumberParam('group') || 0; | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
| 
 | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
| @ -156,7 +156,7 @@ export class AddonModDataEditPage implements OnInit { | |||||||
| 
 | 
 | ||||||
|         if (changed) { |         if (changed) { | ||||||
|             // Show confirmation if some data has been modified.
 |             // Show confirmation if some data has been modified.
 | ||||||
|             await CoreAlerts.confirmLeaveWithChanges(); |             await CoreDomUtils.showConfirm(Translate.instant('core.confirmcanceledit')); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // Delete the local files from the tmp folder.
 |         // Delete the local files from the tmp folder.
 | ||||||
| @ -238,7 +238,7 @@ export class AddonModDataEditPage implements OnInit { | |||||||
| 
 | 
 | ||||||
|                 if (!haveAccess) { |                 if (!haveAccess) { | ||||||
|                     // You shall not pass, go back.
 |                     // You shall not pass, go back.
 | ||||||
|                     CoreAlerts.showError(Translate.instant('addon.mod_data.noaccess')); |                     CoreDomUtils.showErrorModal('addon.mod_data.noaccess', true); | ||||||
| 
 | 
 | ||||||
|                     // Go back to entry list.
 |                     // Go back to entry list.
 | ||||||
|                     this.forceLeave = true; |                     this.forceLeave = true; | ||||||
| @ -251,7 +251,7 @@ export class AddonModDataEditPage implements OnInit { | |||||||
|             this.editFormRender = this.displayEditFields(); |             this.editFormRender = this.displayEditFields(); | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.course.errorgetmodule', true); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         this.loaded = true; |         this.loaded = true; | ||||||
| @ -395,9 +395,10 @@ export class AddonModDataEditPage implements OnInit { | |||||||
|                     this.scrollToFirstError(); |                     this.scrollToFirstError(); | ||||||
| 
 | 
 | ||||||
|                     if (updateEntryResult.generalnotifications?.length) { |                     if (updateEntryResult.generalnotifications?.length) { | ||||||
|                         CoreAlerts.show({ |                         CoreDomUtils.showAlertWithOptions({ | ||||||
|                             header: Translate.instant('core.notice'), |                             header: Translate.instant('core.notice'), | ||||||
|                             message: CoreText.buildMessage(updateEntryResult.generalnotifications), |                             message: CoreText.buildMessage(updateEntryResult.generalnotifications), | ||||||
|  |                             buttons: [Translate.instant('core.ok')], | ||||||
|                         }); |                         }); | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
| @ -405,7 +406,7 @@ export class AddonModDataEditPage implements OnInit { | |||||||
|                 modal.dismiss(); |                 modal.dismiss(); | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Cannot edit entry' }); |             CoreDomUtils.showErrorModalDefault(error, 'Cannot edit entry', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -21,6 +21,7 @@ import { IonContent } from '@ionic/angular'; | |||||||
| import { CoreGroups, CoreGroupInfo } from '@services/groups'; | import { CoreGroups, CoreGroupInfo } from '@services/groups'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreArray } from '@singletons/array'; | import { CoreArray } from '@singletons/array'; | ||||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||||
| import { AddonModDataComponentsCompileModule } from '../../components/components-compile.module'; | import { AddonModDataComponentsCompileModule } from '../../components/components-compile.module'; | ||||||
| @ -43,8 +44,6 @@ import { | |||||||
|     AddonModDataTemplateMode, |     AddonModDataTemplateMode, | ||||||
| } from '../../constants'; | } from '../../constants'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| import { Translate } from '@singletons'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the view entry page. |  * Page that displays the view entry page. | ||||||
| @ -157,7 +156,8 @@ export class AddonModDataEntryPage implements OnInit, OnDestroy { | |||||||
|             const sortBy = Number(CoreNavigator.getRouteParam('sortBy')); |             const sortBy = Number(CoreNavigator.getRouteParam('sortBy')); | ||||||
|             this.sortBy = isNaN(sortBy) ? this.sortBy : sortBy; |             this.sortBy = isNaN(sortBy) ? this.sortBy : sortBy; | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -236,7 +236,7 @@ export class AddonModDataEntryPage implements OnInit, OnDestroy { | |||||||
|                 return this.refreshAllData(isPtr); |                 return this.refreshAllData(isPtr); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.course.errorgetmodule', true); | ||||||
|         } finally { |         } finally { | ||||||
|             this.content?.scrollToTop(); |             this.content?.scrollToTop(); | ||||||
|             this.entryLoaded = true; |             this.entryLoaded = true; | ||||||
|  | |||||||
| @ -47,9 +47,8 @@ import { | |||||||
|     AddonModDataTemplateType, |     AddonModDataTemplateType, | ||||||
|     AddonModDataTemplateMode, |     AddonModDataTemplateMode, | ||||||
| } from '../constants'; | } from '../constants'; | ||||||
| import { CoreToasts, ToastDuration } from '@services/overlays/toasts'; | import { CoreToasts, ToastDuration } from '@services/toasts'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Service that provides helper functions for datas. |  * Service that provides helper functions for datas. | ||||||
| @ -165,7 +164,7 @@ export class AddonModDataHelperProvider { | |||||||
|                 // Approve/disapprove entry.
 |                 // Approve/disapprove entry.
 | ||||||
|                 await AddonModData.approveEntry(dataId, entryId, approve, courseId, siteId); |                 await AddonModData.approveEntry(dataId, entryId, approve, courseId, siteId); | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('addon.mod_data.errorapproving') }); |                 CoreDomUtils.showErrorModalDefault(error, 'addon.mod_data.errorapproving', true); | ||||||
| 
 | 
 | ||||||
|                 throw error; |                 throw error; | ||||||
|             } |             } | ||||||
| @ -857,7 +856,7 @@ export class AddonModDataHelperProvider { | |||||||
|         siteId = siteId || CoreSites.getCurrentSiteId(); |         siteId = siteId || CoreSites.getCurrentSiteId(); | ||||||
| 
 | 
 | ||||||
|         try { |         try { | ||||||
|             await CoreAlerts.confirmDelete(Translate.instant('addon.mod_data.confirmdeleterecord')); |             await CoreDomUtils.showDeleteConfirm('addon.mod_data.confirmdeleterecord'); | ||||||
| 
 | 
 | ||||||
|             const modal = await CoreLoadings.show(); |             const modal = await CoreLoadings.show(); | ||||||
| 
 | 
 | ||||||
| @ -870,7 +869,7 @@ export class AddonModDataHelperProvider { | |||||||
|                     await AddonModData.deleteEntry(dataId, entryId, courseId, siteId); |                     await AddonModData.deleteEntry(dataId, entryId, courseId, siteId); | ||||||
|                 } |                 } | ||||||
|             } catch (message) { |             } catch (message) { | ||||||
|                 CoreAlerts.showError(message, { default: Translate.instant('addon.mod_data.errordeleting') }); |                 CoreDomUtils.showErrorModalDefault(message, 'addon.mod_data.errordeleting', true); | ||||||
| 
 | 
 | ||||||
|                 modal.dismiss(); |                 modal.dismiss(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -17,7 +17,7 @@ import { Params } from '@angular/router'; | |||||||
| import { CoreCourse } from '@features/course/services/course'; | import { CoreCourse } from '@features/course/services/course'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSitesReadingStrategy } from '@services/sites'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { makeSingleton } from '@singletons'; | import { makeSingleton } from '@singletons'; | ||||||
| import { ADDON_MOD_DATA_FEATURE_NAME, ADDON_MOD_DATA_PAGE_NAME } from '../../constants'; | import { ADDON_MOD_DATA_FEATURE_NAME, ADDON_MOD_DATA_PAGE_NAME } from '../../constants'; | ||||||
| import { AddonModDataEditLinkHandlerService } from '@addons/mod/data/services/handlers/edit-link'; | import { AddonModDataEditLinkHandlerService } from '@addons/mod/data/services/handlers/edit-link'; | ||||||
|  | |||||||
| @ -17,7 +17,7 @@ import { Params } from '@angular/router'; | |||||||
| import { CoreCourse } from '@features/course/services/course'; | import { CoreCourse } from '@features/course/services/course'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSitesReadingStrategy } from '@services/sites'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { makeSingleton } from '@singletons'; | import { makeSingleton } from '@singletons'; | ||||||
| import { ADDON_MOD_DATA_PAGE_NAME } from '../../constants'; | import { ADDON_MOD_DATA_PAGE_NAME } from '../../constants'; | ||||||
| import { AddonModDataShowLinkHandlerService } from '@addons/mod/data/services/handlers/show-link'; | import { AddonModDataShowLinkHandlerService } from '@addons/mod/data/services/handlers/show-link'; | ||||||
|  | |||||||
| @ -17,6 +17,7 @@ import { ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router'; | |||||||
| import { CoreRoutedItemsManagerSourcesTracker } from '@classes/items-management/routed-items-manager-sources-tracker'; | import { CoreRoutedItemsManagerSourcesTracker } from '@classes/items-management/routed-items-manager-sources-tracker'; | ||||||
| import { CoreSwipeNavigationItemsManager } from '@classes/items-management/swipe-navigation-items-manager'; | import { CoreSwipeNavigationItemsManager } from '@classes/items-management/swipe-navigation-items-manager'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreFileHelper } from '@services/file-helper'; | import { CoreFileHelper } from '@services/file-helper'; | ||||||
| import { AddonModFeedbackAttemptsSource } from '../../classes/feedback-attempts-source'; | import { AddonModFeedbackAttemptsSource } from '../../classes/feedback-attempts-source'; | ||||||
| import { | import { | ||||||
| @ -28,8 +29,6 @@ import { AddonModFeedbackAttempt, AddonModFeedbackFormItem, AddonModFeedbackHelp | |||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { ADDON_MOD_FEEDBACK_COMPONENT } from '../../constants'; | import { ADDON_MOD_FEEDBACK_COMPONENT } from '../../constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| import { Translate } from '@singletons'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays a feedback attempt review. |  * Page that displays a feedback attempt review. | ||||||
| @ -90,7 +89,8 @@ export class AddonModFeedbackAttemptPage implements OnInit, OnDestroy { | |||||||
|         try { |         try { | ||||||
|             await this.attempts.start(); |             await this.attempts.start(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -156,7 +156,7 @@ export class AddonModFeedbackAttemptPage implements OnInit, OnDestroy { | |||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (message) { |         } catch (message) { | ||||||
|             // Some call failed on fetch, go back.
 |             // Some call failed on fetch, go back.
 | ||||||
|             CoreAlerts.showError(message, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(message, 'core.course.errorgetmodule', true); | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|  | |||||||
| @ -20,13 +20,12 @@ import { CorePromisedValue } from '@classes/promised-value'; | |||||||
| import { CoreSplitViewComponent } from '@components/split-view/split-view'; | import { CoreSplitViewComponent } from '@components/split-view/split-view'; | ||||||
| import { CoreGroupInfo } from '@services/groups'; | import { CoreGroupInfo } from '@services/groups'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { AddonModFeedbackAttemptItem, AddonModFeedbackAttemptsSource } from '../../classes/feedback-attempts-source'; | import { AddonModFeedbackAttemptItem, AddonModFeedbackAttemptsSource } from '../../classes/feedback-attempts-source'; | ||||||
| import { AddonModFeedbackWSAnonAttempt, AddonModFeedbackWSAttempt } from '../../services/feedback'; | import { AddonModFeedbackWSAnonAttempt, AddonModFeedbackWSAttempt } from '../../services/feedback'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| import { Translate } from '@singletons'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays feedback attempts. |  * Page that displays feedback attempts. | ||||||
| @ -117,7 +116,8 @@ export class AddonModFeedbackAttemptsPage implements AfterViewInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             this.promisedAttempts.resolve(new AddonModFeedbackAttemptsManager(source, this.route.component)); |             this.promisedAttempts.resolve(new AddonModFeedbackAttemptsManager(source, this.route.component)); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -135,7 +135,7 @@ export class AddonModFeedbackAttemptsPage implements AfterViewInit, OnDestroy { | |||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             this.fetchFailed = true; |             this.fetchFailed = true; | ||||||
| 
 | 
 | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.course.errorgetmodule', true); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         await attempts.start(this.splitView); |         await attempts.start(this.splitView); | ||||||
| @ -163,7 +163,7 @@ export class AddonModFeedbackAttemptsPage implements AfterViewInit, OnDestroy { | |||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             this.fetchFailed = true; |             this.fetchFailed = true; | ||||||
| 
 | 
 | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.course.errorgetmodule', true); | ||||||
|         } finally { |         } finally { | ||||||
|             infiniteComplete && infiniteComplete(); |             infiniteComplete && infiniteComplete(); | ||||||
|         } |         } | ||||||
| @ -186,7 +186,7 @@ export class AddonModFeedbackAttemptsPage implements AfterViewInit, OnDestroy { | |||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             this.fetchFailed = true; |             this.fetchFailed = true; | ||||||
| 
 | 
 | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.course.errorgetmodule', true); | ||||||
|         } finally { |         } finally { | ||||||
|             refresher.complete(); |             refresher.complete(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -21,6 +21,7 @@ import { IonContent } from '@ionic/angular'; | |||||||
| import { CoreNetwork } from '@services/network'; | import { CoreNetwork } from '@services/network'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreUtils } from '@singletons/utils'; | import { CoreUtils } from '@singletons/utils'; | ||||||
| import { NgZone, Translate } from '@singletons'; | import { NgZone, Translate } from '@singletons'; | ||||||
| import { CoreEvents } from '@singletons/events'; | import { CoreEvents } from '@singletons/events'; | ||||||
| @ -41,12 +42,11 @@ import { | |||||||
|     ADDON_MOD_FEEDBACK_PAGE_NAME, |     ADDON_MOD_FEEDBACK_PAGE_NAME, | ||||||
|     AddonModFeedbackIndexTabName, |     AddonModFeedbackIndexTabName, | ||||||
| } from '../../constants'; | } from '../../constants'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreError } from '@classes/errors/error'; | import { CoreError } from '@classes/errors/error'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreWSError } from '@classes/errors/wserror'; | import { CoreWSError } from '@classes/errors/wserror'; | ||||||
| import { CoreObject } from '@singletons/object'; | import { CoreObject } from '@singletons/object'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays feedback form. |  * Page that displays feedback form. | ||||||
| @ -109,7 +109,7 @@ export class AddonModFeedbackFormPage implements OnInit, OnDestroy, CanLeave { | |||||||
|             this.preview = !!CoreNavigator.getRouteBooleanParam('preview'); |             this.preview = !!CoreNavigator.getRouteBooleanParam('preview'); | ||||||
|             this.fromIndex = !!CoreNavigator.getRouteBooleanParam('fromIndex'); |             this.fromIndex = !!CoreNavigator.getRouteBooleanParam('fromIndex'); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
| 
 | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
| @ -119,7 +119,7 @@ export class AddonModFeedbackFormPage implements OnInit, OnDestroy, CanLeave { | |||||||
|         await this.fetchData(); |         await this.fetchData(); | ||||||
| 
 | 
 | ||||||
|         if (!this.access || this.access.isempty && (!this.access.canedititems && !this.access.canviewreports)) { |         if (!this.access || this.access.isempty && (!this.access.canedititems && !this.access.canviewreports)) { | ||||||
|             CoreAlerts.showError(Translate.instant('core.nopermissiontoaccesspage')); |             CoreDomUtils.showErrorModal(Translate.instant('core.nopermissiontoaccesspage')); | ||||||
| 
 | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
| @ -160,7 +160,7 @@ export class AddonModFeedbackFormPage implements OnInit, OnDestroy, CanLeave { | |||||||
|             if (this.items && !this.completed && this.originalData) { |             if (this.items && !this.completed && this.originalData) { | ||||||
|                 // Form submitted. Check if there is any change.
 |                 // Form submitted. Check if there is any change.
 | ||||||
|                 if (!CoreObject.basicLeftCompare(responses, this.originalData, 3)) { |                 if (!CoreObject.basicLeftCompare(responses, this.originalData, 3)) { | ||||||
|                     await CoreAlerts.confirmLeaveWithChanges(); |                     await CoreDomUtils.showConfirm(Translate.instant('core.confirmcanceledit')); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @ -200,7 +200,7 @@ export class AddonModFeedbackFormPage implements OnInit, OnDestroy, CanLeave { | |||||||
| 
 | 
 | ||||||
|             await this.fetchFeedbackPageData(page); |             await this.fetchFeedbackPageData(page); | ||||||
|         } catch (message) { |         } catch (message) { | ||||||
|             CoreAlerts.showError(message, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(message, 'core.course.errorgetmodule', true); | ||||||
|             this.forceLeave = true; |             this.forceLeave = true; | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
|         } finally { |         } finally { | ||||||
| @ -405,7 +405,7 @@ export class AddonModFeedbackFormPage implements OnInit, OnDestroy, CanLeave { | |||||||
|                 await this.fetchFeedbackPageData(response.jumpto); |                 await this.fetchFeedbackPageData(response.jumpto); | ||||||
|             } |             } | ||||||
|         } catch (message) { |         } catch (message) { | ||||||
|             CoreAlerts.showError(message, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(message, 'core.course.errorgetmodule', true); | ||||||
|         } finally { |         } finally { | ||||||
|             this.feedbackLoaded = true; |             this.feedbackLoaded = true; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -15,13 +15,12 @@ | |||||||
| import { Component, OnInit } from '@angular/core'; | import { Component, OnInit } from '@angular/core'; | ||||||
| import { CoreGroupInfo, CoreGroups } from '@services/groups'; | import { CoreGroupInfo, CoreGroups } from '@services/groups'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { AddonModFeedback, AddonModFeedbackWSFeedback } from '../../services/feedback'; | import { AddonModFeedback, AddonModFeedbackWSFeedback } from '../../services/feedback'; | ||||||
| import { AddonModFeedbackHelper, AddonModFeedbackNonRespondent } from '../../services/feedback-helper'; | import { AddonModFeedbackHelper, AddonModFeedbackNonRespondent } from '../../services/feedback-helper'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| import { Translate } from '@singletons'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays feedback non respondents. |  * Page that displays feedback non respondents. | ||||||
| @ -71,7 +70,8 @@ export class AddonModFeedbackNonRespondentsPage implements OnInit { | |||||||
|             this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); |             this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); | ||||||
|             this.selectedGroup = CoreNavigator.getRouteNumberParam('group') || 0; |             this.selectedGroup = CoreNavigator.getRouteNumberParam('group') || 0; | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -102,7 +102,7 @@ export class AddonModFeedbackNonRespondentsPage implements OnInit { | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (message) { |         } catch (message) { | ||||||
|             CoreAlerts.showError(message, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(message, 'core.course.errorgetmodule', true); | ||||||
| 
 | 
 | ||||||
|             if (!refresh) { |             if (!refresh) { | ||||||
|                 // Some call failed on first fetch, go back.
 |                 // Some call failed on first fetch, go back.
 | ||||||
| @ -162,7 +162,7 @@ export class AddonModFeedbackNonRespondentsPage implements OnInit { | |||||||
|         try { |         try { | ||||||
|             await this.loadGroupUsers(groupId); |             await this.loadGroupUsers(groupId); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.course.errorgetmodule', true); | ||||||
|         } finally { |         } finally { | ||||||
|             infiniteComplete && infiniteComplete(); |             infiniteComplete && infiniteComplete(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -17,6 +17,7 @@ import { CoreCourse } from '@features/course/services/course'; | |||||||
| import { CoreUser } from '@features/user/services/user'; | import { CoreUser } from '@features/user/services/user'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreFileHelper } from '@services/file-helper'; | import { CoreFileHelper } from '@services/file-helper'; | ||||||
| import { CoreTimeUtils } from '@services/utils/time'; | import { CoreTimeUtils } from '@services/utils/time'; | ||||||
| import { CoreUtils } from '@singletons/utils'; | import { CoreUtils } from '@singletons/utils'; | ||||||
| @ -39,9 +40,8 @@ import { | |||||||
|     ADDON_MOD_FEEDBACK_MULTICHOICE_HIDENOSELECT, |     ADDON_MOD_FEEDBACK_MULTICHOICE_HIDENOSELECT, | ||||||
|     ADDON_MOD_FEEDBACK_PAGE_NAME, |     ADDON_MOD_FEEDBACK_PAGE_NAME, | ||||||
| } from '../constants'; | } from '../constants'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreText } from '@singletons/text'; | import { CoreText } from '@singletons/text'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| const MODE_RESPONSETIME = 1; | const MODE_RESPONSETIME = 1; | ||||||
| const MODE_COURSE = 2; | const MODE_COURSE = 2; | ||||||
| @ -216,7 +216,7 @@ export class AddonModFeedbackHelperProvider { | |||||||
|                 }, |                 }, | ||||||
|             ); |             ); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error opening link.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error opening link.'); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -17,10 +17,10 @@ import { CoreContentLinksHandlerBase } from '@features/contentlinks/classes/base | |||||||
| import { CoreContentLinksAction } from '@features/contentlinks/services/contentlinks-delegate'; | import { CoreContentLinksAction } from '@features/contentlinks/services/contentlinks-delegate'; | ||||||
| import { CoreCourse } from '@features/course/services/course'; | import { CoreCourse } from '@features/course/services/course'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { makeSingleton } from '@singletons'; | import { makeSingleton } from '@singletons'; | ||||||
| import { ADDON_MOD_FEEDBACK_PAGE_NAME, AddonModFeedbackIndexTabName } from '../../constants'; | import { ADDON_MOD_FEEDBACK_PAGE_NAME, AddonModFeedbackIndexTabName } from '../../constants'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Content links handler for a feedback analysis. |  * Content links handler for a feedback analysis. | ||||||
| @ -65,7 +65,7 @@ export class AddonModFeedbackAnalysisLinkHandlerService extends CoreContentLinks | |||||||
|                         }, |                         }, | ||||||
|                     ); |                     ); | ||||||
|                 } catch (error) { |                 } catch (error) { | ||||||
|                     CoreAlerts.showError(error, { default: 'Error opening link.' }); |                     CoreDomUtils.showErrorModalDefault(error, 'Error opening link.'); | ||||||
|                 } finally { |                 } finally { | ||||||
|                     modal.dismiss(); |                     modal.dismiss(); | ||||||
|                 } |                 } | ||||||
|  | |||||||
| @ -18,10 +18,10 @@ import { CoreContentLinksAction } from '@features/contentlinks/services/contentl | |||||||
| import { CoreCourse } from '@features/course/services/course'; | import { CoreCourse } from '@features/course/services/course'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSitesReadingStrategy } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { makeSingleton } from '@singletons'; | import { makeSingleton } from '@singletons'; | ||||||
| import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants'; | import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Content links handler for feedback complete questions. |  * Content links handler for feedback complete questions. | ||||||
| @ -60,7 +60,7 @@ export class AddonModFeedbackCompleteLinkHandlerService extends CoreContentLinks | |||||||
|                         }, |                         }, | ||||||
|                     ); |                     ); | ||||||
|                 } catch (error) { |                 } catch (error) { | ||||||
|                     CoreAlerts.showError(error, { default: 'Error opening link.' }); |                     CoreDomUtils.showErrorModalDefault(error, 'Error opening link.'); | ||||||
|                 } finally { |                 } finally { | ||||||
|                     modal.dismiss(); |                     modal.dismiss(); | ||||||
|                 } |                 } | ||||||
|  | |||||||
| @ -18,10 +18,10 @@ import { CoreContentLinksAction } from '@features/contentlinks/services/contentl | |||||||
| import { CoreCourse } from '@features/course/services/course'; | import { CoreCourse } from '@features/course/services/course'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSitesReadingStrategy } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { makeSingleton } from '@singletons'; | import { makeSingleton } from '@singletons'; | ||||||
| import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants'; | import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Content links handler for feedback print questions. |  * Content links handler for feedback print questions. | ||||||
| @ -60,7 +60,7 @@ export class AddonModFeedbackPrintLinkHandlerService extends CoreContentLinksHan | |||||||
|                         }, |                         }, | ||||||
|                     ); |                     ); | ||||||
|                 } catch (error) { |                 } catch (error) { | ||||||
|                     CoreAlerts.showError(error, { default: 'Error opening link.' }); |                     CoreDomUtils.showErrorModalDefault(error, 'Error opening link.'); | ||||||
|                 } finally { |                 } finally { | ||||||
|                     modal.dismiss(); |                     modal.dismiss(); | ||||||
|                 } |                 } | ||||||
|  | |||||||
| @ -18,10 +18,10 @@ import { CoreContentLinksAction } from '@features/contentlinks/services/contentl | |||||||
| import { CoreCourse } from '@features/course/services/course'; | import { CoreCourse } from '@features/course/services/course'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSitesReadingStrategy } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { makeSingleton } from '@singletons'; | import { makeSingleton } from '@singletons'; | ||||||
| import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants'; | import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| /** | /** | ||||||
|  * Content links handler for feedback show non respondents. |  * Content links handler for feedback show non respondents. | ||||||
|  * Match mod/feedback/show_nonrespondents.php with a valid feedback id. |  * Match mod/feedback/show_nonrespondents.php with a valid feedback id. | ||||||
| @ -54,7 +54,7 @@ export class AddonModFeedbackShowNonRespondentsLinkHandlerService extends CoreCo | |||||||
|                         { siteId }, |                         { siteId }, | ||||||
|                     ); |                     ); | ||||||
|                 } catch (error) { |                 } catch (error) { | ||||||
|                     CoreAlerts.showError(error, { default: 'Error opening link.' }); |                     CoreDomUtils.showErrorModalDefault(error, 'Error opening link.'); | ||||||
|                 } finally { |                 } finally { | ||||||
|                     modal.dismiss(); |                     modal.dismiss(); | ||||||
|                 } |                 } | ||||||
|  | |||||||
| @ -14,14 +14,14 @@ | |||||||
| 
 | 
 | ||||||
| import { Component, Input, OnInit } from '@angular/core'; | import { Component, Input, OnInit } from '@angular/core'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { PopoverController } from '@singletons'; | import { PopoverController } from '@singletons'; | ||||||
| import { CoreEvents } from '@singletons/events'; | import { CoreEvents } from '@singletons/events'; | ||||||
| import { AddonModForum, AddonModForumDiscussion } from '../../services/forum'; | import { AddonModForum, AddonModForumDiscussion } from '../../services/forum'; | ||||||
| import { ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT } from '../../constants'; | import { ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT } from '../../constants'; | ||||||
| import { CoreToasts } from '@services/overlays/toasts'; | import { CoreToasts } from '@services/toasts'; | ||||||
| import { CoreSharedModule } from '@/core/shared.module'; | import { CoreSharedModule } from '@/core/shared.module'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * This component is meant to display a popover with the discussion options. |  * This component is meant to display a popover with the discussion options. | ||||||
| @ -86,7 +86,7 @@ export class AddonModForumDiscussionOptionsMenuComponent implements OnInit { | |||||||
|                 translateMessage: true, |                 translateMessage: true, | ||||||
|             }); |             }); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|             PopoverController.dismiss(); |             PopoverController.dismiss(); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
| @ -118,7 +118,7 @@ export class AddonModForumDiscussionOptionsMenuComponent implements OnInit { | |||||||
|                 translateMessage: true, |                 translateMessage: true, | ||||||
|             }); |             }); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|             PopoverController.dismiss(); |             PopoverController.dismiss(); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
| @ -150,7 +150,7 @@ export class AddonModForumDiscussionOptionsMenuComponent implements OnInit { | |||||||
|                 translateMessage: true, |                 translateMessage: true, | ||||||
|             }); |             }); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|             PopoverController.dismiss(); |             PopoverController.dismiss(); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|  | |||||||
| @ -38,6 +38,7 @@ import { | |||||||
| } from '@addons/mod/forum/services/forum-sync'; | } from '@addons/mod/forum/services/forum-sync'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
| import { CoreUser } from '@features/user/services/user'; | import { CoreUser } from '@features/user/services/user'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreCourse } from '@features/course/services/course'; | import { CoreCourse } from '@features/course/services/course'; | ||||||
| import { CoreSplitViewComponent } from '@components/split-view/split-view'; | import { CoreSplitViewComponent } from '@components/split-view/split-view'; | ||||||
| import { CoreScreen } from '@services/screen'; | import { CoreScreen } from '@services/screen'; | ||||||
| @ -64,10 +65,9 @@ import { | |||||||
|     AddonModForumType, |     AddonModForumType, | ||||||
| } from '@addons/mod/forum/constants'; | } from '@addons/mod/forum/constants'; | ||||||
| import { CoreSearchGlobalSearch } from '@features/search/services/global-search'; | import { CoreSearchGlobalSearch } from '@features/search/services/global-search'; | ||||||
| import { CoreToasts } from '@services/overlays/toasts'; | import { CoreToasts } from '@services/toasts'; | ||||||
| import { CorePopovers } from '@services/overlays/popovers'; | import { CorePopovers } from '@services/popovers'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| /** | /** | ||||||
|  * Component that displays a forum entry page. |  * Component that displays a forum entry page. | ||||||
|  */ |  */ | ||||||
| @ -475,7 +475,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom | |||||||
| 
 | 
 | ||||||
|             await discussions.load(); |             await discussions.load(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_forum.errorgetforum') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_forum.errorgetforum', true); | ||||||
| 
 | 
 | ||||||
|             this.fetchFailed = true; |             this.fetchFailed = true; | ||||||
|         } finally { |         } finally { | ||||||
| @ -618,7 +618,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom | |||||||
|                 await CoreUser.setUserPreference(ADDON_MOD_FORUM_PREFERENCE_SORTORDER, sortOrder.value.toFixed(0)); |                 await CoreUser.setUserPreference(ADDON_MOD_FORUM_PREFERENCE_SORTORDER, sortOrder.value.toFixed(0)); | ||||||
|                 await this.showLoadingAndFetch(); |                 await this.showLoadingAndFetch(); | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 CoreAlerts.showError(error, { default: 'Error updating preference.' }); |                 CoreDomUtils.showErrorModalDefault(error, 'Error updating preference.'); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @ -679,7 +679,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom | |||||||
|                 this.discussions?.reload(), |                 this.discussions?.reload(), | ||||||
|             ]); |             ]); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.errorloadingcontent') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.errorloadingcontent', true); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -17,9 +17,9 @@ import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | |||||||
| import { CoreNetwork } from '@services/network'; | import { CoreNetwork } from '@services/network'; | ||||||
| import { AddonModForum, AddonModForumPost } from '@addons/mod/forum/services/forum'; | import { AddonModForum, AddonModForumPost } from '@addons/mod/forum/services/forum'; | ||||||
| import { PopoverController } from '@singletons'; | import { PopoverController } from '@singletons'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreNetworkError } from '@classes/errors/network-error'; | import { CoreNetworkError } from '@classes/errors/network-error'; | ||||||
| import { CoreSharedModule } from '@/core/shared.module'; | import { CoreSharedModule } from '@/core/shared.module'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * This component is meant to display a popover with the post options. |  * This component is meant to display a popover with the post options. | ||||||
| @ -65,7 +65,7 @@ export class AddonModForumPostOptionsMenuComponent implements OnInit { | |||||||
|                             readingStrategy: CoreSitesReadingStrategy.ONLY_NETWORK, |                             readingStrategy: CoreSitesReadingStrategy.ONLY_NETWORK, | ||||||
|                         }); |                         }); | ||||||
|                 } catch (error) { |                 } catch (error) { | ||||||
|                     CoreAlerts.showError(error, { default: 'Error getting discussion post.' }); |                     CoreDomUtils.showErrorModalDefault(error, 'Error getting discussion post.'); | ||||||
|                 } |                 } | ||||||
|             } else { |             } else { | ||||||
|                 this.loaded = true; |                 this.loaded = true; | ||||||
| @ -111,7 +111,7 @@ export class AddonModForumPostOptionsMenuComponent implements OnInit { | |||||||
|     deletePost(): void { |     deletePost(): void { | ||||||
|         if (!this.offlinePost) { |         if (!this.offlinePost) { | ||||||
|             if (!CoreNetwork.isOnline()) { |             if (!CoreNetwork.isOnline()) { | ||||||
|                 CoreAlerts.showError(new CoreNetworkError()); |                 CoreDomUtils.showErrorModal(new CoreNetworkError()); | ||||||
| 
 | 
 | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
| @ -127,7 +127,7 @@ export class AddonModForumPostOptionsMenuComponent implements OnInit { | |||||||
|      */ |      */ | ||||||
|     editPost(): void { |     editPost(): void { | ||||||
|         if (!this.offlinePost && !CoreNetwork.isOnline()) { |         if (!this.offlinePost && !CoreNetwork.isOnline()) { | ||||||
|             CoreAlerts.showError(new CoreNetworkError()); |             CoreDomUtils.showErrorModal(new CoreNetworkError()); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -25,6 +25,7 @@ import { | |||||||
|     ViewChild, |     ViewChild, | ||||||
| } from '@angular/core'; | } from '@angular/core'; | ||||||
| import { FormControl } from '@angular/forms'; | import { FormControl } from '@angular/forms'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreEvents } from '@singletons/events'; | import { CoreEvents } from '@singletons/events'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
| import { | import { | ||||||
| @ -52,14 +53,13 @@ import { AddonModForumSharedPostFormData } from '../../pages/discussion/discussi | |||||||
| import { CoreDom } from '@singletons/dom'; | import { CoreDom } from '@singletons/dom'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, ADDON_MOD_FORUM_COMPONENT } from '../../constants'; | import { ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, ADDON_MOD_FORUM_COMPONENT } from '../../constants'; | ||||||
| import { CoreToasts } from '@services/overlays/toasts'; | import { CoreToasts } from '@services/toasts'; | ||||||
| import { toBoolean } from '@/core/transforms/boolean'; | import { toBoolean } from '@/core/transforms/boolean'; | ||||||
| import { CorePopovers } from '@services/overlays/popovers'; | import { CorePopovers } from '@services/popovers'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreWSFile } from '@services/ws'; | import { CoreWSFile } from '@services/ws'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreWSError } from '@classes/errors/wserror'; | import { CoreWSError } from '@classes/errors/wserror'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Components that shows a discussion post, its attachments and the action buttons allowed (reply, etc.). |  * Components that shows a discussion post, its attachments and the action buttons allowed (reply, etc.). | ||||||
| @ -155,7 +155,7 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges | |||||||
|         this.analyticsLogEvent('mod_forum_delete_post', `/mod/forum/post.php?delete=${this.post.id}`); |         this.analyticsLogEvent('mod_forum_delete_post', `/mod/forum/post.php?delete=${this.post.id}`); | ||||||
| 
 | 
 | ||||||
|         try { |         try { | ||||||
|             await CoreAlerts.confirmDelete(Translate.instant('addon.mod_forum.deletesure')); |             await CoreDomUtils.showDeleteConfirm('addon.mod_forum.deletesure'); | ||||||
| 
 | 
 | ||||||
|             const modal = await CoreLoadings.show('core.deleting', true); |             const modal = await CoreLoadings.show('core.deleting', true); | ||||||
| 
 | 
 | ||||||
| @ -181,7 +181,7 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges | |||||||
|                     translateMessage: true, |                     translateMessage: true, | ||||||
|                 }); |                 }); | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 CoreAlerts.showError(error); |                 CoreDomUtils.showErrorModal(error); | ||||||
|             } finally { |             } finally { | ||||||
|                 modal.dismiss(); |                 modal.dismiss(); | ||||||
|             } |             } | ||||||
| @ -364,7 +364,7 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges | |||||||
| 
 | 
 | ||||||
|             this.analyticsLogEvent('mod_forum_update_discussion_post', `/mod/forum/post.php?edit=${this.post.id}`); |             this.analyticsLogEvent('mod_forum_update_discussion_post', `/mod/forum/post.php?edit=${this.post.id}`); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_forum.errorgetpost') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_forum.errorgetpost', true); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
| @ -384,13 +384,13 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges | |||||||
|      */ |      */ | ||||||
|     async send(): Promise<void> { |     async send(): Promise<void> { | ||||||
|         if (!this.formData.subject) { |         if (!this.formData.subject) { | ||||||
|             CoreAlerts.showError(Translate.instant('addon.mod_forum.erroremptysubject')); |             CoreDomUtils.showErrorModal('addon.mod_forum.erroremptysubject', true); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (!this.formData.message) { |         if (!this.formData.message) { | ||||||
|             CoreAlerts.showError(Translate.instant('addon.mod_forum.erroremptymessage')); |             CoreDomUtils.showErrorModal('addon.mod_forum.erroremptymessage', true); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @ -481,9 +481,11 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges | |||||||
| 
 | 
 | ||||||
|             this.unblockOperation(); |             this.unblockOperation(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { |             CoreDomUtils.showErrorModalDefault( | ||||||
|                 default: Translate.instant(isEditOnline ? 'addon.mod_forum.couldnotupdate' : 'addon.mod_forum.couldnotadd'), |                 error, | ||||||
|             }); |                 isEditOnline ? 'addon.mod_forum.couldnotupdate' : 'addon.mod_forum.couldnotadd', | ||||||
|  |                 true, | ||||||
|  |             ); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
| @ -587,7 +589,7 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges | |||||||
|      */ |      */ | ||||||
|     async discardOfflineReply(): Promise<void> { |     async discardOfflineReply(): Promise<void> { | ||||||
|         try { |         try { | ||||||
|             await CoreAlerts.confirmDelete(Translate.instant('core.areyousure')); |             await CoreDomUtils.showDeleteConfirm(); | ||||||
| 
 | 
 | ||||||
|             const promises: Promise<void>[] = []; |             const promises: Promise<void>[] = []; | ||||||
| 
 | 
 | ||||||
| @ -641,7 +643,7 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges | |||||||
|     protected async confirmDiscard(): Promise<void> { |     protected async confirmDiscard(): Promise<void> { | ||||||
|         if (AddonModForumHelper.hasPostDataChanged(this.formData, this.originalData)) { |         if (AddonModForumHelper.hasPostDataChanged(this.formData, this.originalData)) { | ||||||
|             // Show confirmation if some data has been modified.
 |             // Show confirmation if some data has been modified.
 | ||||||
|             await CoreAlerts.confirm(Translate.instant('core.confirmloss')); |             await CoreDomUtils.showConfirm(Translate.instant('core.confirmloss')); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         this.unblockOperation(); |         this.unblockOperation(); | ||||||
|  | |||||||
| @ -28,6 +28,7 @@ import { CoreNetwork } from '@services/network'; | |||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreScreen } from '@services/screen'; | import { CoreScreen } from '@services/screen'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreUtils } from '@singletons/utils'; | import { CoreUtils } from '@singletons/utils'; | ||||||
| import { NgZone, Translate } from '@singletons'; | import { NgZone, Translate } from '@singletons'; | ||||||
| import { CoreDom } from '@singletons/dom'; | import { CoreDom } from '@singletons/dom'; | ||||||
| @ -59,11 +60,10 @@ import { | |||||||
|     AddonModForumType, |     AddonModForumType, | ||||||
| } from '../../constants'; | } from '../../constants'; | ||||||
| import { CoreCourseContentsPage } from '@features/course/pages/contents/contents'; | import { CoreCourseContentsPage } from '@features/course/pages/contents/contents'; | ||||||
| import { CoreToasts } from '@services/overlays/toasts'; | import { CoreToasts } from '@services/toasts'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreObject } from '@singletons/object'; | import { CoreObject } from '@singletons/object'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| type SortType = 'flat-newest' | 'flat-oldest' | 'nested'; | type SortType = 'flat-newest' | 'flat-oldest' | 'nested'; | ||||||
| 
 | 
 | ||||||
| @ -171,7 +171,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes | |||||||
|                 await this.discussions.start(); |                 await this.discussions.start(); | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
| 
 | 
 | ||||||
|             this.goBack(); |             this.goBack(); | ||||||
| 
 | 
 | ||||||
| @ -303,7 +303,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes | |||||||
|     async canLeave(): Promise<boolean> { |     async canLeave(): Promise<boolean> { | ||||||
|         if (AddonModForumHelper.hasPostDataChanged(this.formData, this.originalData)) { |         if (AddonModForumHelper.hasPostDataChanged(this.formData, this.originalData)) { | ||||||
|             // Show confirmation if some data has been modified.
 |             // Show confirmation if some data has been modified.
 | ||||||
|             await CoreAlerts.confirmLeaveWithChanges(); |             await CoreDomUtils.showConfirm(Translate.instant('core.confirmcanceledit')); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // Delete the local files from the tmp folder.
 |         // Delete the local files from the tmp folder.
 | ||||||
| @ -571,7 +571,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes | |||||||
|             this.hasOfflineRatings = |             this.hasOfflineRatings = | ||||||
|                 await CoreRatingOffline.hasRatings('mod_forum', 'post', ContextLevel.MODULE, this.cmId, this.discussionId); |                 await CoreRatingOffline.hasRatings('mod_forum', 'post', ContextLevel.MODULE, this.cmId, this.discussionId); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|         } finally { |         } finally { | ||||||
|             this.discussionLoaded = true; |             this.discussionLoaded = true; | ||||||
|             this.refreshIcon = CoreConstants.ICON_REFRESH; |             this.refreshIcon = CoreConstants.ICON_REFRESH; | ||||||
| @ -616,7 +616,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes | |||||||
|                 .syncDiscussionReplies(this.discussionId) |                 .syncDiscussionReplies(this.discussionId) | ||||||
|                 .then((result) => { |                 .then((result) => { | ||||||
|                     if (result.warnings && result.warnings.length) { |                     if (result.warnings && result.warnings.length) { | ||||||
|                         CoreAlerts.show({ message: result.warnings[0] }); |                         CoreDomUtils.showAlert(undefined, result.warnings[0]); | ||||||
|                     } |                     } | ||||||
| 
 | 
 | ||||||
|                     if (result && result.updated && this.forumId) { |                     if (result && result.updated && this.forumId) { | ||||||
| @ -637,7 +637,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes | |||||||
|                 .syncRatings(this.cmId, this.discussionId) |                 .syncRatings(this.cmId, this.discussionId) | ||||||
|                 .then((result) => { |                 .then((result) => { | ||||||
|                     if (result.warnings && result.warnings.length) { |                     if (result.warnings && result.warnings.length) { | ||||||
|                         CoreAlerts.show({ message: result.warnings[0] }); |                         CoreDomUtils.showAlert(undefined, result.warnings[0]); | ||||||
|                     } |                     } | ||||||
| 
 | 
 | ||||||
|                     return; |                     return; | ||||||
| @ -648,7 +648,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes | |||||||
|             await Promise.all(promises); |             await Promise.all(promises); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             if (showErrors) { |             if (showErrors) { | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('core.errorsync') }); |                 CoreDomUtils.showErrorModalDefault(error, 'core.errorsync', true); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             throw new Error('Failed syncing discussion'); |             throw new Error('Failed syncing discussion'); | ||||||
| @ -740,7 +740,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes | |||||||
|                 translateMessage: true, |                 translateMessage: true, | ||||||
|             }); |             }); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
| @ -776,7 +776,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes | |||||||
|                 translateMessage: true, |                 translateMessage: true, | ||||||
|             }); |             }); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
| @ -812,7 +812,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes | |||||||
|                 translateMessage: true, |                 translateMessage: true, | ||||||
|             }); |             }); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -27,6 +27,7 @@ import { | |||||||
| import { CoreEditorRichTextEditorComponent } from '@features/editor/components/rich-text-editor/rich-text-editor'; | import { CoreEditorRichTextEditorComponent } from '@features/editor/components/rich-text-editor/rich-text-editor'; | ||||||
| import { AddonModForumSync } from '@addons/mod/forum/services/forum-sync'; | import { AddonModForumSync } from '@addons/mod/forum/services/forum-sync'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CoreSync } from '@services/sync'; | import { CoreSync } from '@services/sync'; | ||||||
| import { AddonModForumDiscussionOptions, AddonModForumOffline } from '@addons/mod/forum/services/forum-offline'; | import { AddonModForumDiscussionOptions, AddonModForumOffline } from '@addons/mod/forum/services/forum-offline'; | ||||||
| @ -51,9 +52,8 @@ import { | |||||||
|     ADDON_MOD_FORUM_NEW_DISCUSSION_EVENT, |     ADDON_MOD_FORUM_NEW_DISCUSSION_EVENT, | ||||||
| } from '../../constants'; | } from '../../constants'; | ||||||
| import { CoreCourseContentsPage } from '@features/course/pages/contents/contents'; | import { CoreCourseContentsPage } from '@features/course/pages/contents/contents'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| type NewDiscussionData = { | type NewDiscussionData = { | ||||||
|     subject: string; |     subject: string; | ||||||
| @ -159,7 +159,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea | |||||||
|                 await this.discussions.start(); |                 await this.discussions.start(); | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
| 
 | 
 | ||||||
|             this.goBack(); |             this.goBack(); | ||||||
| 
 | 
 | ||||||
| @ -183,10 +183,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea | |||||||
|         // Refresh data if this discussion is synchronized automatically.
 |         // Refresh data if this discussion is synchronized automatically.
 | ||||||
|         this.syncObserver = CoreEvents.on(ADDON_MOD_FORUM_AUTO_SYNCED, data => { |         this.syncObserver = CoreEvents.on(ADDON_MOD_FORUM_AUTO_SYNCED, data => { | ||||||
|             if (data.forumId == this.forumId && data.userId == CoreSites.getCurrentSiteUserId()) { |             if (data.forumId == this.forumId && data.userId == CoreSites.getCurrentSiteUserId()) { | ||||||
|                 CoreAlerts.show({ |                 CoreDomUtils.showAlertTranslated('core.notice', 'core.contenteditingsynced'); | ||||||
|                     header: Translate.instant('core.notice'), |  | ||||||
|                     message: Translate.instant('core.contenteditingsynced'), |  | ||||||
|                 }); |  | ||||||
|                 this.returnToDiscussions(); |                 this.returnToDiscussions(); | ||||||
|             } |             } | ||||||
|         }, CoreSites.getCurrentSiteId()); |         }, CoreSites.getCurrentSiteId()); | ||||||
| @ -339,7 +336,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_forum.errorgetgroups') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_forum.errorgetgroups', true); | ||||||
| 
 | 
 | ||||||
|             this.showForm = false; |             this.showForm = false; | ||||||
|         } |         } | ||||||
| @ -544,12 +541,12 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea | |||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         if (!subject) { |         if (!subject) { | ||||||
|             CoreAlerts.showError(Translate.instant('addon.mod_forum.erroremptysubject')); |             CoreDomUtils.showErrorModal('addon.mod_forum.erroremptysubject', true); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|         if (!message) { |         if (!message) { | ||||||
|             CoreAlerts.showError(Translate.instant('addon.mod_forum.erroremptymessage')); |             CoreDomUtils.showErrorModal('addon.mod_forum.erroremptymessage', true); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @ -587,7 +584,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea | |||||||
| 
 | 
 | ||||||
|             if (discussionIds && discussionIds.length < groupIds.length) { |             if (discussionIds && discussionIds.length < groupIds.length) { | ||||||
|                 // Some discussions could not be created.
 |                 // Some discussions could not be created.
 | ||||||
|                 CoreAlerts.showError(Translate.instant('addon.mod_forum.errorposttoallgroups')); |                 CoreDomUtils.showErrorModalDefault(null, 'addon.mod_forum.errorposttoallgroups', true); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             CoreForms.triggerFormSubmittedEvent( |             CoreForms.triggerFormSubmittedEvent( | ||||||
| @ -598,7 +595,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea | |||||||
| 
 | 
 | ||||||
|             this.returnToDiscussions(discussionIds, discTimecreated); |             this.returnToDiscussions(discussionIds, discTimecreated); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_forum.cannotcreatediscussion') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_forum.cannotcreatediscussion', true); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
| @ -609,7 +606,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea | |||||||
|      */ |      */ | ||||||
|     async discard(): Promise<void> { |     async discard(): Promise<void> { | ||||||
|         try { |         try { | ||||||
|             await CoreAlerts.confirm(Translate.instant('core.areyousure')); |             await CoreDomUtils.showConfirm(Translate.instant('core.areyousure')); | ||||||
| 
 | 
 | ||||||
|             const promises: Promise<unknown>[] = []; |             const promises: Promise<unknown>[] = []; | ||||||
| 
 | 
 | ||||||
| @ -662,7 +659,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea | |||||||
| 
 | 
 | ||||||
|         if (AddonModForumHelper.hasPostDataChanged(this.newDiscussion, this.originalData)) { |         if (AddonModForumHelper.hasPostDataChanged(this.newDiscussion, this.originalData)) { | ||||||
|             // Show confirmation if some data has been modified.
 |             // Show confirmation if some data has been modified.
 | ||||||
|             await CoreAlerts.confirmLeaveWithChanges(); |             await CoreDomUtils.showConfirm(Translate.instant('core.confirmcanceledit')); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // Delete the local files from the tmp folder.
 |         // Delete the local files from the tmp folder.
 | ||||||
|  | |||||||
| @ -26,12 +26,11 @@ import { | |||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreUrl } from '@singletons/url'; | import { CoreUrl } from '@singletons/url'; | ||||||
| import { CoreUtils } from '@singletons/utils'; | import { CoreUtils } from '@singletons/utils'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; |  | ||||||
| 
 | 
 | ||||||
| @Component({ | @Component({ | ||||||
|     selector: 'page-addon-mod-forum-search', |     selector: 'page-addon-mod-forum-search', | ||||||
| @ -83,7 +82,7 @@ export class AddonModForumSearchPage implements OnInit { | |||||||
|             this.resultsSource.setFilters(filters); |             this.resultsSource.setFilters(filters); | ||||||
|             this.ready.resolve(); |             this.ready.resolve(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -104,7 +103,7 @@ export class AddonModForumSearchPage implements OnInit { | |||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         await CoreLoadings.showOperationModals('core.searching', true, async () => { |         await CoreDomUtils.showOperationModals('core.searching', true, async () => { | ||||||
|             await this.resultsSource.reload(); |             await this.resultsSource.reload(); | ||||||
|             await CorePromiseUtils.ignoreErrors( |             await CorePromiseUtils.ignoreErrors( | ||||||
|                 CoreSearchGlobalSearch.logViewResults(this.resultsSource.getQuery(), this.resultsSource.getFilters()), |                 CoreSearchGlobalSearch.logViewResults(this.resultsSource.getQuery(), this.resultsSource.getFilters()), | ||||||
|  | |||||||
| @ -18,7 +18,7 @@ import { CoreContentLinksAction } from '@features/contentlinks/services/contentl | |||||||
| import { CoreCourse } from '@features/course/services/course'; | import { CoreCourse } from '@features/course/services/course'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSitesReadingStrategy } from '@services/sites'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { makeSingleton } from '@singletons'; | import { makeSingleton } from '@singletons'; | ||||||
| import { ADDON_MOD_FORUM_PAGE_NAME } from '../../constants'; | import { ADDON_MOD_FORUM_PAGE_NAME } from '../../constants'; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -28,6 +28,7 @@ import { CoreRatingSyncProvider } from '@features/rating/services/rating-sync'; | |||||||
| import { IonContent } from '@ionic/angular'; | import { IonContent } from '@ionic/angular'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreText } from '@singletons/text'; | import { CoreText } from '@singletons/text'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||||
| @ -57,8 +58,7 @@ import { | |||||||
|     ADDON_MOD_GLOSSARY_PAGE_NAME, |     ADDON_MOD_GLOSSARY_PAGE_NAME, | ||||||
|     GLOSSARY_AUTO_SYNCED, |     GLOSSARY_AUTO_SYNCED, | ||||||
| } from '../../constants'; | } from '../../constants'; | ||||||
| import { CorePopovers } from '@services/overlays/popovers'; | import { CorePopovers } from '@services/popovers'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Component that displays a glossary entry page. |  * Component that displays a glossary entry page. | ||||||
| @ -339,7 +339,7 @@ export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivity | |||||||
|             await entries.load(); |             await entries.load(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             this.loadMoreError = true; |             this.loadMoreError = true; | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_glossary.errorloadingentries') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_glossary.errorloadingentries', true); | ||||||
|         } finally { |         } finally { | ||||||
|             infiniteComplete && infiniteComplete(); |             infiniteComplete && infiniteComplete(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -23,6 +23,7 @@ import { CoreFileEntry } from '@services/file-helper'; | |||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreNetwork } from '@services/network'; | import { CoreNetwork } from '@services/network'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreText } from '@singletons/text'; | import { CoreText } from '@singletons/text'; | ||||||
| import { CoreWSError } from '@classes/errors/wserror'; | import { CoreWSError } from '@classes/errors/wserror'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| @ -39,8 +40,7 @@ import { AddonModGlossaryHelper } from '../../services/glossary-helper'; | |||||||
| import { AddonModGlossaryOffline } from '../../services/glossary-offline'; | import { AddonModGlossaryOffline } from '../../services/glossary-offline'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { ADDON_MOD_GLOSSARY_COMPONENT } from '../../constants'; | import { ADDON_MOD_GLOSSARY_COMPONENT } from '../../constants'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the edit form. |  * Page that displays the edit form. | ||||||
| @ -108,7 +108,7 @@ export class AddonModGlossaryEditPage implements OnInit, CanLeave { | |||||||
|                 this.handler = new AddonModGlossaryNewFormHandler(this); |                 this.handler = new AddonModGlossaryNewFormHandler(this); | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -142,7 +142,7 @@ export class AddonModGlossaryEditPage implements OnInit, CanLeave { | |||||||
|                 url: '/mod/glossary/edit.php' + (this.entry ? `?cmid=${this.cmId}&id=${this.entry.id}` : ''), |                 url: '/mod/glossary/edit.php' + (this.entry ? `?cmid=${this.cmId}&id=${this.entry.id}` : ''), | ||||||
|             }); |             }); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_glossary.errorloadingglossary') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_glossary.errorloadingglossary', true); | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @ -187,7 +187,7 @@ export class AddonModGlossaryEditPage implements OnInit, CanLeave { | |||||||
| 
 | 
 | ||||||
|         if (this.hasDataChanged()) { |         if (this.hasDataChanged()) { | ||||||
|             // Show confirmation if some data has been modified.
 |             // Show confirmation if some data has been modified.
 | ||||||
|             await CoreAlerts.confirmLeaveWithChanges(); |             await CoreDomUtils.showConfirm(Translate.instant('core.confirmcanceledit')); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // Delete the local files from the tmp folder.
 |         // Delete the local files from the tmp folder.
 | ||||||
| @ -203,7 +203,7 @@ export class AddonModGlossaryEditPage implements OnInit, CanLeave { | |||||||
|      */ |      */ | ||||||
|     async save(): Promise<void> { |     async save(): Promise<void> { | ||||||
|         if (!this.data.concept || !this.data.definition) { |         if (!this.data.concept || !this.data.definition) { | ||||||
|             CoreAlerts.showError(Translate.instant('addon.mod_glossary.fillfields')); |             CoreDomUtils.showErrorModal('addon.mod_glossary.fillfields', true); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @ -223,7 +223,7 @@ export class AddonModGlossaryEditPage implements OnInit, CanLeave { | |||||||
| 
 | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_glossary.cannoteditentry') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_glossary.cannoteditentry', true); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -26,6 +26,7 @@ import { CoreTag } from '@features/tag/services/tag'; | |||||||
| import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; | import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreNetwork } from '@services/network'; | import { CoreNetwork } from '@services/network'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||||
| @ -39,9 +40,8 @@ import { CoreTime } from '@singletons/time'; | |||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { ADDON_MOD_GLOSSARY_COMPONENT, ADDON_MOD_GLOSSARY_ENTRY_UPDATED, ADDON_MOD_GLOSSARY_PAGE_NAME } from '../../constants'; | import { ADDON_MOD_GLOSSARY_COMPONENT, ADDON_MOD_GLOSSARY_ENTRY_UPDATED, ADDON_MOD_GLOSSARY_PAGE_NAME } from '../../constants'; | ||||||
| import { CoreCourseContentsPage } from '@features/course/pages/contents/contents'; | import { CoreCourseContentsPage } from '@features/course/pages/contents/contents'; | ||||||
| import { CoreToasts, ToastDuration } from '@services/overlays/toasts'; | import { CoreToasts, ToastDuration } from '@services/toasts'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays a glossary entry. |  * Page that displays a glossary entry. | ||||||
| @ -126,7 +126,7 @@ export class AddonModGlossaryEntryPage implements OnInit, OnDestroy { | |||||||
|                 onlineEntryId = Number(this.entrySlug); |                 onlineEntryId = Number(this.entrySlug); | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|             this.goBack(); |             this.goBack(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -185,7 +185,7 @@ export class AddonModGlossaryEntryPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|         const glossaryId = this.glossary?.id; |         const glossaryId = this.glossary?.id; | ||||||
|         const cancelled = await CorePromiseUtils.promiseFails( |         const cancelled = await CorePromiseUtils.promiseFails( | ||||||
|             CoreAlerts.confirm(Translate.instant('addon.mod_glossary.areyousuredelete')), |             CoreDomUtils.showConfirm(Translate.instant('addon.mod_glossary.areyousuredelete')), | ||||||
|         ); |         ); | ||||||
| 
 | 
 | ||||||
|         if (!glossaryId || cancelled) { |         if (!glossaryId || cancelled) { | ||||||
| @ -224,7 +224,7 @@ export class AddonModGlossaryEntryPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             await this.goBack(); |             await this.goBack(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_glossary.errordeleting') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_glossary.errordeleting', true); | ||||||
|         } finally { |         } finally { | ||||||
|             modal.dismiss(); |             modal.dismiss(); | ||||||
|         } |         } | ||||||
| @ -274,7 +274,7 @@ export class AddonModGlossaryEntryPage implements OnInit, OnDestroy { | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_glossary.errorloadingentry') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_glossary.errorloadingentry', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -298,7 +298,7 @@ export class AddonModGlossaryEntryPage implements OnInit, OnDestroy { | |||||||
|             this.canEdit = true; |             this.canEdit = true; | ||||||
|             this.canDelete = true; |             this.canDelete = true; | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('addon.mod_glossary.errorloadingentry') }); |             CoreDomUtils.showErrorModalDefault(error, 'addon.mod_glossary.errorloadingentry', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -18,10 +18,10 @@ import { CoreContentLinksAction } from '@features/contentlinks/services/contentl | |||||||
| import { CoreCourse } from '@features/course/services/course'; | import { CoreCourse } from '@features/course/services/course'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSitesReadingStrategy } from '@services/sites'; | ||||||
| import { makeSingleton, Translate } from '@singletons'; | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
|  | import { makeSingleton } from '@singletons'; | ||||||
| import { ADDON_MOD_GLOSSARY_PAGE_NAME } from '../../constants'; | import { ADDON_MOD_GLOSSARY_PAGE_NAME } from '../../constants'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Content links handler for glossary new entry. |  * Content links handler for glossary new entry. | ||||||
| @ -56,7 +56,7 @@ export class AddonModGlossaryEditLinkHandlerService extends CoreContentLinksHand | |||||||
|                         { siteId }, |                         { siteId }, | ||||||
|                     ); |                     ); | ||||||
|                 } catch (error) { |                 } catch (error) { | ||||||
|                     CoreAlerts.showError(error, { default: Translate.instant('addon.mod_glossary.errorloadingglossary') }); |                     CoreDomUtils.showErrorModalDefault(error, 'addon.mod_glossary.errorloadingglossary', true); | ||||||
|                 } finally { |                 } finally { | ||||||
|                     // Just in case. In fact we need to dismiss the modal before showing a toast or error message.
 |                     // Just in case. In fact we need to dismiss the modal before showing a toast or error message.
 | ||||||
|                     modal.dismiss(); |                     modal.dismiss(); | ||||||
|  | |||||||
| @ -18,11 +18,11 @@ import { CoreContentLinksAction } from '@features/contentlinks/services/contentl | |||||||
| import { CoreCourse } from '@features/course/services/course'; | import { CoreCourse } from '@features/course/services/course'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSitesReadingStrategy } from '@services/sites'; | ||||||
| import { makeSingleton, Translate } from '@singletons'; | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
|  | import { makeSingleton } from '@singletons'; | ||||||
| import { AddonModGlossary } from '../glossary'; | import { AddonModGlossary } from '../glossary'; | ||||||
| import { ADDON_MOD_GLOSSARY_PAGE_NAME } from '../../constants'; | import { ADDON_MOD_GLOSSARY_PAGE_NAME } from '../../constants'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Handler to treat links to glossary entries. |  * Handler to treat links to glossary entries. | ||||||
| @ -67,7 +67,7 @@ export class AddonModGlossaryEntryLinkHandlerService extends CoreContentLinksHan | |||||||
|                         }, |                         }, | ||||||
|                     ); |                     ); | ||||||
|                 } catch (error) { |                 } catch (error) { | ||||||
|                     CoreAlerts.showError(error, { default: Translate.instant('addon.mod_glossary.errorloadingentry') }); |                     CoreDomUtils.showErrorModalDefault(error, 'addon.mod_glossary.errorloadingentry', true); | ||||||
|                 } finally { |                 } finally { | ||||||
|                     modal.dismiss(); |                     modal.dismiss(); | ||||||
|                 } |                 } | ||||||
|  | |||||||
| @ -28,6 +28,7 @@ import { CoreNetwork } from '@services/network'; | |||||||
| import { CoreFilepool } from '@services/filepool'; | import { CoreFilepool } from '@services/filepool'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreWSFile } from '@services/ws'; | import { CoreWSFile } from '@services/ws'; | ||||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||||
| import { | import { | ||||||
| @ -53,12 +54,10 @@ import { | |||||||
|     ADDON_MOD_H5PACTIVITY_TRACK_COMPONENT, |     ADDON_MOD_H5PACTIVITY_TRACK_COMPONENT, | ||||||
| } from '../../constants'; | } from '../../constants'; | ||||||
| import { CoreH5PMissingDependenciesError } from '@features/h5p/classes/errors/missing-dependencies-error'; | import { CoreH5PMissingDependenciesError } from '@features/h5p/classes/errors/missing-dependencies-error'; | ||||||
| import { CoreToasts, ToastDuration } from '@services/overlays/toasts'; | import { CoreToasts, ToastDuration } from '@services/toasts'; | ||||||
| import { Subscription } from 'rxjs'; | import { Subscription } from 'rxjs'; | ||||||
| import { NgZone, Translate } from '@singletons'; | import { NgZone, Translate } from '@singletons'; | ||||||
| import { CoreError } from '@classes/errors/error'; | import { CoreError } from '@classes/errors/error'; | ||||||
| import { CoreErrorHelper } from '@services/error-helper'; |  | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Component that displays an H5P activity entry page. |  * Component that displays an H5P activity entry page. | ||||||
| @ -147,7 +146,7 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv | |||||||
| 
 | 
 | ||||||
|         if (this.playing && !this.fileUrl && !this.isOnline && wasOnline && this.trackComponent) { |         if (this.playing && !this.fileUrl && !this.isOnline && wasOnline && this.trackComponent) { | ||||||
|             // User lost connection while playing an online package with tracking. Show an error.
 |             // User lost connection while playing an online package with tracking. Show an error.
 | ||||||
|             this.offlineErrorAlert = await CoreAlerts.showError( |             this.offlineErrorAlert = await CoreDomUtils.showErrorModal( | ||||||
|                 new CoreError(Translate.instant('core.course.changesofflinemaybelost'), { |                 new CoreError(Translate.instant('core.course.changesofflinemaybelost'), { | ||||||
|                     title: Translate.instant('core.youreoffline'), |                     title: Translate.instant('core.youreoffline'), | ||||||
|                 }), |                 }), | ||||||
| @ -399,14 +398,14 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (!CoreNetwork.isOnline()) { |         if (!CoreNetwork.isOnline()) { | ||||||
|             CoreAlerts.showError(Translate.instant('core.networkerrormsg')); |             CoreDomUtils.showErrorModal('core.networkerrormsg', true); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         try { |         try { | ||||||
|             // Confirm the download if needed.
 |             // Confirm the download if needed.
 | ||||||
|             await CoreAlerts.confirmDownloadSize({ size: this.deployedFile.filesize || 0, total: true }); |             await CoreDomUtils.confirmDownloadSize({ size: this.deployedFile.filesize || 0, total: true }); | ||||||
| 
 | 
 | ||||||
|             await this.downloadDeployedFile(); |             await this.downloadDeployedFile(); | ||||||
| 
 | 
 | ||||||
| @ -415,7 +414,7 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv | |||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             if (CoreErrorHelper.isCanceledError(error) || this.isDestroyed) { |             if (CoreDomUtils.isCanceledError(error) || this.isDestroyed) { | ||||||
|                 // User cancelled or view destroyed, stop.
 |                 // User cancelled or view destroyed, stop.
 | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
| @ -434,7 +433,7 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv | |||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.errordownloading') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.errordownloading', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -451,7 +450,7 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv | |||||||
|                 this.play(); |                 this.play(); | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.errordownloading') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.errordownloading', true); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -523,7 +522,7 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv | |||||||
|         if (!this.fileUrl && !this.isOnline) { |         if (!this.fileUrl && !this.isOnline) { | ||||||
|             this.triedToPlay = true; |             this.triedToPlay = true; | ||||||
| 
 | 
 | ||||||
|             CoreAlerts.showError(new CoreError(Translate.instant('core.connectandtryagain'), { |             CoreDomUtils.showErrorModal(new CoreError(Translate.instant('core.connectandtryagain'), { | ||||||
|                 title: Translate.instant('core.course.activitynotavailableoffline'), |                 title: Translate.instant('core.course.activitynotavailableoffline'), | ||||||
|             })); |             })); | ||||||
| 
 | 
 | ||||||
| @ -698,7 +697,7 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv | |||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error sending tracking data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error sending tracking data.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -758,7 +757,7 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv | |||||||
| 
 | 
 | ||||||
|             this.hasOffline = !sent; |             this.hasOffline = !sent; | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error sending tracking data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error sending tracking data.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -779,7 +778,7 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv | |||||||
|                 }, |                 }, | ||||||
|             ); |             ); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error sending tracking data.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error sending tracking data.'); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -16,6 +16,7 @@ import { Component, OnInit } from '@angular/core'; | |||||||
| 
 | 
 | ||||||
| import { CoreUser, CoreUserProfile } from '@features/user/services/user'; | import { CoreUser, CoreUserProfile } from '@features/user/services/user'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { | import { | ||||||
|     AddonModH5PActivity, |     AddonModH5PActivity, | ||||||
| @ -25,7 +26,6 @@ import { | |||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { ADDON_MOD_H5PACTIVITY_COMPONENT } from '../../constants'; | import { ADDON_MOD_H5PACTIVITY_COMPONENT } from '../../constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays results of an attempt. |  * Page that displays results of an attempt. | ||||||
| @ -78,7 +78,8 @@ export class AddonModH5PActivityAttemptResultsPage implements OnInit { | |||||||
|             this.cmId = CoreNavigator.getRequiredRouteNumberParam('cmId'); |             this.cmId = CoreNavigator.getRequiredRouteNumberParam('cmId'); | ||||||
|             this.attemptId = CoreNavigator.getRequiredRouteNumberParam('attemptId'); |             this.attemptId = CoreNavigator.getRequiredRouteNumberParam('attemptId'); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -115,7 +116,7 @@ export class AddonModH5PActivityAttemptResultsPage implements OnInit { | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error loading attempt.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error loading attempt.'); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -16,8 +16,9 @@ import { Component, OnDestroy, ViewChild } from '@angular/core'; | |||||||
| 
 | 
 | ||||||
| import { CoreCourseModuleMainActivityPage } from '@features/course/classes/main-activity-page'; | import { CoreCourseModuleMainActivityPage } from '@features/course/classes/main-activity-page'; | ||||||
| import { CanLeave } from '@guards/can-leave'; | import { CanLeave } from '@guards/can-leave'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
|  | import { Translate } from '@singletons'; | ||||||
| import { AddonModH5PActivityIndexComponent } from '../../components/index'; | import { AddonModH5PActivityIndexComponent } from '../../components/index'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays an H5P activity. |  * Page that displays an H5P activity. | ||||||
| @ -44,7 +45,7 @@ export class AddonModH5PActivityIndexPage extends CoreCourseModuleMainActivityPa | |||||||
| 
 | 
 | ||||||
|         if (!this.canLeaveSafely) { |         if (!this.canLeaveSafely) { | ||||||
|             try { |             try { | ||||||
|                 await CoreAlerts.confirmLeaveWithChanges(); |                 await CoreDomUtils.showConfirm(Translate.instant('core.confirmleaveunknownchanges')); | ||||||
| 
 | 
 | ||||||
|                 return true; |                 return true; | ||||||
|             } catch { |             } catch { | ||||||
|  | |||||||
| @ -17,6 +17,7 @@ import { Component, OnInit } from '@angular/core'; | |||||||
| import { CoreUser, CoreUserProfile } from '@features/user/services/user'; | import { CoreUser, CoreUserProfile } from '@features/user/services/user'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { | import { | ||||||
|     AddonModH5PActivity, |     AddonModH5PActivity, | ||||||
| @ -26,7 +27,6 @@ import { | |||||||
| } from '../../services/h5pactivity'; | } from '../../services/h5pactivity'; | ||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays user attempts of a certain user. |  * Page that displays user attempts of a certain user. | ||||||
| @ -79,7 +79,8 @@ export class AddonModH5PActivityUserAttemptsPage implements OnInit { | |||||||
|             this.cmId = CoreNavigator.getRequiredRouteNumberParam('cmId'); |             this.cmId = CoreNavigator.getRequiredRouteNumberParam('cmId'); | ||||||
|             this.userId = CoreNavigator.getRouteNumberParam('userId') || CoreSites.getCurrentSiteUserId(); |             this.userId = CoreNavigator.getRouteNumberParam('userId') || CoreSites.getCurrentSiteUserId(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -117,7 +118,7 @@ export class AddonModH5PActivityUserAttemptsPage implements OnInit { | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error loading attempts.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error loading attempts.'); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -16,6 +16,7 @@ import { Component, OnInit } from '@angular/core'; | |||||||
| import { CoreUser, CoreUserProfile } from '@features/user/services/user'; | import { CoreUser, CoreUserProfile } from '@features/user/services/user'; | ||||||
| 
 | 
 | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { | import { | ||||||
|     AddonModH5PActivity, |     AddonModH5PActivity, | ||||||
| @ -25,7 +26,6 @@ import { | |||||||
| import { CoreTime } from '@singletons/time'; | import { CoreTime } from '@singletons/time'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { AddonModH5PActivityGradeMethod } from '../../constants'; | import { AddonModH5PActivityGradeMethod } from '../../constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays all users that can attempt an H5P activity. |  * Page that displays all users that can attempt an H5P activity. | ||||||
| @ -74,7 +74,8 @@ export class AddonModH5PActivityUsersAttemptsPage implements OnInit { | |||||||
|             this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); |             this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); | ||||||
|             this.cmId = CoreNavigator.getRequiredRouteNumberParam('cmId'); |             this.cmId = CoreNavigator.getRequiredRouteNumberParam('cmId'); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -110,7 +111,7 @@ export class AddonModH5PActivityUsersAttemptsPage implements OnInit { | |||||||
| 
 | 
 | ||||||
|             this.logView(); |             this.logView(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error loading attempts.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error loading attempts.'); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
| @ -191,7 +192,7 @@ export class AddonModH5PActivityUsersAttemptsPage implements OnInit { | |||||||
|         try { |         try { | ||||||
|             await this.fetchUsers(false); |             await this.fetchUsers(false); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error loading more users' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error loading more users'); | ||||||
| 
 | 
 | ||||||
|             this.fetchMoreUsersFailed = true; |             this.fetchMoreUsersFailed = true; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -19,12 +19,12 @@ import { CoreContentLinksAction } from '@features/contentlinks/services/contentl | |||||||
| import { CoreCourse } from '@features/course/services/course'; | import { CoreCourse } from '@features/course/services/course'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { makeSingleton } from '@singletons'; | import { makeSingleton } from '@singletons'; | ||||||
| import { AddonModH5PActivity } from '../h5pactivity'; | import { AddonModH5PActivity } from '../h5pactivity'; | ||||||
| import { ADDON_MOD_H5PACTIVITY_PAGE_NAME } from '../../constants'; | import { ADDON_MOD_H5PACTIVITY_PAGE_NAME } from '../../constants'; | ||||||
| import { CoreLoadings } from '@services/overlays/loadings'; | import { CoreLoadings } from '@services/loadings'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Handler to treat links to H5P activity report. |  * Handler to treat links to H5P activity report. | ||||||
| @ -65,7 +65,7 @@ export class AddonModH5PActivityReportLinkHandlerService extends CoreContentLink | |||||||
|                         await this.openUserAttempts(module.id, module.course, instanceId, siteId, userId); |                         await this.openUserAttempts(module.id, module.course, instanceId, siteId, userId); | ||||||
|                     } |                     } | ||||||
|                 } catch (error) { |                 } catch (error) { | ||||||
|                     CoreAlerts.showError(error, { default: 'Error processing link.' }); |                     CoreDomUtils.showErrorModalDefault(error, 'Error processing link.'); | ||||||
|                 } finally { |                 } finally { | ||||||
|                     modal.dismiss(); |                     modal.dismiss(); | ||||||
|                 } |                 } | ||||||
|  | |||||||
| @ -22,12 +22,12 @@ import { CoreCourseModuleData } from '@features/course/services/course-helper'; | |||||||
| import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; | import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; | ||||||
| import { CoreNetwork } from '@services/network'; | import { CoreNetwork } from '@services/network'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreErrorHelper } from '@services/error-helper'; | import { CoreErrorHelper } from '@services/error-helper'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { Translate } from '@singletons'; | import { Translate } from '@singletons'; | ||||||
| import { AddonModImscp, AddonModImscpImscp, AddonModImscpTocItem } from '../../services/imscp'; | import { AddonModImscp, AddonModImscpImscp, AddonModImscpTocItem } from '../../services/imscp'; | ||||||
| import { CoreModals } from '@services/overlays/modals'; | import { CoreModals } from '@services/modals'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays a IMSCP content. |  * Page that displays a IMSCP content. | ||||||
| @ -61,7 +61,8 @@ export class AddonModImscpViewPage implements OnInit { | |||||||
|             this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); |             this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); | ||||||
|             this.initialItemHref = CoreNavigator.getRouteParam('initialHref'); |             this.initialItemHref = CoreNavigator.getRouteParam('initialHref'); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|  | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
| @ -117,7 +118,7 @@ export class AddonModImscpViewPage implements OnInit { | |||||||
|             try { |             try { | ||||||
|                 await this.loadItemHref(this.currentHref); |                 await this.loadItemHref(this.currentHref); | ||||||
|             } catch (error) { |             } catch (error) { | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('addon.mod_imscp.deploymenterror') }); |                 CoreDomUtils.showErrorModalDefault(error, 'addon.mod_imscp.deploymenterror', true); | ||||||
| 
 | 
 | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
| @ -129,7 +130,7 @@ export class AddonModImscpViewPage implements OnInit { | |||||||
|                 this.warning = ''; |                 this.warning = ''; | ||||||
|             } |             } | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.course.errorgetmodule', true); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -22,6 +22,7 @@ import { CoreUser } from '@features/user/services/user'; | |||||||
| import { IonContent, IonInput } from '@ionic/angular'; | import { IonContent, IonInput } from '@ionic/angular'; | ||||||
| import { CoreGroupInfo, CoreGroups } from '@services/groups'; | import { CoreGroupInfo, CoreGroups } from '@services/groups'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreForms } from '@singletons/form'; | import { CoreForms } from '@singletons/form'; | ||||||
| import { CoreText } from '@singletons/text'; | import { CoreText } from '@singletons/text'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| @ -51,7 +52,6 @@ import { | |||||||
|     ADDON_MOD_LESSON_DATA_SENT_EVENT, |     ADDON_MOD_LESSON_DATA_SENT_EVENT, | ||||||
|     ADDON_MOD_LESSON_PAGE_NAME, |     ADDON_MOD_LESSON_PAGE_NAME, | ||||||
| } from '../../constants'; | } from '../../constants'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Component that displays a lesson entry page. |  * Component that displays a lesson entry page. | ||||||
| @ -126,7 +126,7 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo | |||||||
|         try { |         try { | ||||||
|             await this.setGroup(groupId); |             await this.setGroup(groupId); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error getting report.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error getting report.'); | ||||||
|         } finally { |         } finally { | ||||||
|             this.reportLoaded = true; |             this.reportLoaded = true; | ||||||
|         } |         } | ||||||
| @ -464,7 +464,7 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo | |||||||
| 
 | 
 | ||||||
|         if (!this.groupInfo) { |         if (!this.groupInfo) { | ||||||
|             this.fetchReportData().catch((error) => { |             this.fetchReportData().catch((error) => { | ||||||
|                 CoreAlerts.showError(error, { default: 'Error getting report.' }); |                 CoreDomUtils.showErrorModalDefault(error, 'Error getting report.'); | ||||||
|             }); |             }); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| @ -613,7 +613,7 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo | |||||||
|                 // Error downloading but there is something offline, allow continuing it.
 |                 // Error downloading but there is something offline, allow continuing it.
 | ||||||
|                 this.playLesson(continueLast); |                 this.playLesson(continueLast); | ||||||
|             } else { |             } else { | ||||||
|                 CoreAlerts.showError(error, { default: Translate.instant('core.errordownloading') }); |                 CoreDomUtils.showErrorModalDefault(error, 'core.errordownloading', true); | ||||||
|             } |             } | ||||||
|         } finally { |         } finally { | ||||||
|             this.showSpinner = false; |             this.showSpinner = false; | ||||||
| @ -632,7 +632,7 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo | |||||||
| 
 | 
 | ||||||
|         const password = passwordEl?.value; |         const password = passwordEl?.value; | ||||||
|         if (!password) { |         if (!password) { | ||||||
|             CoreAlerts.showError(Translate.instant('addon.mod_lesson.emptypassword')); |             CoreDomUtils.showErrorModal('addon.mod_lesson.emptypassword', true); | ||||||
| 
 | 
 | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @ -652,7 +652,7 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo | |||||||
|             // Log view now that we have the password.
 |             // Log view now that we have the password.
 | ||||||
|             this.logActivity(); |             this.logActivity(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
|         } finally { |         } finally { | ||||||
|             this.showLoading = false; |             this.showLoading = false; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -22,6 +22,7 @@ import { CoreNetwork } from '@services/network'; | |||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreSites, CoreSitesCommonWSOptions, CoreSitesReadingStrategy } from '@services/sites'; | import { CoreSites, CoreSitesCommonWSOptions, CoreSitesReadingStrategy } from '@services/sites'; | ||||||
| import { CoreSync } from '@services/sync'; | import { CoreSync } from '@services/sync'; | ||||||
|  | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
| import { CoreUrl } from '@singletons/url'; | import { CoreUrl } from '@singletons/url'; | ||||||
| import { CoreObject } from '@singletons/object'; | import { CoreObject } from '@singletons/object'; | ||||||
| import { CoreWSExternalFile } from '@services/ws'; | import { CoreWSExternalFile } from '@services/ws'; | ||||||
| @ -53,11 +54,10 @@ import { AddonModLessonSync } from '../../services/lesson-sync'; | |||||||
| import { CoreFormFields, CoreForms } from '@singletons/form'; | import { CoreFormFields, CoreForms } from '@singletons/form'; | ||||||
| import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; | ||||||
| import { ADDON_MOD_LESSON_COMPONENT, AddonModLessonJumpTo } from '../../constants'; | import { ADDON_MOD_LESSON_COMPONENT, AddonModLessonJumpTo } from '../../constants'; | ||||||
| import { CoreModals } from '@services/overlays/modals'; | import { CoreModals } from '@services/modals'; | ||||||
| import { CorePromiseUtils } from '@singletons/promise-utils'; | import { CorePromiseUtils } from '@singletons/promise-utils'; | ||||||
| import { CoreWSError } from '@classes/errors/wserror'; | import { CoreWSError } from '@classes/errors/wserror'; | ||||||
| import { CoreDom } from '@singletons/dom'; | import { CoreDom } from '@singletons/dom'; | ||||||
| import { CoreAlerts } from '@services/overlays/alerts'; |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that allows attempting and reviewing a lesson. |  * Page that allows attempting and reviewing a lesson. | ||||||
| @ -131,7 +131,7 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy, CanLeave { | |||||||
|             this.currentPage = CoreNavigator.getRouteNumberParam('pageId'); |             this.currentPage = CoreNavigator.getRouteNumberParam('pageId'); | ||||||
|             this.retakeToReview = CoreNavigator.getRouteNumberParam('retake'); |             this.retakeToReview = CoreNavigator.getRouteNumberParam('retake'); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error); |             CoreDomUtils.showErrorModal(error); | ||||||
| 
 | 
 | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
| @ -173,7 +173,7 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy, CanLeave { | |||||||
|         if (this.question && !this.eolData && !this.processData && this.originalData) { |         if (this.question && !this.eolData && !this.processData && this.originalData) { | ||||||
|             // Question shown. Check if there is any change.
 |             // Question shown. Check if there is any change.
 | ||||||
|             if (!CoreObject.basicLeftCompare(this.questionForm.getRawValue(), this.originalData, 3)) { |             if (!CoreObject.basicLeftCompare(this.questionForm.getRawValue(), this.originalData, 3)) { | ||||||
|                 await CoreAlerts.confirmLeaveWithChanges(); |                 await CoreDomUtils.showConfirm(Translate.instant('core.confirmcanceledit')); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| @ -258,7 +258,7 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy, CanLeave { | |||||||
|         try { |         try { | ||||||
|             await this.loadPage(pageId); |             await this.loadPage(pageId); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error loading page' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error loading page'); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
| @ -363,7 +363,7 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy, CanLeave { | |||||||
|                 await AddonModLessonSync.deleteRetakeFinishedInSync(this.lesson!.id); |                 await AddonModLessonSync.deleteRetakeFinishedInSync(this.lesson!.id); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             CoreAlerts.showError(error, { default: Translate.instant('core.course.errorgetmodule') }); |             CoreDomUtils.showErrorModalDefault(error, 'core.course.errorgetmodule', true); | ||||||
|             this.forceLeave = true; |             this.forceLeave = true; | ||||||
|             CoreNavigator.back(); |             CoreNavigator.back(); | ||||||
| 
 | 
 | ||||||
| @ -406,7 +406,7 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy, CanLeave { | |||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 // Retake hasn't changed, show the warning and finish the retake in offline.
 |                 // Retake hasn't changed, show the warning and finish the retake in offline.
 | ||||||
|                 CoreAlerts.show({ message: result.warnings[0] }); |                 CoreDomUtils.showAlert(undefined, result.warnings[0]); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             this.offline = false; |             this.offline = false; | ||||||
| @ -546,7 +546,7 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy, CanLeave { | |||||||
| 
 | 
 | ||||||
|             this.lessonPages = pages.map((entry) => entry.page); |             this.lessonPages = pages.map((entry) => entry.page); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error loading menu.' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error loading menu.'); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loadingMenu = false; |             this.loadingMenu = false; | ||||||
|         } |         } | ||||||
| @ -763,7 +763,7 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy, CanLeave { | |||||||
| 
 | 
 | ||||||
|             this.logContinuePageLoaded(); |             this.logContinuePageLoaded(); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error processing page' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error processing page'); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
| @ -782,7 +782,7 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy, CanLeave { | |||||||
|         try { |         try { | ||||||
|             await this.loadPage(pageId); |             await this.loadPage(pageId); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error loading page' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error loading page'); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
| @ -818,7 +818,7 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy, CanLeave { | |||||||
|         try { |         try { | ||||||
|             await this.finishRetake(true); |             await this.finishRetake(true); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             CoreAlerts.showError(error, { default: 'Error finishing attempt' }); |             CoreDomUtils.showErrorModalDefault(error, 'Error finishing attempt'); | ||||||
|         } finally { |         } finally { | ||||||
|             this.loaded = true; |             this.loaded = true; | ||||||
|         } |         } | ||||||
|  | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user