submission-import-external-collection.component.ts (dspace-angular-dspace-7.0) | : | submission-import-external-collection.component.ts (dspace-angular-dspace-7.1) | ||
---|---|---|---|---|
import { Component, Output, EventEmitter } from '@angular/core'; | import { Component, EventEmitter, Output } from '@angular/core'; | |||
import { CollectionListEntry } from '../../../shared/collection-dropdown/collect ion-dropdown.component'; | import { CollectionListEntry } from '../../../shared/collection-dropdown/collect ion-dropdown.component'; | |||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; | import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; | |||
/** | /** | |||
* Wrap component for 'ds-collection-dropdown'. | * Wrap component for 'ds-collection-dropdown'. | |||
*/ | */ | |||
@Component({ | @Component({ | |||
selector: 'ds-submission-import-external-collection', | selector: 'ds-submission-import-external-collection', | |||
styleUrls: ['./submission-import-external-collection.component.scss'], | styleUrls: ['./submission-import-external-collection.component.scss'], | |||
templateUrl: './submission-import-external-collection.component.html' | templateUrl: './submission-import-external-collection.component.html' | |||
}) | }) | |||
export class SubmissionImportExternalCollectionComponent { | export class SubmissionImportExternalCollectionComponent { | |||
/** | /** | |||
* The event passed by 'ds-collection-dropdown'. | * The event passed by 'ds-collection-dropdown'. | |||
*/ | */ | |||
@Output() public selectedEvent = new EventEmitter<CollectionListEntry>(); | @Output() public selectedEvent = new EventEmitter<CollectionListEntry>(); | |||
/** | /** | |||
* If present this value is used to filter collection list by entity type | ||||
*/ | ||||
public entityType: string; | ||||
/** | ||||
* If collection searching is pending or not | ||||
*/ | ||||
public loading = true; | ||||
/** | ||||
* Initialize the component variables. | * Initialize the component variables. | |||
* @param {NgbActiveModal} activeModal | * @param {NgbActiveModal} activeModal | |||
*/ | */ | |||
constructor( | constructor( | |||
private activeModal: NgbActiveModal | private activeModal: NgbActiveModal | |||
) { } | ) { } | |||
/** | /** | |||
* This method populates the 'selectedEvent' variable. | * This method populates the 'selectedEvent' variable. | |||
*/ | */ | |||
public selectObject(event): void { | public selectObject(event): void { | |||
this.selectedEvent.emit(event); | this.selectedEvent.emit(event); | |||
} | } | |||
/** | /** | |||
* This method closes the modal. | * This method closes the modal. | |||
*/ | */ | |||
public closeCollectionModal(): void { | public closeCollectionModal(): void { | |||
this.activeModal.dismiss(false); | this.activeModal.dismiss(false); | |||
} | } | |||
/** | ||||
* Propagate the onlySelectable collection | ||||
* @param theOnlySelectable | ||||
*/ | ||||
public theOnlySelectable(theOnlySelectable: CollectionListEntry) { | ||||
this.selectedEvent.emit(theOnlySelectable); | ||||
} | ||||
/** | ||||
* Set the hasChoice state | ||||
* @param hasChoice | ||||
*/ | ||||
public searchComplete() { | ||||
this.loading = false; | ||||
} | ||||
/** | ||||
* If the component is in loading state. | ||||
*/ | ||||
public isLoading(): boolean { | ||||
return !!this.loading; | ||||
} | ||||
} | } | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 35 lines changed or added |