Browse Source

Refactoring

pull/6094/head
Thomas Kaul 1 week ago
parent
commit
8d1ef49b54
  1. 32
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts

32
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; scraperConfiguration = undefined;
} }
} catch (error) { } catch (error) {
console.error('Error parsing scraper configuration:', error); console.error($localize`Could not parse scraper configuration`, error);
this.snackBar.open( this.snackBar.open(
$localize`Invalid scraper configuration. Please check the HTTP Request Headers field contains valid JSON.`, '😞 ' + $localize`Could not parse scraper configuration`,
undefined, undefined,
{ {
duration: ms('5 seconds') duration: ms('3 seconds')
} }
); );
return; return;
} }
@ -550,14 +552,16 @@ export class GfAssetProfileDialogComponent implements OnDestroy, OnInit {
object: assetProfile object: assetProfile
}); });
} catch (error) { } catch (error) {
console.error('Validation error:', error); console.error($localize`Could not validate form`, error);
this.snackBar.open( this.snackBar.open(
$localize`Validation failed. Please check all required fields.`, '😞 ' + $localize`Could not validate form`,
undefined, undefined,
{ {
duration: ms('5 seconds') duration: ms('3 seconds')
} }
); );
return; return;
} }
@ -572,19 +576,25 @@ export class GfAssetProfileDialogComponent implements OnDestroy, OnInit {
.subscribe({ .subscribe({
next: () => { next: () => {
this.snackBar.open( this.snackBar.open(
$localize`Asset profile saved successfully`, '✅ ' + $localize`Asset profile has been saved`,
undefined, undefined,
{ {
duration: ms('3 seconds') duration: ms('3 seconds')
} }
); );
this.initialize(); this.initialize();
}, },
error: (error) => { error: (error) => {
console.error('Error saving asset profile:', error); console.error($localize`Could not save asset profile`, error);
this.snackBar.open($localize`Error saving asset profile`, undefined, {
duration: ms('5 seconds') this.snackBar.open(
}); '😞 ' + $localize`Could not save asset profile`,
undefined,
{
duration: ms('3 seconds')
}
);
} }
}); });
} }

Loading…
Cancel
Save