Skip to content

Commit

Permalink
SHIBUI-906 Integrated backend endpoint for filter schema
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Nov 8, 2018
1 parent c014fe2 commit 96c53cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { UpdateFilterRequest } from '../action/collection.action';
import { CancelCreateFilter, UpdateFilterChanges } from '../action/filter.action';
import { PreviewEntity } from '../../domain/action/entity.action';
import { EntityAttributesFilterEntity } from '../../domain/entity';
import { shareReplay } from 'rxjs/operators';

@Component({
selector: 'edit-filter-page',
Expand Down Expand Up @@ -40,7 +41,7 @@ export class EditFilterComponent {
) {
this.definition = MetadataFilterTypes.EntityAttributesFilter;

this.schema$ = this.schemaService.get(this.definition.schema);
this.schema$ = this.schemaService.get(this.definition.schema).pipe(shareReplay());
this.isSaving$ = this.store.select(fromFilter.getCollectionSaving);
this.model$ = this.store.select(fromFilter.getSelectedFilter);

Expand Down
5 changes: 3 additions & 2 deletions ui/src/app/metadata/filter/container/new-filter.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
import { Subject, Observable, of } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { takeUntil, shareReplay } from 'rxjs/operators';

import * as fromFilter from '../reducer';
import { MetadataFilterTypes } from '../model';
Expand Down Expand Up @@ -39,7 +39,7 @@ export class NewFilterComponent implements OnDestroy, OnInit {
) {
this.definition = MetadataFilterTypes.EntityAttributesFilter;

this.schema$ = this.schemaService.get(this.definition.schema);
this.schema$ = this.schemaService.get(this.definition.schema).pipe(shareReplay());
this.isSaving$ = this.store.select(fromFilter.getCollectionSaving);
this.model$ = of(<MetadataFilter>{});
}
Expand All @@ -51,6 +51,7 @@ export class NewFilterComponent implements OnDestroy, OnInit {
this.statusChangeEmitted$
.pipe(takeUntil(this.ngUnsubscribe))
.subscribe(valid => {
console.log(valid);
this.isValid = valid.value ? valid.value.length === 0 : true;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MetadataFilter } from '../../domain/model';
export const EntityAttributesFilter: FormDefinition<MetadataFilter> = {
label: 'EntityAttributes',
type: 'EntityAttributes',
schema: 'assets/schema/filter/entity-attributes.schema.json',
schema: '/api/ui/EntityAttributesFilters',
getValidators(): any {
const validators = {};
return validators;
Expand Down

0 comments on commit 96c53cc

Please sign in to comment.