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
8fa58802
Commit
8fa58802
authored
Aug 11, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'didam' into 'master'
update didam See merge request
!42
parents
8a734896
430ef26b
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
226 additions
and
41 deletions
+226
-41
index.js
src/api/index.js
+6
-0
UserRole.js
src/container/Otorisasi/UserRole.js
+9
-7
AddRole.js
src/container/Otorisasi/UserRole/AddRole.js
+1
-1
EditRole.js
src/container/Otorisasi/UserRole/EditRole.js
+210
-33
No files found.
src/api/index.js
View file @
8fa58802
...
@@ -65,9 +65,13 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
...
@@ -65,9 +65,13 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
//Role
//Role
const
getRole
=
()
=>
api
.
get
(
'role/get_all_role'
)
const
getRole
=
()
=>
api
.
get
(
'role/get_all_role'
)
const
getDetailRole
=
(
roleId
)
=>
api
.
get
(
`role/get_role_by_id/
${
roleId
}
`
)
const
addRole
=
(
body
)
=>
api
.
post
(
'role/create_role'
,
body
)
const
addRole
=
(
body
)
=>
api
.
post
(
'role/create_role'
,
body
)
const
editRole
=
(
body
)
=>
api
.
post
(
'role/update_role'
,
body
)
const
editRole
=
(
body
)
=>
api
.
post
(
'role/update_role'
,
body
)
const
deleteRole
=
(
roleId
)
=>
api
.
post
(
`role/delete_role/
${
roleId
}
`
)
const
deleteRole
=
(
roleId
)
=>
api
.
post
(
`role/delete_role/
${
roleId
}
`
)
//Menu
const
getMenu
=
()
=>
api
.
get
(
'menu/get_menu_hierarki'
)
// ------
// ------
// STEP 3
// STEP 3
// ------
// ------
...
@@ -86,9 +90,11 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
...
@@ -86,9 +90,11 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
login
,
login
,
verification
,
verification
,
getRole
,
getRole
,
getDetailRole
,
addRole
,
addRole
,
editRole
,
editRole
,
deleteRole
,
deleteRole
,
getMenu
}
}
}
}
...
...
src/container/Otorisasi/UserRole.js
View file @
8fa58802
...
@@ -18,7 +18,7 @@ export default class UserRole extends Component {
...
@@ -18,7 +18,7 @@ export default class UserRole extends Component {
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
listRole
:
[],
listRole
:
[],
params
Data
:
{},
index
Data
:
{},
add
:
false
,
add
:
false
,
edit
:
false
edit
:
false
}
}
...
@@ -38,6 +38,7 @@ export default class UserRole extends Component {
...
@@ -38,6 +38,7 @@ export default class UserRole extends Component {
getRole
()
{
getRole
()
{
api
.
create
().
getRole
().
then
((
response
)
=>
{
api
.
create
().
getRole
().
then
((
response
)
=>
{
// console.log(response)
if
(
response
.
data
.
status
==
'success'
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
listData
=
data
.
map
((
item
,
index
)
=>
{
let
listData
=
data
.
map
((
item
,
index
)
=>
{
...
@@ -52,7 +53,7 @@ export default class UserRole extends Component {
...
@@ -52,7 +53,7 @@ export default class UserRole extends Component {
}
else
{
}
else
{
alert
(
response
.
data
.
message
)
alert
(
response
.
data
.
message
)
}
}
//
console.log(response.data.data)
console
.
log
(
response
.
data
.
data
)
})
})
}
}
...
@@ -69,7 +70,8 @@ export default class UserRole extends Component {
...
@@ -69,7 +70,8 @@ export default class UserRole extends Component {
cursor
:
'pointer'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
borderColor
:
'transparent'
,
}}
}}
onClick
=
{()
=>
this
.
setState
({
edit
:
true
,
paramsData
:
tableMeta
.
rowData
})}
// onClick={() => console.log(tableMeta.rowData[1])}
onClick
=
{()
=>
this
.
setState
({
edit
:
true
,
indexData
:
tableMeta
.
rowData
[
1
]})}
>
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
<
/button
>
...
@@ -148,14 +150,14 @@ export default class UserRole extends Component {
...
@@ -148,14 +150,14 @@ export default class UserRole extends Component {
<
/div
>
<
/div
>
{
this
.
state
.
add
&&
(
{
this
.
state
.
add
&&
(
<
AddRole
<
AddRole
onClickClose
=
{
this
.
closeAdd
.
bind
(
this
)}
onClickClose
=
{
this
.
closeAdd
.
bind
(
this
)}
data
=
{
this
.
state
.
params
Data
}
data
=
{
this
.
state
.
index
Data
}
/
>
/
>
)}
)}
{
this
.
state
.
edit
&&
(
{
this
.
state
.
edit
&&
(
<
EditRole
<
EditRole
onClickClose
=
{
this
.
closeEdit
.
bind
(
this
)}
onClickClose
=
{
this
.
closeEdit
.
bind
(
this
)}
data
=
{
this
.
state
.
params
Data
}
data
=
{
this
.
state
.
index
Data
}
/
>
/
>
)}
)}
<
/div
>
<
/div
>
...
...
src/container/Otorisasi/UserRole/AddRole.js
View file @
8fa58802
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
TextField
}
from
'@material-ui/core'
;
import
{
TextField
}
from
'@material-ui/core'
;
export
default
class
CreateUnitBisnis
extends
Component
{
export
default
class
AddRole
extends
Component
{
render
()
{
render
()
{
return
(
return
(
<
div
className
=
"test app-popup-show"
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
div
className
=
"test app-popup-show"
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
...
...
src/container/Otorisasi/UserRole/EditRole.js
View file @
8fa58802
This diff is collapsed.
Click to expand it.
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