58789: Error fix and selecting/deselecting schemas improvement

This commit is contained in:
Kristof De Langhe
2019-01-22 14:22:39 +01:00
parent 2f853f09b9
commit 55f5857c9c
3 changed files with 10 additions and 4 deletions

View File

@@ -30,7 +30,7 @@
<tbody>
<tr *ngFor="let schema of (metadataSchemas | async)?.payload?.page"
(click)="editSchema(schema)"
[class.active-row]="isActive(schema) | async">
[ngClass]="{'table-primary' : isActive(schema) | async}">
<td>
<label>
<input type="checkbox"

View File

@@ -44,7 +44,13 @@ export class MetadataRegistryComponent {
}
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> {

View File

@@ -94,8 +94,8 @@ export class RemoteDataBuildService {
toRemoteDataObservable<T>(requestEntry$: Observable<RequestEntry>, payload$: Observable<T>) {
return observableCombineLatest(requestEntry$, payload$).pipe(
map(([reqEntry, payload]) => {
const requestPending = hasValue(reqEntry.requestPending) ? reqEntry.requestPending : true;
const responsePending = hasValue(reqEntry.responsePending) ? reqEntry.responsePending : false;
const requestPending = hasValue(reqEntry) && hasValue(reqEntry.requestPending) ? reqEntry.requestPending : true;
const responsePending = hasValue(reqEntry) && hasValue(reqEntry.responsePending) ? reqEntry.responsePending : false;
let isSuccessful: boolean;
let error: RemoteDataError;
if (hasValue(reqEntry) && hasValue(reqEntry.response)) {