Skip to content

Commit f54d8d2

Browse files
committed
chore: use markdown for descriptions in dev-demo
1 parent 650fe9b commit f54d8d2

File tree

1 file changed

+32
-21
lines changed

1 file changed

+32
-21
lines changed

dev-demo/resources/carsResourseTemplate.ts

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import InlineCreatePlugin from '../../plugins/adminforth-inline-create/index.js'
1111
import ListInPlaceEditPlugin from "../../plugins/adminforth-list-in-place-edit/index.js";
1212
import BulkAiFlowPlugin from '../../plugins/adminforth-bulk-ai-flow/index.js';
1313
import ForeignInlineShowPlugin from '../../plugins/adminforth-foreign-inline-show/index.js';
14-
14+
import MarkdownPlugin from '../../plugins/adminforth-markdown/index.js';
1515

1616
import CompletionAdapterOpenAIChatGPT from '../../adapters/adminforth-completion-adapter-open-ai-chat-gpt/index.js';
1717
import CompletionAdapterGoogleGemini from '../../adapters/adminforth-completion-adapter-google-gemini/index.js';
@@ -193,26 +193,37 @@ export default function carsResourseTemplate(resourceId: string, dataSource: str
193193
maxShowWidth: "300px",
194194
},
195195
}),
196-
new RichEditorPlugin({
197-
htmlFieldName: 'description',
198-
attachments: {
199-
attachmentResource: "cars_description_images",
200-
attachmentFieldName: "image_path",
201-
attachmentRecordIdFieldName: "record_id",
202-
attachmentResourceIdFieldName: "resource_id",
203-
},
204-
...(process.env.OPENAI_API_KEY ? {
205-
completion: {
206-
adapter: new CompletionAdapterOpenAIChatGPT({
207-
openAiApiKey: process.env.OPENAI_API_KEY as string,
208-
model: 'gpt-5-mini',
209-
}),
210-
expert: {
211-
debounceTime: 250,
212-
}
213-
}
214-
} : {}),
215-
}),
196+
// new RichEditorPlugin({
197+
// htmlFieldName: 'description',
198+
// attachments: {
199+
// attachmentResource: "cars_description_images",
200+
// attachmentFieldName: "image_path",
201+
// attachmentRecordIdFieldName: "record_id",
202+
// attachmentResourceIdFieldName: "resource_id",
203+
// },
204+
// ...(process.env.OPENAI_API_KEY ? {
205+
// completion: {
206+
// adapter: new CompletionAdapterOpenAIChatGPT({
207+
// openAiApiKey: process.env.OPENAI_API_KEY as string,
208+
// model: 'gpt-5-mini',
209+
// }),
210+
// expert: {
211+
// debounceTime: 250,
212+
// }
213+
// }
214+
// } : {}),
215+
// }),
216+
new MarkdownPlugin(
217+
{
218+
fieldName: "description",
219+
attachments: {
220+
attachmentResource: "cars_description_images",
221+
attachmentFieldName: "image_path",
222+
attachmentRecordIdFieldName: "record_id",
223+
attachmentResourceIdFieldName: "resource_id",
224+
},
225+
}
226+
),
216227
new importExport({}),
217228
// new InlineCreatePlugin({}),
218229
new ListInPlaceEditPlugin({

0 commit comments

Comments
 (0)