Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
C
cms
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
Pedro-dev_2
cms
Commits
718a02d9
Commit
718a02d9
authored
May 27, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactory platforms
parent
74ec76a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
avaliability.js
src/views/assets/projectassets/card/avaliability.js
+9
-9
No files found.
src/views/assets/projectassets/card/avaliability.js
View file @
718a02d9
...
@@ -16,9 +16,9 @@ import Moment from 'moment'
...
@@ -16,9 +16,9 @@ import Moment from 'moment'
const
PlanAvaliability
=
({
dataElement
,
handleElmChange
})
=>
{
const
PlanAvaliability
=
({
dataElement
,
handleElmChange
})
=>
{
const
[
pickerstartdate
,
setPickerstartdate
]
=
useState
(
Date
.
parse
(
dataElement
.
startdate
)),
const
[
pickerstartdate
,
setPickerstartdate
]
=
useState
(
Date
.
parse
(
dataElement
.
startdate
)),
[
pickerenddate
,
setPickerenddate
]
=
useState
(
Date
.
parse
(
dataElement
.
enddate
)),
[
pickerenddate
,
setPickerenddate
]
=
useState
(
Date
.
parse
(
dataElement
.
enddate
)),
[
plat
a
forms
,
setPlatforms
]
=
useState
([]),
[
platforms
,
setPlatforms
]
=
useState
([]),
[
geolocations
,
setGeolocations
]
=
useState
([]),
[
geolocations
,
setGeolocations
]
=
useState
([]),
[
avaliaPlat
a
forms
,
setAvaliaPlatforms
]
=
useState
([]),
[
avaliaPlatforms
,
setAvaliaPlatforms
]
=
useState
([]),
[
permitGeo
,
setPermitGeo
]
=
useState
([]),
[
permitGeo
,
setPermitGeo
]
=
useState
([]),
[
denytGeo
,
setDenyGeo
]
=
useState
([]),
[
denytGeo
,
setDenyGeo
]
=
useState
([]),
store
=
useSelector
(
state
=>
state
.
projectsettings
)
store
=
useSelector
(
state
=>
state
.
projectsettings
)
...
@@ -45,7 +45,7 @@ const PlanAvaliability = ({dataElement, handleElmChange}) => {
...
@@ -45,7 +45,7 @@ const PlanAvaliability = ({dataElement, handleElmChange}) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
dataElement
)
return
if
(
!
dataElement
)
return
const
selected
=
dataElement
.
plat
a
forms
.
map
(
elm
=>
{
const
selected
=
dataElement
.
platforms
.
map
(
elm
=>
{
return
{
return
{
value
:
elm
.
id
,
value
:
elm
.
id
,
label
:
elm
.
name
label
:
elm
.
name
...
@@ -83,7 +83,7 @@ const PlanAvaliability = ({dataElement, handleElmChange}) => {
...
@@ -83,7 +83,7 @@ const PlanAvaliability = ({dataElement, handleElmChange}) => {
})
})
const
newData
=
{
const
newData
=
{
...
dataElement
,
...
dataElement
,
plat
a
forms
:
newValue
platforms
:
newValue
}
}
handleElmChange
(
newData
)
handleElmChange
(
newData
)
},
},
...
@@ -207,14 +207,14 @@ const PlanAvaliability = ({dataElement, handleElmChange}) => {
...
@@ -207,14 +207,14 @@ const PlanAvaliability = ({dataElement, handleElmChange}) => {
<
/FormGroup
>
<
/FormGroup
>
<
/Col
>
<
/Col
>
<
Col
md
=
'8'
sm
=
'12'
>
<
Col
md
=
'8'
sm
=
'12'
>
<
Label
for
=
'plat
a
forms'
>
Platforms
<
/Label
>
<
Label
for
=
'platforms'
>
Platforms
<
/Label
>
<
Select
<
Select
isClearable
=
{
false
}
isClearable
=
{
false
}
theme
=
{
selectThemeColors
}
theme
=
{
selectThemeColors
}
value
=
{
avaliaPlat
a
forms
}
value
=
{
avaliaPlatforms
}
isMulti
isMulti
name
=
{
`platforms
${
dataElement
.
id
}
`
}
name
=
{
`platforms
${
dataElement
.
id
}
`
}
options
=
{
plat
a
forms
}
options
=
{
platforms
}
onChange
=
{
platfomsOnChange
}
onChange
=
{
platfomsOnChange
}
className
=
'react-select'
className
=
'react-select'
classNamePrefix
=
'select'
classNamePrefix
=
'select'
...
@@ -281,7 +281,7 @@ const AvaliabilityBlock = ({dataElement, handleElmChange}) => {
...
@@ -281,7 +281,7 @@ const AvaliabilityBlock = ({dataElement, handleElmChange}) => {
const
handleAvalChange
=
(
value
)
=>
{
const
handleAvalChange
=
(
value
)
=>
{
const
newData
=
dataElement
.
map
(
elm
=>
{
const
newData
=
dataElement
.
map
(
elm
=>
{
if
(
elm
.
id
===
value
.
id
)
{
if
(
elm
.
id
===
value
.
id
)
{
elm
.
plat
aforms
=
value
.
plata
forms
elm
.
plat
forms
=
value
.
plat
forms
elm
.
geolocations
=
value
.
geolocations
elm
.
geolocations
=
value
.
geolocations
elm
.
startdate
=
value
.
startdate
elm
.
startdate
=
value
.
startdate
elm
.
enddate
=
value
.
enddate
elm
.
enddate
=
value
.
enddate
...
@@ -299,7 +299,7 @@ const AvaliabilityBlock = ({dataElement, handleElmChange}) => {
...
@@ -299,7 +299,7 @@ const AvaliabilityBlock = ({dataElement, handleElmChange}) => {
idassets
:
'current'
,
idassets
:
'current'
,
startdate
:
''
,
startdate
:
''
,
enddate
:
''
,
enddate
:
''
,
plat
a
forms
:
[],
platforms
:
[],
geolocations
:
[]
geolocations
:
[]
})
})
handleElmChange
(
newData
)
handleElmChange
(
newData
)
...
...
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