From 604cf7adf006630f5bdf35c014357aa4de2e6be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 2 Oct 2023 15:09:09 +0200 Subject: [PATCH 1/2] MOBILE-4362 chore: Remove deprecated code from 3.9.5 or bellow --- src/addons/mod/scorm/services/scorm-sync.ts | 2 +- .../infinite-loading/infinite-loading.ts | 12 --- src/core/constants.ts | 1 - .../services/contentlinks-helper.ts | 16 --- .../classes/activity-prefetch-handler.ts | 17 --- .../features/course/services/log-helper.ts | 13 --- .../course/services/module-delegate.ts | 14 --- .../fileuploader/services/fileuploader.ts | 11 -- .../settings/services/settings-helper.ts | 25 ----- .../services/siteplugins-helper.ts | 25 +---- src/core/services/app.ts | 94 ---------------- src/core/services/file.ts | 22 ---- src/core/services/filepool.ts | 21 ---- src/core/services/utils/dom.ts | 100 +----------------- src/core/services/utils/text.ts | 49 --------- src/core/services/utils/utils.ts | 13 --- src/core/services/ws.ts | 17 --- src/core/singletons/window.ts | 15 --- 18 files changed, 3 insertions(+), 464 deletions(-) diff --git a/src/addons/mod/scorm/services/scorm-sync.ts b/src/addons/mod/scorm/services/scorm-sync.ts index b55470e84..d7165a41b 100644 --- a/src/addons/mod/scorm/services/scorm-sync.ts +++ b/src/addons/mod/scorm/services/scorm-sync.ts @@ -612,7 +612,7 @@ export class AddonModScormSyncProvider extends CoreCourseActivitySyncBaseProvide let lastOnlineWasFinished = false; // Sync offline logs. - await CoreUtils.ignoreErrors(CoreCourseLogHelper.syncIfNeeded(AddonModScormProvider.COMPONENT, scorm.id, siteId)); + await CoreUtils.ignoreErrors(CoreCourseLogHelper.syncActivity(AddonModScormProvider.COMPONENT, scorm.id, siteId)); // Get attempts data. We ignore cache for online attempts, so this call will fail if offline or server down. const attemptsData = await AddonModScorm.getAttemptCount(scorm.id, { diff --git a/src/core/components/infinite-loading/infinite-loading.ts b/src/core/components/infinite-loading/infinite-loading.ts index 5ba3e3c13..ab0a4b7fa 100644 --- a/src/core/components/infinite-loading/infinite-loading.ts +++ b/src/core/components/infinite-loading/infinite-loading.ts @@ -129,18 +129,6 @@ export class CoreInfiniteLoadingComponent implements OnChanges { this.checkScrollDistance(); } - /** - * Get the height of the element. - * - * @returns Height. - * @todo erase if not needed: I'm depreacating it because if not needed or getBoundingClientRect has the same result, it should - * be erased, also with getElementHeight - * @deprecated since 3.9.5 - */ - getHeight(): number { - return this.hostElement.getBoundingClientRect().height; - } - /** * Get the infinite scroll element. * diff --git a/src/core/constants.ts b/src/core/constants.ts index b1eaa1af8..fea73ab5d 100644 --- a/src/core/constants.ts +++ b/src/core/constants.ts @@ -62,7 +62,6 @@ export class CoreConstants { static readonly DOWNLOAD_THRESHOLD = 10485760; // 10MB. static readonly MINIMUM_FREE_SPACE = 10485760; // 10MB. static readonly IOS_FREE_SPACE_THRESHOLD = 524288000; // 500MB. - static readonly DONT_SHOW_ERROR = 'CoreDontShowError'; // @deprecated since 3.9.5. Use CoreSilentError instead. static readonly NO_SITE_ID = 'NoSite'; // Settings constants. diff --git a/src/core/features/contentlinks/services/contentlinks-helper.ts b/src/core/features/contentlinks/services/contentlinks-helper.ts index 421cb477b..84291fe38 100644 --- a/src/core/features/contentlinks/services/contentlinks-helper.ts +++ b/src/core/features/contentlinks/services/contentlinks-helper.ts @@ -19,7 +19,6 @@ import { CoreContentLinksDelegate, CoreContentLinksAction } from './contentlinks import { CoreSite } from '@classes/site'; import { makeSingleton, Translate } from '@singletons'; import { CoreNavigator } from '@services/navigator'; -import { Params } from '@angular/router'; import { CoreContentLinksChooseSiteModalComponent } from '../components/choose-site-modal/choose-site-modal'; import { CoreCustomURLSchemes } from '@services/urlschemes'; @@ -90,21 +89,6 @@ export class CoreContentLinksHelperProvider { return actions.find((action) => action && action.sites && action.sites.length); } - /** - * Goes to a certain page in a certain site. If the site is current site it will perform a regular navigation, - * otherwise it will 'redirect' to the other site. - * - * @param navCtrlUnused Deprecated param. - * @param pageName Name of the page to go. - * @param pageParams Params to send to the page. - * @param siteId Site ID. If not defined, current site. - * @returns Promise resolved when done. - * @deprecated since 3.9.5. Use CoreNavigator.navigateToSitePath instead. - */ - async goInSite(navCtrlUnused: unknown, pageName: string, pageParams: Params, siteId?: string): Promise { - await CoreNavigator.navigateToSitePath(pageName, { params: pageParams, siteId }); - } - /** * Go to the page to choose a site. * diff --git a/src/core/features/course/classes/activity-prefetch-handler.ts b/src/core/features/course/classes/activity-prefetch-handler.ts index 3c433ef97..19df8150e 100644 --- a/src/core/features/course/classes/activity-prefetch-handler.ts +++ b/src/core/features/course/classes/activity-prefetch-handler.ts @@ -179,21 +179,4 @@ export class CoreCourseActivityPrefetchHandlerBase extends CoreCourseModulePrefe await CoreFilepool.setPackagePreviousStatus(siteId, this.component, id); } - /** - * Set previous status and return a rejected promise. - * - * @param id Unique identifier per component. - * @param error Error to throw. - * @param siteId Site ID. If not defined, current site. - * @returns Rejected promise. - * @deprecated since 3.9.5. Use setPreviousStatus instead. - */ - async setPreviousStatusAndReject(id: number, error?: Error, siteId?: string): Promise { - siteId = siteId || CoreSites.getCurrentSiteId(); - - await CoreFilepool.setPackagePreviousStatus(siteId, this.component, id); - - throw error; - } - } diff --git a/src/core/features/course/services/log-helper.ts b/src/core/features/course/services/log-helper.ts index 052149036..5a41c4e97 100644 --- a/src/core/features/course/services/log-helper.ts +++ b/src/core/features/course/services/log-helper.ts @@ -299,19 +299,6 @@ export class CoreCourseLogHelperProvider { return this.syncLogs(unique, siteId); } - /** - * Sync the offline saved activity logs. - * - * @param component Component name. - * @param componentId Component ID. - * @param siteId Site ID. If not defined, current site. - * @returns Promise resolved when done. - * @deprecated since 3.9.5. Please use syncActivity instead. - */ - syncIfNeeded(component: string, componentId: number, siteId?: string): Promise { - return this.syncActivity(component, componentId, siteId); - } - /** * Sync the offline saved activity logs. * diff --git a/src/core/features/course/services/module-delegate.ts b/src/core/features/course/services/module-delegate.ts index 0a6a2af3a..8ee7cd75d 100644 --- a/src/core/features/course/services/module-delegate.ts +++ b/src/core/features/course/services/module-delegate.ts @@ -238,20 +238,6 @@ export interface CoreCourseModuleHandlerButton { */ hidden?: boolean; - /** - * The name of the button icon to use in iOS instead of "icon". - * - * @deprecated since 3.9.5. Now the icon must be the same for all platforms. - */ - iosIcon?: string; - - /** - * The name of the button icon to use in MaterialDesign instead of "icon". - * - * @deprecated since 3.9.5. Now the icon must be the same for all platforms. - */ - mdIcon?: string; - /** * Action to perform when the button is clicked. * diff --git a/src/core/features/fileuploader/services/fileuploader.ts b/src/core/features/fileuploader/services/fileuploader.ts index 35351fd8b..c64a654b6 100644 --- a/src/core/features/fileuploader/services/fileuploader.ts +++ b/src/core/features/fileuploader/services/fileuploader.ts @@ -445,17 +445,6 @@ export class CoreFileUploaderProvider { } } - /** - * Mark files as offline. - * - * @param files Files to mark as offline. - * @returns Files marked as offline. - * @deprecated since 3.9.5. Now stored files no longer have an offline property. - */ - markOfflineFiles(files: FileEntry[]): FileEntry[] { - return files; - } - /** * Parse filetypeList to get the list of allowed mimetypes and the data to render information. * diff --git a/src/core/features/settings/services/settings-helper.ts b/src/core/features/settings/services/settings-helper.ts index b5fdf00ad..477c4e937 100644 --- a/src/core/features/settings/services/settings-helper.ts +++ b/src/core/features/settings/services/settings-helper.ts @@ -208,31 +208,6 @@ export class CoreSettingsHelperProvider { return totalEntries; } - /** - * Get a certain processor from a list of processors. - * - * @param processors List of processors. - * @param name Name of the processor to get. - * @param fallback True to return first processor if not found, false to not return any. Defaults to true. - * @deprecated since 3.9.5. This function has been moved to AddonNotificationsHelperProvider. - */ - // eslint-disable-next-line @typescript-eslint/no-unused-vars - getProcessor(processors: unknown[], name: string, fallback: boolean = true): void { - return; - } - - /** - * Return the components and notifications that have a certain processor. - * - * @param processorName Name of the processor to filter. - * @param components Array of components. - * @returns Filtered components. - * @deprecated since 3.9.5. This function has been moved to AddonNotificationsHelperProvider. - */ - getProcessorComponents(processorName: string, components: unknown[]): unknown[] { - return components; - } - /** * Get the synchronization promise of a site. * diff --git a/src/core/features/siteplugins/services/siteplugins-helper.ts b/src/core/features/siteplugins/services/siteplugins-helper.ts index 37759ab91..d0d55948b 100644 --- a/src/core/features/siteplugins/services/siteplugins-helper.ts +++ b/src/core/features/siteplugins/services/siteplugins-helper.ts @@ -20,7 +20,7 @@ import { AddonModAssignSubmissionDelegate } from '@addons/mod/assign/services/su import { AddonModQuizAccessRuleDelegate } from '@addons/mod/quiz/services/access-rules-delegate'; import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; import { CoreError } from '@classes/errors/error'; -import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; +import { CoreSiteWSPreSets } from '@classes/site'; import { CoreBlockDelegate } from '@features/block/services/block-delegate'; import { CoreCompile } from '@features/compile/services/compile'; import { CoreCourseOptionsDelegate } from '@features/course/services/course-options-delegate'; @@ -293,17 +293,6 @@ export class CoreSitePluginsHelperProvider { return result; } - /** - * Fetch site plugins. - * - * @param siteId Site ID. If not defined, current site. - * @returns Promise resolved when done. Returns the list of plugins to load. - * @deprecated since 3.9.5. The function was moved to CoreSitePlugins.getPlugins. - */ - async fetchSitePlugins(siteId?: string): Promise { - return CoreSitePlugins.getPlugins(siteId); - } - /** * Given an addon name, return the prefix to add to its string keys. * @@ -329,18 +318,6 @@ export class CoreSitePluginsHelperProvider { return this.getPrefixForStrings(addon) + key; } - /** - * Check if a certain plugin is a site plugin and it's enabled in a certain site. - * - * @param plugin Data of the plugin. - * @param site Site affected. - * @returns Whether it's a site plugin and it's enabled. - * @deprecated since 3.9.5. The function was moved to CoreSitePlugins.isSitePluginEnabled. - */ - isSitePluginEnabled(plugin: CoreSitePluginsPlugin, site: CoreSite): boolean { - return CoreSitePlugins.isSitePluginEnabled(plugin, site); - } - /** * Load the lang strings for a plugin. * diff --git a/src/core/services/app.ts b/src/core/services/app.ts index 1b8f62d55..be8f9374a 100644 --- a/src/core/services/app.ts +++ b/src/core/services/app.ts @@ -189,16 +189,6 @@ export class CoreAppProvider { return this.db; } - /** - * Get an ID for a main menu. - * - * @returns Main menu ID. - * @deprecated since 3.9.5. No longer supported. - */ - getMainMenuId(): number { - return 0; - } - /** * Get app store URL. * @@ -231,16 +221,6 @@ export class CoreAppProvider { return CorePlatform.getPlatformMajorVersion(); } - /** - * Checks if the app is running in a 64 bits desktop environment (not browser). - * - * @returns false. - * @deprecated since 3.9.5 Desktop support has been removed. - */ - is64Bits(): boolean { - return false; - } - /** * Checks if the app is running in an Android mobile or tablet device. * @@ -251,16 +231,6 @@ export class CoreAppProvider { return CorePlatform.isAndroid(); } - /** - * Checks if the app is running in a desktop environment (not browser). - * - * @returns false. - * @deprecated since 3.9.5 Desktop support has been removed. - */ - isDesktop(): boolean { - return false; - } - /** * Checks if the app is running in an iOS mobile or tablet device. * @@ -298,36 +268,6 @@ export class CoreAppProvider { return this.isKeyboardShown; } - /** - * Check if the app is running in a Linux environment. - * - * @returns false. - * @deprecated since 3.9.5 Desktop support has been removed. - */ - isLinux(): boolean { - return false; - } - - /** - * Check if the app is running in a Mac OS environment. - * - * @returns false. - * @deprecated since 3.9.5 Desktop support has been removed. - */ - isMac(): boolean { - return false; - } - - /** - * Check if the main menu is open. - * - * @returns Whether the main menu is open. - * @deprecated since 3.9.5. No longer supported. - */ - isMainMenuOpen(): boolean { - return false; - } - /** * Checks if the app is running in a mobile or tablet device (Cordova). * @@ -377,16 +317,6 @@ export class CoreAppProvider { return CoreNetwork.isWifi(); } - /** - * Check if the app is running in a Windows environment. - * - * @returns false. - * @deprecated since 3.9.5 Desktop support has been removed. - */ - isWindows(): boolean { - return false; - } - /** * Open the keyboard. */ @@ -609,21 +539,6 @@ export class CoreAppProvider { } } - /** - * Register a back button action. - * This function is deprecated and no longer works. You should now use Ionic events directly, please see: - * https://ionicframework.com/docs/developing/hardware-back-button - * - * @param callback Called when the back button is pressed. - * @param priority Priority. - * @returns A function that, when called, will unregister the back button action. - * @deprecated since 3.9.5 - */ - // eslint-disable-next-line @typescript-eslint/no-unused-vars - registerBackButtonAction(callback: () => boolean, priority = 0): () => boolean { - return () => false; - } - /** * Set System UI Colors. */ @@ -652,15 +567,6 @@ export class CoreAppProvider { StatusBar.backgroundColorByHexString(color); } - /** - * Reset StatusBar color if any was set. - * - * @deprecated since 3.9.5. Use setStatusBarColor passing the color of the new statusbar color, or no color to reset. - */ - resetStatusBarColor(): void { - this.setStatusBarColor(); - } - /** * Set value of forceOffline flag. If true, the app will think the device is offline. * diff --git a/src/core/services/file.ts b/src/core/services/file.ts index cc45ae0d2..0f3798ce0 100644 --- a/src/core/services/file.ts +++ b/src/core/services/file.ts @@ -71,28 +71,6 @@ export const enum CoreFileFormat { @Injectable({ providedIn: 'root' }) export class CoreFileProvider { - // Formats to read a file. - /** - * @deprecated since 3.9.5, use CoreFileFormat directly. - */ - static readonly FORMATTEXT = CoreFileFormat.FORMATTEXT; - /** - * @deprecated since 3.9.5, use CoreFileFormat directly. - */ - static readonly FORMATDATAURL = CoreFileFormat.FORMATDATAURL; - /** - * @deprecated since 3.9.5, use CoreFileFormat directly. - */ - static readonly FORMATBINARYSTRING = CoreFileFormat.FORMATBINARYSTRING; - /** - * @deprecated since 3.9.5, use CoreFileFormat directly. - */ - static readonly FORMATARRAYBUFFER = CoreFileFormat.FORMATARRAYBUFFER; - /** - * @deprecated since 3.9.5, use CoreFileFormat directly. - */ - static readonly FORMATJSON = CoreFileFormat.FORMATJSON; - // Folders. static readonly SITESFOLDER = 'sites'; static readonly TMPFOLDER = 'tmp'; diff --git a/src/core/services/filepool.ts b/src/core/services/filepool.ts index 6c352d777..5623c46a8 100644 --- a/src/core/services/filepool.ts +++ b/src/core/services/filepool.ts @@ -2839,27 +2839,6 @@ export class CoreFilepoolProvider { (CoreNetwork.isWifi() && size <= CoreFilepoolProvider.WIFI_DOWNLOAD_THRESHOLD); } - /** - * Convenience function to check if a file should be downloaded before opening it. - * - * @param url File online URL. - * @param size File size. - * @returns Promise resolved if should download before open, rejected otherwise. - * @deprecated since 3.9.5. Please use shouldDownloadFileBeforeOpen instead. - */ - async shouldDownloadBeforeOpen(url: string, size: number): Promise { - if (size >= 0 && size <= CoreFilepoolProvider.DOWNLOAD_THRESHOLD) { - // The file is small, download it. - return; - } - - const mimetype = await CoreUtils.getMimeTypeFromUrl(url); - // If the file is streaming (audio or video) we reject. - if (CoreMimetypeUtils.isStreamedMimetype(mimetype)) { - throw new CoreError('File is audio or video.'); - } - } - /** * Convenience function to check if a file should be downloaded before opening it. * diff --git a/src/core/services/utils/dom.ts b/src/core/services/utils/dom.ts index 9483cdc3c..7eb2a73f8 100644 --- a/src/core/services/utils/dom.ts +++ b/src/core/services/utils/dom.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Injectable, SimpleChange, ElementRef, KeyValueChanges } from '@angular/core'; +import { Injectable, SimpleChange, KeyValueChanges } from '@angular/core'; import { IonContent } from '@ionic/angular'; import { ModalOptions, PopoverOptions, AlertOptions, AlertButton, TextFieldTypes, getMode, ToastOptions } from '@ionic/core'; import { Md5 } from 'ts-md5'; @@ -43,7 +43,6 @@ import { CoreFileSizeSum } from '@services/plugin-file-delegate'; import { CoreNetworkError } from '@classes/errors/network-error'; import { CoreBSTooltipComponent } from '@components/bs-tooltip/bs-tooltip'; import { CoreViewerImageComponent } from '@features/viewer/components/image/image'; -import { CoreFormFields, CoreForms } from '../../singletons/form'; import { CoreModalLateralTransitionEnter, CoreModalLateralTransitionLeave } from '@classes/modal-lateral-transition'; import { CoreZoomLevel } from '@features/settings/services/settings-helper'; import { CoreSites } from '@services/sites'; @@ -226,16 +225,6 @@ export class CoreDomUtilsProvider { return this.template.content.children[0]; } - /** - * Create a "cancelled" error. These errors won't display an error message in showErrorModal functions. - * - * @returns The error object. - * @deprecated since 3.9.5. Just create the error directly. - */ - createCanceledError(): CoreCanceledError { - return new CoreCanceledError(''); - } - /** * Given a list of changes for a component input detected by a KeyValueDiffers, create an object similar to the one * passed to the ngOnChanges functions. @@ -395,17 +384,6 @@ export class CoreDomUtilsProvider { } } - /** - * Get the data from a form. It will only collect elements that have a name. - * - * @param form The form to get the data from. - * @returns Object with the data. The keys are the names of the inputs. - * @deprecated since 3.9.5. Function has been moved to CoreForms. - */ - getDataFromForm(form: HTMLFormElement): CoreFormFields { - return CoreForms.getDataFromForm(form); - } - /** * Returns the attribute value of a string element. Only the first element will be selected. * @@ -648,11 +626,6 @@ export class CoreDomUtilsProvider { errorMessage = error; } - if (errorMessage == CoreConstants.DONT_SHOW_ERROR) { - // The error shouldn't be shown, stop. - return null; - } - let message = CoreTextUtils.decodeHTML(needsTranslate ? Translate.instant(errorMessage) : errorMessage); if (extraInfo) { @@ -814,16 +787,6 @@ export class CoreDomUtilsProvider { return !!enabled; } - /** - * Check if rich text editor is supported in the platform. - * - * @returns Whether it's supported. - * @deprecated since 3.9.5 - */ - isRichTextEditorSupported(): boolean { - return true; - } - /** * Move children from one HTMLElement to another. * @@ -982,44 +945,6 @@ export class CoreDomUtilsProvider { return element.innerHTML; } - /** - * Scroll to somehere in the content. - * - * @param content Content to scroll. - * @param x The x-value to scroll to. - * @param y The y-value to scroll to. - * @param duration Duration of the scroll animation in milliseconds. - * @returns Returns a promise which is resolved when the scroll has completed. - * @deprecated since 3.9.5. Use directly the IonContent class. - */ - scrollTo(content: IonContent, x: number, y: number, duration = 0): Promise { - return content.scrollToPoint(x, y, duration); - } - - /** - * Scroll to Bottom of the content. - * - * @param content Content to scroll. - * @param duration Duration of the scroll animation in milliseconds. - * @returns Returns a promise which is resolved when the scroll has completed. - * @deprecated since 3.9.5. Use directly the IonContent class. - */ - scrollToBottom(content: IonContent, duration = 0): Promise { - return content.scrollToBottom(duration); - } - - /** - * Scroll to Top of the content. - * - * @param content Content to scroll. - * @param duration Duration of the scroll animation in milliseconds. - * @returns Returns a promise which is resolved when the scroll has completed. - * @deprecated since 3.9.5. Use directly the IonContent class. - */ - scrollToTop(content: IonContent, duration = 0): Promise { - return content.scrollToTop(duration); - } - /** * Returns height of the content. * @@ -2041,29 +1966,6 @@ export class CoreDomUtilsProvider { wrapper.appendChild(el); } - /** - * Trigger form cancelled event. - * - * @param formRef Form element. - * @param siteId The site affected. If not provided, no site affected. - * @deprecated since 3.9.5. Function has been moved to CoreForms. - */ - triggerFormCancelledEvent(formRef: ElementRef | HTMLFormElement | undefined, siteId?: string): void { - CoreForms.triggerFormCancelledEvent(formRef, siteId); - } - - /** - * Trigger form submitted event. - * - * @param formRef Form element. - * @param online Whether the action was done in offline or not. - * @param siteId The site affected. If not provided, no site affected. - * @deprecated since 3.9.5. Function has been moved to CoreForms. - */ - triggerFormSubmittedEvent(formRef: ElementRef | HTMLFormElement | undefined, online?: boolean, siteId?: string): void { - CoreForms.triggerFormSubmittedEvent(formRef, online, siteId); - } - /** * In iOS the resize event is triggered before the window size changes. Wait for the size to change. * Use of this function is discouraged. Please use CoreDom.onWindowResize to check window resize event. diff --git a/src/core/services/utils/text.ts b/src/core/services/utils/text.ts index f58e0bf99..f8c533b5b 100644 --- a/src/core/services/utils/text.ts +++ b/src/core/services/utils/text.ts @@ -23,7 +23,6 @@ import { Locutus } from '@singletons/locutus'; import { CoreViewerTextComponent } from '@features/viewer/components/text/text'; import { CoreFileHelper } from '@services/file-helper'; import { CoreDomUtils } from './dom'; -import { CoreText } from '@singletons/text'; import { CoreUrl } from '@singletons/url'; import { AlertButton } from '@ionic/angular'; import { CorePath } from '@singletons/path'; @@ -473,43 +472,6 @@ export class CoreTextUtilsProvider { .replace(/'/g, '''); } - /** - * Shows a text on a new page. - * - * @param title Title of the new state. - * @param text Content of the text to be expanded. - * @param component Component to link the embedded files to. - * @param componentId An ID to use in conjunction with the component. - * @param files List of files to display along with the text. - * @param filter Whether the text should be filtered. - * @param contextLevel The context level. - * @param instanceId The instance ID related to the context. - * @param courseId Course ID the text belongs to. It can be used to improve performance with filters. - * @returns Promise resolved when done. - * @deprecated since 3.8.3. Please use viewText instead. - */ - expandText( - title: string, - text: string, - component?: string, - componentId?: string | number, - files?: CoreWSFile[], - filter?: boolean, - contextLevel?: string, - instanceId?: number, - courseId?: number, - ): Promise { - return this.viewText(title, text, { - component, - componentId, - files, - filter, - contextLevel, - instanceId, - courseId, - }); - } - /** * Formats a text, in HTML replacing new lines by correct html new lines. * @@ -720,17 +682,6 @@ export class CoreTextUtilsProvider { throw new CoreError('JSON cannot be parsed and not default value has been provided') ; } - /** - * Remove ending slash from a path or URL. - * - * @param text Text to treat. - * @returns Treated text. - * @deprecated since 3.9.5. Use CoreText instead. - */ - removeEndingSlash(text?: string): string { - return CoreText.removeEndingSlash(text); - } - /** * Replace all characters that cause problems with files in Android and iOS. * diff --git a/src/core/services/utils/utils.ts b/src/core/services/utils/utils.ts index 84b033fd3..0d1ee1649 100644 --- a/src/core/services/utils/utils.ts +++ b/src/core/services/utils/utils.ts @@ -24,7 +24,6 @@ import { CoreWS } from '@services/ws'; import { CoreDomUtils } from '@services/utils/dom'; import { CoreMimetypeUtils } from '@services/utils/mimetype'; import { CoreTextUtils } from '@services/utils/text'; -import { CoreWSError } from '@classes/errors/wserror'; import { makeSingleton, Clipboard, InAppBrowser, FileOpener, WebIntent, QRScanner, Translate, NgZone } from '@singletons'; import { CoreLogger } from '@singletons/logger'; import { CoreViewerQRScannerComponent } from '@features/viewer/components/qr-scanner/qr-scanner'; @@ -384,18 +383,6 @@ export class CoreUtilsProvider { CoreDomUtils.showToast('core.copiedtoclipboard', true); } - /** - * Create a "fake" WS error for local errors. - * - * @param message The message to include in the error. - * @param needsTranslate If the message needs to be translated. - * @returns Fake WS error. - * @deprecated since 3.9.5. Just create the error directly. - */ - createFakeWSError(message: string, needsTranslate?: boolean): CoreWSError { - return CoreWS.createFakeWSError(message, needsTranslate); - } - /** * Empties an array without losing its reference. * diff --git a/src/core/services/ws.ts b/src/core/services/ws.ts index d27e06eb1..1f3db3a47 100644 --- a/src/core/services/ws.ts +++ b/src/core/services/ws.ts @@ -208,23 +208,6 @@ export class CoreWSProvider { return result; } - /** - * Create a "fake" WS error for local errors. - * - * @param message The message to include in the error. - * @param needsTranslate If the message needs to be translated. - * @param translateParams Translation params, if needed. - * @returns Fake WS error. - * @deprecated since 3.9.5. Just create the error directly. - */ - createFakeWSError(message: string, needsTranslate?: boolean, translateParams?: {[name: string]: string}): CoreError { - if (needsTranslate) { - message = Translate.instant(message, translateParams); - } - - return new CoreError(message); - } - /** * It will check if response has failed and throw the propper error. * diff --git a/src/core/singletons/window.ts b/src/core/singletons/window.ts index 78dbaa519..e3323e20b 100644 --- a/src/core/singletons/window.ts +++ b/src/core/singletons/window.ts @@ -13,7 +13,6 @@ // limitations under the License. import { CoreContentLinksHelper } from '@features/contentlinks/services/contentlinks-helper'; -import { NavController } from '@ionic/angular'; import { CoreConfig } from '@services/config'; import { CoreFileHelper } from '@services/file-helper'; @@ -24,20 +23,6 @@ import { CoreUtils } from '@services/utils/utils'; import { Translate } from '@singletons'; import { CoreConstants } from '../constants'; -/** - * Options for the open function. - * - * @deprecated since 3.9.5 - */ -export type CoreWindowOpenOptions = { - /** - * NavController to use when opening the link in the app. - * - * @deprecated since 3.9.5 - */ - navCtrl?: NavController; -}; - /** * Singleton with helper functions for windows. */ From b4294e2d313397f4cf4228f345ef896b769b089d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 2 Oct 2023 16:03:16 +0200 Subject: [PATCH 2/2] MOBILE-4362 login: Make siteaddressplaceholder translatable --- scripts/langindex.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/langindex.json b/scripts/langindex.json index 709e101f2..7dbfa28cf 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -2136,7 +2136,7 @@ "core.login.signupplugindisabled": "local_moodlemobileapp", "core.login.signuprequiredfieldnotsupported": "local_moodlemobileapp", "core.login.siteaddress": "local_moodlemobileapp", - "core.login.siteaddressplaceholder": "donottranslate", + "core.login.siteaddressplaceholder": "local_moodlemobileapp", "core.login.sitebadgedescription": "local_moodlemobileapp", "core.login.sitehasredirect": "local_moodlemobileapp", "core.login.siteinmaintenance": "local_moodlemobileapp",