Skip to content

Commit e9a8526

Browse files
committed
Redirect the user and remove the notification
1 parent 064dae2 commit e9a8526

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
88
import { AuthService } from '../../core/auth/auth.service';
99
import { DSpaceObject } from '../../core/shared/dspace-object.model';
1010
import { NotificationsService } from '../../shared/notifications/notifications.service';
11-
import { NotificationOptions } from '../../shared/notifications/models/notification-options.model';
1211
import { UploaderOptions } from '../../shared/uploader/uploader-options.model';
1312
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
14-
import { NotificationType } from '../../shared/notifications/models/notification-type';
1513
import { hasValue } from '../../shared/empty.util';
1614
import { SearchResult } from '../../shared/search/models/search-result.model';
1715
import { CollectionSelectorComponent } from '../collection-selector/collection-selector.component';
1816
import { UploaderComponent } from '../../shared/uploader/uploader.component';
1917
import { UploaderError } from '../../shared/uploader/uploader-error.model';
18+
import { Router } from '@angular/router';
2019

2120
/**
2221
* This component represents the whole mydspace page header
@@ -62,7 +61,8 @@ export class MyDSpaceNewSubmissionComponent implements OnDestroy, OnInit {
6261
private halService: HALEndpointService,
6362
private notificationsService: NotificationsService,
6463
private translate: TranslateService,
65-
private modalService: NgbModal) {
64+
private modalService: NgbModal,
65+
private router: Router) {
6666
}
6767

6868
/**
@@ -87,16 +87,9 @@ export class MyDSpaceNewSubmissionComponent implements OnDestroy, OnInit {
8787
this.uploadEnd.emit(workspaceitems);
8888

8989
if (workspaceitems.length === 1) {
90-
const options = new NotificationOptions();
91-
options.timeOut = 0;
9290
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');
91+
// To avoid confusion and ambiguity, redirect the user on the publication page.
92+
this.router.navigateByUrl(link);
10093
} else if (workspaceitems.length > 1) {
10194
this.notificationsService.success(null, this.translate.get('mydspace.upload.upload-multiple-successful', {qty: workspaceitems.length}));
10295
}

0 commit comments

Comments
 (0)