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
38fc3a89
Commit
38fc3a89
authored
Jul 21, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist avalibility UI
parent
bd3254d0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
29 deletions
+76
-29
avaliability.js
src/views/assets/projectassets/card/avaliability.js
+1
-1
index.js
src/views/playlists/projectplaylists/add/index.js
+10
-2
index.js
src/views/playlists/projectplaylists/card/index.js
+65
-26
No files found.
src/views/assets/projectassets/card/avaliability.js
View file @
38fc3a89
...
@@ -340,7 +340,7 @@ const AvaliabilityBlock = ({dataElement, handleElmChange}) => {
...
@@ -340,7 +340,7 @@ const AvaliabilityBlock = ({dataElement, handleElmChange}) => {
<
Col
sm
=
'12'
>
<
Col
sm
=
'12'
>
<
Card
>
<
Card
>
<
CardBody
className
=
'pt-2'
>
<
CardBody
className
=
'pt-2'
>
{
dataElement
!==
null
&&
dataElement
.
map
(
elm
=>
{
{
dataElement
!==
null
&&
dataElement
!==
undefined
&&
dataElement
.
map
(
elm
=>
{
return
<
PlanAvaliability
return
<
PlanAvaliability
key
=
{
elm
.
id
}
key
=
{
elm
.
id
}
dataElement
=
{
elm
}
dataElement
=
{
elm
}
...
...
src/views/playlists/projectplaylists/add/index.js
View file @
38fc3a89
...
@@ -31,7 +31,8 @@ const Tables = () => {
...
@@ -31,7 +31,8 @@ const Tables = () => {
dynamic
:
values
.
dynamic
,
dynamic
:
values
.
dynamic
,
special
:
values
.
special
,
special
:
values
.
special
,
special_id
:
values
.
special_id
,
special_id
:
values
.
special_id
,
assets
:
values
.
assets
assets
:
values
.
assets
,
availability
:
values
.
availability
}
}
)
)
)
)
...
@@ -62,7 +63,14 @@ const Tables = () => {
...
@@ -62,7 +63,14 @@ const Tables = () => {
dynamic
:
0
,
dynamic
:
0
,
special
:
0
,
special
:
0
,
special_id
:
''
,
special_id
:
''
,
assets
:
[]
assets
:
[],
parent
:
{
textual
:
[],
genres
:
[],
subgenres
:
[],
availability
:
[],
imagery
:
[]
}
}}
}}
onSubmitHandler
=
{
onSubmitHandler
}
onSubmitHandler
=
{
onSubmitHandler
}
/
>
/
>
...
...
src/views/playlists/projectplaylists/card/index.js
View file @
38fc3a89
...
@@ -13,13 +13,11 @@ import { Bell, Check, X, AlertTriangle, Info } from 'react-feather'
...
@@ -13,13 +13,11 @@ import { Bell, Check, X, AlertTriangle, Info } from 'react-feather'
import
ManageAssets
from
'./manageassets'
import
ManageAssets
from
'./manageassets'
import
AvaliabilityBlock
from
'../../../assets/projectassets/card/avaliability'
// import TabLayoutPlaylist from './tablayoutplaylists'
// ** Store & Actions
// ** Store & Actions
import
{
resetResults
}
from
'../../store/actions'
import
{
resetResults
}
from
'../../store/actions'
import
{
get
Data_pagetypes
}
from
'../../../settings/store/actions'
import
{
get
Project
}
from
'../../../settings/store/actions'
import
{
getData_assets
}
from
'../../../assets/store/actions'
import
{
getData_assets
}
from
'../../../assets/store/actions'
import
{
getData_layoutPlaylists
}
from
'../../../screens/store/actions'
import
{
getData_layoutPlaylists
}
from
'../../../screens/store/actions'
...
@@ -32,6 +30,8 @@ import withReactContent from 'sweetalert2-react-content'
...
@@ -32,6 +30,8 @@ import withReactContent from 'sweetalert2-react-content'
// ** Styles
// ** Styles
import
'@styles/react/apps/app-users.scss'
import
'@styles/react/apps/app-users.scss'
import
'@styles/react/libs/flatpickr/flatpickr.scss'
const
SuccessProgressToast
=
()
=>
(
const
SuccessProgressToast
=
()
=>
(
<
Fragment
>
<
Fragment
>
...
@@ -53,6 +53,7 @@ const SuccessProgressToast = () => (
...
@@ -53,6 +53,7 @@ const SuccessProgressToast = () => (
const
ElementCard
=
({
selectedElement
,
onSubmitHandler
,
handelDelete
})
=>
{
const
ElementCard
=
({
selectedElement
,
onSubmitHandler
,
handelDelete
})
=>
{
const
store
=
useSelector
(
state
=>
state
.
projectsettings
)
const
store
=
useSelector
(
state
=>
state
.
projectsettings
)
const
storeNavbar
=
useSelector
(
state
=>
state
.
navbar
)
const
[
PlatformName
,
setPlatformName
]
=
useState
(
'Web'
)
const
[
PlatformName
,
setPlatformName
]
=
useState
(
'Web'
)
const
MySwal
=
withReactContent
(
Swal
)
const
MySwal
=
withReactContent
(
Swal
)
...
@@ -72,8 +73,8 @@ const handleError = (text) => {
...
@@ -72,8 +73,8 @@ const handleError = (text) => {
const
[
dataElement
,
setElementData
]
=
useState
(
null
),
const
[
dataElement
,
setElementData
]
=
useState
(
null
),
{
register
,
errors
,
handleSubmit
}
=
useForm
(),
{
register
,
errors
,
handleSubmit
}
=
useForm
(),
// settingStore = useSelector(state => state.projectsettings),
screensStore
=
useSelector
(
state
=>
state
.
screens
),
screensStore
=
useSelector
(
state
=>
state
.
screens
),
projectStore
=
useSelector
(
state
=>
state
.
projectsettings
),
// [pagetypes, setPagetypes] = useState(null),
// [pagetypes, setPagetypes] = useState(null),
[
layoutplaylists
,
setLayoutplaylists
]
=
useState
(
null
),
[
layoutplaylists
,
setLayoutplaylists
]
=
useState
(
null
),
[
activeTab
,
setActiveTab
]
=
useState
(
0
),
[
activeTab
,
setActiveTab
]
=
useState
(
0
),
...
@@ -106,6 +107,13 @@ const handleError = (text) => {
...
@@ -106,6 +107,13 @@ const handleError = (text) => {
}
}
},
},
handleAvalChange
=
(
value
)
=>
{
const
newData
=
{
...
dataElement
,
availability
:
value
}
setElementData
(
newData
)
},
handleAddBlock
=
()
=>
{
handleAddBlock
=
()
=>
{
if
(
!
dataElement
)
return
if
(
!
dataElement
)
return
...
@@ -123,8 +131,9 @@ const handleError = (text) => {
...
@@ -123,8 +131,9 @@ const handleError = (text) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!!
dataElement
)
return
if
(
selectedElement
!==
null
||
(
selectedElement
!==
null
&&
dataElement
!==
null
&&
selectedElement
.
id
!==
dataElement
.
id
))
{
if
(
selectedElement
!==
null
||
(
selectedElement
!==
null
&&
dataElement
!==
null
&&
selectedElement
.
id
!==
dataElement
.
id
))
{
return
setElementData
(
selectedElement
)
setElementData
(
selectedElement
)
}
}
},
[
selectedElement
])
},
[
selectedElement
])
...
@@ -142,21 +151,6 @@ const handleError = (text) => {
...
@@ -142,21 +151,6 @@ const handleError = (text) => {
}
}
},
[
store
.
saveSucces
])
},
[
store
.
saveSucces
])
// populate page types
// useEffect(() => {
// if (!settingStore.allDataPagetypes || settingStore.allDataPagetypes.length < 1) {
// dispatch(getData_pagetypes({
// start: 1,
// length: 1000,
// q: null
// }))
// }
// }, [dispatch])
// useEffect(() => {
// setPagetypes(settingStore.allDataPagetypes)
// }, [settingStore.allDataPagetypes])
// populate layout menus
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
screensStore
.
allDataLayoutPlaylists
||
screensStore
.
allDataLayoutPlaylists
.
length
<
1
)
{
if
(
!
screensStore
.
allDataLayoutPlaylists
||
screensStore
.
allDataLayoutPlaylists
.
length
<
1
)
{
dispatch
(
getData_layoutPlaylists
({
dispatch
(
getData_layoutPlaylists
({
...
@@ -165,13 +159,17 @@ const handleError = (text) => {
...
@@ -165,13 +159,17 @@ const handleError = (text) => {
q
:
null
q
:
null
}))
}))
}
}
if
(
!
projectStore
.
selectedProject
)
{
dispatch
(
getProject
(
selectedElement
.
idproject
))
}
},
[
dispatch
])
},
[
dispatch
])
useEffect
(()
=>
{
useEffect
(()
=>
{
setLayoutplaylists
(
screensStore
.
allDataLayoutPlaylists
)
setLayoutplaylists
(
screensStore
.
allDataLayoutPlaylists
)
},
[
screensStore
.
allDataLayoutPlaylists
])
},
[
screensStore
.
allDataLayoutPlaylists
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
dataElement
!==
null
&&
(
!
store
.
allData
LayoutAssets
||
store
.
allDataLayout
Assets
.
length
<
1
))
{
if
(
dataElement
!==
null
&&
(
!
store
.
allData
Assets
||
store
.
allData
Assets
.
length
<
1
))
{
dispatch
(
getData_assets
({
dispatch
(
getData_assets
({
start
:
0
,
start
:
0
,
length
:
1000
,
length
:
1000
,
...
@@ -302,7 +300,48 @@ return (
...
@@ -302,7 +300,48 @@ return (
<
Row
className
=
'app-user-edit'
>
<
Row
className
=
'app-user-edit'
>
<
Col
sm
=
'12'
>
<
Col
sm
=
'12'
>
<
ManageAssets
dataElement
=
{
dataElement
&&
dataElement
.
assets
}
handleChange
=
{
handleAssetsChange
}
/>
<
Card
>
<
CardBody
className
=
'pt-2'
>
<
Nav
pills
>
<
NavItem
>
<
NavLink
active
=
{
activeTab
===
0
}
onClick
=
{()
=>
toggle
(
0
)}
>
<
span
className
=
'align-middle d-none d-sm-block'
>
Assets
<
/span
>
<
/NavLink
>
<
/NavItem
>
<
NavItem
>
<
NavLink
active
=
{
activeTab
===
1
}
onClick
=
{()
=>
toggle
(
1
)}
>
<
span
className
=
'align-middle d-none d-sm-block'
>
Avaliability
<
/span
>
<
/NavLink
>
<
/NavItem
>
<
/Nav
>
<
TabContent
activeTab
=
{
activeTab
}
>
<
TabPane
tabId
=
{
0
}
>
<
ManageAssets
dataElement
=
{
dataElement
&&
dataElement
.
assets
}
handleChange
=
{
handleAssetsChange
}
/>
<
/TabPane
>
<
TabPane
tabId
=
{
1
}
>
<
AvaliabilityBlock
dataElement
=
{
dataElement
&&
dataElement
.
parent
&&
dataElement
.
parent
.
availability
}
handleElmChange
=
{
handleAvalChange
}
/
>
<
/TabPane
>
<
/TabContent
>
<
/CardBody>
<
/Card
>
<
/Col>
<
/Col>
<
/Row
>
<
/Row
>
...
...
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