[ACA-4436] - added option for select item to display None (#7113)

* [ACA-4436] - added option for select item to display None

* [ACA-4436] - added unit test and fixed wrong default behaviour

* [ACA-4436] - fixed property check

* [ACA-4436] - fixed unit test

* [ACA-4436] - fixed unit test
This commit is contained in:
Vito
2021-06-25 10:19:16 +01:00
committed by GitHub
parent 26d180e661
commit 82a57c9c05
8 changed files with 112 additions and 2 deletions

View File

@@ -25,12 +25,15 @@ import { switchMap } from 'rxjs/operators';
export class CardViewSelectItemModel<T> extends CardViewBaseItemModel implements CardViewItem, DynamicComponentModel {
type: string = 'select';
options$: Observable<CardViewSelectItemOption<T>[]>;
displayNoneOption: boolean;
valueFetch$: Observable<string> = null;
constructor(cardViewSelectItemProperties: CardViewSelectItemProperties<T>) {
super(cardViewSelectItemProperties);
this.displayNoneOption = cardViewSelectItemProperties.displayNoneOption !== undefined ? cardViewSelectItemProperties.displayNoneOption : true;
this.options$ = cardViewSelectItemProperties.options$;
this.valueFetch$ = this.options$.pipe(