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
97814c86
Commit
97814c86
authored
May 15, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pesented manu layout playlist
parent
18cf491f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
manageplaylist.js
src/views/menupages/mainpages/card/manageplaylist.js
+27
-7
tablayoutplaylists.js
src/views/menupages/mainpages/card/tablayoutplaylists.js
+1
-1
No files found.
src/views/menupages/mainpages/card/manageplaylist.js
View file @
97814c86
...
@@ -8,6 +8,7 @@ import classnames from 'classnames'
...
@@ -8,6 +8,7 @@ import classnames from 'classnames'
import
{
getData_menupagesplaylists
,
updatemenupages
}
from
'../../store/actions'
import
{
getData_menupagesplaylists
,
updatemenupages
}
from
'../../store/actions'
import
DataTableServerSide
from
'@components/datatable'
import
DataTableServerSide
from
'@components/datatable'
import
{
element
}
from
'prop-types'
// ** Table Server Side Column
// ** Table Server Side Column
const
serverSideColumns
=
[
const
serverSideColumns
=
[
...
@@ -18,18 +19,20 @@ const serverSideColumns = [
...
@@ -18,18 +19,20 @@ const serverSideColumns = [
minWidth
:
'25px'
minWidth
:
'25px'
},
},
{
{
name
:
'
System nam
e'
,
name
:
'
Titl
e'
,
selector
:
'
system_nam
e'
,
selector
:
'
titl
e'
,
sortable
:
true
,
sortable
:
true
,
minWidth
:
'225px'
minWidth
:
'225px'
}
}
]
]
const
ManagePlaylist
=
(
ElementID
)
=>
{
const
ManagePlaylist
=
(
dataElement
)
=>
{
const
store
=
useSelector
(
state
=>
state
.
menupages
),
const
store
=
useSelector
(
state
=>
state
.
menupages
),
[
avaliablePlaylists
,
setavaliablePlaylists
]
=
useState
([]),
[
avaliablePlaylists
,
setavaliablePlaylists
]
=
useState
([]),
[
selectedPlaylists
,
setSelectedPlaylists
]
=
useState
([])
[
selectedPlaylists
,
setSelectedPlaylists
]
=
useState
([]),
dispatch
=
useDispatch
()
const
handleAdd
=
(
value
)
=>
{
const
handleAdd
=
(
value
)
=>
{
const
newValue
=
selectedPlaylists
.
concat
(
value
)
const
newValue
=
selectedPlaylists
.
concat
(
value
)
...
@@ -39,6 +42,17 @@ const ManagePlaylist = (ElementID) => {
...
@@ -39,6 +42,17 @@ const ManagePlaylist = (ElementID) => {
const
newValue
=
selectedPlaylists
.
filter
(
element
=>
element
.
id
!==
value
.
id
)
const
newValue
=
selectedPlaylists
.
filter
(
element
=>
element
.
id
!==
value
.
id
)
setSelectedPlaylists
(
newValue
)
setSelectedPlaylists
(
newValue
)
}
}
const
getData_selectedPlaylists
=
(
params
)
=>
{
return
(
dispatch
)
=>
{
if
(
params
.
q
===
''
)
{
setSelectedPlaylists
(
dataElement
.
dataElement
)
return
}
const
newValue
=
dataElement
.
dataElement
.
filter
(
element
=>
element
.
title
.
includes
(
params
.
q
))
setSelectedPlaylists
(
newValue
)
}
}
const
serverSideColumnsLeft
=
[
const
serverSideColumnsLeft
=
[
...
serverSideColumns
,
...
serverSideColumns
,
{
{
...
@@ -93,6 +107,12 @@ const ManagePlaylist = (ElementID) => {
...
@@ -93,6 +107,12 @@ const ManagePlaylist = (ElementID) => {
setavaliablePlaylists
(
filtered
)
setavaliablePlaylists
(
filtered
)
},
[
selectedPlaylists
])
},
[
selectedPlaylists
])
useEffect
(()
=>
{
if
(
dataElement
!==
null
&&
dataElement
.
dataElement
!==
null
)
{
setSelectedPlaylists
(
dataElement
.
dataElement
)
}
},
[
dataElement
])
return
<
div
className
=
"card"
>
return
<
div
className
=
"card"
>
<
div
className
=
"card-header"
>
<
div
className
=
"card-header"
>
<
h4
className
=
"card-title"
>
playlist
<
/h4
>
<
h4
className
=
"card-title"
>
playlist
<
/h4
>
...
@@ -103,7 +123,7 @@ const ManagePlaylist = (ElementID) => {
...
@@ -103,7 +123,7 @@ const ManagePlaylist = (ElementID) => {
<
DataTableServerSide
<
DataTableServerSide
cardTitle
=
'Content'
cardTitle
=
'Content'
allData
=
{
selectedPlaylists
}
allData
=
{
selectedPlaylists
}
getData
=
{
getData_
menupagesp
laylists
}
getData
=
{
getData_
selectedP
laylists
}
serverSideColumns
=
{
serverSideColumnsLeft
}
serverSideColumns
=
{
serverSideColumnsLeft
}
// linkAddButton={`/add`}
// linkAddButton={`/add`}
total
=
{
selectedPlaylists
.
length
}
total
=
{
selectedPlaylists
.
length
}
...
...
src/views/menupages/mainpages/card/tablayoutplaylists.js
View file @
97814c86
...
@@ -112,7 +112,7 @@ const TabLayoutPlaylist = ({block, selectedDataElement, setElementData}) => {
...
@@ -112,7 +112,7 @@ const TabLayoutPlaylist = ({block, selectedDataElement, setElementData}) => {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
ManagePlaylist
ElementID
=
{
dataElement
&&
dataElement
.
layout_id
}
/>
<
ManagePlaylist
dataElement
=
{
dataElement
&&
dataElement
.
playlists
}
/>
<
/Col>
<
/Col>
...
...
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