Skip to content

Commit 5b9a5e0

Browse files
committed
Merge branch 'main' of github.com:devforth/adminforth-bulk-ai-flow
2 parents abdf9b9 + 6b87be6 commit 5b9a5e0

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

custom/VisionAction.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
:tableColumnsIndexes="tableColumnsIndexes"
8080
:selected="selected"
8181
:oldData="oldData"
82+
:isError="isError"
83+
:errorMessage="errorMessage"
8284
:isAiResponseReceivedAnalizeImage="isAiResponseReceivedAnalizeImage"
8385
:isAiResponseReceivedAnalizeNoImage="isAiResponseReceivedAnalizeNoImage"
8486
:isAiResponseReceivedImage="isAiResponseReceivedImage"
@@ -181,13 +183,8 @@ const props = defineProps<{
181183
meta: any,
182184
resource: AdminForthResourceCommon,
183185
adminUser: AdminUser,
184-
updateList: {
185-
type: Function,
186-
required: true
187-
},
188-
clearCheckboxes: {
189-
type: Function
190-
}
186+
updateList: () => any,
187+
clearCheckboxes?: () => any,
191188
}>();
192189
193190
defineExpose({
@@ -361,6 +358,13 @@ function fillCarouselSaveImages() {
361358
362359
363360
function formatLabel(str) {
361+
const labelsMap = props.meta?.columnLabels || {};
362+
let labelFromMeta = labelsMap[str];
363+
if (!labelFromMeta) {
364+
const match = Object.keys(labelsMap).find(k => k.toLowerCase() === String(str).toLowerCase());
365+
if (match) labelFromMeta = labelsMap[match];
366+
}
367+
if (labelFromMeta) return labelFromMeta;
364368
return str
365369
.split('_')
366370
.map(word => word.charAt(0).toUpperCase() + word.slice(1))

index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,10 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
563563
};
564564

565565
const primaryKeyColumn = this.resourceConfig.columns.find((col) => col.primaryKey);
566+
// Map of column technical names to their display labels from resource config
567+
const columnLabels: Record<string, string> = Object.fromEntries(
568+
(this.resourceConfig.columns || []).map((c: any) => [c.name, c.label || c.name])
569+
);
566570

567571
const pageInjection = {
568572
file: this.componentPath('VisionAction.vue'),
@@ -571,6 +575,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
571575
outputFields: outputFields,
572576
actionName: this.options.actionName,
573577
columnEnums: columnEnums,
578+
columnLabels: columnLabels,
574579
outputImageFields: outputImageFields,
575580
outputFieldsForAnalizeFromImages: outputFieldsForAnalizeFromImages,
576581
outputPlainFields: outputPlainFields,

0 commit comments

Comments
 (0)