Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions apps/medusa-be/medusa-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,17 @@ const notificationProvider =
},
}

const MEDUSA_ADMIN_ALLOWED_HOSTS =
process.env.NODE_ENV === "development" ? true : process.env.MEDUSA_BACKEND_URL
const getMedusaAdminAllowedHosts = () => {
if (process.env.NODE_ENV === "development") {
return true
}

return process.env.MEDUSA_BACKEND_URL
? [process.env.MEDUSA_BACKEND_URL]
: undefined
Comment thread
BleedingDev marked this conversation as resolved.
Outdated
}

const MEDUSA_ADMIN_ALLOWED_HOSTS = getMedusaAdminAllowedHosts()

module.exports = defineConfig({
featureFlags: {
Expand Down
2 changes: 1 addition & 1 deletion apps/medusa-be/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"jest": "^30.2.0",
"ts-node": "10.9.2",
"typescript": "^5.9.3",
"vite": "^5.4.21",
"vite": "8.0.11",
"yalc": "1.0.0-pre.53"
},
"engines": {
Expand Down
30 changes: 3 additions & 27 deletions apps/medusa-be/src/admin/widgets/product-description-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ import {
BoldItalicUnderlineToggles,
CreateLink,
codeBlockPlugin,
codeMirrorPlugin,
DiffSourceToggleWrapper,
diffSourcePlugin,
headingsPlugin,
InsertCodeBlock,
InsertTable,
InsertThematicBreak,
ListsToggle,
linkDialogPlugin,
Expand Down Expand Up @@ -343,17 +338,6 @@ const htmlToMarkdown = (html: string) => {
const markdownToHtml = (markdown: string) =>
String(marked.parse(markdown, { async: false, gfm: true })).trim()

const productEditorCodeLanguages = {
bash: "Bash",
css: "CSS",
html: "HTML",
js: "JavaScript",
json: "JSON",
md: "Markdown",
sh: "Shell",
ts: "TypeScript",
} as const

const ProductDescriptionEditor = ({
data: product,
}: ProductDescriptionEditorProps) => {
Expand Down Expand Up @@ -439,7 +423,7 @@ const ProductDescriptionEditor = ({
() => [
toolbarPlugin({
toolbarContents: () => (
<DiffSourceToggleWrapper>
<>
<UndoRedo />
<Separator />
<BlockTypeSelect />
Expand All @@ -450,10 +434,8 @@ const ProductDescriptionEditor = ({
<ListsToggle />
<Separator />
<CreateLink />
<InsertTable />
<InsertThematicBreak />
<InsertCodeBlock />
</DiffSourceToggleWrapper>
</>
),
}),
headingsPlugin(),
Expand All @@ -464,15 +446,9 @@ const ProductDescriptionEditor = ({
linkDialogPlugin(),
tablePlugin(),
codeBlockPlugin({ defaultCodeBlockLanguage: "html" }),
codeMirrorPlugin({ codeBlockLanguages: productEditorCodeLanguages }),
diffSourcePlugin({
diffMarkdown: htmlToMarkdown(product?.description ?? ""),
readOnlyDiff: true,
viewMode: "rich-text",
}),
markdownShortcutPlugin(),
Comment thread
BleedingDev marked this conversation as resolved.
],
[product?.description]
[]
)

if (!product?.id) {
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
"react": "19.2.3",
"react-dom": "19.2.3",
"@types/react": "19.2.3",
"@types/react-dom": "19.2.3"
"@types/react-dom": "19.2.3",
"@medusajs/admin-bundler>vite": "8.0.11",
"@medusajs/admin-vite-plugin>vite": "8.0.11",
"@medusajs/admin-bundler>@vitejs/plugin-react": "6.0.1"
},
"supportedArchitectures": {
"os": [
Expand Down
Loading
Loading