From 8d1ef49b5441292bf68c9e925554683090954a0e Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 2 Jan 2026 18:07:21 +0100 Subject: [PATCH] Refactoring --- .../asset-profile-dialog.component.ts | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts index 12eb382d6..07e060764 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts @@ -507,14 +507,16 @@ export class GfAssetProfileDialogComponent implements OnDestroy, OnInit { scraperConfiguration = undefined; } } catch (error) { - console.error('Error parsing scraper configuration:', error); + console.error($localize`Could not parse scraper configuration`, error); + this.snackBar.open( - $localize`Invalid scraper configuration. Please check the HTTP Request Headers field contains valid JSON.`, + '😞 ' + $localize`Could not parse scraper configuration`, undefined, { - duration: ms('5 seconds') + duration: ms('3 seconds') } ); + return; } @@ -550,14 +552,16 @@ export class GfAssetProfileDialogComponent implements OnDestroy, OnInit { object: assetProfile }); } catch (error) { - console.error('Validation error:', error); + console.error($localize`Could not validate form`, error); + this.snackBar.open( - $localize`Validation failed. Please check all required fields.`, + '😞 ' + $localize`Could not validate form`, undefined, { - duration: ms('5 seconds') + duration: ms('3 seconds') } ); + return; } @@ -572,19 +576,25 @@ export class GfAssetProfileDialogComponent implements OnDestroy, OnInit { .subscribe({ next: () => { this.snackBar.open( - $localize`Asset profile saved successfully`, + '✅ ' + $localize`Asset profile has been saved`, undefined, { duration: ms('3 seconds') } ); + this.initialize(); }, error: (error) => { - console.error('Error saving asset profile:', error); - this.snackBar.open($localize`Error saving asset profile`, undefined, { - duration: ms('5 seconds') - }); + console.error($localize`Could not save asset profile`, error); + + this.snackBar.open( + '😞 ' + $localize`Could not save asset profile`, + undefined, + { + duration: ms('3 seconds') + } + ); } }); }