@@ -8,15 +8,14 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
88import { AuthService } from '../../core/auth/auth.service' ;
99import { DSpaceObject } from '../../core/shared/dspace-object.model' ;
1010import { NotificationsService } from '../../shared/notifications/notifications.service' ;
11- import { NotificationOptions } from '../../shared/notifications/models/notification-options.model' ;
1211import { UploaderOptions } from '../../shared/uploader/uploader-options.model' ;
1312import { HALEndpointService } from '../../core/shared/hal-endpoint.service' ;
14- import { NotificationType } from '../../shared/notifications/models/notification-type' ;
1513import { hasValue } from '../../shared/empty.util' ;
1614import { SearchResult } from '../../shared/search/models/search-result.model' ;
1715import { CollectionSelectorComponent } from '../collection-selector/collection-selector.component' ;
1816import { UploaderComponent } from '../../shared/uploader/uploader.component' ;
1917import { UploaderError } from '../../shared/uploader/uploader-error.model' ;
18+ import { Router } from '@angular/router' ;
2019
2120/**
2221 * This component represents the whole mydspace page header
@@ -56,13 +55,15 @@ export class MyDSpaceNewSubmissionComponent implements OnDestroy, OnInit {
5655 * @param {NotificationsService } notificationsService
5756 * @param {TranslateService } translate
5857 * @param {NgbModal } modalService
58+ * @param {Router } router
5959 */
6060 constructor ( private authService : AuthService ,
6161 private changeDetectorRef : ChangeDetectorRef ,
6262 private halService : HALEndpointService ,
6363 private notificationsService : NotificationsService ,
6464 private translate : TranslateService ,
65- private modalService : NgbModal ) {
65+ private modalService : NgbModal ,
66+ private router : Router ) {
6667 }
6768
6869 /**
@@ -87,16 +88,9 @@ export class MyDSpaceNewSubmissionComponent implements OnDestroy, OnInit {
8788 this . uploadEnd . emit ( workspaceitems ) ;
8889
8990 if ( workspaceitems . length === 1 ) {
90- const options = new NotificationOptions ( ) ;
91- options . timeOut = 0 ;
9291 const link = '/workspaceitems/' + workspaceitems [ 0 ] . id + '/edit' ;
93- this . notificationsService . notificationWithAnchor (
94- NotificationType . Success ,
95- options ,
96- link ,
97- 'mydspace.general.text-here' ,
98- 'mydspace.upload.upload-successful' ,
99- 'here' ) ;
92+ // To avoid confusion and ambiguity, redirect the user on the publication page.
93+ this . router . navigateByUrl ( link ) ;
10094 } else if ( workspaceitems . length > 1 ) {
10195 this . notificationsService . success ( null , this . translate . get ( 'mydspace.upload.upload-multiple-successful' , { qty : workspaceitems . length } ) ) ;
10296 }
0 commit comments