|
1 | 1 | import { AdminForthPlugin, Filters } from "adminforth";
|
2 |
| -import type { IAdminForth, IHttpServer, AdminForthResourcePages, AdminForthResourceColumn, AdminForthDataTypes, AdminForthResource } from "adminforth"; |
| 2 | +import type { IAdminForth, IHttpServer, AdminForthComponentDeclaration, AdminForthResourceColumn, AdminForthDataTypes, AdminForthResource } from "adminforth"; |
3 | 3 | import type { PluginOptions } from './types.js';
|
4 | 4 | import { json } from "stream/consumers";
|
5 | 5 | import Handlebars, { compile } from 'handlebars';
|
@@ -192,15 +192,18 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
192 | 192 | isImageGeneration: this.options.generateImages ? Object.keys(this.options.generateImages).length > 0 : false
|
193 | 193 | }
|
194 | 194 | }
|
195 |
| - |
196 |
| - if (!this.resourceConfig.options.pageInjections) { |
197 |
| - this.resourceConfig.options.pageInjections = {}; |
| 195 | + |
| 196 | + if (!resourceConfig.options.pageInjections) { |
| 197 | + resourceConfig.options.pageInjections = {}; |
| 198 | + } |
| 199 | + if (!resourceConfig.options.pageInjections.list) { |
| 200 | + resourceConfig.options.pageInjections.list = {}; |
198 | 201 | }
|
199 |
| - if (!this.resourceConfig.options.pageInjections.list) { |
200 |
| - this.resourceConfig.options.pageInjections.list = {}; |
| 202 | + if (!resourceConfig.options.pageInjections.list.threeDotsDropdownItems) { |
| 203 | + resourceConfig.options.pageInjections.list.threeDotsDropdownItems = []; |
201 | 204 | }
|
202 | 205 |
|
203 |
| - this.resourceConfig.options.pageInjections.list.threeDotsDropdownItems = [pageInjection]; |
| 206 | + (resourceConfig.options.pageInjections.list.threeDotsDropdownItems as AdminForthComponentDeclaration[]).push(pageInjection); |
204 | 207 | }
|
205 | 208 |
|
206 | 209 | validateConfigAfterDiscover(adminforth: IAdminForth, resourceConfig: AdminForthResource) {
|
|
0 commit comments