Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kszkepzes-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Köpeczi-Bócz Gergely
kszkepzes-frontend
Commits
7354b866
Commit
7354b866
authored
6 years ago
by
Bereczki Sandor
Browse files
Options
Downloads
Patches
Plain Diff
Separated multiple solutions, Added solution validation for blank fields
parent
e8b6db9f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/forms/AddSolutionForm.js
+36
-13
36 additions, 13 deletions
src/components/forms/AddSolutionForm.js
src/components/pages/Homework.js
+6
-1
6 additions, 1 deletion
src/components/pages/Homework.js
with
42 additions
and
14 deletions
src/components/forms/AddSolutionForm.js
+
36
−
13
View file @
7354b866
...
...
@@ -3,6 +3,7 @@ import { Modal, Button, Form, Input, TextArea, Icon, Header } from 'semantic-ui-
import
{
connect
}
from
'
react-redux
'
;
import
{
addSolution
,
writeSolution
,
writeSolutionFile
,
addDocument
,
clearWrite
}
from
'
../../actions/homework
'
;
import
'
./Forms.css
'
;
import
ConfirmModal
from
'
../forms/ConfirmModal
'
;
class
AddSolutionForm
extends
Component
{
constructor
(
props
)
{
...
...
@@ -32,7 +33,7 @@ class AddSolutionForm extends Component {
}
>
<
Modal
.
Header
>
Új
megoldás
beadása
a
(
z
)
{
this
.
props
.
tasktitle
}
nevű
feladathoz
:
{
this
.
props
.
multiple
?
'
Másik
'
:
'
Új
'
}
megoldás
beadása
a
(
z
)
{
this
.
props
.
tasktitle
}
nevű
feladathoz
:
<
/Modal.Header
>
<
Modal
.
Content
>
<
Modal
.
Description
style
=
{{
marginBottom
:
'
2em
'
}}
>
...
...
@@ -72,18 +73,40 @@ class AddSolutionForm extends Component {
>
<
Icon
name
=
'
remove
'
/>
Mégse
<
/Button
>
<
Button
inverted
color
=
'
green
'
onClick
=
{()
=>
{
this
.
props
.
addSolution
({
task
,
accepted
,
corrected
,
note
,
name
,
description
,
file
,
});
this
.
setState
({
showModal
:
false
});
}}
>
<
Icon
name
=
'
checkmark
'
/>
Beadás
<
/Button
>
{
this
.
props
.
multiple
?
<
ConfirmModal
button
=
{
<
Button
disabled
=
{(
name
===
''
||
description
===
''
)}
inverted
color
=
'
green
'
>
<
Icon
name
=
'
checkmark
'
/>
Beadás
<
/Button
>
}
text
=
'
beadod az új megoldást, ami felülírja az előzőt
'
onAccept
=
{()
=>
{
this
.
props
.
addSolution
({
task
,
accepted
,
corrected
,
note
,
name
,
description
,
file
,
});
this
.
setState
({
showModal
:
false
});
}
}
/
>
:
<
Button
inverted
color
=
'
green
'
disabled
=
{(
name
===
''
||
description
===
''
)}
onClick
=
{()
=>
{
console
.
log
()
this
.
props
.
addSolution
({
task
,
accepted
,
corrected
,
note
,
name
,
description
,
file
,
});
this
.
setState
({
showModal
:
false
});
}
}
>
<
Icon
name
=
'
checkmark
'
/>
Beadás
<
/Button
>
}
<
/Modal.Actions
>
<
/Modal
>
);
...
...
This diff is collapsed.
Click to expand it.
src/components/pages/Homework.js
+
6
−
1
View file @
7354b866
...
...
@@ -115,7 +115,12 @@ class Homework extends Component {
}
>
<
Table
.
Cell
>
<
AddSolutionForm
taskid
=
{
task
.
id
}
tasktitle
=
{
task
.
title
}
taskdesc
=
{
task
.
text
}
/
>
<
AddSolutionForm
taskid
=
{
task
.
id
}
tasktitle
=
{
task
.
title
}
taskdesc
=
{
task
.
text
}
multiple
=
{
this
.
getTaskDisplayStyle
(
task
)
!==
'
can_submit
'
}
/
>
<
/Table.Cell
>
<
Table
.
Cell
>
{
moment
(
task
.
deadline
).
format
(
'
YYYY. MM. DD. HH:mm
'
)}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment