"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.ts" between
dspace-angular-dspace-7.0.tar.gz and dspace-angular-dspace-7.1.tar.gz

About: dspace-angular is the Angular-based frontend of DSpace, a digital repository system to capture, store, index, preserve and redistribute an organization’s research material in digital formats.

submission-import-external-preview.component.ts  (dspace-angular-dspace-7.0):submission-import-external-preview.component.ts  (dspace-angular-dspace-7.1)
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { NgbActiveModal, NgbModalRef, NgbModal } from '@ng-bootstrap/ng-bootstra p'; import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstra p';
import { ExternalSourceEntry } from '../../../core/shared/external-source-entry. model'; import { ExternalSourceEntry } from '../../../core/shared/external-source-entry. model';
import { MetadataValue } from '../../../core/shared/metadata.models'; import { MetadataValue } from '../../../core/shared/metadata.models';
import { Metadata } from '../../../core/shared/metadata.utils'; import { Metadata } from '../../../core/shared/metadata.utils';
import { CollectionListEntry } from '../../../shared/collection-dropdown/collect ion-dropdown.component'; import { CollectionListEntry } from '../../../shared/collection-dropdown/collect ion-dropdown.component';
import { mergeMap } from 'rxjs/operators'; import { mergeMap } from 'rxjs/operators';
import { SubmissionService } from '../../submission.service'; import { SubmissionService } from '../../submission.service';
import { SubmissionObject } from '../../../core/submission/models/submission-obj ect.model'; import { SubmissionObject } from '../../../core/submission/models/submission-obj ect.model';
import { NotificationsService } from '../../../shared/notifications/notification s.service'; import { NotificationsService } from '../../../shared/notifications/notification s.service';
import { SubmissionImportExternalCollectionComponent } from '../import-external- collection/submission-import-external-collection.component'; import { SubmissionImportExternalCollectionComponent } from '../import-external- collection/submission-import-external-collection.component';
skipping to change at line 32 skipping to change at line 32
export class SubmissionImportExternalPreviewComponent implements OnInit { export class SubmissionImportExternalPreviewComponent implements OnInit {
/** /**
* The external source entry * The external source entry
*/ */
@Input() public externalSourceEntry: ExternalSourceEntry; @Input() public externalSourceEntry: ExternalSourceEntry;
/** /**
* The entry metadata list * The entry metadata list
*/ */
public metadataList: { key: string, value: MetadataValue }[]; public metadataList: { key: string, value: MetadataValue }[];
/** /**
* The label prefix to use to generate the translation label
*/
public labelPrefix: string;
/**
* The modal for the entry preview * The modal for the entry preview
*/ */
modalRef: NgbModalRef; modalRef: NgbModalRef;
/** /**
* Initialize the component variables. * Initialize the component variables.
* @param {NgbActiveModal} activeModal * @param {NgbActiveModal} activeModal
* @param {SubmissionService} submissionService * @param {SubmissionService} submissionService
* @param {NgbModal} modalService * @param {NgbModal} modalService
* @param {Router} router * @param {Router} router
skipping to change at line 80 skipping to change at line 84
this.activeModal.dismiss(false); this.activeModal.dismiss(false);
} }
/** /**
* Start the import of an entry by opening up a collection choice modal window . * Start the import of an entry by opening up a collection choice modal window .
*/ */
public import(): void { public import(): void {
this.modalRef = this.modalService.open(SubmissionImportExternalCollectionCom ponent, { this.modalRef = this.modalService.open(SubmissionImportExternalCollectionCom ponent, {
size: 'lg', size: 'lg',
}); });
this.modalRef.componentInstance.entityType = this.labelPrefix;
this.closeMetadataModal(); this.closeMetadataModal();
this.modalRef.componentInstance.selectedEvent.pipe( this.modalRef.componentInstance.selectedEvent.pipe(
mergeMap((collectionListEntry: CollectionListEntry) => { mergeMap((collectionListEntry: CollectionListEntry) => {
return this.submissionService.createSubmissionFromExternalSource(this.ex ternalSourceEntry._links.self.href, collectionListEntry.collection.id); return this.submissionService.createSubmissionFromExternalSource(this.ex ternalSourceEntry._links.self.href, collectionListEntry.collection.id);
}) })
).subscribe((submissionObjects: SubmissionObject[]) => { ).subscribe((submissionObjects: SubmissionObject[]) => {
let isValid = false; let isValid = false;
if (submissionObjects.length === 1) { if (submissionObjects.length === 1) {
if (submissionObjects[0] !== null) { if (submissionObjects[0] !== null) {
 End of changes. 3 change blocks. 
1 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)