Skip to content

Commit 389ae85

Browse files
authored
Merge pull request DSpace#1823 from nibou230/dd-submission-1765
After drag & drop: Redirect the user and remove the notification
2 parents 1d13fd3 + 9140fb6 commit 389ae85

3 files changed

Lines changed: 6 additions & 22 deletions

File tree

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

Lines changed: 6 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
@@ -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
}

src/assets/i18n/en.json5

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2734,8 +2734,6 @@
27342734

27352735
"mydspace.description": "",
27362736

2737-
"mydspace.general.text-here": "here",
2738-
27392737
"mydspace.messages.controller-help": "Select this option to send a message to item's submitter.",
27402738

27412739
"mydspace.messages.description-placeholder": "Insert your message here...",
@@ -2812,8 +2810,6 @@
28122810

28132811
"mydspace.upload.upload-multiple-successful": "{{qty}} new workspace items created.",
28142812

2815-
"mydspace.upload.upload-successful": "New workspace item created. Click {{here}} for edit it.",
2816-
28172813
"mydspace.view-btn": "View",
28182814

28192815

src/assets/i18n/fr.json5

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3627,9 +3627,6 @@
36273627
// "mydspace.description": "",
36283628
"mydspace.description": "",
36293629

3630-
// "mydspace.general.text-here": "here",
3631-
"mydspace.general.text-here": "ici",
3632-
36333630
// "mydspace.messages.controller-help": "Select this option to send a message to item's submitter.",
36343631
"mydspace.messages.controller-help": "Sélectionner cette option pour envoyer un message au déposant.",
36353632

@@ -3744,9 +3741,6 @@
37443741
// "mydspace.upload.upload-multiple-successful": "{{qty}} new workspace items created.",
37453742
"mydspace.upload.upload-multiple-successful": "{{qty}} nouveaux Items créés dans l'espace de travail.",
37463743

3747-
// "mydspace.upload.upload-successful": "New workspace item created. Click {{here}} for edit it.",
3748-
"mydspace.upload.upload-successful": "Nouvel item créé dans l'espace de travail. Cliquer {{here}} pour l'éditer.",
3749-
37503744
// "mydspace.view-btn": "View",
37513745
"mydspace.view-btn": "Afficher",
37523746

0 commit comments

Comments
 (0)