mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
65272: Intermediate commit
This commit is contained in:
@@ -139,6 +139,7 @@
|
|||||||
"collection.edit.tabs.roles.title": "Collection Edit - Roles",
|
"collection.edit.tabs.roles.title": "Collection Edit - Roles",
|
||||||
"collection.edit.tabs.source.head": "Content Source",
|
"collection.edit.tabs.source.head": "Content Source",
|
||||||
"collection.edit.tabs.source.title": "Collection Edit - Content Source",
|
"collection.edit.tabs.source.title": "Collection Edit - Content Source",
|
||||||
|
"collection.edit.template.label": "Item template",
|
||||||
"collection.form.abstract": "Short Description",
|
"collection.form.abstract": "Short Description",
|
||||||
"collection.form.description": "Introductory text (HTML)",
|
"collection.form.description": "Introductory text (HTML)",
|
||||||
"collection.form.errors.title.required": "Please enter a collection name",
|
"collection.form.errors.title.required": "Please enter a collection name",
|
||||||
|
@@ -1,3 +1,6 @@
|
|||||||
|
<div>
|
||||||
|
<label>{{ 'collection.edit.template.label' | translate}}</label>
|
||||||
|
</div>
|
||||||
<ds-collection-form (submitForm)="onSubmit($event)" [dso]="(dsoRD$ | async)?.payload"></ds-collection-form>
|
<ds-collection-form (submitForm)="onSubmit($event)" [dso]="(dsoRD$ | async)?.payload"></ds-collection-form>
|
||||||
<a class="btn btn-danger"
|
<a class="btn btn-danger"
|
||||||
[routerLink]="'/collections/' + (dsoRD$ | async)?.payload.uuid + '/delete'">{{'collection.edit.delete'
|
[routerLink]="'/collections/' + (dsoRD$ | async)?.payload.uuid + '/delete'">{{'collection.edit.delete'
|
||||||
|
@@ -3,6 +3,12 @@ import { ComcolMetadataComponent } from '../../../shared/comcol-forms/edit-comco
|
|||||||
import { Collection } from '../../../core/shared/collection.model';
|
import { Collection } from '../../../core/shared/collection.model';
|
||||||
import { CollectionDataService } from '../../../core/data/collection-data.service';
|
import { CollectionDataService } from '../../../core/data/collection-data.service';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
import { ItemTemplateDataService } from '../../../core/data/item-template-data.service';
|
||||||
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
|
import { Item } from '../../../core/shared/item.model';
|
||||||
|
import { getRemoteDataPayload, getSucceededRemoteData } from '../../../core/shared/operators';
|
||||||
|
import { switchMap } from 'rxjs/operators';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component for editing a collection's metadata
|
* Component for editing a collection's metadata
|
||||||
@@ -14,11 +20,27 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
export class CollectionMetadataComponent extends ComcolMetadataComponent<Collection> {
|
export class CollectionMetadataComponent extends ComcolMetadataComponent<Collection> {
|
||||||
protected frontendURL = '/collections/';
|
protected frontendURL = '/collections/';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The collection's template item
|
||||||
|
*/
|
||||||
|
templateItemRD$: Observable<RemoteData<Item>>;
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
protected collectionDataService: CollectionDataService,
|
protected collectionDataService: CollectionDataService,
|
||||||
|
protected itemTemplateService: ItemTemplateDataService,
|
||||||
protected router: Router,
|
protected router: Router,
|
||||||
protected route: ActivatedRoute
|
protected route: ActivatedRoute
|
||||||
) {
|
) {
|
||||||
super(collectionDataService, router, route);
|
super(collectionDataService, router, route);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
super.ngOnInit();
|
||||||
|
|
||||||
|
this.templateItemRD$ = this.dsoRD$.pipe(
|
||||||
|
getSucceededRemoteData(),
|
||||||
|
getRemoteDataPayload(),
|
||||||
|
switchMap((collection: Collection) => this.itemTemplateService.findByCollectionID(collection.uuid))
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user