Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TDDD27_Advance Web Programming
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Muhammad Ismail
TDDD27_Advance Web Programming
Commits
37b9660c
Commit
37b9660c
authored
4 years ago
by
Ismail
Browse files
Options
Downloads
Patches
Plain Diff
Manage shift modified. fixes button actions
parent
66e8c52e
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
employeemanagement/src/components/dashboard/Dashboard.js
+1
-1
1 addition, 1 deletion
employeemanagement/src/components/dashboard/Dashboard.js
employeemanagement/src/components/layout/ManageShift.js
+46
-47
46 additions, 47 deletions
employeemanagement/src/components/layout/ManageShift.js
with
47 additions
and
48 deletions
employeemanagement/src/components/dashboard/Dashboard.js
+
1
−
1
View file @
37b9660c
...
...
@@ -19,7 +19,7 @@ class Dashboard extends Component {
const
todayList
=
list
&&
list
.
length
?
(
list
.
filter
(
l
=>
{
return
l
.
D
ate
===
moment
().
format
(
'
MM/DD/YYYY
'
)
return
l
.
d
ate
===
moment
().
format
(
'
MM/DD/YYYY
'
)
})
)
:
null
...
...
This diff is collapsed.
Click to expand it.
employeemanagement/src/components/layout/ManageShift.js
+
46
−
47
View file @
37b9660c
...
...
@@ -14,9 +14,7 @@ class ManageShift extends Component {
endShift
:
''
,
stateSet
:
false
}
componentDidMount
()
{
//console.log(this.props.todayList)
}
UNSAFE_componentWillReceiveProps
()
{
if
(
this
.
props
.
todayList
&&
!
this
.
state
.
stateSet
)
{
this
.
setState
(
this
.
props
.
todayList
[
0
],
()
=>
{
...
...
@@ -46,52 +44,53 @@ class ManageShift extends Component {
}
}
render
()
{
return
(
const
worklist
=
this
.
props
.
todayList
&&
this
.
props
.
todayList
.
length
?
(
this
.
props
.
todayList
&&
this
.
props
.
todayList
.
map
(
w
=>
{
const
startWork
=
w
.
startShift
!==
''
?
(
<
button
disabled
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
>
Start
Work
<
/button
>
)
:
(
<
button
onClick
=
{
this
.
handleCreatEvent
}
id
=
"
startShift
"
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
>
Start
Work
<
/button
>
)
const
startBreak
=
w
.
startBreak
!==
''
?
(
<
button
disabled
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
>
Start
Lunch
Break
<
/button
>
)
:
(
<
button
onClick
=
{
this
.
handleUpdateEvent
}
id
=
"
startBreak
"
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
>
Start
Lunch
Break
<
/button
>
)
const
endBreak
=
w
.
endBreak
!==
''
?
(
<
button
disabled
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
>
Lunch
Break
Finish
<
/button
>
)
:
(
<
button
onClick
=
{
this
.
handleUpdateEvent
}
id
=
"
endBreak
"
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
>
Lunch
Break
Finish
<
/button
>
)
const
endWork
=
w
.
endShift
!==
''
?
(
<
button
disabled
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
>
Close
Work
<
/button
>
)
:
(
<
button
onClick
=
{
this
.
handleUpdateEvent
}
id
=
"
endShift
"
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
>
Close
Work
<
/button
>
)
return
(
<
div
className
=
"
row
"
key
=
{
w
.
id
}
>
<
div
className
=
"
col-3 text-center
"
>
{
startWork
}
<
/div
>
<
div
className
=
"
col-3 text-center
"
>
{
startBreak
}
<
/div
>
<
div
className
=
"
col-3 text-center
"
>
{
endBreak
}
<
/div
>
<
div
className
=
"
col-3 text-center
"
>
{
endWork
}
<
/div
>
<
/div
>
)
})
):(
<
div
className
=
"
row
"
>
<
div
className
=
"
col-3 text-center
"
>
<
button
onClick
=
{
this
.
handleCreatEvent
}
disabled
=
{
this
.
state
.
startShift
+
""
!=
""
}
id
=
"
startShift
"
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
>
Start
Work
<
/button
>
<
/div
>
<
div
className
=
"
col-3 text-center
"
>
<
button
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
disabled
=
{
this
.
state
.
startShift
+
""
==
""
||
this
.
state
.
startBreak
+
""
!=
""
}
onClick
=
{
this
.
handleUpdateEvent
}
id
=
"
startBreak
"
>
Start
Lunch
Break
<
/button
>
<
/div
>
<
div
className
=
"
col-3 text-center
"
>
<
button
disabled
=
{
this
.
state
.
startShift
+
""
==
""
||
this
.
state
.
startBreak
+
""
==
""
||
this
.
state
.
endBreak
+
""
!=
""
}
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
onClick
=
{
this
.
handleUpdateEvent
}
id
=
"
endBreak
"
>
Lunch
Break
Finish
{
this
.
state
.
endBreak
==
""
}
<
/button
>
<
/div
>
<
div
className
=
"
col-3 text-center
"
>
<
button
disabled
=
{
this
.
state
.
startShift
+
""
==
""
||
this
.
state
.
startBreak
+
""
==
""
||
this
.
state
.
endBreak
+
""
==
""
||
this
.
state
.
endShift
+
""
!=
""
}
type
=
"
button
"
onClick
=
{
this
.
handleUpdateEvent
}
className
=
"
btn btn-success btn-sm btn-special
"
id
=
"
endShift
"
>
Close
Work
{
this
.
state
.
endShift
==
""
}
<
/button
>
<
/div
>
<
div
className
=
"
col-3 text-center
"
><
button
onClick
=
{
this
.
handleCreatEvent
}
id
=
"
startShift
"
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
>
Start
Work
<
/button></
div
>
<
div
className
=
"
col-3 text-center
"
><
button
disabled
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
>
Start
Lunch
Break
<
/button></
div
>
<
div
className
=
"
col-3 text-center
"
><
button
disabled
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
>
Lunch
Break
Finish
<
/button></
div
>
<
div
className
=
"
col-3 text-center
"
><
button
disabled
type
=
"
button
"
className
=
"
btn btn-success btn-sm btn-special
"
>
Close
Work
<
/button></
div
>
<
/div
>
);
)
return
(
<
div
className
=
"
container
"
>
{
worklist
}
<
/div
>
)
}
}
const
mapStateToProps
=
(
dispatc
)
=>
{
...
...
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