@everymatrix/general-player-register-form 0.0.292 → 0.0.295

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/general-player-register-form",
3
- "version": "0.0.292",
3
+ "version": "0.0.295",
4
4
  "main": "dist/general-player-register-form.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "c69fc04487b15c7c69d2a7c8943340d2a8b78c4f"
39
+ "gitHead": "5f850bb3c7a28c78d04d9b6d856c364797cdaf40"
40
40
  }
@@ -28,6 +28,8 @@
28
28
 
29
29
  let isLoading:boolean = false;
30
30
 
31
+ let disabledFieldsList:Array<string>;
32
+
31
33
  let showRegisterStepOne:boolean = true;
32
34
  let showRegisterStepTwo:boolean = false;
33
35
  let showRegisterStepThree:boolean = false;
@@ -104,32 +106,48 @@
104
106
  // @TODO data typescript
105
107
  const createData = (step:string, data:any):void => {
106
108
  if (step === 'RegisterStepOne') {
107
- userData.email = data.userEmail;
108
- userData.username = data.userValue;
109
- userData.password = data.userPassword;
110
- userData.securityQuestion = data.securityQuestion;
111
- userData.securityAnswer = data.securityAnswer;
109
+ userData.email = disabledFieldsList.indexOf('email') >= 0 ? 'dummy@dummy.com' : data.userEmail;
110
+ userData.username = disabledFieldsList.indexOf('username') >= 0 ? 'dummyUsername' : data.userValue;
111
+ userData.password = disabledFieldsList.indexOf('password') >= 0 ? 'dummyPassword01!' : data.userPassword;
112
+ userData.securityQuestion = disabledFieldsList.indexOf('securityQuestion') >= 0 ? 'dummy question' : data.securityQuestion;
113
+ userData.securityAnswer = disabledFieldsList.indexOf('securityAnswer') >= 0 ? 'dummy answer' : data.securityAnswer;
112
114
  }
113
115
  if (step === 'RegisterStepTwo') {
114
116
  userData.title = data.userTitleSelected;
115
- userData.firstname = data.userFirstName;
116
- userData.lastname = data.userLastName;
117
- userData.birth = {};
118
- userData.birth.day = data.birthDaySelected;
119
- userData.birth.month = data.birthMonthSelected;
120
- userData.birth.year = data.birthYearSelected;
121
- userData.birthPlace = data.birthPlace;
117
+ userData.firstname = disabledFieldsList.indexOf('firstName') >= 0 ? 'dummy first name' : data.userFirstName;
118
+ userData.lastname = disabledFieldsList.indexOf('lastName') >= 0 ? 'dummy last name' : data.userLastName;
119
+ if (disabledFieldsList.indexOf('birthDate') >= 0) {
120
+ userData.birth = {
121
+ day: 1,
122
+ month: 1,
123
+ year: 2000
124
+ };
125
+ } else {
126
+ userData.birth = {};
127
+ userData.birth.day = data.birthDaySelected;
128
+ userData.birth.month = data.birthMonthSelected;
129
+ userData.birth.year = data.birthYearSelected;
130
+ }
131
+ userData.birthPlace = disabledFieldsList.indexOf('birthPlace') >= 0 ? 'ngenge' : data.birthPlace;
122
132
  userData.currency = data.currencySelected;
123
133
  }
124
134
  if (step === 'RegisterStepThree') {
125
- userData.address1 = data.address;
126
- userData.postalCode = data.postalCode;
127
- userData.city = data.city;
128
- userData.country = data.countrySelected;
129
- userData.nationality = data.nationalitySelected;
130
- userData.mobile = {};
131
- userData.mobile.prefix = data.mobilePrefixSelected;
132
- userData.mobile.number = data.mobile;
135
+ userData.address1 = disabledFieldsList.indexOf('address') >= 0 ? 'dummy address' : data.address;
136
+ userData.postalCode = disabledFieldsList.indexOf('postalCode') >= 0 ? '000000' : data.postalCode;
137
+ userData.city = disabledFieldsList.indexOf('city') >= 0 ? 'dummy city' : data.city;
138
+ userData.country = disabledFieldsList.indexOf('country') >= 0 ? 'dummy country' : data.countrySelected;
139
+ userData.nationality = disabledFieldsList.indexOf('nationality') >= 0 ? 'dummy nationality' : data.nationalitySelected;
140
+ if (disabledFieldsList.indexOf('mobile') >= 0) {
141
+ userData.mobile = {
142
+ prefix: '0040',
143
+ number: '1234123412'
144
+ };
145
+ } else {
146
+ userData.mobile = {};
147
+ userData.mobile.prefix = data.mobilePrefixSelected;
148
+ userData.mobile.number = data.mobile;
149
+ }
150
+
133
151
  userData.userConsents = {};
134
152
  // analytics data
135
153
  userData.affiliateMarker = trackedanalyticsdata;
@@ -252,6 +270,10 @@
252
270
  }
253
271
  }
254
272
 
273
+ const formatDisabledFields = ():void => {
274
+ disabledFieldsList = disabledfields.split(',');
275
+ }
276
+
255
277
  const switchToLogin = ():void => {
256
278
  window.postMessage({ type: "ToLogin" }, window.location.href);
257
279
  }
@@ -274,6 +296,7 @@
274
296
  $: cmsendpoint && lang && env && getCmsData();
275
297
  $: playerid && session;
276
298
  $: lang && setActiveLanguage();
299
+ $: disabledfields && formatDisabledFields();
277
300
  </script>
278
301
 
279
302
  {#if isLoading}
@@ -295,17 +318,17 @@ $: lang && setActiveLanguage();
295
318
  {/if}
296
319
  {#if showRegisterStepOne}
297
320
  <div class="RegisterFormStep1" part="RegisterFormStep1">
298
- <general-player-register-form-step1 {lang} />
321
+ <general-player-register-form-step1 {lang} {disabledfields} {dummydata} />
299
322
  </div>
300
323
  {/if}
301
324
  {#if showRegisterStepTwo}
302
325
  <div class="RegisterFormStep2" part="RegisterFormStep2">
303
- <general-player-register-form-step2 {endpoint} {lang} {licenseyears} />
326
+ <general-player-register-form-step2 {endpoint} {lang} {licenseyears} {disabledfields} {dummydata} />
304
327
  </div>
305
328
  {/if}
306
329
  {#if showRegisterStepThree}
307
330
  <div class="RegisterFormStep3" part="RegisterFormStep3">
308
- <general-player-register-form-step3 {userconsentsexist} {endpoint} {captchakey} {lang} />
331
+ <general-player-register-form-step3 {userconsentsexist} {endpoint} {captchakey} {lang} {disabledfields} {dummydata} />
309
332
  </div>
310
333
  {/if}
311
334
  {#if showConfirmation}