Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit b6e67d9

Browse files
committed
webui: Migrate discussion and MR comments pages to React
1 parent 525691d commit b6e67d9

File tree

6 files changed

+498
-1040
lines changed

6 files changed

+498
-1040
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ webui/js/database-tags.js
5959
webui/js/database-view.js
6060
webui/js/database-watchers.js
6161
webui/js/db-header.js
62+
webui/js/discussion-comments.js
6263
webui/js/discussion-list.js
6364
webui/js/markdown-editor.js
6465

webui/jsx/app.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import DatabaseTags from "./database-tags";
1111
import DatabaseView from "./database-view";
1212
import DatabaseWatchers from "./database-watchers";
1313
import DbHeader from "./db-header";
14+
import DiscussionComments from "./discussion-comments";
1415
import DiscussionList from "./discussion-list";
1516
import MarkdownEditor from "./markdown-editor";
1617

@@ -82,6 +83,14 @@ import MarkdownEditor from "./markdown-editor";
8283
}
8384
}
8485

86+
{
87+
const rootNode = document.getElementById("discussion-comments");
88+
if (rootNode) {
89+
const root = ReactDOM.createRoot(rootNode);
90+
root.render(<DiscussionComments />);
91+
}
92+
}
93+
8594
{
8695
const rootNode = document.getElementById("discussion-list");
8796
if (rootNode) {
@@ -100,6 +109,7 @@ import MarkdownEditor from "./markdown-editor";
100109
const defaultIndex = rootNode.dataset.defaultIndex;
101110
const initialValue = rootNode.dataset.initialValue;
102111
const viewOnly = rootNode.dataset.viewOnly;
112+
const onChange = rootNode.dataset.onChange;
103113

104114
const root = ReactDOM.createRoot(rootNode);
105115
root.render(<MarkdownEditor
@@ -109,6 +119,7 @@ import MarkdownEditor from "./markdown-editor";
109119
defaultIndex={defaultIndex}
110120
initialValue={initialValue}
111121
viewOnly={viewOnly}
122+
onChange={onChange}
112123
/>);
113124
});
114125
}

0 commit comments

Comments
 (0)