Skip to content

Commit b72d157

Browse files
committed
feat: add snackbar messages for profile save actions #448
1 parent 8ecb7ec commit b72d157

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/app/modules/query-editor/components/query-editor.component.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { NavigationHelperService } from 'src/app/service/NavigationHelper.servic
88
import { PathSegments } from 'src/app/app-paths';
99
import { PossibleReferencesService } from 'src/app/service/PossibleReferences.service';
1010
import { StagedProfileService } from 'src/app/service/StagedDataSelectionProfile.service';
11+
import { SnackbarService } from 'src/app/shared/service/Snackbar/Snackbar.service';
1112

1213
@Component({
1314
selector: 'num-query-editor',
@@ -31,7 +32,8 @@ export class QueryEditorComponent implements OnInit, OnDestroy {
3132
private navigationHelperService: NavigationHelperService,
3233
private activatedRoute: ActivatedRoute,
3334
private stagedProfileService: StagedProfileService,
34-
private possibleReferencesService: PossibleReferencesService
35+
private possibleReferencesService: PossibleReferencesService,
36+
private snackbarService: SnackbarService
3537
) {}
3638

3739
ngOnInit(): void {
@@ -55,7 +57,6 @@ export class QueryEditorComponent implements OnInit, OnDestroy {
5557
}
5658

5759
ngOnDestroy(): void {
58-
console.log('destroy');
5960
this.routeSubscription?.unsubscribe();
6061
this.buildProfileSubscription?.unsubscribe();
6162
}
@@ -80,7 +81,9 @@ export class QueryEditorComponent implements OnInit, OnDestroy {
8081
this.buildProfileSubscription = this.stagedProfileService
8182
.buildProfile()
8283
.pipe(take(1))
83-
.subscribe();
84+
.subscribe(() => {
85+
this.snackbarService.displayInfoMessage('EDITOR.CONTENT.PROFILE.SNACKBAR.SAVED');
86+
});
8487
}
8588
}
8689

src/assets/i18n/de.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@
106106
"ADD": "Neues Merkmal hinzufügen",
107107
"INFO": "Klicken Sie auf neues Merkmal hinzufügen, um ein neues Merkmal zu erstellen"
108108
},
109+
"SNACKBAR": {
110+
"SAVED": "Profil erfolgreich gespeichert",
111+
"SAVING_ERROR": "Fehler beim Speichern des Profils"
112+
},
109113
"TAB_LABEL": {
110114
"FIELD": "Felder",
111115
"FILTER": "Filter",

src/assets/i18n/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@
106106
"ADD": "Add new reference",
107107
"INFO": "Click on 'Add new reference' to create a new reference"
108108
},
109+
"SNACKBAR": {
110+
"SAVED": "Profile saved successfully",
111+
"SAVING_ERROR": "Error saving profile"
112+
},
109113
"TAB_LABEL": {
110114
"FIELD": "Fields",
111115
"FILTER": "Filter",

0 commit comments

Comments
 (0)