wt-front-shared 1.0.36 → 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.
- package/esm2020/lib/core/components/auto-form/components/form-field-file/form-field-file.component.mjs +22 -10
- package/fesm2015/wt-front-shared.mjs +23 -11
- package/fesm2015/wt-front-shared.mjs.map +1 -1
- package/fesm2020/wt-front-shared.mjs +21 -9
- package/fesm2020/wt-front-shared.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -7753,18 +7753,26 @@ 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
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
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
|
+
});*/
|
|
7764
7771
|
}
|
|
7765
7772
|
ngOnChanges(changes) {
|
|
7766
7773
|
const field = this.fieldData.field;
|
|
7767
7774
|
if (field && this.form) {
|
|
7775
|
+
console.log("ngOnChanges", this.form.get(field)?.value);
|
|
7768
7776
|
this.imageVersions = this.form.get(field)?.value?.versions || "";
|
|
7769
7777
|
if (this.imageVersions) {
|
|
7770
7778
|
this.inputStatus = "0";
|
|
@@ -7794,12 +7802,14 @@ class FormFieldFileComponent {
|
|
|
7794
7802
|
}
|
|
7795
7803
|
}
|
|
7796
7804
|
deleteImage() {
|
|
7805
|
+
console.log("deleteImage");
|
|
7797
7806
|
const id = this.form.get("id")?.value;
|
|
7798
7807
|
const field = this.fieldData.field;
|
|
7799
7808
|
if (id) {
|
|
7800
7809
|
this.dialogService.openDeleteDialog()
|
|
7801
7810
|
.pipe(untilComponentDestroyed(this))
|
|
7802
7811
|
.subscribe((result) => {
|
|
7812
|
+
console.log("result");
|
|
7803
7813
|
if (result) {
|
|
7804
7814
|
if (!this.imageSource) {
|
|
7805
7815
|
this.initRequest();
|
|
@@ -7819,12 +7829,14 @@ class FormFieldFileComponent {
|
|
|
7819
7829
|
this.request$ = this.requestsFacade.getRequestUpdates(this.formDeleteFile, this.putMethod);
|
|
7820
7830
|
this.request$
|
|
7821
7831
|
.pipe(filter(request => request.status === this.requestStatuses.LOADED), take(1), untilComponentDestroyed(this))
|
|
7822
|
-
.subscribe(() => {
|
|
7832
|
+
.subscribe((data) => {
|
|
7833
|
+
console.log("data", data);
|
|
7823
7834
|
this.clearFile();
|
|
7824
7835
|
});
|
|
7825
7836
|
}
|
|
7826
7837
|
}
|
|
7827
7838
|
clearFile() {
|
|
7839
|
+
console.log("clearFile");
|
|
7828
7840
|
this.input.nativeElement.value = "";
|
|
7829
7841
|
this.imageSource = "";
|
|
7830
7842
|
this.imageVersions = null;
|