Merge pull request #1823 from nibou230/dd-submission-1765

After drag & drop: Redirect the user and remove the notification
This commit is contained in:
Tim Donohue
2022-09-28 08:31:15 -05:00
committed by GitHub
3 changed files with 6 additions and 22 deletions

View File

@@ -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
@@ -56,13 +55,15 @@ 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,
private halService: HALEndpointService,
private notificationsService: NotificationsService,
private translate: TranslateService,
private modalService: NgbModal) {
private modalService: NgbModal,
private router: Router) {
}
/**
@@ -87,16 +88,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}));
}

View File

@@ -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",

View File

@@ -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",