Skip to content

Commit 4896854

Browse files
author
leonardoespinosa
committed
Fix integration errors
2 parents f015765 + 416fdaf commit 4896854

File tree

14 files changed

+126
-128
lines changed

14 files changed

+126
-128
lines changed

i4t_mobile/src/assets/i18n/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@
129129
"ERROR_TITLE": "Error"
130130
},
131131
"SIGN_OUT": "Sign Out",
132-
"MSG_COMFIRM": "Your data has been updated"
132+
"MSG_COMFIRM": "Your data has been updated",
133+
"FULL_NAME": "Full name",
134+
"GENDER": "Gender"
133135
},
134136
"CODE_TYPE_SELECT": {
135137
"TITTLE": "Type of code",

i4t_mobile/src/assets/i18n/es.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@
129129
"ERROR_TITLE": "Error"
130130
},
131131
"SIGN_OUT": "Cerrar sesión",
132-
"MSG_COMFIRM": "Tus datos han sido actualizados"
132+
"MSG_COMFIRM": "Tus datos han sido actualizados",
133+
"FULL_NAME": "Nombres y apellidos",
134+
"GENDER": "Género"
133135
},
134136
"CODE_TYPE_SELECT": {
135137
"TITTLE": "Tipo de código",

i4t_mobile/src/pages/auth/signup/signup.html

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,6 @@
4242
<div *ngIf="signupForm.controls['username'].hasError('maxlength') && signupForm.controls['username'].touched" class="error-message">
4343
<p class="error-message">{{'MOBILE.SIGNUP.MAX_LENGTH_USERNAME' | translate}}</p>
4444
</div>
45-
46-
47-
<ion-item>
48-
<ion-label floating>
49-
<ion-icon name="gender"></ion-icon>
50-
{{'MOBILE.SIGNUP.GENDER' | translate}}
51-
</ion-label>
52-
<ion-select formControlName="gender" [(ngModel)]="_selectedGender" style="color: white">
53-
<ion-option *ngFor="let gender of _genderArray" value="{{gender.value}}">{{gender.label | translate}}</ion-option>
54-
</ion-select>
55-
</ion-item>
56-
5745
<ion-item>
5846
<ion-label floating>
5947
<ion-icon name="mail"></ion-icon>

i4t_mobile/src/pages/auth/signup/signup.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ export class SignupComponent implements OnInit {
5353
username: new FormControl('', [Validators.required, Validators.minLength(6), Validators.maxLength(20)]),
5454
email: new FormControl('', [Validators.required, Validators.minLength(6), Validators.maxLength(40), CustomValidators.emailValidator]),
5555
password: new FormControl('', [Validators.required, Validators.minLength(8), Validators.maxLength(20)]),
56-
confirmPassword: new FormControl('', [Validators.required, Validators.minLength(8), Validators.maxLength(20)]),
57-
gender: new FormControl('', [Validators.required])
56+
confirmPassword: new FormControl('', [Validators.required, Validators.minLength(8), Validators.maxLength(20)])
5857
});
5958
this.error = '';
6059

@@ -66,11 +65,9 @@ export class SignupComponent implements OnInit {
6665
register() {
6766

6867
if (this.signupForm.value.password == this.signupForm.value.confirmPassword) {
69-
70-
this.userProfile.first_name = "";
71-
this.userProfile.last_name = "";
68+
this.userProfile.full_name = "";
7269
this.userProfile.language_code = this.userLang;
73-
this.userProfile.gender = this.signupForm.value.gender;
70+
this.userProfile.gender = "";
7471

7572
if (this.signupForm.valid) {
7673
let confirmMsg: string;

i4t_mobile/src/pages/customer/options/settings/settings.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ <h2 style="font-weight: bold;">{{'MOBILE.SETTINGS.MY_DATA' | translate}}</h2>
4343
<ion-label floating>{{'MOBILE.USERNAME' | translate}}</ion-label>
4444
<ion-input formControlName="username" type="text"></ion-input>
4545
</ion-item>
46+
4647
<ion-item *ngIf="_userForm.controls['first_name']">
4748
<ion-label floating>{{'MOBILE.SETTINGS.FIRST_NAME' | translate}}</ion-label>
4849
<ion-input formControlName="first_name" type="text"></ion-input>
@@ -51,6 +52,21 @@ <h2 style="font-weight: bold;">{{'MOBILE.SETTINGS.MY_DATA' | translate}}</h2>
5152
<ion-label floating>{{'MOBILE.SETTINGS.LAST_NAME' | translate}}</ion-label>
5253
<ion-input formControlName="last_name" type="text"></ion-input>
5354
</ion-item>
55+
56+
<ion-item *ngIf="_userForm.controls['full_name']">
57+
<ion-label floating>{{'MOBILE.SETTINGS.FULL_NAME' | translate}}</ion-label>
58+
<ion-input formControlName="full_name" type="text"></ion-input>
59+
</ion-item>
60+
61+
<ion-item *ngIf="_userForm.controls['gender']">
62+
<ion-label>
63+
<ion-icon name="gender"></ion-icon>
64+
{{'MOBILE.SETTINGS.GENDER' | translate}}
65+
</ion-label>
66+
<ion-select formControlName="gender" [(ngModel)]="_selectedGender">
67+
<ion-option *ngFor="let gender of _genderArray" value="{{gender.value}}">{{gender.label | translate}}</ion-option>
68+
</ion-select>
69+
</ion-item>
5470
</ion-list>
5571

5672
<div *ngIf="this._user.username">

i4t_mobile/src/pages/customer/options/settings/settings.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,13 @@ export class SettingsPage implements OnInit, OnDestroy {
4141
private _languageCode: string;
4242
private _imageProfile: string;
4343
private _userLang: string;
44-
4544
private _user: any;
4645
private _userDetail: any;
4746
private _languages: any;
48-
4947
private _validateChangeEmail: boolean = true;
5048
private _validateChangePass: boolean = true;
51-
5249
private disconnectSubscription: Subscription;
50+
private _genderArray: any[] = [];
5351

5452
/**
5553
* SettingsPage constructor
@@ -88,7 +86,6 @@ export class SettingsPage implements OnInit, OnDestroy {
8886
* ionViewWillEnter implementation
8987
*/
9088
ionViewWillEnter() {
91-
this.init();
9289
}
9390

9491
init() {
@@ -104,6 +101,9 @@ export class SettingsPage implements OnInit, OnDestroy {
104101
});
105102
});
106103

104+
this._genderArray = [{ value: "SIGNUP.MALE_GENDER", label: "SIGNUP.MALE_GENDER" },
105+
{ value: "SIGNUP.FEMALE_GENDER", label: "SIGNUP.FEMALE_GENDER" },
106+
{ value: "SIGNUP.OTHER_GENDER", label: "SIGNUP.OTHER_GENDER" }];
107107

108108
this._userDetailSubscription = MeteorObservable.subscribe('getUserDetailsByUser', Meteor.userId()).takeUntil(this.ngUnsubscribe).subscribe(() => {
109109
this._ngZone.run(() => {
@@ -121,9 +121,10 @@ export class SettingsPage implements OnInit, OnDestroy {
121121
}
122122

123123
if (this._user && this._user.username) {
124-
this._userForm = this.formBuilder.group({
124+
this._userForm = new FormGroup({
125125
username: new FormControl({ value: this._user.username, disabled: !controlsDisabled }),
126-
language_code: new FormControl({ value: this._user.profile.language_code, disabled: controlsDisabled })
126+
language_code: new FormControl({ value: this._user.profile.language_code, disabled: controlsDisabled }),
127+
gender: new FormControl({value: this._user.profile.gender, disabled: controlsDisabled})
127128
});
128129

129130
this._validateChangePass = false;
@@ -134,11 +135,16 @@ export class SettingsPage implements OnInit, OnDestroy {
134135
controlsDisabled = true
135136
}
136137

138+
/**
137139
let first_name: FormControl = new FormControl({ value: this._user.profile.first_name, disabled: controlsDisabled });
138140
this._userForm.addControl('first_name', first_name);
139141
140142
let last_name: FormControl = new FormControl({ value: this._user.profile.last_name, disabled: controlsDisabled });
141143
this._userForm.addControl('last_name', last_name);
144+
*/
145+
146+
let full_name: FormControl = new FormControl({ value: this._user.profile.full_name, disabled: controlsDisabled });
147+
this._userForm.addControl('full_name', full_name);
142148
}
143149
});
144150
});
@@ -180,9 +186,11 @@ export class SettingsPage implements OnInit, OnDestroy {
180186
$set:
181187
{
182188
profile: {
183-
first_name: this._userForm.value.first_name,
184-
last_name: this._userForm.value.last_name,
185-
language_code: this._userForm.value.language_code
189+
//first_name: this._userForm.value.first_name,
190+
//last_name: this._userForm.value.last_name,
191+
full_name: this._userForm.value.full_name,
192+
language_code: this._userForm.value.language_code,
193+
gender: this._userForm.value.gender
186194
}
187195
}
188196
});

i4t_web/client/imports/app/web/administrator/administration/collaborators/edition/collaborators-edition.component.html

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,19 @@
2323
</table>
2424
<table style="width: 100%" cellspacing="0">
2525
<tr>
26-
<td colspan="3" style="padding-top: 10px;">
26+
<td colspan="1" style="padding-top: 10px;">
2727
<mat-form-field style="width: 100%">
2828
<input matInput required formControlName="fullName" placeholder="{{'NAME' | translate}}" minlength="1" maxlength="70" #inputName/>
2929
<mat-hint align="end">{{inputName.value.length}} / 50</mat-hint>
3030
</mat-form-field>
3131
</td>
32+
<td colspan="2" style="padding-top: 10px; width: 50%">
33+
<mat-form-field style="width: 100%">
34+
<mat-select formControlName="gender" placeholder="{{'SIGNUP.GENDER_LBL' | translate}}" required>
35+
<mat-option *ngFor="let gender of _genderArray" value="{{gender.value}}">{{gender.label | translate}}</mat-option>
36+
</mat-select>
37+
</mat-form-field>
38+
</td>
3239
</tr>
3340
</table>
3441
<table style="width: 100%" cellspacing="0">
@@ -77,8 +84,8 @@
7784
<mat-card-subtitle>{{'COLLABORATORS.PASSWORD_MSG' | translate}}</mat-card-subtitle>
7885
<div>
7986
<mat-form-field style="width: 100%">
80-
<input matInput formControlName="new_password" placeholder="{{'SETTINGS.NEW_PASSWORD' | translate}}" #inputNewPassword
81-
type="password" />
87+
<input matInput formControlName="new_password" placeholder="{{'SETTINGS.NEW_PASSWORD' | translate}}" #inputNewPassword type="password"
88+
/>
8289
<mat-hint align="end">{{inputNewPassword.value.length}} / 40</mat-hint>
8390
</mat-form-field>
8491
<div *ngIf="_collaboratorEditionForm.controls['new_password'].hasError('required') && _collaboratorEditionForm.controls['new_password'].touched"
@@ -90,8 +97,8 @@
9097
</div>
9198
<div>
9299
<mat-form-field style="width: 100%">
93-
<input matInput formControlName="confirm_new_password" placeholder="{{'SETTINGS.CONFIRM_NEW_PASSWORD' | translate}}"
94-
#inputConfirmNewPassword type="password" />
100+
<input matInput formControlName="confirm_new_password" placeholder="{{'SETTINGS.CONFIRM_NEW_PASSWORD' | translate}}" #inputConfirmNewPassword
101+
type="password" />
95102
<mat-hint align="end">{{inputConfirmNewPassword.value.length}} / 40</mat-hint>
96103
</mat-form-field>
97104
<div *ngIf="_collaboratorEditionForm.controls['confirm_new_password'].hasError('required') && _collaboratorEditionForm.controls['confirm_new_password'].touched"

i4t_web/client/imports/app/web/administrator/administration/collaborators/edition/collaborators-edition.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ export class CollaboratorsEditionComponent implements OnInit, OnDestroy {
5353
private _showTablesSelect: boolean = false;
5454
private _disabledTablesAssignment: boolean = true;
5555

56+
private _genderArray: any[] = [];
57+
5658
/**
5759
* CollaboratorsEditionComponent constructor
5860
* @param {Router} _router
@@ -97,12 +99,17 @@ export class CollaboratorsEditionComponent implements OnInit, OnDestroy {
9799
table_end: [this.selectUserDetail.table_assignment_end],
98100
new_password: new FormControl('', [Validators.minLength(8), Validators.maxLength(20)]),
99101
confirm_new_password: new FormControl('', [Validators.minLength(8), Validators.maxLength(20)]),
102+
gender: [this.selectUser.profile.gender, [Validators.required]]
100103
});
101104
this._tableInit = this.selectUserDetail.table_assignment_init;
102105
this._tableEnd = this.selectUserDetail.table_assignment_end;
103106
this._establishments = Establishments.find({}).zone();
104107
this._roles = Roles.find({}).zone();
105108
this._tableSub = MeteorObservable.subscribe('getTablesByEstablishmentWork', this.selectUser._id).takeUntil(this._ngUnsubscribe).subscribe();
109+
110+
this._genderArray = [{ value: "SIGNUP.MALE_GENDER", label: "SIGNUP.MALE_GENDER" },
111+
{ value: "SIGNUP.FEMALE_GENDER", label: "SIGNUP.FEMALE_GENDER" },
112+
{ value: "SIGNUP.OTHER_GENDER", label: "SIGNUP.OTHER_GENDER" }];
106113
}
107114

108115
/**
@@ -182,7 +189,7 @@ export class CollaboratorsEditionComponent implements OnInit, OnDestroy {
182189
full_name: this._collaboratorEditionForm.value.fullName,
183190
language_code: this.selectUser.profile.language_code,
184191
image: this.selectUser.profile.image,
185-
gender: this.selectUser.profile.gender
192+
gender: this._collaboratorEditionForm.value.gender
186193
}
187194
}
188195
});
@@ -247,6 +254,7 @@ export class CollaboratorsEditionComponent implements OnInit, OnDestroy {
247254
this._collaboratorEditionForm.controls['email'].reset();
248255
this._collaboratorEditionForm.controls['password'].reset();
249256
this._collaboratorEditionForm.controls['confirmPassword'].reset();
257+
this._collaboratorEditionForm.controls['gender'].reset();
250258

251259
this._router.navigate(['app/collaborators']);
252260
}

i4t_web/client/imports/app/web/auth/admin-signup/admin-signup.component.html

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,6 @@ <h3 style="width: 100%; text-align: center">
3232
<div *ngIf="signupForm.controls['fullName'].hasError('required') && signupForm.controls['fullName'].touched" class="error-message">{{'ADMIN_SIGNUP.REQUIRED_FULLNAME' | translate}}</div>
3333
<div *ngIf="signupForm.controls['fullName'].hasError('maxlength') && signupForm.controls['fullName'].touched" class="error-message">{{'ADMIN_SIGNUP.MAX_LENGTH_FULLNAME' | translate}}</div>
3434

35-
<mat-form-field style="width: 100%">
36-
<mat-select formControlName="gender" placeholder="{{'SIGNUP.GENDER_LBL' | translate}}">
37-
<mat-option *ngFor="let gender of _genderArray" value="{{gender.value}}">{{gender.label | translate}}</mat-option>
38-
</mat-select>
39-
</mat-form-field>
40-
41-
<mat-form-field style="width: 100%; margin-top: 10px">
42-
<mat-select formControlName="country" [(ngModel)]="_selectedCountry" placeholder="{{'ADMIN_SIGNUP.COUNTRY' | translate}}">
43-
<mat-option *ngFor="let country of _countries | async" value="{{country._id}}" (click)="changeCountry(country)">{{country.name | translate}}</mat-option>
44-
</mat-select>
45-
</mat-form-field>
46-
47-
<mat-form-field style="width: 100%; margin-top: 10px">
48-
<mat-select formControlName="city" [(ngModel)]="_selectedCity" placeholder="{{'ADMIN_SIGNUP.CITY' | translate}}">
49-
<mat-option *ngFor="let city of _cities | async" value="{{city._id}}" (click)="changeCity()">{{city.name}}</mat-option>
50-
<mat-option *ngIf="(_cities | async)?.length > 0" (click)="changeOtherCity('0000');" value="0000">{{'OTHER' | translate}}</mat-option>
51-
</mat-select>
52-
</mat-form-field>
53-
54-
<mat-form-field *ngIf="_showOtherCity" style="width: 100%; margin-top: 15px">
55-
<input matInput formControlName="otherCity" placeholder="{{'ADMIN_SIGNUP.WHICH_ONE' | translate}}" required>
56-
</mat-form-field>
57-
<div *ngIf="signupForm.controls['otherCity'].hasError('required') && signupForm.controls['otherCity'].touched && _showOtherCity"
58-
class="error-message">{{'ADMIN_SIGNUP.REQUIRED_OTHER' | translate}}</div>
59-
<div *ngIf="signupForm.controls['otherCity'].hasError('maxlength') && signupForm.controls['otherCity'].touched && _showOtherCity"
60-
class="error-message">{{'ADMIN_SIGNUP.MAX_LENGTH_OTHER' | translate}}</div>
6135

6236
<mat-form-field style="width: 100%;">
6337
<input matInput formControlName="username" placeholder="{{'ADMIN_SIGNUP.USERNAME' | translate}}" required>
@@ -95,7 +69,7 @@ <h3 style="width: 100%; text-align: center">
9569
class="error-message">{{'ADMIN_SIGNUP.MAX_LENGTH_PASSWORD' | translate}}</div>
9670
<div *ngIf="showConfirmError" class="error-message"> {{'ADMIN_SIGNUP.PASSWORD_NOT_MATCH' | translate}}</div>
9771

98-
<button mat-raised-button class="primary-button pb-tr" type="submit" [disabled]="!signupForm.valid">{{'ADMIN_SIGNUP.SIGNUP' | translate}}</button>
72+
<button mat-raised-button class="primary-button pb-tr" style="width: 100%" type="submit" [disabled]="!signupForm.valid">{{'ADMIN_SIGNUP.SIGNUP' | translate}}</button>
9973
</form>
10074
<div style="text-align: center; padding-top: 10px">
10175
{{'ADMIN_SIGNUP.ALREADY_ACCOUNT'| translate}}
@@ -150,33 +124,6 @@ <h2 class="opacity revealOnScroll" data-animation="fadeInDown" data-timeout="300
150124
<span>{{'ADMIN_SIGNUP.GENERAL_INFO' | translate}}</span>
151125
</div>
152126
<form [formGroup]="signupForm" (ngSubmit)="register()" novalidate>
153-
<mat-form-field style="width: 100%">
154-
<mat-select formControlName="gender" placeholder="{{'SIGNUP.GENDER_LBL' | translate}}">
155-
<mat-option *ngFor="let gender of _genderArray" value="{{gender.value}}">{{gender.label | translate}}</mat-option>
156-
</mat-select>
157-
</mat-form-field>
158-
159-
<mat-form-field style="width: 100%; margin-top: 10px">
160-
<mat-select formControlName="country" [(ngModel)]="_selectedCountry" placeholder="{{'ADMIN_SIGNUP.COUNTRY' | translate}}">
161-
<mat-option *ngFor="let country of _countries | async" value="{{country._id}}" (click)="changeCountry(country)">{{country.name | translate}}</mat-option>
162-
</mat-select>
163-
</mat-form-field>
164-
165-
<mat-form-field style="width: 100%; margin-top: 10px">
166-
<mat-select formControlName="city" [(ngModel)]="_selectedCity" placeholder="{{'ADMIN_SIGNUP.CITY' | translate}}">
167-
<mat-option *ngFor="let city of _cities | async" value="{{city._id}}" (click)="changeCity()">{{city.name}}</mat-option>
168-
<mat-option *ngIf="(_cities | async)?.length > 0" (click)="changeOtherCity('0000');" value="0000">{{'OTHER' | translate}}</mat-option>
169-
</mat-select>
170-
</mat-form-field>
171-
172-
<mat-form-field *ngIf="_showOtherCity" style="width: 100%; margin-top: 15px">
173-
<input matInput formControlName="otherCity" placeholder="{{'ADMIN_SIGNUP.WHICH_ONE' | translate}}" required>
174-
</mat-form-field>
175-
<div *ngIf="signupForm.controls['otherCity'].hasError('required') && signupForm.controls['otherCity'].touched && _showOtherCity"
176-
class="error-message">{{'ADMIN_SIGNUP.REQUIRED_OTHER' | translate}}</div>
177-
<div *ngIf="signupForm.controls['otherCity'].hasError('maxlength') && signupForm.controls['otherCity'].touched && _showOtherCity"
178-
class="error-message">{{'ADMIN_SIGNUP.MAX_LENGTH_OTHER' | translate}}</div>
179-
180127
<div style="width: 100%; text-align: center; margin-top: 30px">
181128
<span>{{'ADMIN_SIGNUP.USER_PASSWD' | translate}}</span>
182129
</div>
@@ -234,4 +181,4 @@ <h2 class="opacity revealOnScroll" data-animation="fadeInDown" data-timeout="300
234181
<div class="copy">
235182
<span>comeygana © 2018. {{'ADMIN_SIGNUP.COPYRIGHT' | translate}}</span>
236183
</div>
237-
</div>
184+
</div>

0 commit comments

Comments
 (0)