@fluxhub/fluxhub-lib 10.0.525 → 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 });
@@ -23873,7 +23920,6 @@ class dati_aggiuntivi_v2 {
23873
23920
  evt_salv(rip_pulsanti = true, check_on_save = false) {
23874
23921
  this.b_rip_pulsanti = rip_pulsanti;
23875
23922
  this.btnprocedi = false;
23876
- console.log(check_on_save);
23877
23923
  if (check_on_save)
23878
23924
  if (!this.ck_field())
23879
23925
  return;
@@ -24158,6 +24204,9 @@ class dati_aggiuntivi_v2 {
24158
24204
  if (this.ck_after(liv)) {
24159
24205
  this.calcola_destinari(o);
24160
24206
  }
24207
+ else {
24208
+ this.edit_b(this.b_edit_before);
24209
+ }
24161
24210
  }
24162
24211
  calcola_destinari(o) {
24163
24212
  console.log('this. this.transizione_info ', o);
@@ -24412,7 +24461,6 @@ class dati_aggiuntivi_v2 {
24412
24461
  if (arrd[i].val instanceof Date)
24413
24462
  if (new Date(arrd[i].val).getTime() != new Date(arrd[i].oldVal).getTime())
24414
24463
  flt.push(arrd[i]);
24415
- console.log('arrx ', flt, edit_button, !edit_button || flt.length == 0);
24416
24464
  if (!edit_button || flt.length == 0)
24417
24465
  this.m_router.navigate([this.app_info.modulo_swf]);
24418
24466
  else {