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
a0d7c716
Commit
a0d7c716
authored
Dec 15, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ENV-DEV' into 'ENV-DEPLOYMENT'
email recipient See merge request
!2259
parents
e05d96a6
c2c53026
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
152 additions
and
39 deletions
+152
-39
AddUser.js
src/container/Authorization/User/AddUser.js
+68
-12
EditUser.js
src/container/Authorization/User/EditUser.js
+84
-27
No files found.
src/container/Authorization/User/AddUser.js
View file @
a0d7c716
...
...
@@ -60,14 +60,27 @@ export default class AddUser extends Component {
errorRoleName
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
errorNotification
:
false
,
msgErrorFN
:
''
,
msgErrorEM
:
''
,
msgErrorRN
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
msgErrorNotification
:
''
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
messageAlert
:
''
,
notification
:
null
,
listNotification
:
[
{
"id"
:
0
,
"value"
:
"No"
},
{
"id"
:
1
,
"value"
:
"Yes"
}
],
}
}
...
...
@@ -101,11 +114,13 @@ export default class AddUser extends Component {
errorRoleName
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
errorNotification
:
false
,
msgErrorFN
:
''
,
msgErrorEM
:
''
,
msgErrorRN
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
msgErrorNotification
:
''
,
})
}
else
if
(
isDate
&&
type
===
'end_date'
)
{
this
.
setState
({
...
...
@@ -115,11 +130,13 @@ export default class AddUser extends Component {
errorRoleName
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
errorNotification
:
false
,
msgErrorFN
:
''
,
msgErrorEM
:
''
,
msgErrorRN
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
msgErrorNotification
:
''
,
})
}
else
{
this
.
setState
({
...
...
@@ -129,11 +146,13 @@ export default class AddUser extends Component {
errorRoleName
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
errorNotification
:
false
,
msgErrorFN
:
''
,
msgErrorEM
:
''
,
msgErrorRN
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
msgErrorNotification
:
''
,
})
}
}
...
...
@@ -148,7 +167,7 @@ export default class AddUser extends Component {
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
...
...
@@ -163,7 +182,7 @@ export default class AddUser extends Component {
let
uniqueCompany
=
company
.
filter
((
val
,
id
,
array
)
=>
{
return
array
.
indexOf
(
val
)
==
id
;
});
company
=
this
.
state
.
role
==
null
?
[]
:
this
.
state
.
role
.
role_id
===
1
?
uniqueCompany
:
[]
company
=
this
.
state
.
role
==
null
?
[]
:
this
.
state
.
role
.
role_id
===
1
?
uniqueCompany
:
[]
// console.log(uniqueCompany)
this
.
setState
({
...
...
@@ -172,11 +191,13 @@ export default class AddUser extends Component {
errorRoleName
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
errorNotification
:
false
,
msgErrorFN
:
''
,
msgErrorEM
:
''
,
msgErrorRN
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
msgErrorNotification
:
''
,
company
},
()
=>
{
// console.log(this.state.company)
...
...
@@ -205,6 +226,8 @@ export default class AddUser extends Component {
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'Valid To Cannot be Empty'
})
}
else
if
(
this
.
state
.
company
.
length
<
1
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'Authorization company cannot be empty'
,
tipeAlert
:
'warning'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
notification
))
{
this
.
setState
({
errorNotification
:
true
,
msgErrorNotification
:
'Email Notification Maintenance Cannot be Empty'
})
}
// else if (this.state.privileges.length < 1) {
// alert('Hak Akses belum di pilih !!')
...
...
@@ -217,8 +240,10 @@ export default class AddUser extends Component {
"password"
:
this
.
state
.
fullname
,
"company"
:
this
.
state
.
company
,
"start_date"
:
this
.
state
.
startDate
,
"end_date"
:
this
.
state
.
endDate
"end_date"
:
this
.
state
.
endDate
,
"mail_notif"
:
this
.
state
.
notification
.
id
}
// console.log(payload);
this
.
props
.
createUser
(
payload
)
}
}
...
...
@@ -300,7 +325,7 @@ export default class AddUser extends Component {
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
...
...
@@ -314,7 +339,7 @@ export default class AddUser extends Component {
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handleSpliceChild
(
items
)
})
}
...
...
@@ -325,7 +350,7 @@ export default class AddUser extends Component {
company
.
push
(
item
.
id
)
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handlePushChild
(
items
)
})
}
...
...
@@ -335,7 +360,7 @@ export default class AddUser extends Component {
company
.
splice
(
indexID
,
1
)
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
handleSpliceChild
(
items
)
})
}
...
...
@@ -343,7 +368,7 @@ export default class AddUser extends Component {
}
// console.log(company)
this
.
setState
({
company
})
this
.
setState
({
company
})
}
renderChildren
=
(
item
,
pad
)
=>
{
...
...
@@ -679,6 +704,37 @@ export default class AddUser extends Component {
<
/div
>
<
/div
>
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px"
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"column-1"
>
<
div
className
=
"margin-bottom-20px"
>
<
Autocomplete
debug
id
=
"tipe"
options
=
{
this
.
state
.
listNotification
}
getOptionLabel
=
{(
option
)
=>
option
.
value
}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
notification
:
newInputValue
},
()
=>
this
.
clearError
())}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Email Notification Maintenance"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
error
=
{
this
.
state
.
errorNotification
}
helperText
=
{
this
.
state
.
msgErrorNotification
}
/
>
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"column-2"
>
<
/div
>
<
/div
>
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px"
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"column-1"
>
<
div
className
=
"margin-bottom-20px"
>
...
...
src/container/Authorization/User/EditUser.js
View file @
a0d7c716
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