wt-front-shared 1.0.37 → 1.0.38

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.
@@ -7753,15 +7753,21 @@ class FormFieldFileComponent {
7753
7753
  }
7754
7754
  ngOnInit() {
7755
7755
  this.statusChanges$ = this.form.valueChanges;
7756
- // If the form reset need to clear the field
7757
- this.form.statusChanges
7758
- .pipe(untilComponentDestroyed(this))
7759
- .subscribe(() => {
7760
- if (!this.currentPristineValue && this.form.pristine) {
7761
- this.clearFile();
7762
- }
7763
- this.currentPristineValue = this.form.pristine;
7764
- });
7756
+ // If the form reset, need to clear the field
7757
+ /*
7758
+ @TODO Need to test
7759
+ this.form.statusChanges
7760
+ .pipe(
7761
+ untilComponentDestroyed(this)
7762
+ )
7763
+ .subscribe(() => {
7764
+ console.log("this.currentPristineValue", this.currentPristineValue, this.form.pristine);
7765
+ if (!this.currentPristineValue && this.form.pristine) {
7766
+ console.log("ngOnInit");
7767
+ this.clearFile();
7768
+ }
7769
+ this.currentPristineValue = this.form.pristine;
7770
+ });*/
7765
7771
  }
7766
7772
  ngOnChanges(changes) {
7767
7773
  const field = this.fieldData.field;
@@ -7796,12 +7802,14 @@ class FormFieldFileComponent {
7796
7802
  }
7797
7803
  }
7798
7804
  deleteImage() {
7805
+ console.log("deleteImage");
7799
7806
  const id = this.form.get("id")?.value;
7800
7807
  const field = this.fieldData.field;
7801
7808
  if (id) {
7802
7809
  this.dialogService.openDeleteDialog()
7803
7810
  .pipe(untilComponentDestroyed(this))
7804
7811
  .subscribe((result) => {
7812
+ console.log("result");
7805
7813
  if (result) {
7806
7814
  if (!this.imageSource) {
7807
7815
  this.initRequest();
@@ -7821,7 +7829,8 @@ class FormFieldFileComponent {
7821
7829
  this.request$ = this.requestsFacade.getRequestUpdates(this.formDeleteFile, this.putMethod);
7822
7830
  this.request$
7823
7831
  .pipe(filter(request => request.status === this.requestStatuses.LOADED), take(1), untilComponentDestroyed(this))
7824
- .subscribe(() => {
7832
+ .subscribe((data) => {
7833
+ console.log("data", data);
7825
7834
  this.clearFile();
7826
7835
  });
7827
7836
  }
@@ -7830,7 +7839,7 @@ class FormFieldFileComponent {
7830
7839
  console.log("clearFile");
7831
7840
  this.input.nativeElement.value = "";
7832
7841
  this.imageSource = "";
7833
- // this.imageVersions = null;
7842
+ this.imageVersions = null;
7834
7843
  this.inputStatus = "1";
7835
7844
  this.cd.markForCheck();
7836
7845
  }