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
6a83ab50
Commit
6a83ab50
authored
Jul 17, 2022
by
syadziy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update fixing UAT
parent
8bde7f1c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
46 deletions
+34
-46
CafrmDocument.js
src/container/CAFRM/CafrmDocument.js
+33
-45
CreateCarfmDocument.js
src/container/CAFRM/CreateCarfmDocument.js
+0
-0
TableCafrmDocument.js
src/container/CAFRM/TableCafrmDocument.js
+0
-0
homeRoutes.js
src/router/homeRoutes.js
+1
-1
No files found.
src/container/C
RFM/Carf
mDocument.js
→
src/container/C
AFRM/Cafr
mDocument.js
View file @
6a83ab50
import
React
,
{
Component
}
from
'react'
import
{
withStyles
}
from
'@material-ui/core/styles'
;
import
{
createMuiTheme
,
MuiThemeProvider
,
Paper
,
Snackbar
,
Tab
,
Tabs
,
Typography
}
from
'@material-ui/core'
;
import
React
,
{
Component
}
from
'react'
import
{
withStyles
}
from
'@material-ui/core/styles'
;
import
{
Paper
,
Snackbar
,
Typography
}
from
'@material-ui/core'
;
import
MuiAlert
from
'@material-ui/lab/Alert'
;
import
Constant
from
'../../library/Constant'
;
import
Images
from
'../../assets/Images'
;
import
ReactTooltip
from
'react-tooltip'
;
import
api
from
'../../api'
;
import
PropagateLoader
from
"react-spinners/PropagateLoader"
import
TableDocument
from
"./TableDocument"
;
import
CreateCarfmDoc
from
"./CreateCarfmDoc"
;
import
TableDocument
from
"./Table
Cafrm
Document"
;
import
CreateCarfmDoc
from
"./CreateCarfmDoc
ument
"
;
const
Alert
=
withStyles
({})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
...
...
@@ -33,34 +33,27 @@ export default class CarfmDocument extends Component {
}
async
componentDidMount
()
{
// this.getPermission()
await
this
.
getMenuName
();
await
this
.
getPermission
(
this
.
state
.
submenu_name
)
await
this
.
getDataCarfm
();
await
this
.
getDetailUser
();
await
this
.
setState
({
finishLoad
:
true
})
componentDidMount
()
{
this
.
getMenuName
();
}
async
getMenuName
(){
await
api
.
create
().
getMenuByUser
().
then
(
getMenuName
(){
api
.
create
().
getMenuByUser
().
then
(
response
=>
{
if
(
response
.
data
){
if
(
response
.
data
.
status
===
'success'
){
response
.
data
.
data
.
map
(
(
item
)
=>
{
let
arr
=
window
.
location
.
href
.
split
(
'/'
);
if
(
item
.
class_id
==
arr
.
slice
(
-
1
)[
0
]){
if
(
item
.
class_id
==
arr
.
slice
(
-
1
)[
0
]){
this
.
setState
({
submenu_id
:
item
.
menu_id
,
submenu_name
:
item
.
menu_name
.
toLowerCase
(),
menu_title
:
item
.
menu_name
.
replace
(
/
\b\w
/g
,
c
=>
c
.
toUpperCase
())
},
()
=>
{
this
.
getPermission
(
this
.
state
.
submenu_name
)
this
.
getDataCarfm
();
this
.
getDetailUser
();
})
}
}
...
...
@@ -71,11 +64,11 @@ export default class CarfmDocument extends Component {
)
}
async
getDataCarfm
(
create
){
getDataCarfm
(
create
){
let
payload
=
{
submenu_id
:
this
.
state
.
submenu_id
}
a
wait
a
pi
.
create
().
getCarfmDocumentBySubmenu
(
payload
).
then
(
api
.
create
().
getCarfmDocumentBySubmenu
(
payload
).
then
(
response
=>
{
if
(
response
){
if
(
response
.
data
.
status
===
'success'
){
...
...
@@ -110,11 +103,11 @@ export default class CarfmDocument extends Component {
)
}
async
getPermission
(
subMenu
)
{
getPermission
(
subMenu
)
{
let
payload
=
{
menu
:
subMenu
}
a
wait
a
pi
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
if
(
response
.
data
)
{
console
.
log
(
`status get permission
${
response
.
data
.
status
}
`
);
if
(
response
.
data
.
status
===
"success"
)
{
...
...
@@ -139,9 +132,9 @@ export default class CarfmDocument extends Component {
})
}
async
getDetailUser
()
{
getDetailUser
()
{
let
userId
=
localStorage
.
getItem
(
Constant
.
USER
)
a
wait
a
pi
.
create
().
getDetailUser
(
userId
).
then
((
response
)
=>
{
api
.
create
().
getDetailUser
(
userId
).
then
((
response
)
=>
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
...
...
@@ -155,8 +148,8 @@ export default class CarfmDocument extends Component {
})
}
async
getCompanyActive
()
{
a
wait
a
pi
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
getCompanyActive
()
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
console
.
log
(
"getcompanyactive start"
);
console
.
log
(
response
.
data
.
data
);
console
.
log
(
"getcompanyactive stop"
);
...
...
@@ -200,9 +193,9 @@ export default class CarfmDocument extends Component {
})
}
async
createDocument
(
payload
)
{
//upload apinya disini
createDocument
(
payload
)
{
//upload apinya disini
this
.
setState
({
loading
:
true
})
a
wait
a
pi
.
create
().
uploadCarfmDocument
(
payload
).
then
(
response
=>
{
api
.
create
().
uploadCarfmDocument
(
payload
).
then
(
response
=>
{
// console.log(response)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
...
...
@@ -260,10 +253,9 @@ export default class CarfmDocument extends Component {
/
>
<
/div
>
);
return
(
<
div
style
=
{{
height
:
this
.
props
.
height
,
backgroundColor
:
'#f8f8f8'
}}
>
{
/* {this.props.load && ()} */
}
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
...
...
@@ -275,13 +267,10 @@ export default class CarfmDocument extends Component {
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
{
this
.
state
.
menu_title
}
<
/Typography
>
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
{
this
.
state
.
loading
&&
loadingComponent
}
{
this
.
state
.
btnview
&&
this
.
state
.
finishLoad
&&
(
<
div
style
=
{{
padding
:
20
}}
>
{
this
.
state
.
btnview
&&
(
<
Paper
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
}}
>
{
console
.
log
(
"renderbtn"
+
this
.
state
.
btncreate
)}
{(
this
.
state
.
btncreate
)
&&
<
span
>
...
...
@@ -302,8 +291,8 @@ export default class CarfmDocument extends Component {
<
/div
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
this
.
state
.
visibleTrue
&&
(
<
TableDocument
{
this
.
state
.
visibleTrue
&&
(
<
TableDocument
data
=
{
this
.
state
.
listData
}
refresh
=
{
this
.
state
.
refresh
}
load
=
{
true
}
...
...
@@ -319,15 +308,14 @@ export default class CarfmDocument extends Component {
<
/Paper
>
)}
{
!
this
.
state
.
btnview
&&
this
.
state
.
finishLoad
&&
(
{
!
this
.
state
.
btnview
&&
(
<
Paper
style
=
{{
padding
:
20
}}
>
<
label
>
You
Don
't Have Any Access in Document Management</label>
</Paper>
)}
</div>
{this.state.visibleCreate && (
{/* {this.state.visibleCreate && (
<CreateCarfmDoc
onClickClose={() => this.setState({ visibleCreate: false })}
// getDataDocument={this.getDataDocument.bind(this)}
...
...
@@ -335,7 +323,7 @@ export default class CarfmDocument extends Component {
handleLoading={this.handleLoading.bind(this)}
submenu_id={this.state.submenu_id}
/>
)}
)}
*/}
</div>
);
...
...
src/container/C
RFM/CreateCarfmDoc
.js
→
src/container/C
AFRM/CreateCarfmDocument
.js
View file @
6a83ab50
File moved
src/container/C
RFM/Table
Document.js
→
src/container/C
AFRM/TableCafrm
Document.js
View file @
6a83ab50
File moved
src/router/homeRoutes.js
View file @
6a83ab50
...
...
@@ -20,7 +20,7 @@ import SubHolding from '../container/Reports/SubHolding';
import
SummaryTriputra
from
'../container/SummaryTriputra/SummaryOfTriputra'
;
import
MasterDataCAT
from
'../container/MasterData/MasterDataCAT/MasterDataCAT'
;
import
ProgressReport
from
'../container/ProgressReport/ProgressReport'
;
import
CarfmDocument
from
"../container/C
RFM/Carf
mDocument"
;
import
CarfmDocument
from
"../container/C
AFRM/Cafr
mDocument"
;
const
routes
=
[
{
...
...
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