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
aa7168d4
Commit
aa7168d4
authored
Mar 16, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev/riri' into 'ENV-DEV'
issue See merge request
!1740
parents
3b1e01cf
4af1ea70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
14 deletions
+29
-14
ProgressReport.js
src/container/ProgressReport/ProgressReport.js
+9
-3
TableProgressReport.js
src/container/ProgressReport/TableProgressReport.js
+20
-11
No files found.
src/container/ProgressReport/ProgressReport.js
View file @
aa7168d4
import
React
,
{
Component
}
from
'react'
;
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
Images
from
'../../assets/Images'
;
import
Constant
from
'../../library/Constant'
;
import
Constant
from
'../../library/Constant'
;
import
api
from
'../../api'
;
import
api
from
'../../api'
;
...
@@ -7,8 +7,11 @@ import { PropagateLoader } from 'react-spinners';
...
@@ -7,8 +7,11 @@ import { PropagateLoader } from 'react-spinners';
import
{
format
}
from
'date-fns'
;
import
{
format
}
from
'date-fns'
;
import
Autocomplete
from
'@material-ui/lab/Autocomplete'
;
import
Autocomplete
from
'@material-ui/lab/Autocomplete'
;
import
TableProgressReport
from
'./TableProgressReport'
import
TableProgressReport
from
'./TableProgressReport'
import
{
Alert
}
from
'@material-ui/lab'
;
import
ReactTooltip
from
"react-tooltip"
;
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
{
class
ReportProgress
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -35,7 +38,10 @@ class ReportProgress extends Component {
...
@@ -35,7 +38,10 @@ class ReportProgress extends Component {
month
:
null
,
month
:
null
,
periodeMB
:
null
,
periodeMB
:
null
,
reportType
:
null
,
reportType
:
null
,
dataTable
:
[]
dataTable
:
[],
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
,
}
}
}
}
...
...
src/container/ProgressReport/TableProgressReport.js
View file @
aa7168d4
import
React
,
{
Component
}
from
"react"
;
import
React
,
{
Component
}
from
"react"
;
import
{
createMuiTheme
,
FormControlLabel
,
Input
,
MuiThemeProvider
,
TableCell
,
Typography
}
from
"@material-ui/core"
;
import
{
createMuiTheme
,
FormControlLabel
,
Input
,
MuiThemeProvider
,
Snackbar
,
TableCell
,
Typography
,
withStyles
}
from
"@material-ui/core"
;
import
MUIDataTable
from
"mui-datatables"
;
import
MUIDataTable
from
"mui-datatables"
;
import
api
from
'../../api'
;
import
api
from
'../../api'
;
import
Constant
from
'../../library/Constant'
;
import
Constant
from
'../../library/Constant'
;
import
{
PropagateLoader
}
from
"react-spinners"
;
import
{
PropagateLoader
}
from
"react-spinners"
;
import
Images
from
"../../assets/Images"
;
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"
);
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable3
());
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable3
());
...
@@ -31,12 +34,14 @@ export default class TableProgressReport extends Component {
...
@@ -31,12 +34,14 @@ export default class TableProgressReport extends Component {
idCompany
:
null
,
idCompany
:
null
,
companyName
:
""
,
companyName
:
""
,
month
:
""
,
month
:
""
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
,
}
}
}
}
handleShowPopup
(
id
,
data
)
{
handleShowPopup
(
id
,
data
)
{
let
item
=
this
.
props
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
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
})
this
.
setState
({
visiblePopup
:
true
,
idCompany
:
id
,
companyName
:
data
[
0
],
month
:
bulan
})
}
}
...
@@ -60,15 +65,10 @@ export default class TableProgressReport extends Component {
...
@@ -60,15 +65,10 @@ export default class TableProgressReport extends Component {
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
if
(
response
.
data
.
status
==
'success'
)
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
},
()
=>
{
this
.
setState
({
loading
:
false
,
visiblePopup
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
})
this
.
getData
()
},
2000
);
})
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
}
else
{
}
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"
))
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
localStorage
.
removeItem
(
Constant
.
TOKEN
)
...
@@ -78,14 +78,18 @@ export default class TableProgressReport extends Component {
...
@@ -78,14 +78,18 @@ export default class TableProgressReport extends Component {
})
})
}
}
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
})
}
}
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
})
}
}
})
})
}
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
render
()
{
let
dataTable2
=
this
.
props
.
dataTable
;
let
dataTable2
=
this
.
props
.
dataTable
;
...
@@ -717,6 +721,11 @@ export default class TableProgressReport extends Component {
...
@@ -717,6 +721,11 @@ export default class TableProgressReport extends Component {
return
(
return
(
<
div
>
<
div
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
<
div
style
=
{{
padding
:
"0px 20px 20px 20px"
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
350
:
100
)
}}
>
<
div
style
=
{{
padding
:
"0px 20px 20px 20px"
,
width
:
this
.
props
.
width
-
(
this
.
props
.
open
===
true
?
350
:
100
)
}}
>
{
this
.
state
.
loading
&&
loadingComponent
}
{
this
.
state
.
loading
&&
loadingComponent
}
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
...
...
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