Skip to content
Snippets Groups Projects
Commit 854e3568 authored by chris's avatar chris
Browse files

temp

parent 5259a79e
No related branches found
No related tags found
1 merge request!296Feedback editor
...@@ -60,7 +60,7 @@ import invisibles, { ...@@ -60,7 +60,7 @@ import invisibles, {
// }; // };
const updateTitle = debounce(title => { const updateTitle = debounce(title => {
console.log(title); // console.log(title);
}, 3000); }, 3000);
const saveTags = tags => { const saveTags = tags => {
......
...@@ -54,7 +54,7 @@ const Editors = () => { ...@@ -54,7 +54,7 @@ const Editors = () => {
case 'ncbi': case 'ncbi':
break; break;
default: default:
return <Editoria />; return <HHMI />;
} }
}; };
......
...@@ -183,7 +183,7 @@ const Hhmi = () => { ...@@ -183,7 +183,7 @@ const Hhmi = () => {
config={config} config={config}
autoFocus autoFocus
fileUpload={file => renderImage(file)} fileUpload={file => renderImage(file)}
value={initialValue} value=""
targetFormat="JSON" targetFormat="JSON"
// readonly // readonly
layout={HhmiLayout} layout={HhmiLayout}
......
import { AbstractNodeView } from 'wax-prosemirror-services';
export default class FeedBackNodeView extends AbstractNodeView {
static name() {
return 'feedback';
}
}
...@@ -12,6 +12,7 @@ class MultipleChoiceQuestion extends Tools { ...@@ -12,6 +12,7 @@ class MultipleChoiceQuestion extends Tools {
get run() { get run() {
return (state, dispatch) => { return (state, dispatch) => {
console.log(state);
const { from, to } = state.selection; const { from, to } = state.selection;
const { tr } = state; const { tr } = state;
......
import { Service } from 'wax-prosemirror-services'; import { Service } from 'wax-prosemirror-services';
import MultipleChoiceQuestion from './MultipleChoiceQuestion'; import MultipleChoiceQuestion from './MultipleChoiceQuestion';
import multipleChoiceNode from './schema/multipleChoiceNode'; import multipleChoiceNode from './schema/multipleChoiceNode';
// import feedBackNode from './schema/feedBackNode';
import QuestionComponent from './components/QuestionComponent'; import QuestionComponent from './components/QuestionComponent';
import FeedbackComponent from './components/FeedbackComponent'; // import FeedbackComponent from './components/FeedbackComponent';
import MultipleChoiceNodeView from './MultipleChoiceNodeView'; import MultipleChoiceNodeView from './MultipleChoiceNodeView';
// import FeedBackNodeView from './FeedBackNodeView';
class MultipleChoiceQuestionService extends Service { class MultipleChoiceQuestionService extends Service {
boot() {} boot() {}
...@@ -16,6 +18,10 @@ class MultipleChoiceQuestionService extends Service { ...@@ -16,6 +18,10 @@ class MultipleChoiceQuestionService extends Service {
multiple_choice: multipleChoiceNode, multiple_choice: multipleChoiceNode,
}); });
// createNode({
// feedback: feedBackNode,
// });
createNode({ createNode({
question_wrapper: { question_wrapper: {
group: 'block', group: 'block',
...@@ -47,7 +53,11 @@ class MultipleChoiceQuestionService extends Service { ...@@ -47,7 +53,11 @@ class MultipleChoiceQuestionService extends Service {
component: QuestionComponent, component: QuestionComponent,
context: this.app, context: this.app,
}); });
// addPortal({ nodeView, component: FeedbackComponent, context: this.app }); // addPortal({
// nodeView: FeedBackNodeView,
// component: FeedbackComponent,
// context: this.app,
// });
} }
} }
......
...@@ -6,6 +6,6 @@ import { WaxContext } from 'wax-prosemirror-core'; ...@@ -6,6 +6,6 @@ import { WaxContext } from 'wax-prosemirror-core';
import EditorComponent from './EditorComponent'; import EditorComponent from './EditorComponent';
export default ({ node, view, getPos }) => { export default ({ node, view, getPos }) => {
console.log(node); console.log(node, 'feedback');
return null; return <EditorComponent node={node} view={view} getPos={getPos} />;
}; };
...@@ -4,6 +4,7 @@ import styled from 'styled-components'; ...@@ -4,6 +4,7 @@ import styled from 'styled-components';
import { TextSelection } from 'prosemirror-state'; import { TextSelection } from 'prosemirror-state';
import { WaxContext } from 'wax-prosemirror-core'; import { WaxContext } from 'wax-prosemirror-core';
import EditorComponent from './EditorComponent'; import EditorComponent from './EditorComponent';
import FeedbackComponent from './FeedbackComponent';
const QuestionWrapper = styled.div` const QuestionWrapper = styled.div`
display: flex; display: flex;
...@@ -59,6 +60,7 @@ const Question = styled.div` ...@@ -59,6 +60,7 @@ const Question = styled.div`
`; `;
export default ({ node, view, getPos }) => { export default ({ node, view, getPos }) => {
console.log(node);
const context = useContext(WaxContext); const context = useContext(WaxContext);
const [showExplanation, setShowExplanation] = useState(false); const [showExplanation, setShowExplanation] = useState(false);
const [explanationValue, setExplanationValue] = useState(''); const [explanationValue, setExplanationValue] = useState('');
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment