65240: Success notification on submitting comcol form

This commit is contained in:
Kristof De Langhe
2019-10-02 13:40:06 +02:00
parent 8a475f2523
commit 37a18fdaa7
13 changed files with 77 additions and 11 deletions

View File

@@ -3,7 +3,7 @@ import { Community } from '../../../core/shared/community.model';
import { CommunityDataService } from '../../../core/data/community-data.service';
import { Observable } from 'rxjs';
import { RouteService } from '../../../core/services/route.service';
import { Router } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { RemoteData } from '../../../core/data/remote-data';
import { hasValue, isNotEmpty, isNotUndefined } from '../../empty.util';
import { take } from 'rxjs/operators';
@@ -11,6 +11,9 @@ import { getSucceededRemoteData } from '../../../core/shared/operators';
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
import { DataService } from '../../../core/data/data.service';
import { ComColDataService } from '../../../core/data/comcol-data.service';
import { NotificationsService } from '../../notifications/notifications.service';
import { TranslateService } from '@ngx-translate/core';
import { ResourceType } from '../../../core/shared/resource-type';
/**
* Component representing the create page for communities and collections
@@ -40,11 +43,18 @@ export class CreateComColPageComponent<TDomain extends DSpaceObject> implements
*/
private newUUID: string;
/**
* The type of the dso
*/
protected type: ResourceType;
public constructor(
protected dsoDataService: ComColDataService<TDomain>,
protected parentDataService: CommunityDataService,
protected routeService: RouteService,
protected router: Router
protected router: Router,
protected notificationsService: NotificationsService,
protected translate: TranslateService
) {
}
@@ -80,6 +90,7 @@ export class CreateComColPageComponent<TDomain extends DSpaceObject> implements
} else {
this.navigateToNewPage();
}
this.notificationsService.success(null, this.translate.get(this.type.value + '.create.notifications.success'));
}
});
});