mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
64503: Remembering previously selected harvest type + small dropdown fix
This commit is contained in:
@@ -207,6 +207,13 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem
|
|||||||
*/
|
*/
|
||||||
harvestTypeNone = ContentSourceHarvestType.None;
|
harvestTypeNone = ContentSourceHarvestType.None;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The previously selected harvesting type
|
||||||
|
* Used for switching between ContentSourceHarvestType.None and the previously selected value when enabling / disabling harvesting
|
||||||
|
* Defaults to ContentSourceHarvestType.Metadata
|
||||||
|
*/
|
||||||
|
previouslySelectedHarvestType = ContentSourceHarvestType.Metadata;
|
||||||
|
|
||||||
public constructor(public objectUpdatesService: ObjectUpdatesService,
|
public constructor(public objectUpdatesService: ObjectUpdatesService,
|
||||||
public notificationsService: NotificationsService,
|
public notificationsService: NotificationsService,
|
||||||
protected location: Location,
|
protected location: Location,
|
||||||
@@ -286,7 +293,11 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem
|
|||||||
this.metadataConfigIdModel.options = this.contentSource.metadataConfigs
|
this.metadataConfigIdModel.options = this.contentSource.metadataConfigs
|
||||||
.map((metadataConfig: MetadataConfig) => Object.assign({ value: metadataConfig.id, label: metadataConfig.label }));
|
.map((metadataConfig: MetadataConfig) => Object.assign({ value: metadataConfig.id, label: metadataConfig.label }));
|
||||||
if (this.metadataConfigIdModel.options.length > 0) {
|
if (this.metadataConfigIdModel.options.length > 0) {
|
||||||
this.metadataConfigIdModel.value = this.metadataConfigIdModel.options[0].value;
|
this.formGroup.patchValue({
|
||||||
|
oaiSetContainer: {
|
||||||
|
metadataConfigId: this.metadataConfigIdModel.options[0].value
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,8 +378,9 @@ export class CollectionSourceComponent extends AbstractTrackableComponent implem
|
|||||||
*/
|
*/
|
||||||
changeExternalSource() {
|
changeExternalSource() {
|
||||||
if (this.contentSource.harvestType === ContentSourceHarvestType.None) {
|
if (this.contentSource.harvestType === ContentSourceHarvestType.None) {
|
||||||
this.contentSource.harvestType = ContentSourceHarvestType.Metadata;
|
this.contentSource.harvestType = this.previouslySelectedHarvestType;
|
||||||
} else {
|
} else {
|
||||||
|
this.previouslySelectedHarvestType = this.contentSource.harvestType;
|
||||||
this.contentSource.harvestType = ContentSourceHarvestType.None;
|
this.contentSource.harvestType = ContentSourceHarvestType.None;
|
||||||
}
|
}
|
||||||
this.updateContentSource(false);
|
this.updateContentSource(false);
|
||||||
|
@@ -38,7 +38,7 @@ export class ContentSource {
|
|||||||
* The ID of the metadata format used
|
* The ID of the metadata format used
|
||||||
*/
|
*/
|
||||||
@autoserializeAs('metadata_config_id')
|
@autoserializeAs('metadata_config_id')
|
||||||
metadataConfigId = 'dc';
|
metadataConfigId: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of content being harvested
|
* Type of content being harvested
|
||||||
|
Reference in New Issue
Block a user