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'
const
PlanAvaliability
=
({
dataElement
,
handleElmChange
})
=>
{
const
[
pickerstartdate
,
setPickerstartdate
]
=
useState
(
Date
.
parse
(
dataElement
.
startdate
)),
[
pickerenddate
,
setPickerenddate
]
=
useState
(
Date
.
parse
(
dataElement
.
enddate
)),
[
plat
a
forms
,
setPlatforms
]
=
useState
([]),
[
platforms
,
setPlatforms
]
=
useState
([]),
[
geolocations
,
setGeolocations
]
=
useState
([]),
[
avaliaPlat
a
forms
,
setAvaliaPlatforms
]
=
useState
([]),
[
avaliaPlatforms
,
setAvaliaPlatforms
]
=
useState
([]),
[
permitGeo
,
setPermitGeo
]
=
useState
([]),
[
denytGeo
,
setDenyGeo
]
=
useState
([]),
store
=
useSelector
(
state
=>
state
.
projectsettings
)
...
...
@@ -45,7 +45,7 @@ const PlanAvaliability = ({dataElement, handleElmChange}) => {
useEffect
(()
=>
{
if
(
!
dataElement
)
return
const
selected
=
dataElement
.
plat
a
forms
.
map
(
elm
=>
{
const
selected
=
dataElement
.
platforms
.
map
(
elm
=>
{
return
{
value
:
elm
.
id
,
label
:
elm
.
name
...
...
@@ -83,7 +83,7 @@ const PlanAvaliability = ({dataElement, handleElmChange}) => {
})
const
newData
=
{
...
dataElement
,
plat
a
forms
:
newValue
platforms
:
newValue
}
handleElmChange
(
newData
)
},
...
...
@@ -207,14 +207,14 @@ const PlanAvaliability = ({dataElement, handleElmChange}) => {
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'8'
sm
=
'12'
>
<
Label
for
=
'plat
a
forms'
>
Platforms
<
/Label
>
<
Label
for
=
'platforms'
>
Platforms
<
/Label
>
<
Select
isClearable
=
{
false
}
theme
=
{
selectThemeColors
}
value
=
{
avaliaPlat
a
forms
}
value
=
{
avaliaPlatforms
}
isMulti
name
=
{
`platforms
${
dataElement
.
id
}
`
}
options
=
{
plat
a
forms
}
options
=
{
platforms
}
onChange
=
{
platfomsOnChange
}
className
=
'react-select'
classNamePrefix
=
'select'
...
...
@@ -281,7 +281,7 @@ const AvaliabilityBlock = ({dataElement, handleElmChange}) => {
const
handleAvalChange
=
(
value
)
=>
{
const
newData
=
dataElement
.
map
(
elm
=>
{
if
(
elm
.
id
===
value
.
id
)
{
elm
.
plat
aforms
=
value
.
plata
forms
elm
.
plat
forms
=
value
.
plat
forms
elm
.
geolocations
=
value
.
geolocations
elm
.
startdate
=
value
.
startdate
elm
.
enddate
=
value
.
enddate
...
...
@@ -299,7 +299,7 @@ const AvaliabilityBlock = ({dataElement, handleElmChange}) => {
idassets
:
'current'
,
startdate
:
''
,
enddate
:
''
,
plat
a
forms
:
[],
platforms
:
[],
geolocations
:
[]
})
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