mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 23:43:01 +00:00
58789: Clear index cache and reload lists after adding metadata schema
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<p id="description" class="pb-2">{{'admin.registries.metadata.description' | translate}}</p>
|
<p id="description" class="pb-2">{{'admin.registries.metadata.description' | translate}}</p>
|
||||||
|
|
||||||
<ds-metadata-schema-form
|
<ds-metadata-schema-form
|
||||||
></ds-metadata-schema-form>
|
(submitForm)="createdSchema($event)"></ds-metadata-schema-form>
|
||||||
|
|
||||||
<ds-pagination
|
<ds-pagination
|
||||||
*ngIf="(metadataSchemas | async)?.payload?.totalElements > 0"
|
*ngIf="(metadataSchemas | async)?.payload?.totalElements > 0"
|
||||||
|
@@ -62,6 +62,11 @@ export class MetadataRegistryComponent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createdSchema(event) {
|
||||||
|
this.registryService.clearMetadataSchemaRequests().subscribe((value) => console.log('cleared for substring: ' + value));
|
||||||
|
this.updateSchemas();
|
||||||
|
}
|
||||||
|
|
||||||
deleteSchemas() {
|
deleteSchemas() {
|
||||||
this.registryService.getSelectedMetadataSchemas().subscribe(
|
this.registryService.getSelectedMetadataSchemas().subscribe(
|
||||||
(schemas) => {
|
(schemas) => {
|
||||||
|
@@ -104,6 +104,7 @@ export class MetadataSchemaFormComponent implements OnInit {
|
|||||||
if (schema == null) {
|
if (schema == null) {
|
||||||
this.registryService.createOrUpdateMetadataSchema(Object.assign(new MetadataSchema(), values)).subscribe((newSchema) => {
|
this.registryService.createOrUpdateMetadataSchema(Object.assign(new MetadataSchema(), values)).subscribe((newSchema) => {
|
||||||
console.log(newSchema);
|
console.log(newSchema);
|
||||||
|
this.submitForm.emit(newSchema);
|
||||||
// TODO: Reload the list of schemas
|
// TODO: Reload the list of schemas
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@@ -370,4 +370,10 @@ export class RegistryService {
|
|||||||
getResponseFromEntry()
|
getResponseFromEntry()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public clearMetadataSchemaRequests(): Observable<string> {
|
||||||
|
return this.halService.getEndpoint(this.metadataSchemasPath).pipe(
|
||||||
|
tap((href: string) => this.requestService.removeByHrefSubstring(href))
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user