@fluxhub/fluxhub-lib 10.0.525 → 10.0.527

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,54 @@ class AuthenticationService {
8853
8853
  throw err;
8854
8854
  }));
8855
8855
  }
8856
+ register_user(name, surname, email, username, password, 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
+ password: password,
8863
+ username: username,
8864
+ add_role: add_role
8865
+ });
8866
+ return this.http
8867
+ .post(this.url, post_v, {
8868
+ headers: this.headers,
8869
+ })
8870
+ .pipe(map((res) => {
8871
+ // Handle errors, display if enabled
8872
+ let err;
8873
+ if (!res) {
8874
+ err = new Error("Empty server response");
8875
+ }
8876
+ else if (res.result_msg === "KO") {
8877
+ err = new Error(res.msg);
8878
+ }
8879
+ else {
8880
+ if (res.result_data.length > 0) {
8881
+ localStorage.setItem(this.app_s.COMPANY_KEY + "token", res.result_data[0].token);
8882
+ }
8883
+ }
8884
+ if (err) {
8885
+ console.error(err);
8886
+ if (displayError) {
8887
+ this.toastr.error(err.message);
8888
+ }
8889
+ throw new Error(err);
8890
+ }
8891
+ return res || new QGResult();
8892
+ }), catchError((err) => {
8893
+ // In a real world app, we might use a remote logging infrastructure
8894
+ // We'd also dig deeper into the error to get a better message
8895
+ let errMsg = err.message
8896
+ ? err.message
8897
+ : err.status
8898
+ ? `${err.status} - ${err.statusText}`
8899
+ : "Server error";
8900
+ console.error(errMsg); // log to console instead
8901
+ throw err;
8902
+ }));
8903
+ }
8856
8904
  login_by_email(email, displayError = true) {
8857
8905
  this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT + '_email';
8858
8906
  let post_v = JSON.stringify({ email: email });
@@ -23873,7 +23921,6 @@ class dati_aggiuntivi_v2 {
23873
23921
  evt_salv(rip_pulsanti = true, check_on_save = false) {
23874
23922
  this.b_rip_pulsanti = rip_pulsanti;
23875
23923
  this.btnprocedi = false;
23876
- console.log(check_on_save);
23877
23924
  if (check_on_save)
23878
23925
  if (!this.ck_field())
23879
23926
  return;
@@ -24158,6 +24205,9 @@ class dati_aggiuntivi_v2 {
24158
24205
  if (this.ck_after(liv)) {
24159
24206
  this.calcola_destinari(o);
24160
24207
  }
24208
+ else {
24209
+ this.edit_b(this.b_edit_before);
24210
+ }
24161
24211
  }
24162
24212
  calcola_destinari(o) {
24163
24213
  console.log('this. this.transizione_info ', o);
@@ -24412,7 +24462,6 @@ class dati_aggiuntivi_v2 {
24412
24462
  if (arrd[i].val instanceof Date)
24413
24463
  if (new Date(arrd[i].val).getTime() != new Date(arrd[i].oldVal).getTime())
24414
24464
  flt.push(arrd[i]);
24415
- console.log('arrx ', flt, edit_button, !edit_button || flt.length == 0);
24416
24465
  if (!edit_button || flt.length == 0)
24417
24466
  this.m_router.navigate([this.app_info.modulo_swf]);
24418
24467
  else {