From 1fcbd4f2ce98fce5858e13323d334430e52569e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 17 Nov 2023 14:14:39 +0100 Subject: [PATCH] MOBILE-3947 dev: Improve error log styling --- .../settings/pages/error-log/error-log.html | 14 +++++++------- .../settings/pages/error-log/error-log.scss | 4 ---- .../settings/pages/error-log/error-log.ts | 15 ++++++++++++--- 3 files changed, 19 insertions(+), 14 deletions(-) delete mode 100644 src/core/features/settings/pages/error-log/error-log.scss diff --git a/src/core/features/settings/pages/error-log/error-log.html b/src/core/features/settings/pages/error-log/error-log.html index 3a8f56dee..7647af8c7 100644 --- a/src/core/features/settings/pages/error-log/error-log.html +++ b/src/core/features/settings/pages/error-log/error-log.html @@ -9,7 +9,7 @@ - + @@ -18,8 +18,8 @@ - -
+ +

Trace

{{ error.message }}

@@ -38,10 +38,10 @@

{{ error.data | json }}

-
- {{ error.time | coreFormatDate :'strftimedatetimeshort' }} -
-
+

+ {{ error.time | coreFormatDate :'strftimedatetimeshort' }} +

+
diff --git a/src/core/features/settings/pages/error-log/error-log.scss b/src/core/features/settings/pages/error-log/error-log.scss deleted file mode 100644 index 588b78e22..000000000 --- a/src/core/features/settings/pages/error-log/error-log.scss +++ /dev/null @@ -1,4 +0,0 @@ -.timestamp { - display: flex; - justify-content: end; -} diff --git a/src/core/features/settings/pages/error-log/error-log.ts b/src/core/features/settings/pages/error-log/error-log.ts index 19c9adb4d..65a6e3c38 100644 --- a/src/core/features/settings/pages/error-log/error-log.ts +++ b/src/core/features/settings/pages/error-log/error-log.ts @@ -22,18 +22,27 @@ import { CoreErrorLogs, CoreSettingsErrorLog } from '@singletons/error-logs'; @Component({ selector: 'page-core-app-settings-error-log', templateUrl: 'error-log.html', - styleUrls: ['./error-log.scss'], }) export class CoreSettingsErrorLogPage implements OnInit { errorLogs: CoreSettingsErrorLog[] = []; + /** + * @inheritdoc + */ ngOnInit(): void { this.errorLogs = CoreErrorLogs.getErrorLogs(); } - copyInfo(): void { - CoreUtils.copyToClipboard(JSON.stringify({ errors: this.errorLogs })); + /** + * Copy Info of all the errors. + */ + async copyError(error?: CoreSettingsErrorLog): Promise { + if (error) { + await CoreUtils.copyToClipboard(JSON.stringify(error)); + } else { + await CoreUtils.copyToClipboard(JSON.stringify({ errors: this.errorLogs })); + } } }