From e9a8526b1b2712c24eb42294de2c389865ed0271 Mon Sep 17 00:00:00 2001 From: Nicolas Boulay Date: Wed, 14 Sep 2022 13:52:27 -0400 Subject: [PATCH 1/3] Redirect the user and remove the notification --- .../my-dspace-new-submission.component.ts | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts index 127d266138..f8fe264a27 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts @@ -8,15 +8,14 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { AuthService } from '../../core/auth/auth.service'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { NotificationOptions } from '../../shared/notifications/models/notification-options.model'; import { UploaderOptions } from '../../shared/uploader/uploader-options.model'; import { HALEndpointService } from '../../core/shared/hal-endpoint.service'; -import { NotificationType } from '../../shared/notifications/models/notification-type'; import { hasValue } from '../../shared/empty.util'; import { SearchResult } from '../../shared/search/models/search-result.model'; import { CollectionSelectorComponent } from '../collection-selector/collection-selector.component'; import { UploaderComponent } from '../../shared/uploader/uploader.component'; import { UploaderError } from '../../shared/uploader/uploader-error.model'; +import { Router } from '@angular/router'; /** * This component represents the whole mydspace page header @@ -62,7 +61,8 @@ export class MyDSpaceNewSubmissionComponent implements OnDestroy, OnInit { private halService: HALEndpointService, private notificationsService: NotificationsService, private translate: TranslateService, - private modalService: NgbModal) { + private modalService: NgbModal, + private router: Router) { } /** @@ -87,16 +87,9 @@ export class MyDSpaceNewSubmissionComponent implements OnDestroy, OnInit { this.uploadEnd.emit(workspaceitems); if (workspaceitems.length === 1) { - const options = new NotificationOptions(); - options.timeOut = 0; const link = '/workspaceitems/' + workspaceitems[0].id + '/edit'; - this.notificationsService.notificationWithAnchor( - NotificationType.Success, - options, - link, - 'mydspace.general.text-here', - 'mydspace.upload.upload-successful', - 'here'); + // To avoid confusion and ambiguity, redirect the user on the publication page. + this.router.navigateByUrl(link); } else if (workspaceitems.length > 1) { this.notificationsService.success(null, this.translate.get('mydspace.upload.upload-multiple-successful', {qty: workspaceitems.length})); } From 6cd01ec4716155f57319f2dd82dceda5cdb151c8 Mon Sep 17 00:00:00 2001 From: Nicolas Boulay Date: Wed, 14 Sep 2022 14:17:50 -0400 Subject: [PATCH 2/3] Add missing documentation --- .../my-dspace-new-submission.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts index f8fe264a27..b2ba6fe2af 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts @@ -55,6 +55,7 @@ export class MyDSpaceNewSubmissionComponent implements OnDestroy, OnInit { * @param {NotificationsService} notificationsService * @param {TranslateService} translate * @param {NgbModal} modalService + * @param {Router} router */ constructor(private authService: AuthService, private changeDetectorRef: ChangeDetectorRef, From 9140fb6106ec26859db29a32aa85b69432c878c7 Mon Sep 17 00:00:00 2001 From: Nicolas Boulay Date: Wed, 14 Sep 2022 14:19:28 -0400 Subject: [PATCH 3/3] Remove unused translations --- src/assets/i18n/en.json5 | 4 ---- src/assets/i18n/fr.json5 | 6 ------ 2 files changed, 10 deletions(-) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 1bdfbedfdc..a8243ead0e 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -2734,8 +2734,6 @@ "mydspace.description": "", - "mydspace.general.text-here": "here", - "mydspace.messages.controller-help": "Select this option to send a message to item's submitter.", "mydspace.messages.description-placeholder": "Insert your message here...", @@ -2812,8 +2810,6 @@ "mydspace.upload.upload-multiple-successful": "{{qty}} new workspace items created.", - "mydspace.upload.upload-successful": "New workspace item created. Click {{here}} for edit it.", - "mydspace.view-btn": "View", diff --git a/src/assets/i18n/fr.json5 b/src/assets/i18n/fr.json5 index 5cfb7ff099..8cce148c9f 100644 --- a/src/assets/i18n/fr.json5 +++ b/src/assets/i18n/fr.json5 @@ -3627,9 +3627,6 @@ // "mydspace.description": "", "mydspace.description": "", - // "mydspace.general.text-here": "here", - "mydspace.general.text-here": "ici", - // "mydspace.messages.controller-help": "Select this option to send a message to item's submitter.", "mydspace.messages.controller-help": "Sélectionner cette option pour envoyer un message au déposant.", @@ -3744,9 +3741,6 @@ // "mydspace.upload.upload-multiple-successful": "{{qty}} new workspace items created.", "mydspace.upload.upload-multiple-successful": "{{qty}} nouveaux Items créés dans l'espace de travail.", - // "mydspace.upload.upload-successful": "New workspace item created. Click {{here}} for edit it.", - "mydspace.upload.upload-successful": "Nouvel item créé dans l'espace de travail. Cliquer {{here}} pour l'éditer.", - // "mydspace.view-btn": "View", "mydspace.view-btn": "Afficher",