@adminforth/bulk-ai-flow 1.21.3 → 1.21.5

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/build.log CHANGED
@@ -13,5 +13,5 @@ custom/package-lock.json
13
13
  custom/package.json
14
14
  custom/tsconfig.json
15
15
 
16
- sent 96,721 bytes received 172 bytes 193,786.00 bytes/sec
17
- total size is 96,085 speedup is 0.99
16
+ sent 96,802 bytes received 172 bytes 193,948.00 bytes/sec
17
+ total size is 96,157 speedup is 0.99
@@ -83,7 +83,7 @@
83
83
  <p class="text-sm ">{{ $t('old value') }}</p>
84
84
  </div>
85
85
  <template #tooltip>
86
- {{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }}
86
+ {{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] ?? "No old value" }}
87
87
  </template>
88
88
  </Tooltip>
89
89
  </div>
@@ -99,7 +99,7 @@
99
99
  <p class="text-sm ">{{ $t('old value') }}</p>
100
100
  </div>
101
101
  <template #tooltip>
102
- <p class="max-w-[200px]">{{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }}</p>
102
+ <p class="max-w-[200px]">{{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] ?? "No old value" }}</p>
103
103
  </template>
104
104
  </Tooltip>
105
105
  </div>
@@ -114,7 +114,7 @@
114
114
  <p class="text-sm ">{{ $t('old value') }}</p>
115
115
  </div>
116
116
  <template #tooltip>
117
- {{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }}
117
+ {{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] ?? "No old value" }}
118
118
  </template>
119
119
  </Tooltip>
120
120
  </div>
@@ -130,7 +130,7 @@
130
130
  <p class="text-sm ">{{ $t('old value') }}</p>
131
131
  </div>
132
132
  <template #tooltip>
133
- {{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }}
133
+ {{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] ?? "No old value" }}
134
134
  </template>
135
135
  </Tooltip>
136
136
  </div>
@@ -83,7 +83,7 @@
83
83
  <p class="text-sm ">{{ $t('old value') }}</p>
84
84
  </div>
85
85
  <template #tooltip>
86
- {{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }}
86
+ {{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] ?? "No old value" }}
87
87
  </template>
88
88
  </Tooltip>
89
89
  </div>
@@ -99,7 +99,7 @@
99
99
  <p class="text-sm ">{{ $t('old value') }}</p>
100
100
  </div>
101
101
  <template #tooltip>
102
- <p class="max-w-[200px]">{{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }}</p>
102
+ <p class="max-w-[200px]">{{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] ?? "No old value" }}</p>
103
103
  </template>
104
104
  </Tooltip>
105
105
  </div>
@@ -114,7 +114,7 @@
114
114
  <p class="text-sm ">{{ $t('old value') }}</p>
115
115
  </div>
116
116
  <template #tooltip>
117
- {{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }}
117
+ {{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] ?? "No old value" }}
118
118
  </template>
119
119
  </Tooltip>
120
120
  </div>
@@ -130,7 +130,7 @@
130
130
  <p class="text-sm ">{{ $t('old value') }}</p>
131
131
  </div>
132
132
  <template #tooltip>
133
- {{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] }}
133
+ {{ oldData[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] ?? "No old value" }}
134
134
  </template>
135
135
  </Tooltip>
136
136
  </div>
package/dist/index.js CHANGED
@@ -786,6 +786,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
786
786
  }
787
787
  }
788
788
  const primaryKeyColumn = this.resourceConfig.columns.find((col) => col.primaryKey);
789
+ const decimalFieldsArray = this.resourceConfig.columns.filter(c => c.type === 'decimal').map(c => c.name);
789
790
  const updates = selectedIds.map((ID, idx) => __awaiter(this, void 0, void 0, function* () {
790
791
  const oldRecord = yield this.adminforth.resource(this.resourceConfig.resourceId).get([Filters.EQ(primaryKeyColumn.name, ID)]);
791
792
  for (const [key, value] of Object.entries(outputImageFields)) {
@@ -821,6 +822,14 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
821
822
  }
822
823
  }
823
824
  }
825
+ // Convert decimal fields to numbers
826
+ if (decimalFieldsArray.length > 0) {
827
+ for (const fieldName of decimalFieldsArray) {
828
+ if (fieldsToUpdate[idx].hasOwnProperty(fieldName)) {
829
+ fieldsToUpdate[idx][fieldName] = `${fieldsToUpdate[idx][fieldName]}`;
830
+ }
831
+ }
832
+ }
824
833
  const newRecord = Object.assign(Object.assign({}, oldRecord), fieldsToUpdate[idx]);
825
834
  return this.adminforth.updateResourceRecord({
826
835
  resource: this.resourceConfig,
package/index.ts CHANGED
@@ -803,6 +803,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
803
803
  }
804
804
  }
805
805
  const primaryKeyColumn = this.resourceConfig.columns.find((col) => col.primaryKey);
806
+ const decimalFieldsArray = this.resourceConfig.columns.filter(c => c.type === 'decimal').map(c => c.name);
806
807
  const updates = selectedIds.map(async (ID, idx) => {
807
808
  const oldRecord = await this.adminforth.resource(this.resourceConfig.resourceId).get( [Filters.EQ(primaryKeyColumn.name, ID)] );
808
809
  for (const [key, value] of Object.entries(outputImageFields)) {
@@ -837,6 +838,15 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
837
838
  }
838
839
  }
839
840
  }
841
+
842
+ // Convert decimal fields to numbers
843
+ if (decimalFieldsArray.length > 0) {
844
+ for (const fieldName of decimalFieldsArray) {
845
+ if (fieldsToUpdate[idx].hasOwnProperty(fieldName)) {
846
+ fieldsToUpdate[idx][fieldName] = `${fieldsToUpdate[idx][fieldName]}`;
847
+ }
848
+ }
849
+ }
840
850
  const newRecord = {
841
851
  ...oldRecord,
842
852
  ...fieldsToUpdate[idx]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/bulk-ai-flow",
3
- "version": "1.21.3",
3
+ "version": "1.21.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },