File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
193190defineExpose ({
@@ -361,6 +358,13 @@ function fillCarouselSaveImages() {
361358
362359
363360function 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 ))
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments