@adminforth/bulk-ai-flow 1.1.2 → 1.1.4

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,084 bytes received 115 bytes 48,398.00 bytes/sec
14
- total size is 23,659 speedup is 0.98
13
+ sent 24,189 bytes received 115 bytes 48,608.00 bytes/sec
14
+ total size is 23,770 speedup is 0.98
@@ -131,9 +131,9 @@ function generateTableColumns() {
131
131
  }
132
132
  reqFields.label = record._label;
133
133
  reqFields.images = images.value[index];
134
- reqFields.id = record.id;
134
+ reqFields[primaryKey] = record[primaryKey];
135
135
  indexes.push({
136
- id: record.id,
136
+ [primaryKey]: record[primaryKey],
137
137
  label: record._label,
138
138
  });
139
139
  tableData.push(reqFields);
@@ -49,6 +49,8 @@
49
49
  <Select
50
50
  :options="convertColumnEnumToSelectOptions(props.meta.columnEnums, n)"
51
51
  v-model="selected[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n]"
52
+ :teleportToTop="true"
53
+ :teleportToBody="false"
52
54
  >
53
55
  </Select>
54
56
  </div>
@@ -131,9 +131,9 @@ function generateTableColumns() {
131
131
  }
132
132
  reqFields.label = record._label;
133
133
  reqFields.images = images.value[index];
134
- reqFields.id = record.id;
134
+ reqFields[primaryKey] = record[primaryKey];
135
135
  indexes.push({
136
- id: record.id,
136
+ [primaryKey]: record[primaryKey],
137
137
  label: record._label,
138
138
  });
139
139
  tableData.push(reqFields);
@@ -49,6 +49,8 @@
49
49
  <Select
50
50
  :options="convertColumnEnumToSelectOptions(props.meta.columnEnums, n)"
51
51
  v-model="selected[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n]"
52
+ :teleportToTop="true"
53
+ :teleportToBody="false"
52
54
  >
53
55
  </Select>
54
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.2",
3
+ "version": "1.1.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },