Skip to content

Commit

Permalink
added 'Started work on' field
Browse files Browse the repository at this point in the history
  • Loading branch information
closedspace committed Jul 11, 2019
1 parent f3fd817 commit e2d2dad
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
Expand Up @@ -77,4 +77,13 @@
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label for="startedWork" class="label">Started Work</label>
<input [nbDatepicker]="datepicker" nbInput fullWidth placeholder="Started work on" formControlName="startedWorkOn">
<nb-datepicker #datepicker></nb-datepicker>
</div>
</div>
</div>
</form>
Expand Up @@ -16,7 +16,8 @@ export class BasicInfoFormComponent {
lastName: [''],
email: ['', Validators.compose([Validators.required, Validators.email])],
imageUrl: ['', Validators.compose([Validators.pattern(new RegExp(`(http)?s?:?(\/\/[^"']*\.(?:png|jpg|jpeg|gif|png|svg))`, 'g'))])],
password: ['', Validators.compose([Validators.required, Validators.minLength(4)])]
password: ['', Validators.compose([Validators.required, Validators.minLength(4)])],
startedWorkOn: ['', Validators.compose([Validators.required])]
});

username = this.form.get('username');
Expand All @@ -26,6 +27,7 @@ export class BasicInfoFormComponent {
imageUrl = this.form.get('imageUrl');
password = this.form.get('password');
off: string;
startedWorkOn = this.form.get('startedWorkOn');

constructor(
private readonly fb: FormBuilder,
Expand All @@ -43,7 +45,8 @@ export class BasicInfoFormComponent {
email: this.email.value,
username: this.username.value || null,
imageUrl: this.imageUrl.value,
role
role,
startedWorkOn: this.startedWorkOn.value
},
password: this.password.value
}).pipe(first()).toPromise();
Expand Down
3 changes: 2 additions & 1 deletion apps/gauzy/src/app/@shared/user/forms/user-forms.module.ts
Expand Up @@ -2,7 +2,7 @@ import { ThemeModule } from '../../../@theme/theme.module';
import { NgModule } from '@angular/core';
import { BasicInfoFormComponent } from './basic-info/basic-info-form.component';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { NbInputModule, NbCardModule } from '@nebular/theme';
import { NbInputModule, NbCardModule, NbDatepickerModule } from '@nebular/theme';
import { AuthService } from '../../../@core/services/auth.service';
import { RoleService } from '../../../@core/services/role.service';

Expand All @@ -13,6 +13,7 @@ import { RoleService } from '../../../@core/services/role.service';
ReactiveFormsModule,
NbInputModule,
NbCardModule,
NbDatepickerModule
],
exports: [BasicInfoFormComponent],
declarations: [BasicInfoFormComponent],
Expand Down
1 change: 1 addition & 0 deletions libs/models/src/lib/user.model.ts
Expand Up @@ -14,6 +14,7 @@ export interface User extends IBaseEntityModel {
roleId?: string;
hash?: string;
imageUrl?: string;
startedWorkOn?: string;
}

export interface UserFindInput extends IBaseEntityModel {
Expand Down

0 comments on commit e2d2dad

Please sign in to comment.