Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
survey
Commits
5b5755eb
Commit
5b5755eb
authored
Jan 16, 2023
by
Lee SeoYeon
Browse files
title, content, text 입력시 확인체크 할 수 있도록 완료
parent
34980609
Changes
1
Show whitespace changes
Inline
Side-by-side
frontend/src/surveys/Question.tsx
View file @
5b5755eb
...
...
@@ -18,12 +18,17 @@ export const Question = ({
const
isEditing
=
question
.
isEditing
;
async
function
handleEditComplete
()
{
if
(
question
.
content
.
length
<
0
||
question
.
title
.
length
>
1
)
{
question
.
isEditing
=
false
;
handleQuestion
(
question
);
}
switch
(
question
.
type
)
{
case
"
rating
"
:
case
"
checkbox
"
:
case
"
radio
"
:
case
"
dropdown
"
:
question
.
content
.
choices
.
map
((
choice
)
=>
{
if
(
question
.
title
.
length
<
1
||
choice
.
text
.
trim
()
===
""
)
{
if
(
question
.
title
.
length
<
1
||
question
.
content
.
length
<
0
||
choice
.
text
.
trim
()
===
""
)
{
alert
(
"
빈칸을 채워주세요
"
);
return
(
question
.
isEditing
=
true
);
}
else
{
...
...
@@ -32,6 +37,17 @@ export const Question = ({
handleQuestion
(
question
);
}
});
break
;
default
:
if
(
question
.
title
===
""
)
{
alert
(
"
제목을 입력해주세요
"
);
question
.
isEditing
=
true
;
}
else
{
question
.
isEditing
=
false
;
handleQuestion
(
question
);
}
break
;
}
}
function
handleSelect
(
event
:
React
.
ChangeEvent
<
HTMLSelectElement
>
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment