@fluxhub/fluxhub-lib 10.0.524 → 10.0.526

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.
@@ -8853,6 +8853,53 @@ class AuthenticationService {
8853
8853
  throw err;
8854
8854
  }));
8855
8855
  }
8856
+ register_user(name, surname, email, username, add_role, displayError = true) {
8857
+ this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT + '_register';
8858
+ let post_v = JSON.stringify({
8859
+ name: name,
8860
+ surname: surname,
8861
+ email: email,
8862
+ username: username,
8863
+ add_role: add_role
8864
+ });
8865
+ return this.http
8866
+ .post(this.url, post_v, {
8867
+ headers: this.headers,
8868
+ })
8869
+ .pipe(map((res) => {
8870
+ // Handle errors, display if enabled
8871
+ let err;
8872
+ if (!res) {
8873
+ err = new Error("Empty server response");
8874
+ }
8875
+ else if (res.result_msg === "KO") {
8876
+ err = new Error(res.msg);
8877
+ }
8878
+ else {
8879
+ if (res.result_data.length > 0) {
8880
+ localStorage.setItem(this.app_s.COMPANY_KEY + "token", res.result_data[0].token);
8881
+ }
8882
+ }
8883
+ if (err) {
8884
+ console.error(err);
8885
+ if (displayError) {
8886
+ this.toastr.error(err.message);
8887
+ }
8888
+ throw new Error(err);
8889
+ }
8890
+ return res || new QGResult();
8891
+ }), catchError((err) => {
8892
+ // In a real world app, we might use a remote logging infrastructure
8893
+ // We'd also dig deeper into the error to get a better message
8894
+ let errMsg = err.message
8895
+ ? err.message
8896
+ : err.status
8897
+ ? `${err.status} - ${err.statusText}`
8898
+ : "Server error";
8899
+ console.error(errMsg); // log to console instead
8900
+ throw err;
8901
+ }));
8902
+ }
8856
8903
  login_by_email(email, displayError = true) {
8857
8904
  this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT + '_email';
8858
8905
  let post_v = JSON.stringify({ email: email });
@@ -11398,15 +11445,18 @@ class FHAutoCompleteComponent {
11398
11445
  }, this.load_delay);
11399
11446
  }
11400
11447
  fillCombo() {
11448
+ console.log('fillcombo ', this.option_values);
11401
11449
  this.myData = new Array();
11402
11450
  this.searchItemsFiltered = new Array();
11403
11451
  if (this.sql == null)
11404
- this.sql = "";
11452
+ this.sql = '';
11453
+ if (this.option_values == null)
11454
+ this.option_values = '';
11405
11455
  if (this.sql.indexOf("|") != -1 && this.sql.indexOf("$") != -1) {
11406
11456
  this.set_options(this.sql);
11407
11457
  return;
11408
11458
  }
11409
- if (this.option_values != null && this.option_values != '') {
11459
+ if (this.option_values != '') {
11410
11460
  this.set_options(this.option_values);
11411
11461
  return;
11412
11462
  }
@@ -23870,7 +23920,6 @@ class dati_aggiuntivi_v2 {
23870
23920
  evt_salv(rip_pulsanti = true, check_on_save = false) {
23871
23921
  this.b_rip_pulsanti = rip_pulsanti;
23872
23922
  this.btnprocedi = false;
23873
- console.log(check_on_save);
23874
23923
  if (check_on_save)
23875
23924
  if (!this.ck_field())
23876
23925
  return;
@@ -24155,6 +24204,9 @@ class dati_aggiuntivi_v2 {
24155
24204
  if (this.ck_after(liv)) {
24156
24205
  this.calcola_destinari(o);
24157
24206
  }
24207
+ else {
24208
+ this.edit_b(this.b_edit_before);
24209
+ }
24158
24210
  }
24159
24211
  calcola_destinari(o) {
24160
24212
  console.log('this. this.transizione_info ', o);
@@ -24409,7 +24461,6 @@ class dati_aggiuntivi_v2 {
24409
24461
  if (arrd[i].val instanceof Date)
24410
24462
  if (new Date(arrd[i].val).getTime() != new Date(arrd[i].oldVal).getTime())
24411
24463
  flt.push(arrd[i]);
24412
- console.log('arrx ', flt, edit_button, !edit_button || flt.length == 0);
24413
24464
  if (!edit_button || flt.length == 0)
24414
24465
  this.m_router.navigate([this.app_info.modulo_swf]);
24415
24466
  else {