[Library | Trunk]: contact us change organization type to select
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60820 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
ae3435b9ef
commit
f0d0858a25
|
@ -54,14 +54,10 @@
|
|||
</div>
|
||||
<div *ngIf="contactForm.get('organizationType')" class="uk-width-1-2@s uk-margin-medium-top">
|
||||
<h6 class="uk-text-bold uk-margin-small-bottom">Organization Type <span class="uk-text-danger uk-text-bold">*</span></h6>
|
||||
<input type="text" class="uk-input uk-width-1-1" placeholder="Your Organization Type" formControlName="organizationType"
|
||||
[class.uk-form-danger]="contactForm.get('organizationType').invalid && contactForm.get('organizationType').touched"
|
||||
[matAutocomplete]="auto">
|
||||
<mat-autocomplete #auto="matAutocomplete">
|
||||
<mat-option *ngFor="let option of autoCompleteTypes | async" [value]="option">
|
||||
{{option}}
|
||||
</mat-option>
|
||||
</mat-autocomplete>
|
||||
<select class="uk-select uk-width-1-1" formControlName="organizationType">
|
||||
<option [value]="''" hidden selected>Select your organization type</option>
|
||||
<option *ngFor="let option of organizationTypes" [value]="option">{{option}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div *ngIf="contactForm.get('subject')" class="uk-width-1-1@s uk-margin-medium-top">
|
||||
<h6 class="uk-text-bold uk-margin-small-bottom">Subject <span class="uk-text-danger uk-text-bold">*</span></h6>
|
||||
|
|
|
@ -10,7 +10,7 @@ import {map, startWith} from "rxjs/operators";
|
|||
styleUrls: ['contact-us.component.css']
|
||||
})
|
||||
|
||||
export class ContactUsComponent implements OnInit {
|
||||
export class ContactUsComponent {
|
||||
@Input()
|
||||
public contactForm: FormGroup;
|
||||
@Input() formTitle: string;
|
||||
|
@ -23,25 +23,6 @@ export class ContactUsComponent implements OnInit {
|
|||
public right: boolean = true;
|
||||
@Input()
|
||||
public buttonClass: string;
|
||||
public autoCompleteTypes: Observable<string[]>;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if(this.contactForm.get('organizationType')) {
|
||||
this.autoCompleteTypes = this.contactForm.get('organizationType').valueChanges
|
||||
.pipe(
|
||||
startWith(''),
|
||||
map(value => this._filter(value))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private _filter(value: string): string[] {
|
||||
const filterValue = value.toLowerCase();
|
||||
return this.organizationTypes.filter(option => option.toLowerCase().includes(filterValue));
|
||||
}
|
||||
|
||||
public send() {
|
||||
this.sendEmitter.emit({
|
||||
|
|
Loading…
Reference in New Issue