@adminforth/bulk-ai-flow 1.1.3 → 1.1.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
@@ -10,5 +10,5 @@ custom/tsconfig.json
10
10
  custom/visionAction.vue
11
11
  custom/visionTable.vue
12
12
 
13
- sent 24,151 bytes received 115 bytes 48,532.00 bytes/sec
14
- total size is 23,732 speedup is 0.98
13
+ sent 24,245 bytes received 115 bytes 48,720.00 bytes/sec
14
+ total size is 23,826 speedup is 0.98
@@ -8,10 +8,10 @@
8
8
  @click="closeDialog"
9
9
  >
10
10
  <div
11
- class="relative max-w-[95vw] max-h-[90vh] bg-white dark:bg-gray-900 rounded-md shadow-2xl overflow-hidden"
11
+ class="bulk-vision-dialog relative max-w-[95vw] max-h-[90vh] bg-white dark:bg-gray-900 rounded-md shadow-2xl overflow-hidden"
12
12
  @click.stop
13
13
  >
14
- <div class="flex flex-col items-end justify-evenly gap-4 w-full h-full p-6 overflow-y-auto">
14
+ <div class="bulk-vision-table flex flex-col items-end justify-evenly gap-4 w-full h-full p-6 overflow-y-auto">
15
15
  <VisionTable
16
16
  v-if="records && props.checkboxes.length"
17
17
  :checkbox="props.checkboxes"
@@ -28,7 +28,7 @@
28
28
  :primaryKey="primaryKey"
29
29
  />
30
30
  <Button
31
- class="w-64"
31
+ class="bulk-vision-button w-64"
32
32
  @click="saveData"
33
33
  >
34
34
  {{ props.checkboxes.length > 1 ? 'Save fields' : 'Save field' }}
@@ -50,6 +50,7 @@
50
50
  :options="convertColumnEnumToSelectOptions(props.meta.columnEnums, n)"
51
51
  v-model="selected[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n]"
52
52
  :teleportToTop="true"
53
+ :teleportToBody="false"
53
54
  >
54
55
  </Select>
55
56
  </div>
@@ -8,10 +8,10 @@
8
8
  @click="closeDialog"
9
9
  >
10
10
  <div
11
- class="relative max-w-[95vw] max-h-[90vh] bg-white dark:bg-gray-900 rounded-md shadow-2xl overflow-hidden"
11
+ class="bulk-vision-dialog relative max-w-[95vw] max-h-[90vh] bg-white dark:bg-gray-900 rounded-md shadow-2xl overflow-hidden"
12
12
  @click.stop
13
13
  >
14
- <div class="flex flex-col items-end justify-evenly gap-4 w-full h-full p-6 overflow-y-auto">
14
+ <div class="bulk-vision-table flex flex-col items-end justify-evenly gap-4 w-full h-full p-6 overflow-y-auto">
15
15
  <VisionTable
16
16
  v-if="records && props.checkboxes.length"
17
17
  :checkbox="props.checkboxes"
@@ -28,7 +28,7 @@
28
28
  :primaryKey="primaryKey"
29
29
  />
30
30
  <Button
31
- class="w-64"
31
+ class="bulk-vision-button w-64"
32
32
  @click="saveData"
33
33
  >
34
34
  {{ props.checkboxes.length > 1 ? 'Save fields' : 'Save field' }}
@@ -50,6 +50,7 @@
50
50
  :options="convertColumnEnumToSelectOptions(props.meta.columnEnums, n)"
51
51
  v-model="selected[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n]"
52
52
  :teleportToTop="true"
53
+ :teleportToBody="false"
53
54
  >
54
55
  </Select>
55
56
  </div>
package/dist/index.js CHANGED
@@ -52,22 +52,28 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
52
52
  throw new Error(`⚠️ No column found for key "${key}"`);
53
53
  }
54
54
  }
55
+ //check if Upload plugin is installed on all attachment fields
55
56
  if (this.options.generateImages) {
56
- console.log('Generate Images options:', this.options.generateImages);
57
57
  for (const [key, value] of Object.entries(this.options.generateImages)) {
58
58
  const column = columns.find(c => c.name.toLowerCase() === key.toLowerCase());
59
59
  if (!column) {
60
60
  throw new Error(`⚠️ No column found for key "${key}"`);
61
61
  }
62
- const plugin = adminforth.activatedPlugins.find(p => p.resourceConfig.resourceId === key &&
63
- p.pluginOptions.pathColumnName === this.resourceConfig.resourceId);
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
- // }
62
+ const plugin = adminforth.activatedPlugins.find(p => p.resourceConfig.resourceId === this.resourceConfig.resourceId &&
63
+ p.pluginOptions.pathColumnName === key);
64
+ if (!plugin) {
65
+ 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}`);
66
+ }
67
+ if (!plugin.pluginOptions.storageAdapter.objectCanBeAccesedPublicly()) {
68
+ throw new Error(`Upload Plugin for attachment field '${key}' in resource '${this.resourceConfig.resourceId}'
69
+ 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.
70
+ Please configure adapter in such way that it will store objects publicly (e.g. for S3 use 'public-read' ACL).
71
+ `);
72
+ }
73
+ this.uploadPlugin = plugin;
67
74
  }
68
75
  }
69
76
  const primaryKeyColumn = this.resourceConfig.columns.find((col) => col.primaryKey);
70
- //console.log('Primary Key Column:', primaryKeyColumn);
71
77
  const pageInjection = {
72
78
  file: this.componentPath('visionAction.vue'),
73
79
  meta: {
package/index.ts CHANGED
@@ -49,27 +49,34 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
49
49
  }
50
50
  }
51
51
 
52
-
52
+ //check if Upload plugin is installed on all attachment fields
53
53
  if (this.options.generateImages) {
54
- console.log('Generate Images options:', this.options.generateImages);
55
54
  for (const [key, value] of Object.entries(this.options.generateImages)) {
56
55
  const column = columns.find(c => c.name.toLowerCase() === key.toLowerCase());
57
56
  if (!column) {
58
57
  throw new Error(`⚠️ No column found for key "${key}"`);
59
58
  }
60
59
  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
63
62
  );
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;
67
73
  }
74
+
75
+
68
76
  }
69
77
 
70
78
 
71
79
  const primaryKeyColumn = this.resourceConfig.columns.find((col) => col.primaryKey);
72
- //console.log('Primary Key Column:', primaryKeyColumn);
73
80
 
74
81
  const pageInjection = {
75
82
  file: this.componentPath('visionAction.vue'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/bulk-ai-flow",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },