Skip to content
Snippets Groups Projects
Commit a80f3068 authored by Christos's avatar Christos
Browse files

Merge branch 'readonly-states' into 'master'

fix(services): add pure read only state to hhmi services

See merge request !409
parents 7e998970 9dd07f53
No related branches found
No related tags found
1 merge request!409fix(services): add pure read only state to hhmi services
Showing
with 176 additions and 75 deletions
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import styled from 'styled-components'; import styled, { css } from 'styled-components';
import { Wax } from 'wax-prosemirror-core'; import { Wax } from 'wax-prosemirror-core';
...@@ -16,16 +16,60 @@ const renderImage = file => { ...@@ -16,16 +16,60 @@ const renderImage = file => {
}); });
}; };
const NormalButton = styled.button`
left: 600px;
position: absolute;
top: 16px;
/* stylelint-disable-next-line order/properties-alphabetical-order */
${props =>
props.isActive &&
css`
background-color: gray;
color: white;
`}
`;
const ReadOnlyButton = styled.button` const ReadOnlyButton = styled.button`
left: 670px;
position: absolute;
top: 16px;
/* stylelint-disable-next-line order/properties-alphabetical-order */
${props =>
props.isActive &&
css`
background-color: gray;
color: white;
`}
`;
const TestModeButton = styled.button`
left: 760px;
position: absolute; position: absolute;
left: 600px;
top: 16px; top: 16px;
/* stylelint-disable-next-line order/properties-alphabetical-order */
${props =>
props.isActive &&
css`
background-color: gray;
color: white;
`}
`; `;
const SubmitButton = styled.button` const SubmitButton = styled.button`
left: 850px;
position: absolute; position: absolute;
left: 700px;
top: 16px; top: 16px;
/* stylelint-disable-next-line order/properties-alphabetical-order */
${props =>
props.isActive &&
css`
background-color: gray;
color: white;
`}
`; `;
const initialContent = `<p class="paragraph"></p> const initialContent = `<p class="paragraph"></p>
...@@ -55,32 +99,64 @@ const initialContent = `<p class="paragraph"></p> ...@@ -55,32 +99,64 @@ const initialContent = `<p class="paragraph"></p>
</div>`; </div>`;
const Hhmi = () => { const Hhmi = () => {
const [submited, isSubmited] = useState(false); const [submitted, isSubmitted] = useState(false);
const [readOnly, isReadOnly] = useState(false); const [readOnly, isReadOnly] = useState(false);
const [testMode, isTestMode] = useState(false);
const [content, setContent] = useState(initialContent); const [content, setContent] = useState(initialContent);
const normalQuestions = () => {
isReadOnly(false);
isTestMode(false);
isSubmitted(false);
setContent(editorRef.current.getContent());
};
const readOnlyQuestions = () => { const readOnlyQuestions = () => {
isReadOnly(true);
isTestMode(false);
isSubmitted(false);
setContent(editorRef.current.getContent()); setContent(editorRef.current.getContent());
};
const testModeQuestions = () => {
isReadOnly(true); isReadOnly(true);
isTestMode(true);
isSubmitted(false);
setContent(editorRef.current.getContent());
}; };
const submitQuestions = () => { const submitQuestions = () => {
setContent(editorRef.current.getContent());
isSubmited(true);
isReadOnly(true); isReadOnly(true);
isTestMode(false);
isSubmitted(true);
setContent(editorRef.current.getContent());
}; };
const editorRef = useRef(); const editorRef = useRef();
return ( return (
<> <>
<ReadOnlyButton onClick={readOnlyQuestions}>Read Only</ReadOnlyButton> <NormalButton isActive={!readOnly} onClick={normalQuestions}>
<SubmitButton onClick={submitQuestions}>Submit</SubmitButton> Normal
</NormalButton>
<ReadOnlyButton
isActive={readOnly && !submitted && !testMode}
onClick={readOnlyQuestions}
>
Read Only
</ReadOnlyButton>
<TestModeButton isActive={testMode} onClick={testModeQuestions}>
Test Mode
</TestModeButton>
<SubmitButton isActive={submitted} onClick={submitQuestions}>
Submit
</SubmitButton>
<Wax <Wax
config={config} config={config}
autoFocus autoFocus
ref={editorRef} ref={editorRef}
customValues={{ showFeedBack: submited }} customValues={{ showFeedBack: submitted, testMode }}
fileUpload={file => renderImage(file)} fileUpload={file => renderImage(file)}
value={content} value={content}
readonly={readOnly} readonly={readOnly}
......
...@@ -59,22 +59,23 @@ const EditorArea = styled.div` ...@@ -59,22 +59,23 @@ const EditorArea = styled.div`
`; `;
const WaxSurfaceScroll = styled.div` const WaxSurfaceScroll = styled.div`
padding: 25px 25% 0 25%;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
padding: 25px 25% 0 25%;
position: relative; position: relative;
width: 100%; width: 100%;
/* PM styles for main content*/ /* PM styles for main content*/
/* stylelint-disable-next-line order/properties-alphabetical-order */
${EditorElements}; ${EditorElements};
`; `;
const EditorContainer = styled.div` const EditorContainer = styled.div`
height: 100%; height: 100%;
width: 100%;
position: relative; position: relative;
width: 100%;
.ProseMirror { .ProseMirror {
box-shadow: 0 0 8px #ecedf1; box-shadow: 0 0 8px #ecedf1;
......
...@@ -96,6 +96,7 @@ const Wax = forwardRef((props, ref) => { ...@@ -96,6 +96,7 @@ const Wax = forwardRef((props, ref) => {
Wax.defaultProps = { Wax.defaultProps = {
config: { SchemaService: DefaultSchema, services: [] }, config: { SchemaService: DefaultSchema, services: [] },
customValues: {},
}; };
export default Wax; export default Wax;
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
"prosemirror-transform": "1.3.4", "prosemirror-transform": "1.3.4",
"prosemirror-view": "1.23.7", "prosemirror-view": "1.23.7",
"rc-switch": "^3.2.2", "rc-switch": "^3.2.2",
"react-dropdown": "^1.6.2",
"styled-components": "^5.3.0", "styled-components": "^5.3.0",
"use-deep-compare-effect": "^1.3.1", "use-deep-compare-effect": "^1.3.1",
"uuid": "^7.0.3", "uuid": "^7.0.3",
......
/* eslint-disable react/prop-types */ /* eslint-disable react/prop-types */
/* stylelint-disable declaration-no-important */
import React, { useContext, useRef, useEffect } from 'react'; import React, { useContext, useRef, useEffect } from 'react';
import styled from 'styled-components'; import styled from 'styled-components';
...@@ -147,9 +148,9 @@ const EditorComponent = ({ node, view, getPos }) => { ...@@ -147,9 +148,9 @@ const EditorComponent = ({ node, view, getPos }) => {
if (!tr.getMeta('fromOutside')) { if (!tr.getMeta('fromOutside')) {
const outerTr = view.state.tr; const outerTr = view.state.tr;
const offsetMap = StepMap.offset(getPos() + 1); const offsetMap = StepMap.offset(getPos() + 1);
for (let i = 0; i < transactions.length; i++) { for (let i = 0; i < transactions.length; i += 1) {
const { steps } = transactions[i]; const { steps } = transactions[i];
for (let j = 0; j < steps.length; j++) for (let j = 0; j < steps.length; j += 1)
outerTr.step(steps[j].map(offsetMap)); outerTr.step(steps[j].map(offsetMap));
} }
if (outerTr.docChanged) if (outerTr.docChanged)
...@@ -159,7 +160,7 @@ const EditorComponent = ({ node, view, getPos }) => { ...@@ -159,7 +160,7 @@ const EditorComponent = ({ node, view, getPos }) => {
return ( return (
<> <>
{isEditable ? ( {isEditable || (!isEditable && !main.props.customValues.testMode) ? (
<EditorWrapper> <EditorWrapper>
<div ref={editorRef} /> <div ref={editorRef} />
</EditorWrapper> </EditorWrapper>
......
...@@ -11,9 +11,7 @@ const FillTheGapContainer = styled.div` ...@@ -11,9 +11,7 @@ const FillTheGapContainer = styled.div`
`; `;
const FillTheGapWrapper = styled.div` const FillTheGapWrapper = styled.div`
margin-bottom: ;
margin: 0px 38px 15px 38px; margin: 0px 38px 15px 38px;
margin-top: 10px; margin-top: 10px;
`; `;
...@@ -24,6 +22,7 @@ export default ({ node, view, getPos }) => { ...@@ -24,6 +22,7 @@ export default ({ node, view, getPos }) => {
} = context; } = context;
const customProps = main.props.customValues; const customProps = main.props.customValues;
const { testMode } = customProps;
const isEditable = main.props.editable(editable => { const isEditable = main.props.editable(editable => {
return editable; return editable;
...@@ -36,7 +35,8 @@ export default ({ node, view, getPos }) => { ...@@ -36,7 +35,8 @@ export default ({ node, view, getPos }) => {
<span>Fill The Gap</span> <span>Fill The Gap</span>
<FillTheGapContainer className="fill-the-gap"> <FillTheGapContainer className="fill-the-gap">
<ContainerEditor getPos={getPos} node={node} view={view} /> <ContainerEditor getPos={getPos} node={node} view={view} />
{!(readOnly && customProps && !customProps.showFeedBack) && (
{!testMode && (
<FeedbackComponent <FeedbackComponent
getPos={getPos} getPos={getPos}
node={node} node={node}
......
...@@ -12,11 +12,12 @@ const Wrapper = styled.div` ...@@ -12,11 +12,12 @@ const Wrapper = styled.div`
${ReactDropDownStyles}; ${ReactDropDownStyles};
`; `;
const DropdownStyled = styled(Dropdown)` const DropdownStyled = styled(Dropdown)`
display: inline-flex;
cursor: not-allowed; cursor: not-allowed;
display: inline-flex;
margin-left: auto; margin-left: auto;
opacity: ${props => (props.select ? 1 : 0.4)}; opacity: ${props => (props.select ? 1 : 0.4)};
pointer-events: ${props => (props.select ? 'default' : 'none')}; pointer-events: ${props => (props.select ? 'default' : 'none')};
.Dropdown-control { .Dropdown-control {
border: none; border: none;
padding: 8px 30px 8px 10px; padding: 8px 30px 8px 10px;
...@@ -31,10 +32,11 @@ const DropdownStyled = styled(Dropdown)` ...@@ -31,10 +32,11 @@ const DropdownStyled = styled(Dropdown)`
} }
.Dropdown-menu { .Dropdown-menu {
width: 102%; align-items: flex-start;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; width: 102%;
.Dropdown-option { .Dropdown-option {
width: 100%; width: 100%;
} }
...@@ -85,7 +87,7 @@ const DropComponent = ({ getPos, node, view }) => { ...@@ -85,7 +87,7 @@ const DropComponent = ({ getPos, node, view }) => {
placeholder="Select option" placeholder="Select option"
select select
value={ value={
selectedOption === 'undedfined' ? 'Select Option' : selectedOption selectedOption === 'undefined' ? 'Select Option' : selectedOption
} }
/> />
</Wrapper> </Wrapper>
......
...@@ -29,10 +29,10 @@ const QuestionWrapper = styled.div` ...@@ -29,10 +29,10 @@ const QuestionWrapper = styled.div`
`; `;
const ActionButton = styled.button` const ActionButton = styled.button`
height: 24px;
border: none;
background: transparent; background: transparent;
border: none;
cursor: pointer; cursor: pointer;
height: 24px;
padding-left: 0; padding-left: 0;
`; `;
...@@ -53,27 +53,27 @@ const OptionArea = styled.div` ...@@ -53,27 +53,27 @@ const OptionArea = styled.div`
ul { ul {
display: flex; display: flex;
flex-wrap: wrap;
flex-direction: row; flex-direction: row;
flex-wrap: wrap;
margin: 0; margin: 0;
padding: 0; padding: 0;
li { li {
list-style-type: none; list-style-type: none;
padding-right: 7px;
padding-bottom: 7px; padding-bottom: 7px;
padding-right: 7px;
span { span {
background: #535e76; background: #535e76;
border-radius: 12px;
color: white; color: white;
padding: 3px 3px 3px 10px; padding: 3px 3px 3px 10px;
border-radius: 12px;
}
buttton {
} }
svg { svg {
fill: white; fill: white;
width: 16px;
height: 16px; height: 16px;
width: 16px;
} }
} }
} }
...@@ -81,9 +81,11 @@ const OptionArea = styled.div` ...@@ -81,9 +81,11 @@ const OptionArea = styled.div`
const AddOption = styled.div` const AddOption = styled.div`
display: flex; display: flex;
input { input {
border: none; border: none;
border-bottom: 1px solid black; border-bottom: 1px solid black;
&:focus { &:focus {
outline: none; outline: none;
} }
...@@ -93,21 +95,21 @@ const AddOption = styled.div` ...@@ -93,21 +95,21 @@ const AddOption = styled.div`
font-style: italic; font-style: italic;
} }
} }
button { button {
background: #fff;
border: 1px solid #535e76; border: 1px solid #535e76;
cursor: pointer;
color: #535e76; color: #535e76;
cursor: pointer;
margin-left: 20px; margin-left: 20px;
background: #fff;
padding: 4px 8px 4px 8px; padding: 4px 8px 4px 8px;
&:hover { &:hover {
background: #535e76;
border: 1px solid #535e76; border: 1px solid #535e76;
color: #fff;
cursor: pointer; cursor: pointer;
color: #535e76;
margin-right: 20px; margin-right: 20px;
background: #fff;
background: #535e76;
color: #fff;
padding: 4px 8px 4px 8px; padding: 4px 8px 4px 8px;
} }
} }
...@@ -136,7 +138,7 @@ export default ({ node, view, getPos }) => { ...@@ -136,7 +138,7 @@ export default ({ node, view, getPos }) => {
useEffect(() => { useEffect(() => {
const allNodes = getNodes(main); const allNodes = getNodes(main);
/*TEMP TO SAVE NODE OPTIONS TODO: SAVE IN CONTEXT OPTIONS*/ /* TEMP TO SAVE NODE OPTIONS TODO: SAVE IN CONTEXT OPTIONS */
saveInChildOptions(allNodes); saveInChildOptions(allNodes);
if (!addingOption) return; if (!addingOption) return;
...@@ -190,6 +192,7 @@ export default ({ node, view, getPos }) => { ...@@ -190,6 +192,7 @@ export default ({ node, view, getPos }) => {
singleNode.node.content.content.forEach(parentNodes => { singleNode.node.content.content.forEach(parentNodes => {
parentNodes.forEach(optionNode => { parentNodes.forEach(optionNode => {
if (optionNode.type.name === 'matching_option') if (optionNode.type.name === 'matching_option')
/* eslint-disable-next-line no-param-reassign */
optionNode.attrs.options = options; optionNode.attrs.options = options;
}); });
}); });
...@@ -204,7 +207,8 @@ export default ({ node, view, getPos }) => { ...@@ -204,7 +207,8 @@ export default ({ node, view, getPos }) => {
<QuestionWrapper> <QuestionWrapper>
<ContainerEditor getPos={getPos} node={node} view={view} /> <ContainerEditor getPos={getPos} node={node} view={view} />
</QuestionWrapper> </QuestionWrapper>
{!readOnly && ( {(!readOnly ||
(readOnly && !customProps.testMode && !customProps.showFeedBack)) && (
<CreateOptions> <CreateOptions>
<OptionArea> <OptionArea>
{options.length > 0 && ( {options.length > 0 && (
...@@ -215,12 +219,14 @@ export default ({ node, view, getPos }) => { ...@@ -215,12 +219,14 @@ export default ({ node, view, getPos }) => {
<li key={option.value}> <li key={option.value}>
<span> <span>
{option.label} &nbsp; {option.label} &nbsp;
<ActionButton {!readOnly && (
onClick={() => removeOption(option.value)} <ActionButton
type="button" onClick={() => removeOption(option.value)}
> type="button"
<StyledIconAction name="deleteOutlined" /> >
</ActionButton> <StyledIconAction name="deleteOutlined" />
</ActionButton>
)}
</span> </span>
</li> </li>
); );
...@@ -228,22 +234,26 @@ export default ({ node, view, getPos }) => { ...@@ -228,22 +234,26 @@ export default ({ node, view, getPos }) => {
</ul> </ul>
)} )}
</OptionArea> </OptionArea>
<AddOption>
<input {!readOnly && (
onChange={updateOptionText} <AddOption>
onKeyPress={handleKeyDown} <input
placeholder="Type an option ..." onChange={updateOptionText}
ref={addOptionRef} onKeyPress={handleKeyDown}
type="text" placeholder="Type an option ..."
value={optionText} ref={addOptionRef}
/> type="text"
<button onClick={addOption} type="button"> value={optionText}
Add Option />
</button> <button onClick={addOption} type="button">
</AddOption> Add Option
</button>
</AddOption>
)}
</CreateOptions> </CreateOptions>
)} )}
{!(readOnly && !customProps.showFeedBack) && ( {(!(readOnly && !customProps.showFeedBack) ||
(readOnly && !customProps.testMode && !customProps.showFeedBack)) && (
<FeedbackComponent <FeedbackComponent
getPos={getPos} getPos={getPos}
node={node} node={node}
......
/* eslint-disable react/prop-types */ /* eslint-disable react/prop-types */
import React, { useContext, useState } from 'react'; import React, { useContext } from 'react';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import { TextSelection } from 'prosemirror-state'; import { TextSelection } from 'prosemirror-state';
import { Fragment } from 'prosemirror-model'; import { Fragment } from 'prosemirror-model';
...@@ -13,28 +13,28 @@ import ReadOnlyDropDownComponent from './ReadOnlyDropDownComponent'; ...@@ -13,28 +13,28 @@ import ReadOnlyDropDownComponent from './ReadOnlyDropDownComponent';
const Option = styled.div` const Option = styled.div`
display: flex; display: flex;
flex-direction: row; flex-direction: row;
width: 100%;
padding-bottom: 10px; padding-bottom: 10px;
width: 100%;
`; `;
const ButtonsContainer = styled.div` const ButtonsContainer = styled.div`
width: 7%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
width: 7%;
`; `;
const DropDownContainer = styled.div` const DropDownContainer = styled.div`
display: flex; display: flex;
justify-content: center;
flex-direction: column; flex-direction: column;
justify-content: center;
`; `;
const ActionButton = styled.button` const ActionButton = styled.button`
height: 24px;
border: none;
background: transparent; background: transparent;
border: none;
cursor: pointer; cursor: pointer;
height: 24px;
padding-left: 0; padding-left: 0;
`; `;
...@@ -44,9 +44,9 @@ const StyledIconAction = styled(Icon)` ...@@ -44,9 +44,9 @@ const StyledIconAction = styled(Icon)`
`; `;
const AnswerContainer = styled.div` const AnswerContainer = styled.div`
margin-left: 10px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-left: 10px;
`; `;
const CorrectAnswer = styled.span` const CorrectAnswer = styled.span`
span { span {
...@@ -72,6 +72,7 @@ export default ({ node, view, getPos }) => { ...@@ -72,6 +72,7 @@ export default ({ node, view, getPos }) => {
const readOnly = !isEditable; const readOnly = !isEditable;
const customProps = main.props.customValues; const customProps = main.props.customValues;
const { testMode, showFeedBack } = customProps;
const addAnswer = () => { const addAnswer = () => {
const nodeId = node.attrs.id; const nodeId = node.attrs.id;
...@@ -133,15 +134,15 @@ export default ({ node, view, getPos }) => { ...@@ -133,15 +134,15 @@ export default ({ node, view, getPos }) => {
)} )}
<EditorComponent getPos={getPos} node={node} view={view} /> <EditorComponent getPos={getPos} node={node} view={view} />
<DropDownContainer> <DropDownContainer>
{!readOnly && ( {(!readOnly || (readOnly && !testMode && !showFeedBack)) && (
<DropDownComponent getPos={getPos} node={node} view={view} /> <DropDownComponent getPos={getPos} node={node} view={view} />
)} )}
{readOnly && customProps && !customProps.showFeedBack && ( {readOnly && testMode && !showFeedBack && (
<ReadOnlyDropDownComponent getPos={getPos} node={node} view={view} /> <ReadOnlyDropDownComponent getPos={getPos} node={node} view={view} />
)} )}
{readOnly && customProps && customProps.showFeedBack && ( {readOnly && showFeedBack && (
<AnswerContainer> <AnswerContainer>
<CorrectAnswer> <CorrectAnswer>
Correct : &nbsp;{correct && <span>{correct.label} </span>} Correct : &nbsp;{correct && <span>{correct.label} </span>}
......
...@@ -172,6 +172,7 @@ export default ({ node, view, getPos }) => { ...@@ -172,6 +172,7 @@ export default ({ node, view, getPos }) => {
}; };
const readOnly = !isEditable; const readOnly = !isEditable;
const { testMode } = customProps;
return ( return (
<Wrapper> <Wrapper>
...@@ -184,7 +185,7 @@ export default ({ node, view, getPos }) => { ...@@ -184,7 +185,7 @@ export default ({ node, view, getPos }) => {
<QuestionData> <QuestionData>
<EditorComponent getPos={getPos} node={node} view={view} /> <EditorComponent getPos={getPos} node={node} view={view} />
</QuestionData> </QuestionData>
{!(readOnly && customProps && !customProps.showFeedBack) && ( {!testMode && (
<FeedbackComponent <FeedbackComponent
getPos={getPos} getPos={getPos}
node={node} node={node}
......
...@@ -15,6 +15,7 @@ const AnswerContainer = styled.span` ...@@ -15,6 +15,7 @@ const AnswerContainer = styled.span`
const Correct = styled.span` const Correct = styled.span`
margin-right: 10px; margin-right: 10px;
span { span {
color: #008000; color: #008000;
} }
...@@ -22,6 +23,7 @@ const Correct = styled.span` ...@@ -22,6 +23,7 @@ const Correct = styled.span`
const Answer = styled.span` const Answer = styled.span`
margin-right: 10px; margin-right: 10px;
span { span {
color: ${props => (props.isCorrect ? ' #008000' : 'red')}; color: ${props => (props.isCorrect ? ' #008000' : 'red')};
} }
...@@ -29,15 +31,15 @@ const Answer = styled.span` ...@@ -29,15 +31,15 @@ const Answer = styled.span`
const StyledIconCorrect = styled(Icon)` const StyledIconCorrect = styled(Icon)`
fill: #008000; fill: #008000;
pointer-events: none;
height: 24px; height: 24px;
pointer-events: none;
width: 24px; width: 24px;
`; `;
const StyledIconWrong = styled(Icon)` const StyledIconWrong = styled(Icon)`
fill: red; fill: red;
pointer-events: none;
height: 24px; height: 24px;
pointer-events: none;
width: 24px; width: 24px;
`; `;
const YesNoSwitch = ({ const YesNoSwitch = ({
...@@ -48,7 +50,9 @@ const YesNoSwitch = ({ ...@@ -48,7 +50,9 @@ const YesNoSwitch = ({
checked, checked,
checkedAnswerMode, checkedAnswerMode,
}) => { }) => {
if (customProps && customProps.showFeedBack) { const { testMode, showFeedBack } = customProps;
if (showFeedBack) {
const correct = node.attrs.correct ? 'YES' : 'NO'; const correct = node.attrs.correct ? 'YES' : 'NO';
const answer = node.attrs.answer ? 'YES' : 'NO'; const answer = node.attrs.answer ? 'YES' : 'NO';
const isCorrect = node.attrs.correct === node.attrs.answer; const isCorrect = node.attrs.correct === node.attrs.answer;
...@@ -68,10 +72,14 @@ const YesNoSwitch = ({ ...@@ -68,10 +72,14 @@ const YesNoSwitch = ({
</AnswerContainer> </AnswerContainer>
); );
} }
return ( return (
<StyledSwitch <StyledSwitch
checked={isEditable ? checked : checkedAnswerMode} checked={
isEditable || (!isEditable && !testMode) ? checked : checkedAnswerMode
}
checkedChildren="YES" checkedChildren="YES"
disabled={!isEditable && !testMode}
label="Correct?" label="Correct?"
labelPosition="left" labelPosition="left"
onChange={handleChange} onChange={handleChange}
......
...@@ -6,9 +6,7 @@ import ContainerEditor from './ContainerEditor'; ...@@ -6,9 +6,7 @@ import ContainerEditor from './ContainerEditor';
import FeedbackComponent from './FeedbackComponent'; import FeedbackComponent from './FeedbackComponent';
const MultipleDropDownpWrapper = styled.div` const MultipleDropDownpWrapper = styled.div`
margin-bottom: ;
margin: 0px 38px 15px 38px; margin: 0px 38px 15px 38px;
margin-top: 10px; margin-top: 10px;
`; `;
...@@ -30,13 +28,14 @@ export default ({ node, view, getPos }) => { ...@@ -30,13 +28,14 @@ export default ({ node, view, getPos }) => {
}); });
const readOnly = !isEditable; const readOnly = !isEditable;
const { testMode } = customProps;
return ( return (
<MultipleDropDownpWrapper> <MultipleDropDownpWrapper>
<span>Multiple Drop Down</span> <span>Multiple Drop Down</span>
<MultipleDropDownpContainer className="multiple-drop-down"> <MultipleDropDownpContainer className="multiple-drop-down">
<ContainerEditor getPos={getPos} node={node} view={view} /> <ContainerEditor getPos={getPos} node={node} view={view} />
{!(readOnly && customProps && !customProps.showFeedBack) && ( {!testMode && (
<FeedbackComponent <FeedbackComponent
getPos={getPos} getPos={getPos}
node={node} node={node}
......
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