Skip to content

Commit a11a753

Browse files
committed
fix: update Select component to include teleportToBody prop and adjust error handling in BulkAiFlowPlugin
1 parent 3ae2c1d commit a11a753

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

custom/visionTable.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
:options="convertColumnEnumToSelectOptions(props.meta.columnEnums, n)"
5151
v-model="selected[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n]"
5252
:teleportToTop="true"
53+
:teleportToBody="false"
5354
>
5455
</Select>
5556
</div>

index.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,34 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
4949
}
5050
}
5151

52-
52+
//check if Upload plugin is installed on all attachment fields
5353
if (this.options.generateImages) {
54-
console.log('Generate Images options:', this.options.generateImages);
5554
for (const [key, value] of Object.entries(this.options.generateImages)) {
5655
const column = columns.find(c => c.name.toLowerCase() === key.toLowerCase());
5756
if (!column) {
5857
throw new Error(`⚠️ No column found for key "${key}"`);
5958
}
6059
const plugin = adminforth.activatedPlugins.find(p =>
61-
p.resourceConfig!.resourceId === key &&
62-
p.pluginOptions.pathColumnName === this.resourceConfig.resourceId
60+
p.resourceConfig!.resourceId === this.resourceConfig.resourceId &&
61+
p.pluginOptions.pathColumnName === key
6362
);
64-
// if (!plugin) {
65-
// throw new Error(`Plugin for attachment field '${key}' not found in resource '${this.options.attachments!.attachmentResource}', please check if Upload Plugin is installed on the field ${this.options.attachments!.attachmentFieldName}`);
66-
// }
63+
if (!plugin) {
64+
throw new Error(`Plugin for attachment field '${key}' not found in resource '${this.resourceConfig.resourceId}', please check if Upload Plugin is installed on the field ${key}`);
65+
}
66+
if (!plugin.pluginOptions.storageAdapter.objectCanBeAccesedPublicly()) {
67+
throw new Error(`Upload Plugin for attachment field '${key}' in resource '${this.resourceConfig.resourceId}'
68+
uses adapter which is not configured to store objects in public way, so it will produce only signed private URLs which can not be used in HTML text of blog posts.
69+
Please configure adapter in such way that it will store objects publicly (e.g. for S3 use 'public-read' ACL).
70+
`);
71+
}
72+
this.uploadPlugin = plugin;
6773
}
74+
75+
6876
}
6977

7078

7179
const primaryKeyColumn = this.resourceConfig.columns.find((col) => col.primaryKey);
72-
//console.log('Primary Key Column:', primaryKeyColumn);
7380

7481
const pageInjection = {
7582
file: this.componentPath('visionAction.vue'),

0 commit comments

Comments
 (0)