<commit_before>import { FormGroup, Validators, FormBuilder, ValidatorFn, AbstractControl } from '@angular/forms';
import { Component, ViewChild, Input, EventEmitter, Output } from '@angular/core';
import { Contact } from '../../model/contact';
import { mobileXorEmailValidator } from '../../validators/mobilexoremailvalidator';
import { UserProfile } from '../../model/user-profile';
import { PhoneInput } from '../phone-input.component';

@Component({
    selector: 'member-data-entry',
    templateUrl: 'member-data-entry.html'
})

export class MemberDataEntry {
    @Input() member: UserProfile;
    @Output() memberDeleted: EventEmitter<any> = new EventEmitter();

    @ViewChild('preferredNumber') preferredNumber : PhoneInput;
    //public mask = ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/];

    isActiveUser: boolean = false;
    formGroup: FormGroup;

    constructor(private formBuilder: FormBuilder) { }

    ngOnInit() {
        let role = (this.member.profile.role ? this.member.profile.role : 0);
        this.formGroup = this.formBuilder.group( // set up the validation
            {
                lastName: [this.member.profile.last_name, [Validators.required, Validators.minLength(2), Validators.maxLength(25)]],
                contactString: this.member.profile.contactmethod == 2 ? this.member.profile.email : this.member.profile.mobilenumber,
                firstName: [this.member.profile.first_name, [Validators.required, Validators.maxLength(25)]],
                contactMethod: this.member.profile.contactmethod, // covered by mobileXorEmailValidator below
                isActive: ['1', Validators.required], //this is defaulted to 'Yes', and there is no way to 'unselect' (must be yes or no)
                role: [role, Validators.required],
            },
            {
                validator: mobileXorEmailValidator()
            }
        );<commit_msg>extra comma<commit_after>import { FormGroup, Validators, FormBuilder, ValidatorFn, AbstractControl } from '@angular/forms';
import { Component, ViewChild, Input, EventEmitter, Output } from '@angular/core';
import { Contact } from '../../model/contact';
import { mobileXorEmailValidator } from '../../validators/mobilexoremailvalidator';
import { UserProfile } from '../../model/user-profile';
import { PhoneInput } from '../phone-input.component';

@Component({
    selector: 'member-data-entry',
    templateUrl: 'member-data-entry.html'
})

export class MemberDataEntry {
    @Input() member: UserProfile;
    @Output() memberDeleted: EventEmitter<any> = new EventEmitter();

    @ViewChild('preferredNumber') preferredNumber : PhoneInput;
    //public mask = ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/];

    isActiveUser: boolean = false;
    formGroup: FormGroup;

    constructor(private formBuilder: FormBuilder) { }

    ngOnInit() {
        let role = (this.member.profile.role ? this.member.profile.role : 0);
        this.formGroup = this.formBuilder.group( // set up the validation
            {
                lastName: [this.member.profile.last_name, [Validators.required, Validators.minLength(2), Validators.maxLength(25)]],
                contactString: this.member.profile.contactmethod == 2 ? this.member.profile.email : this.member.profile.mobilenumber,
                firstName: [this.member.profile.first_name, [Validators.required, Validators.maxLength(25)]],
                contactMethod: this.member.profile.contactmethod, // covered by mobileXorEmailValidator below
                isActive: ['1', Validators.required], //this is defaulted to 'Yes', and there is no way to 'unselect' (must be yes or no)
                role: [role, Validators.required]
            },
            {
                validator: mobileXorEmailValidator()
            }
        );
{'fraction_non_alphanumeric': 0.15247217188713436, 'fraction_numerical': 0.0051773233238415735, 'mean_word_length': 2.8257425742574256, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6338837', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1079, 'n_words': 257}