mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
58789: Error fix and selecting/deselecting schemas improvement
This commit is contained in:
@@ -30,7 +30,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let schema of (metadataSchemas | async)?.payload?.page"
|
<tr *ngFor="let schema of (metadataSchemas | async)?.payload?.page"
|
||||||
(click)="editSchema(schema)"
|
(click)="editSchema(schema)"
|
||||||
[class.active-row]="isActive(schema) | async">
|
[ngClass]="{'table-primary' : isActive(schema) | async}">
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
|
@@ -44,7 +44,13 @@ export class MetadataRegistryComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
editSchema(schema: MetadataSchema) {
|
editSchema(schema: MetadataSchema) {
|
||||||
this.registryService.editMetadataSchema(schema);
|
this.getActiveSchema().pipe(take(1)).subscribe((activeSchema) => {
|
||||||
|
if (schema === activeSchema) {
|
||||||
|
this.registryService.cancelEditMetadataSchema();
|
||||||
|
} else {
|
||||||
|
this.registryService.editMetadataSchema(schema);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
isActive(schema: MetadataSchema): Observable<boolean> {
|
isActive(schema: MetadataSchema): Observable<boolean> {
|
||||||
|
@@ -94,8 +94,8 @@ export class RemoteDataBuildService {
|
|||||||
toRemoteDataObservable<T>(requestEntry$: Observable<RequestEntry>, payload$: Observable<T>) {
|
toRemoteDataObservable<T>(requestEntry$: Observable<RequestEntry>, payload$: Observable<T>) {
|
||||||
return observableCombineLatest(requestEntry$, payload$).pipe(
|
return observableCombineLatest(requestEntry$, payload$).pipe(
|
||||||
map(([reqEntry, payload]) => {
|
map(([reqEntry, payload]) => {
|
||||||
const requestPending = hasValue(reqEntry.requestPending) ? reqEntry.requestPending : true;
|
const requestPending = hasValue(reqEntry) && hasValue(reqEntry.requestPending) ? reqEntry.requestPending : true;
|
||||||
const responsePending = hasValue(reqEntry.responsePending) ? reqEntry.responsePending : false;
|
const responsePending = hasValue(reqEntry) && hasValue(reqEntry.responsePending) ? reqEntry.responsePending : false;
|
||||||
let isSuccessful: boolean;
|
let isSuccessful: boolean;
|
||||||
let error: RemoteDataError;
|
let error: RemoteDataError;
|
||||||
if (hasValue(reqEntry) && hasValue(reqEntry.response)) {
|
if (hasValue(reqEntry) && hasValue(reqEntry.response)) {
|
||||||
|
Reference in New Issue
Block a user