From 0975669042d5e047cd74322fa8451b8c9bdf36a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 10 Jan 2024 16:47:55 +0100 Subject: [PATCH] MOBILE-3947 chore: Remove some ionicons usage --- .../fileuploader/services/handlers/album.ts | 15 ++++----------- .../fileuploader/services/handlers/audio.ts | 15 ++++----------- .../fileuploader/services/handlers/camera.ts | 15 ++++----------- .../fileuploader/services/handlers/file.ts | 15 ++++----------- .../fileuploader/services/handlers/video.ts | 15 ++++----------- .../sharedfiles/services/handlers/upload.ts | 15 ++++----------- .../user/services/handlers/profile-mail.ts | 2 +- 7 files changed, 25 insertions(+), 67 deletions(-) diff --git a/src/core/features/fileuploader/services/handlers/album.ts b/src/core/features/fileuploader/services/handlers/album.ts index 26eb45fe6..e61ddf6de 100644 --- a/src/core/features/fileuploader/services/handlers/album.ts +++ b/src/core/features/fileuploader/services/handlers/album.ts @@ -30,19 +30,14 @@ export class CoreFileUploaderAlbumHandlerService implements CoreFileUploaderHand priority = 2000; /** - * Whether or not the handler is enabled on a site level. - * - * @returns Promise resolved with true if enabled. + * @inheritdoc */ async isEnabled(): Promise { return CorePlatform.isMobile(); } /** - * Given a list of mimetypes, return the ones that are supported by the handler. - * - * @param mimetypes List of mimetypes. - * @returns Supported mimetypes. + * @inheritdoc */ getSupportedMimetypes(mimetypes: string[]): string[] { // Album allows picking images and videos. @@ -50,15 +45,13 @@ export class CoreFileUploaderAlbumHandlerService implements CoreFileUploaderHand } /** - * Get the data to display the handler. - * - * @returns Data. + * @inheritdoc */ getData(): CoreFileUploaderHandlerData { return { title: 'core.fileuploader.photoalbums', class: 'core-fileuploader-album-handler', - icon: 'images', // Cannot use font-awesome in action sheet. + icon: 'fas-images', action: async ( maxSize?: number, upload?: boolean, diff --git a/src/core/features/fileuploader/services/handlers/audio.ts b/src/core/features/fileuploader/services/handlers/audio.ts index cdce9f086..2a2e93725 100644 --- a/src/core/features/fileuploader/services/handlers/audio.ts +++ b/src/core/features/fileuploader/services/handlers/audio.ts @@ -30,19 +30,14 @@ export class CoreFileUploaderAudioHandlerService implements CoreFileUploaderHand priority = 1600; /** - * Whether or not the handler is enabled on a site level. - * - * @returns Promise resolved with true if enabled. + * @inheritdoc */ async isEnabled(): Promise { return CorePlatform.isMobile() || (CoreApp.canGetUserMedia() && CoreApp.canRecordMedia()); } /** - * Given a list of mimetypes, return the ones that are supported by the handler. - * - * @param mimetypes List of mimetypes. - * @returns Supported mimetypes. + * @inheritdoc */ getSupportedMimetypes(mimetypes: string[]): string[] { if (CorePlatform.isIOS()) { @@ -66,15 +61,13 @@ export class CoreFileUploaderAudioHandlerService implements CoreFileUploaderHand } /** - * Get the data to display the handler. - * - * @returns Data. + * @inheritdoc */ getData(): CoreFileUploaderHandlerData { return { title: 'core.fileuploader.audio', class: 'core-fileuploader-audio-handler', - icon: 'mic', // Cannot use font-awesome in action sheet. + icon: 'fas-microphone', action: async ( maxSize?: number, upload?: boolean, diff --git a/src/core/features/fileuploader/services/handlers/camera.ts b/src/core/features/fileuploader/services/handlers/camera.ts index 84c9e3ff9..80cae2cdd 100644 --- a/src/core/features/fileuploader/services/handlers/camera.ts +++ b/src/core/features/fileuploader/services/handlers/camera.ts @@ -31,19 +31,14 @@ export class CoreFileUploaderCameraHandlerService implements CoreFileUploaderHan priority = 1800; /** - * Whether or not the handler is enabled on a site level. - * - * @returns Promise resolved with true if enabled. + * @inheritdoc */ async isEnabled(): Promise { return CorePlatform.isMobile() || CoreApp.canGetUserMedia(); } /** - * Given a list of mimetypes, return the ones that are supported by the handler. - * - * @param mimetypes List of mimetypes. - * @returns Supported mimetypes. + * @inheritdoc */ getSupportedMimetypes(mimetypes: string[]): string[] { // Camera only supports JPEG and PNG. @@ -51,15 +46,13 @@ export class CoreFileUploaderCameraHandlerService implements CoreFileUploaderHan } /** - * Get the data to display the handler. - * - * @returns Data. + * @inheritdoc */ getData(): CoreFileUploaderHandlerData { return { title: 'core.fileuploader.camera', class: 'core-fileuploader-camera-handler', - icon: 'camera', // Cannot use font-awesome in action sheet. + icon: 'fas-camera', action: async ( maxSize?: number, upload?: boolean, diff --git a/src/core/features/fileuploader/services/handlers/file.ts b/src/core/features/fileuploader/services/handlers/file.ts index 0ed301042..4e63a0aa8 100644 --- a/src/core/features/fileuploader/services/handlers/file.ts +++ b/src/core/features/fileuploader/services/handlers/file.ts @@ -31,34 +31,27 @@ export class CoreFileUploaderFileHandlerService implements CoreFileUploaderHandl priority = 1200; /** - * Whether or not the handler is enabled on a site level. - * - * @returns Promise resolved with true if enabled. + * @inheritdoc */ async isEnabled(): Promise { return true; } /** - * Given a list of mimetypes, return the ones that are supported by the handler. - * - * @param mimetypes List of mimetypes. - * @returns Supported mimetypes. + * @inheritdoc */ getSupportedMimetypes(mimetypes: string[]): string[] { return mimetypes; } /** - * Get the data to display the handler. - * - * @returns Data. + * @inheritdoc */ getData(): CoreFileUploaderHandlerData { const handler: CoreFileUploaderHandlerData = { title: 'core.fileuploader.file', class: 'core-fileuploader-file-handler', - icon: 'folder', // Cannot use font-awesome in action sheet. + icon: 'fas-file-lines', }; if (CorePlatform.isMobile()) { diff --git a/src/core/features/fileuploader/services/handlers/video.ts b/src/core/features/fileuploader/services/handlers/video.ts index 0472f2248..7d5b72476 100644 --- a/src/core/features/fileuploader/services/handlers/video.ts +++ b/src/core/features/fileuploader/services/handlers/video.ts @@ -30,19 +30,14 @@ export class CoreFileUploaderVideoHandlerService implements CoreFileUploaderHand priority = 1400; /** - * Whether or not the handler is enabled on a site level. - * - * @returns Promise resolved with true if enabled. + * @inheritdoc */ async isEnabled(): Promise { return CorePlatform.isMobile() || (CoreApp.canGetUserMedia() && CoreApp.canRecordMedia()); } /** - * Given a list of mimetypes, return the ones that are supported by the handler. - * - * @param mimetypes List of mimetypes. - * @returns Supported mimetypes. + * @inheritdoc */ getSupportedMimetypes(mimetypes: string[]): string[] { if (CorePlatform.isIOS()) { @@ -66,15 +61,13 @@ export class CoreFileUploaderVideoHandlerService implements CoreFileUploaderHand } /** - * Get the data to display the handler. - * - * @returns Data. + * @inheritdoc */ getData(): CoreFileUploaderHandlerData { return { title: 'core.fileuploader.video', class: 'core-fileuploader-video-handler', - icon: 'videocam', // Cannot use font-awesome in action sheet. + icon: 'fas-video', action: async ( maxSize?: number, upload?: boolean, diff --git a/src/core/features/sharedfiles/services/handlers/upload.ts b/src/core/features/sharedfiles/services/handlers/upload.ts index c0ff37195..b2e3ad45c 100644 --- a/src/core/features/sharedfiles/services/handlers/upload.ts +++ b/src/core/features/sharedfiles/services/handlers/upload.ts @@ -32,34 +32,27 @@ export class CoreSharedFilesUploadHandlerService implements CoreFileUploaderHand priority = 1300; /** - * Whether or not the handler is enabled on a site level. - * - * @returns True or promise resolved with true if enabled. + * @inheritdoc */ async isEnabled(): Promise { return CorePlatform.isIOS(); } /** - * Given a list of mimetypes, return the ones that are supported by the handler. - * - * @param mimetypes List of mimetypes. - * @returns Supported mimetypes. + * @inheritdoc */ getSupportedMimetypes(mimetypes: string[]): string[] { return mimetypes; } /** - * Get the data to display the handler. - * - * @returns Data. + * @inheritdoc */ getData(): CoreFileUploaderHandlerData { return { title: 'core.sharedfiles.sharedfiles', class: 'core-sharedfiles-fileuploader-handler', - icon: 'folder', // Cannot use font-awesome in action sheet. + icon: 'fas-folder', action: ( maxSize?: number, upload?: boolean, diff --git a/src/core/features/user/services/handlers/profile-mail.ts b/src/core/features/user/services/handlers/profile-mail.ts index d848f6307..daba6ac66 100644 --- a/src/core/features/user/services/handlers/profile-mail.ts +++ b/src/core/features/user/services/handlers/profile-mail.ts @@ -49,7 +49,7 @@ export class CoreUserProfileMailHandlerService implements CoreUserProfileHandler */ getDisplayData(): CoreUserProfileHandlerData { return { - icon: 'mail', + icon: 'fas-envelope', title: 'core.user.sendemail', class: 'core-user-profile-mail', action: (event, user): void => {