Adds success message on Dataset Create Wizard.
This commit is contained in:
parent
eebe0886c4
commit
fb70345d39
|
@ -7,7 +7,10 @@ import { QuickWizardService } from '../../core/services/quick-wizard/quick-wizar
|
|||
import { DatasetCreateWizardModel } from './dataset-create-wizard.model';
|
||||
import { IBreadCrumbComponent } from '../misc/breadcrumb/definition/IBreadCrumbComponent';
|
||||
import { Observable } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { BreadcrumbItem } from '../misc/breadcrumb/definition/breadcrumb-item';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '../../core/services/notification/ui-notification-service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'dataset-create-wizard.component',
|
||||
|
@ -17,6 +20,7 @@ import { BreadcrumbItem } from '../misc/breadcrumb/definition/breadcrumb-item';
|
|||
export class DatasetCreateWizard extends BaseComponent implements OnInit, IBreadCrumbComponent {
|
||||
breadCrumbs: Observable<BreadcrumbItem[]>;
|
||||
isLinear = false;
|
||||
isNew = true;
|
||||
formGroup: FormGroup;
|
||||
|
||||
datasetCreateWizardModel: DatasetCreateWizardModel;
|
||||
|
@ -26,6 +30,8 @@ export class DatasetCreateWizard extends BaseComponent implements OnInit, IBread
|
|||
private router: Router,
|
||||
private formBuilder: FormBuilder,
|
||||
public quickWizardService: QuickWizardService,
|
||||
public language: TranslateService,
|
||||
private uiNotificationService: UiNotificationService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
@ -48,9 +54,15 @@ export class DatasetCreateWizard extends BaseComponent implements OnInit, IBread
|
|||
|
||||
submit() {
|
||||
this.quickWizardService.createQuickDatasetWizard(this.formGroup.value)
|
||||
.subscribe(data => {
|
||||
this.router.navigateByUrl('/home');
|
||||
})
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
complete => this.onCallbackSuccess()
|
||||
)
|
||||
}
|
||||
|
||||
onCallbackSuccess(): void {
|
||||
this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
|
||||
this.router.navigate(['/home']);
|
||||
}
|
||||
|
||||
isActive(step: string): boolean {
|
||||
|
|
Loading…
Reference in New Issue