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
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
KSZK
DevTeam
kszkepzes
old
kszkepzes-frontend
Commits
d5a74419
Commit
d5a74419
authored
6 years ago
by
Bsandor453
Browse files
Options
Downloads
Patches
Plain Diff
Refactored some falsy checks
parent
64910744
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/forms/CorrectSolutionForm.js
+10
-11
10 additions, 11 deletions
src/components/forms/CorrectSolutionForm.js
with
10 additions
and
11 deletions
src/components/forms/CorrectSolutionForm.js
+
10
−
11
View file @
d5a74419
...
@@ -23,14 +23,13 @@ class CorrectSolutionForm extends Component {
...
@@ -23,14 +23,13 @@ class CorrectSolutionForm extends Component {
}
=
this
.
props
;
}
=
this
.
props
;
const
taskSolutionsProfile
=
const
taskSolutionsProfile
=
taskSolutions
.
filter
(
solution
=>
solution
.
created_by
===
studentId
);
taskSolutions
.
filter
(
solution
=>
solution
.
created_by
===
studentId
);
const
relevantSolution
=
taskSolutionsProfile
[
taskSolutionsProfile
.
length
-
1
];
const
relevantSolution
=
taskSolutionsProfile
.
slice
(
-
1
)[
0
];
const
relevantDocuments
=
this
.
props
.
homeworks
.
documents
.
filter
(
document
=>
const
relevantDocuments
=
this
.
props
.
homeworks
.
documents
.
filter
(
document
=>
document
.
solution
===
relevantSolution
.
id
).
filter
(
document
=>
document
.
solution
===
relevantSolution
.
id
).
filter
(
document
=>
document
.
uploaded_by_name
===
studentFullName
);
document
.
uploaded_by_name
===
studentFullName
);
const
relevantDocument
=
relevantDocuments
[
relevantDocuments
.
length
-
1
];
const
relevantDocument
=
relevantDocuments
.
slice
(
-
1
)[
0
];
let
fileLink
;
let
fileLink
;
if
(
relevantDocument
!==
undefined
&&
relevantDocument
!==
null
&&
if
(
relevantDocument
&&
relevantDocument
.
file
)
{
relevantDocument
.
file
!==
undefined
&&
relevantDocument
.
file
!==
null
)
{
fileLink
=
`/media
${
relevantDocument
.
file
.
split
(
'
media
'
)[
1
]}
`
;
fileLink
=
`/media
${
relevantDocument
.
file
.
split
(
'
media
'
)[
1
]}
`
;
}
else
{
}
else
{
fileLink
=
null
;
fileLink
=
null
;
...
@@ -69,15 +68,15 @@ class CorrectSolutionForm extends Component {
...
@@ -69,15 +68,15 @@ class CorrectSolutionForm extends Component {
:
<
p
>
Nincs
cím
.
<
/p
>
:
<
p
>
Nincs
cím
.
<
/p
>
}
}
<
Header
as
=
'
h5
'
>
A
megoldás
leírása
:
<
/Header
>
<
Header
as
=
'
h5
'
>
A
megoldás
leírása
:
<
/Header
>
{
(
relevantDocument
!==
undefined
&&
relevantDocument
!==
null
&&
{(
relevantDocument
&&
relevantDocument
.
description
)
relevantDocument
.
description
!==
undefined
&&
relevantDocument
.
description
!==
null
&&
relevantDocument
.
description
!==
''
)
?
relevantDocument
.
description
.
split
(
'
\n
'
).
map
(
s
=>
(
<
p
key
=
{
Math
.
random
()}
>
{
s
}
<
/p>
)
)
?
relevantDocument
.
description
.
split
(
'
\n
'
).
map
(
s
=>
(
<
p
key
=
{
Math
.
random
()}
>
{
s
}
<
/p>
)
)
:
<
p
>
Nincs
leírás
.
<
/p>
}
:
<
p
>
Nincs
leírás
.
<
/p
>
}
<
Header
as
=
'
h5
'
>
A
beadott
dokumentum
:
<
/Header
>
<
Header
as
=
'
h5
'
>
A
beadott
dokumentum
:
<
/Header
>
{
fileLink
===
null
?
{
fileLink
<
p
>
Nincs
fájl
.
<
/p>
:
?
<
a
href
=
{
fileLink
}
>
Fájl
letöltése
<
/a
>
<
a
href
=
{
fileLink
}
>
Fájl
letöltése
<
/a>
}
:
<
p
>
Nincs
fájl
.
<
/p
>
}
<
Header
as
=
'
h5
'
>
Kijavítás
állapotának
változtatása
:
<
/Header
>
<
Header
as
=
'
h5
'
>
Kijavítás
állapotának
változtatása
:
<
/Header
>
<
Button
<
Button
color
=
'
orange
'
color
=
'
orange
'
...
...
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