Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
837d3925
Commit
837d3925
authored
Mar 16, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue
parent
96bcb961
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
14 deletions
+21
-14
ProgressReport.js
src/container/ProgressReport/ProgressReport.js
+9
-3
TableProgressReport.js
src/container/ProgressReport/TableProgressReport.js
+12
-11
No files found.
src/container/ProgressReport/ProgressReport.js
View file @
837d3925
import
React
,
{
Component
}
from
'react'
;
import
{
Typography
,
Paper
,
TextField
,
Snackbar
}
from
'@material-ui/core'
;
import
{
Typography
,
Paper
,
TextField
,
Snackbar
,
withStyles
}
from
'@material-ui/core'
;
import
Images
from
'../../assets/Images'
;
import
Constant
from
'../../library/Constant'
;
import
api
from
'../../api'
;
...
...
@@ -7,8 +7,11 @@ import { PropagateLoader } from 'react-spinners';
import
{
format
}
from
'date-fns'
;
import
Autocomplete
from
'@material-ui/lab/Autocomplete'
;
import
TableProgressReport
from
'./TableProgressReport'
import
{
Alert
}
from
'@material-ui/lab'
;
import
ReactTooltip
from
"react-tooltip"
;
import
MuiAlert
from
'@material-ui/lab/Alert'
;
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
class
ReportProgress
extends
Component
{
constructor
(
props
)
{
...
...
@@ -35,7 +38,10 @@ class ReportProgress extends Component {
month
:
null
,
periodeMB
:
null
,
reportType
:
null
,
dataTable
:
[]
dataTable
:
[],
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
,
}
}
...
...
src/container/ProgressReport/TableProgressReport.js
View file @
837d3925
import
React
,
{
Component
}
from
"react"
;
import
{
createMuiTheme
,
FormControlLabel
,
Input
,
MuiThemeProvider
,
TableCell
,
Typography
}
from
"@material-ui/core"
;
import
{
createMuiTheme
,
FormControlLabel
,
Input
,
MuiThemeProvider
,
TableCell
,
Typography
,
withStyles
}
from
"@material-ui/core"
;
import
MUIDataTable
from
"mui-datatables"
;
import
api
from
'../../api'
;
import
Constant
from
'../../library/Constant'
;
import
{
PropagateLoader
}
from
"react-spinners"
;
import
Images
from
"../../assets/Images"
;
import
MuiAlert
from
'@material-ui/lab/Alert'
;
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable3
());
...
...
@@ -31,12 +34,14 @@ export default class TableProgressReport extends Component {
idCompany
:
null
,
companyName
:
""
,
month
:
""
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
,
}
}
handleShowPopup
(
id
,
data
)
{
let
item
=
this
.
props
console
.
log
(
item
);
let
bulan
=
item
.
month
==
1
?
"Jan"
:
item
.
month
==
2
?
"Feb"
:
item
.
month
==
3
?
"Mar"
:
item
.
month
==
4
?
"Apr"
:
item
.
month
==
5
?
"May"
:
item
.
month
==
6
?
"Jun"
:
item
.
month
==
7
?
"Jul"
:
item
.
month
==
8
?
"Aug"
:
item
.
month
==
9
?
"Sep"
:
item
.
month
==
10
?
"Oct"
:
item
.
month
==
11
?
"Nov"
:
item
.
month
==
12
?
"Dec"
:
null
this
.
setState
({
visiblePopup
:
true
,
idCompany
:
id
,
companyName
:
data
[
0
],
month
:
bulan
})
}
...
...
@@ -60,15 +65,10 @@ export default class TableProgressReport extends Component {
if
(
response
.
ok
)
{
this
.
setState
({
loading
:
false
})
if
(
response
.
data
.
status
==
'success'
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
},
()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
})
this
.
getData
()
},
2000
);
})
this
.
setState
({
loading
:
false
,
visiblePopup
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
...
...
@@ -78,10 +78,11 @@ export default class TableProgressReport extends Component {
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
alert
(
response
.
data
.
message
);
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
visiblePopup
:
false
,
loading
:
false
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
})
}
})
}
...
...
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