Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DCST1008-studass-eksempel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Alexander Moltu
DCST1008-studass-eksempel
Commits
aa77785c
Commit
aa77785c
authored
4 years ago
by
Mustafa Aldoori
Browse files
Options
Downloads
Patches
Plain Diff
Final product
parent
8d5bcbe9
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
public/index.html
+1
-1
1 addition, 1 deletion
public/index.html
src/taskCompleted.js
+34
-26
34 additions, 26 deletions
src/taskCompleted.js
src/taskList.js
+21
-17
21 additions, 17 deletions
src/taskList.js
with
56 additions
and
44 deletions
public/index.html
+
1
−
1
View file @
aa77785c
...
...
@@ -2,7 +2,7 @@
<html>
<head>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<!--
<meta name="viewport" content="width=device-width, initial-scale=1"
/> --
>
<title>
Example Application
</title>
<link
rel=
"stylesheet"
href=
"bootstrap.min.css"
/>
<link
rel=
"stylesheet"
href=
"Styling.css"
/>
...
...
This diff is collapsed.
Click to expand it.
src/taskCompleted.js
+
34
−
26
View file @
aa77785c
...
...
@@ -23,7 +23,7 @@ const history = createHashHistory();
class
TaskCompleted
extends
Component
{
tasks
=
[];
categorys
=
[]
categorys
=
[]
;
onlyPressedOnce
=
false
;
onlyPressedOncePrio
=
false
;
onlyPressedOnceDeadline
=
false
;
...
...
@@ -37,10 +37,10 @@ class TaskCompleted extends Component {
Task
-
name
<
Icon
.
Alfa
onClick
=
{
this
.
sortAlfa
}
/
>
<
/Column
>
<
Column
>
Priority
<
Icon
.
Prio
onClick
=
{
this
.
prioSort
}
/
>
Priority
<
Icon
.
Prio
onClick
=
{
this
.
prioSort
}
/
>
<
/Column
>
<
Column
>
Category
<
Icon
.
Prio
style
=
{{
pointerEvents
:
'
none
'
}}
onClick
=
{
this
.
sortCategory
}
/
>
Category
<
Icon
.
Prio
style
=
{{
pointerEvents
:
'
none
'
}}
onClick
=
{
this
.
sortCategory
}
/
>
<
/Column
>
<
Column
>
Completed
<
/Column
>
<
Column
>
<
/Column
>
...
...
@@ -48,29 +48,37 @@ class TaskCompleted extends Component {
<
br
/>
{
this
.
tasks
.
map
((
task
)
=>
(
<
div
key
=
{
task
.
id
}
className
=
"
taskdiv
"
>
<
Row
key
=
{
task
.
id
}
>
<
Column
title
=
"
Task-name
"
>
<
NavLink
className
=
"
catobject
"
to
=
{
'
/completed/
'
+
task
.
id
}
>
{
task
.
name
}
<
/NavLink
>
<
/Column
>
<
Column
style
=
{{
marginTop
:
'
0.2rem
'
}}
>
{
task
.
priority
?
<
Icon
.
Priority
style
=
{{
pointerEvents
:
'
none
'
}}
/> : <Icon.NoPriority style={{pointerEvents: 'none'}} /
>
}
<
/Column
>
<
Column
style
=
{{
marginTop
:
'
0.31rem
'
}}
title
=
"
Category
"
>
{
this
.
categorys
.
map
((
cate
)
=>
(
task
.
categoryId
==
cate
.
id
?
cate
.
name
:
"
"
))}
<
/Column
>
<
Column
style
=
{{
marginTop
:
'
0.31rem
'
}}
>
{
task
.
Completedate
}
<
/Column
>
<
Column
style
=
{{
marginTop
:
'
0.3rem
'
}}
>
<
div
<
Row
key
=
{
task
.
id
}
>
<
Column
title
=
"
Task-name
"
>
<
NavLink
className
=
"
catobject
"
to
=
{
'
/completed/
'
+
task
.
id
}
>
{
task
.
name
}
<
/NavLink
>
<
/Column
>
<
Column
style
=
{{
marginTop
:
'
0.2rem
'
}}
>
{
task
.
priority
?
(
<
Icon
.
Priority
style
=
{{
pointerEvents
:
'
none
'
}}
/
>
)
:
(
<
Icon
.
NoPriority
style
=
{{
pointerEvents
:
'
none
'
}}
/
>
)}
<
/Column
>
<
Column
style
=
{{
marginTop
:
'
0.31rem
'
}}
title
=
"
Category
"
>
{
this
.
categorys
.
map
((
cate
)
=>
(
task
.
categoryId
==
cate
.
id
?
cate
.
name
:
'
'
))}
<
/Column
>
<
Column
style
=
{{
marginTop
:
'
0.31rem
'
}}
>
{
task
.
Completedate
}
<
/Column
>
<
Column
style
=
{{
marginTop
:
'
0.3rem
'
}}
>
<
div
alt
=
"
Task delete button
"
title
=
"
Press to delete
"
style
=
{{
display
:
'
inline
'
}}
>
<
Icon
.
Trash
onClick
=
{()
=>
{
this
.
delete
(
task
);
}}
/
>
<
/div
>
<
/Column
>
<
/Row
>
<
Icon
.
Trash
onClick
=
{()
=>
{
this
.
delete
(
task
);
}}
/
>
<
/div
>
<
/Column
>
<
/Row
>
<
/div
>
))}
<
/Card
>
...
...
@@ -83,9 +91,9 @@ class TaskCompleted extends Component {
.
getTasks
()
.
then
((
tasks
)
=>
{
this
.
tasks
=
tasks
;
categoryService
.
getCategorys
().
then
((
category
)
=>
{
this
.
categorys
=
category
})
categoryService
.
getCategorys
().
then
((
category
)
=>
{
this
.
categorys
=
category
;
})
;
})
.
catch
((
error
)
=>
{
Alert
.
danger
(
error
.
message
);
...
...
@@ -205,4 +213,4 @@ class TaskCompleted extends Component {
}
}
export
default
TaskCompleted
;
// Exports this Componant to be used in index.js
export
default
TaskCompleted
;
// Exports this Componant to be used in index.js
This diff is collapsed.
Click to expand it.
src/taskList.js
+
21
−
17
View file @
aa77785c
...
...
@@ -68,29 +68,33 @@ class TaskList extends Component {
<
/Column
>
<
Column
>
{
task
.
priority
?
(
<
Icon
.
Priority
onClick
=
{()
=>
{
// Changes the priority when the star icon is pressed
task
.
priority
=
0
;
this
.
prioSave
(
task
);
}}
style
=
{{
marginTop
:
'
95%
'
}}
/
>
<
div
title
=
"
Press to untoggle priority
"
alt
=
"
Task priority
"
>
<
Icon
.
Priority
onClick
=
{()
=>
{
// Changes the priority when the star icon is pressed
task
.
priority
=
0
;
this
.
prioSave
(
task
);
}}
style
=
{{
marginTop
:
'
95%
'
}}
/
>
<
/div
>
)
:
(
<
Icon
.
NoPriority
onClick
=
{()
=>
{
// Changes the priority when the star icon is pressed
task
.
priority
=
1
;
this
.
prioSave
(
task
);
}}
style
=
{{
marginTop
:
'
95%
'
}}
/
>
<
div
title
=
"
Press to toggle priority
"
alt
=
"
Task priority
"
>
<
Icon
.
NoPriority
onClick
=
{()
=>
{
// Changes the priority when the star icon is pressed
task
.
priority
=
1
;
this
.
prioSave
(
task
);
}}
style
=
{{
marginTop
:
'
95%
'
}}
/
>
<
/div
>
)}
<
/Column
>
<
Column
title
=
"
Category
"
>
<
div
style
=
{{
marginTop
:
'
23%
'
}}
>
{
this
.
categorys
.
map
((
cate
)
=>
(
task
.
categoryId
==
cate
.
id
?
cate
.
name
:
'
'
))}{
'
'
}
{
/*Addes which category each task belongs to */
}
{
/*Addes which category each task belongs to */
}
<
/div
>
<
/Column
>
<
Column
>
...
...
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