Skip to content

Commit e89cb60

Browse files
committed
fix: fix incompability with others threedotsmenu items
1 parent 42f5c22 commit e89cb60

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

index.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
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";
33
import type { PluginOptions } from './types.js';
44
import { json } from "stream/consumers";
55
import Handlebars, { compile } from 'handlebars';
@@ -192,15 +192,18 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
192192
isImageGeneration: this.options.generateImages ? Object.keys(this.options.generateImages).length > 0 : false
193193
}
194194
}
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 = {};
198201
}
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 = [];
201204
}
202205

203-
this.resourceConfig.options.pageInjections.list.threeDotsDropdownItems = [pageInjection];
206+
(resourceConfig.options.pageInjections.list.threeDotsDropdownItems as AdminForthComponentDeclaration[]).push(pageInjection);
204207
}
205208

206209
validateConfigAfterDiscover(adminforth: IAdminForth, resourceConfig: AdminForthResource) {

0 commit comments

Comments
 (0)