-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SHIBUI-1521 Fixed issue with entity id validation
- Loading branch information
Showing
12 changed files
with
85 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
ui/src/app/metadata/resolver/container/blank-resolver.component.html
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
ui/src/app/metadata/resolver/container/blank-resolver.component.spec.ts
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
ui/src/app/metadata/resolver/container/blank-resolver.component.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { | ||
getResolverEntityIdCollectionFn, | ||
getAllOtherIdsFn, | ||
getResolverUniqueValidEntityIdsFn | ||
} from './index'; | ||
|
||
describe('Resolver Reducer selectors', () => { | ||
describe(`getResolverEntityIdCollectionFn function`, () => { | ||
it('should return a list of entity ids', () => { | ||
|
||
const resolvers = [ | ||
{ | ||
entityId: 'foo' | ||
}, | ||
{ | ||
entityId: 'bar' | ||
}, | ||
{ | ||
entityId: 'baz' | ||
} | ||
]; | ||
|
||
expect(getResolverEntityIdCollectionFn(resolvers)).toEqual(['foo', 'bar', 'baz']); | ||
}); | ||
}); | ||
|
||
describe('getResolverUniqueValidEntityIdsFn function', () => { | ||
it('should return a unique and valid list of ids from the provided list', () => { | ||
const ids = ['foo', undefined, undefined, 'foo', 'bar']; | ||
expect(getResolverUniqueValidEntityIdsFn(ids)).toEqual(['foo', 'bar']); | ||
}); | ||
}); | ||
|
||
describe('getAllOtherIdsFn function', () => { | ||
it('should return a list of ids without the selected', () => { | ||
const ids = ['foo', 'bar', 'baz']; | ||
expect(getAllOtherIdsFn(ids, 'foo')).toEqual(['bar', 'baz']); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
import { Component, ChangeDetectionStrategy } from '@angular/core'; | ||
import { Store } from '@ngrx/store'; | ||
|
||
import { Observable } from 'rxjs'; | ||
import { LoadResolverRequest } from './action/collection.action'; | ||
import { LoadDraftRequest } from './action/draft.action'; | ||
import * as fromRoot from '../../app.reducer'; | ||
import * as fromResolver from './reducer'; | ||
|
||
@Component({ | ||
selector: 'metadata-resolver-page', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
template: '<router-outlet></router-outlet>', | ||
template: `<ng-container *ngIf="!(loading$ | async)"> | ||
<router-outlet></router-outlet> | ||
<ng-container>`, | ||
styleUrls: [] | ||
}) | ||
export class MetadataResolverPageComponent { | ||
|
||
loading$: Observable<boolean> = this.store.select(fromResolver.getResolversLoading); | ||
|
||
constructor( | ||
private store: Store<fromRoot.State> | ||
) { | ||
// this.store.dispatch(new LoadResolverRequest()); | ||
// this.store.dispatch(new LoadDraftRequest()); | ||
this.store.dispatch(new LoadResolverRequest()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters