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
267ca079
Commit
267ca079
authored
May 18, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist basic crud
parent
9797b0aa
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
146 additions
and
352 deletions
+146
-352
playllists.js
src/navigation/global/playllists.js
+17
-0
index.js
src/navigation/horizontal/index.js
+2
-0
index.js
src/navigation/vertical/index.js
+2
-0
index.js
src/router/routes/index.js
+2
-1
playlists.js
src/router/routes/playlists.js
+33
-0
index.js
src/views/menupages/mainpages/index.js
+1
-1
pages.js
src/views/menupages/store/actions/pages.js
+1
-1
index.js
src/views/playlists/projectplaylists/add/index.js
+10
-13
index.js
src/views/playlists/projectplaylists/card/index.js
+50
-127
plataform.js
src/views/playlists/projectplaylists/card/plataform.js
+0
-179
data.js
src/views/playlists/projectplaylists/data.js
+5
-5
index.js
src/views/playlists/projectplaylists/edit/index.js
+1
-1
main.js
src/views/playlists/projectplaylists/edit/main.js
+14
-16
index.js
src/views/playlists/projectplaylists/index.js
+1
-1
table.js
src/views/playlists/projectplaylists/table.js
+5
-5
playlists.js
src/views/playlists/store/actions/playlists.js
+1
-1
index.js
src/views/playlists/store/reducer/index.js
+1
-1
No files found.
src/navigation/global/playllists.js
0 → 100644
View file @
267ca079
import
{
Package
,
Briefcase
,
HardDrive
,
Globe
,
Flag
}
from
'react-feather'
export
default
[
{
id
:
'Playlists'
,
title
:
'Playlists'
,
icon
:
<
Package
/>
,
children
:
[
{
id
:
'playlistsDash'
,
title
:
'Project Playlists'
,
icon
:
<
Briefcase
/>
,
navLink
:
'/playlists/projectplaylists'
}
]
}
]
\ No newline at end of file
src/navigation/horizontal/index.js
View file @
267ca079
...
@@ -10,11 +10,13 @@ import chartsAndMaps from './charts-maps'
...
@@ -10,11 +10,13 @@ import chartsAndMaps from './charts-maps'
import
settings
from
'./settings'
import
settings
from
'./settings'
import
screens
from
'../global/screens'
import
screens
from
'../global/screens'
import
menupages
from
'../global/pages'
import
menupages
from
'../global/pages'
import
playlists
from
'../global/playllists'
// ** Merge & Export
// ** Merge & Export
export
default
[
export
default
[
// ...dashboards,
// ...dashboards,
...
screens
,
...
screens
,
...
playlists
,
...
menupages
,
...
menupages
,
...
settings
...
settings
// ...apps,
// ...apps,
...
...
src/navigation/vertical/index.js
View file @
267ca079
...
@@ -11,12 +11,14 @@ import chartsAndMaps from './charts-maps'
...
@@ -11,12 +11,14 @@ import chartsAndMaps from './charts-maps'
import
settings
from
'./settings'
import
settings
from
'./settings'
import
screens
from
'../global/screens'
import
screens
from
'../global/screens'
import
pages
from
'../global/pages'
import
pages
from
'../global/pages'
import
playlists
from
'../global/playllists'
// ** Merge & Export
// ** Merge & Export
export
default
[
export
default
[
// ...dashboards,
// ...dashboards,
...
screens
,
...
screens
,
...
playlists
,
...
pages
,
...
pages
,
...
settings
...
settings
// ...apps,
// ...apps,
...
...
src/router/routes/index.js
View file @
267ca079
...
@@ -12,7 +12,7 @@ import PageLayoutsRoutes from './PageLayouts'
...
@@ -12,7 +12,7 @@ import PageLayoutsRoutes from './PageLayouts'
import
SettingsRoutes
from
'./Settings'
import
SettingsRoutes
from
'./Settings'
import
ScreensRoutes
from
'./screens'
import
ScreensRoutes
from
'./screens'
import
MenuPagesRoutes
from
'./menupages'
import
MenuPagesRoutes
from
'./menupages'
import
PlaylistsRoutes
from
'./playlists'
// ** Document title
// ** Document title
const
TemplateTitle
=
'%s - Vuexy React Admin Template'
const
TemplateTitle
=
'%s - Vuexy React Admin Template'
...
@@ -32,6 +32,7 @@ const Routes = [
...
@@ -32,6 +32,7 @@ const Routes = [
...
ChartMapsRoutes
,
...
ChartMapsRoutes
,
...
ScreensRoutes
,
...
ScreensRoutes
,
...
PlaylistsRoutes
,
...
MenuPagesRoutes
,
...
MenuPagesRoutes
,
...
SettingsRoutes
...
SettingsRoutes
]
]
...
...
src/router/routes/playlists.js
0 → 100644
View file @
267ca079
import
{
lazy
}
from
'react'
import
{
Redirect
}
from
'react-router-dom'
const
PlaylistsRoutes
=
[
// settingss
{
path
:
'/playlists/projectplaylists/edit'
,
exact
:
true
,
component
:
()
=>
<
Redirect
to
=
'/playlists/projectplaylists/edit/1'
/>
},
{
path
:
'/playlists/projectplaylists/edit/:id'
,
component
:
lazy
(()
=>
import
(
'../../views/playlists/projectplaylists/edit'
)),
meta
:
{
navLink
:
'/playlists/projectplaylists/edit'
}
},
{
path
:
'/playlists/projectplaylists/add'
,
component
:
lazy
(()
=>
import
(
'../../views/playlists/projectplaylists/add'
)),
meta
:
{
navLink
:
'/playlists/projectplaylists/add'
}
},
{
path
:
'/playlists/projectplaylists'
,
component
:
lazy
(()
=>
import
(
'../../views/playlists/projectplaylists'
))
}
]
export
default
PlaylistsRoutes
src/views/menupages/mainpages/index.js
View file @
267ca079
...
@@ -17,7 +17,7 @@ import moduleSettings from './module'
...
@@ -17,7 +17,7 @@ import moduleSettings from './module'
const
Tables
=
()
=>
{
const
Tables
=
()
=>
{
return
(
return
(
<
Fragment
>
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'
Screens'
breadCrumbParent
=
'Screen
s'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Breadcrumbs
breadCrumbTitle
=
'
Pages'
breadCrumbParent
=
'Page
s'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
Col
sm
=
'12'
>
<
DataTable
/>
<
DataTable
/>
...
...
src/views/menupages/store/actions/pages.js
View file @
267ca079
...
@@ -36,7 +36,7 @@ export const getData_menupages = params => {
...
@@ -36,7 +36,7 @@ export const getData_menupages = params => {
.
then
(
response
=>
{
.
then
(
response
=>
{
dispatch
({
dispatch
({
type
:
'ADD_MENUPAGE'
,
type
:
'ADD_MENUPAGE'
,
params
:
newparams
params
})
})
})
})
.
then
(()
=>
{
.
then
(()
=>
{
...
...
src/views/playlists/projectplaylists/add/index.js
View file @
267ca079
...
@@ -3,7 +3,7 @@ import { Fragment } from 'react'
...
@@ -3,7 +3,7 @@ import { Fragment } from 'react'
import
{
Link
}
from
'react-router-dom'
import
{
Link
}
from
'react-router-dom'
// ** Store & Actions
// ** Store & Actions
import
{
add
menupages
}
from
'../../store/actions'
import
{
add
playlist
}
from
'../../store/actions'
import
{
useDispatch
}
from
'react-redux'
import
{
useDispatch
}
from
'react-redux'
// ** Custom Components
// ** Custom Components
...
@@ -23,24 +23,21 @@ const Tables = () => {
...
@@ -23,24 +23,21 @@ const Tables = () => {
const
dispatch
=
useDispatch
()
const
dispatch
=
useDispatch
()
const
onSubmitHandler
=
values
=>
{
const
onSubmitHandler
=
values
=>
{
dispatch
(
dispatch
(
add
menupages
({
add
playlist
({
idproject
:
values
.
idproject
,
idproject
:
values
.
idproject
,
system_name
:
values
.
system_name
,
title
:
values
.
title
,
last_seen
:
values
.
last_seen
,
layout_id
:
values
.
layout_id
,
layout_page_id
:
values
.
layout_page_id
,
dynamic
:
values
.
dynamic
,
type
:
values
.
type
,
special
:
values
.
special
,
display
:
values
.
display
,
special_id
:
values
.
special_id
pagetypeid
:
values
.
pagetypeid
,
}
order
:
values
.
order
,
menu_page_layouts
:
values
.
menu_page_layouts
})
)
)
)
}
}
return
(
return
(
<
Fragment
>
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'P
ages'
breadCrumbParent
=
'Page
s'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Breadcrumbs
breadCrumbTitle
=
'P
laylists'
breadCrumbParent
=
'Playlist
s'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
Col
sm
=
'12'
>
<
Link
to
=
{
moduleSettings
.
baseURL
}
>
Back
to
{
moduleSettings
.
mainTitle
}
<
/Link
>
<
Link
to
=
{
moduleSettings
.
baseURL
}
>
Back
to
{
moduleSettings
.
mainTitle
}
<
/Link
>
...
...
src/views/playlists/projectplaylists/card/index.js
View file @
267ca079
...
@@ -11,13 +11,13 @@ import { isObjEmpty } from '@utils'
...
@@ -11,13 +11,13 @@ import { isObjEmpty } from '@utils'
import
{
Bell
,
Check
,
X
,
AlertTriangle
,
Info
}
from
'react-feather'
import
{
Bell
,
Check
,
X
,
AlertTriangle
,
Info
}
from
'react-feather'
import
TabLayoutPlaylist
from
'./tablayoutplaylists'
//
import TabLayoutPlaylist from './tablayoutplaylists'
// ** Store & Actions
// ** Store & Actions
import
{
resetResults
}
from
'../../store/actions'
import
{
resetResults
}
from
'../../store/actions'
import
{
getData_pagetypes
}
from
'../../../settings/store/actions'
import
{
getData_pagetypes
}
from
'../../../settings/store/actions'
import
{
getData_layout
menu
s
}
from
'../../../screens/store/actions'
import
{
getData_layout
Playlist
s
}
from
'../../../screens/store/actions'
import
{
useForm
}
from
'react-hook-form'
import
{
useForm
}
from
'react-hook-form'
...
@@ -71,7 +71,7 @@ const handleError = (text) => {
...
@@ -71,7 +71,7 @@ const handleError = (text) => {
settingStore
=
useSelector
(
state
=>
state
.
projectsettings
),
settingStore
=
useSelector
(
state
=>
state
.
projectsettings
),
screensStore
=
useSelector
(
state
=>
state
.
screens
),
screensStore
=
useSelector
(
state
=>
state
.
screens
),
[
pagetypes
,
setPagetypes
]
=
useState
(
null
),
[
pagetypes
,
setPagetypes
]
=
useState
(
null
),
[
layou
menu
,
setLayoumenu
]
=
useState
(
null
),
[
layou
tplaylists
,
setLayoutplaylists
]
=
useState
(
null
),
[
activeTab
,
setActiveTab
]
=
useState
(
0
),
[
activeTab
,
setActiveTab
]
=
useState
(
0
),
//
//
toggle
=
tab
=>
setActiveTab
(
tab
),
toggle
=
tab
=>
setActiveTab
(
tab
),
...
@@ -82,13 +82,11 @@ const handleError = (text) => {
...
@@ -82,13 +82,11 @@ const handleError = (text) => {
const
submitElement
=
{
const
submitElement
=
{
...
dataElement
,
...
dataElement
,
idproject
:
values
.
idproject
,
idproject
:
values
.
idproject
,
system_name
:
values
.
system_name
,
title
:
values
.
title
,
last_seen
:
values
.
last_seen
,
layout_id
:
values
.
layout_id
,
layout_page_id
:
values
.
layout_page_id
,
dynamic
:
values
.
dynamic
,
type
:
values
.
type
,
special
:
values
.
special
,
display
:
values
.
display
,
special_id
:
values
.
special_id
pagetypeid
:
values
.
pagetypeid
,
order
:
values
.
order
}
}
onSubmitHandler
(
submitElement
)
onSubmitHandler
(
submitElement
)
...
@@ -146,8 +144,8 @@ const handleError = (text) => {
...
@@ -146,8 +144,8 @@ const handleError = (text) => {
// populate layout menus
// populate layout menus
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
screensStore
.
allDataLayout
Menus
||
screensStore
.
allDataLayoutMenu
s
.
length
<
1
)
{
if
(
!
screensStore
.
allDataLayout
Playlists
||
screensStore
.
allDataLayoutPlaylist
s
.
length
<
1
)
{
dispatch
(
getData_layout
menu
s
({
dispatch
(
getData_layout
Playlist
s
({
start
:
1
,
start
:
1
,
length
:
1000
,
length
:
1000
,
q
:
null
q
:
null
...
@@ -155,8 +153,8 @@ const handleError = (text) => {
...
@@ -155,8 +153,8 @@ const handleError = (text) => {
}
}
},
[
dispatch
])
},
[
dispatch
])
useEffect
(()
=>
{
useEffect
(()
=>
{
setLayou
menu
(
screensStore
.
allDataLayoutMenu
s
)
setLayou
tplaylists
(
screensStore
.
allDataLayoutPlaylist
s
)
},
[
screensStore
.
allDataLayout
Menu
s
])
},
[
screensStore
.
allDataLayout
Playlist
s
])
return
(
return
(
...
@@ -195,33 +193,33 @@ return (
...
@@ -195,33 +193,33 @@ return (
<
/Col
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
FormGroup
>
<
Label
for
=
'
system_name'
>
System
nam
e
<
/Label
>
<
Label
for
=
'
title'
>
Titl
e
<
/Label
>
<
Input
<
Input
type
=
'text'
type
=
'text'
name
=
'
system_nam
e'
name
=
'
titl
e'
id
=
'
system_nam
e'
id
=
'
titl
e'
innerRef
=
{
register
({
required
:
true
})}
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'
system_nam
e'
placeholder
=
'
titl
e'
defaultValue
=
{
dataElement
&&
dataElement
.
system_nam
e
}
defaultValue
=
{
dataElement
&&
dataElement
.
titl
e
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'
system_nam
e'
]
})}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'
titl
e'
]
})}
/
>
/
>
<
/FormGroup
>
<
/FormGroup
>
<
/Col
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
FormGroup
>
<
Label
for
=
'layout_
page_id'
>
Layout
page
<
/Label
>
<
Label
for
=
'layout_
id'
>
Layout
Playlist
<
/Label
>
<
Input
<
Input
type
=
'select'
type
=
'select'
name
=
'layout_
page_
id'
name
=
'layout_id'
id
=
'layout_
page_
id'
id
=
'layout_id'
innerRef
=
{
register
({
required
:
true
})}
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'layout_
page_
id'
placeholder
=
'layout_id'
defaultValue
=
{
dataElement
&&
dataElement
.
layout_
page_
id
}
defaultValue
=
{
dataElement
&&
dataElement
.
layout_id
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'layout_
page_
id'
]
})}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'layout_id'
]
})}
>
>
{
!!
layou
menu
?
layoumenu
.
map
(
option
=>
{
{
!!
layou
tplaylists
?
layoutplaylists
.
map
(
option
=>
{
return
<
option
key
=
{
option
.
id
}
return
<
option
key
=
{
option
.
id
}
selected
=
{
option
.
id
===
dataElement
.
layout_
page_
id
?
option
.
id
:
''
}
selected
=
{
option
.
id
===
dataElement
.
layout_id
?
option
.
id
:
''
}
value
=
{
option
.
id
}
>
{
option
.
name
}
<
/option
>
value
=
{
option
.
id
}
>
{
option
.
name
}
<
/option
>
})
:
<
option
>
Loading
<
/option>
}
})
:
<
option
>
Loading
<
/option>
}
<
/Input
>
<
/Input
>
...
@@ -229,86 +227,49 @@ return (
...
@@ -229,86 +227,49 @@ return (
<
/Col
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
FormGroup
>
<
Label
for
=
'
type'
>
type
<
/Label
>
<
Label
for
=
'
dynamic'
>
dynamic
<
/Label
>
<
Input
<
Input
type
=
'select'
type
=
'select'
name
=
'
type
'
name
=
'
dynamic
'
id
=
'
type
'
id
=
'
dynamic
'
innerRef
=
{
register
({
required
:
true
})}
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'
type
'
placeholder
=
'
dynamic
'
defaultValue
=
{
dataElement
&&
dataElement
.
type
}
defaultValue
=
{
dataElement
&&
dataElement
.
dynamic
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'
type
'
]
})}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'
dynamic
'
]
})}
>
>
<
option
value
=
'
master'
>
Master
<
/option
>
<
option
value
=
'
0'
>
No
<
/option
>
<
option
value
=
'
child'
>
Child
<
/option
>
<
option
value
=
'
1'
>
Yes
<
/option
>
<
/Input>
<
/Input>
<
/FormGroup
>
<
/FormGroup
>
<
/Col
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
FormGroup
>
<
Label
for
=
'
display'
>
display
<
/Label
>
<
Label
for
=
'
special'
>
special
<
/Label
>
<
Input
<
Input
type
=
'select'
type
=
'select'
name
=
'
display
'
name
=
'
special
'
id
=
'
display
'
id
=
'
special
'
innerRef
=
{
register
({
required
:
true
})}
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'
display
'
placeholder
=
'
special
'
defaultValue
=
{
dataElement
&&
dataElement
.
display
}
defaultValue
=
{
dataElement
&&
dataElement
.
special
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'
display
'
]
})}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'
special
'
]
})}
>
>
<
option
value
=
'icon_text'
>
Icon
Text
<
/option
>
<
option
value
=
'0'
>
No
<
/option
>
<
option
value
=
'icon'
>
Icon
<
/option
>
<
option
value
=
'1'
>
Yes
<
/option>
<
option
value
=
'text'
>
Text
<
/option
>
<
/Input
>
<
/Input
>
<
/FormGroup
>
<
/FormGroup
>
<
/Col
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
FormGroup
>
<
Label
for
=
'
pagetypeid'
>
Page
Type
<
/Label
>
<
Label
for
=
'
special_id'
>
special_id
<
/Label
>
<
Input
<
Input
type
=
'select'
name
=
'pagetypeid'
id
=
'pagetypeid'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'pagetypeid'
defaultValue
=
{
dataElement
&&
dataElement
.
pagetypeid
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'pagetypeid'
]
})}
>
{
!!
pagetypes
?
pagetypes
.
map
(
option
=>
{
return
<
option
key
=
{
option
.
id
}
selected
=
{
option
.
id
===
dataElement
.
pagetypeid
}
value
=
{
option
.
id
}
>
{
option
.
type
}
<
/option
>
})
:
<
option
>
Loading
<
/option>
}
<
/Input
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'order'
>
order
<
/Label
>
<
Input
type
=
'text'
name
=
'order'
id
=
'order'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'order'
defaultValue
=
{
dataElement
&&
dataElement
.
order
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'order'
]
})}
/
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'last_seen'
>
last_seen
<
/Label
>
<
Input
readOnly
=
{
true
}
type
=
'text'
type
=
'text'
name
=
'
last_seen
'
name
=
'
special_id
'
id
=
'
last_seen
'
id
=
'
special_id
'
innerRef
=
{
register
({
required
:
false
})}
innerRef
=
{
register
({
required
:
false
})}
placeholder
=
'
last_seen
'
placeholder
=
'
special_id
'
defaultValue
=
{
dataElement
&&
dataElement
.
last_seen
}
defaultValue
=
{
dataElement
&&
dataElement
.
special_id
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'
last_seen
'
]
})}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'
special_id
'
]
})}
/
>
/
>
<
/FormGroup
>
<
/FormGroup
>
<
/Col
>
<
/Col
>
...
@@ -319,46 +280,8 @@ return (
...
@@ -319,46 +280,8 @@ return (
<
Card
>
<
Card
>
<
CardBody
className
=
'pt-2'
>
<
CardBody
className
=
'pt-2'
>
<
h4
className
=
"card-title"
>
Blocks
<
/h4
>
<
h4
className
=
"card-title"
>
Assets
<
/h4
>
<
Nav
pills
>
{
dataElement
&&
dataElement
.
menu_page_layouts
.
map
((
block
,
index
)
=>
{
return
<
NavItem
>
<
NavLink
key
=
{
index
}
active
=
{
activeTab
===
index
}
onClick
=
{()
=>
toggle
(
index
)}
>
<
span
className
=
'align-middle d-none d-sm-block'
>
Blocks
{
index
+
1
}
<
/span
>
<
/NavLink
>
<
/NavItem
>
})}
<
NavItem
>
<
NavLink
className
=
'btn-primary'
onClick
=
{()
=>
handleAddBlock
()}
>
<
span
className
=
'align-middle d-none d-sm-block'
>+
add
New
<
/span
>
<
/NavLink
>
<
/NavItem
>
<
/Nav
>
<
TabContent
activeTab
=
{
activeTab
}
>
{
!!
dataElement
&&
dataElement
.
menu_page_layouts
.
map
((
block
,
index
)
=>
{
return
<
TabPane
tabId
=
{
index
}
>
<
TabLayoutPlaylist
block
=
{
block
}
selectedDataElement
=
{
dataElement
}
setElementData
=
{
setElementData
}
/
>
<
/TabPane
>
}
)
}
<
TabPane
tabId
=
{
dataElement
?
dataElement
.
menu_page_layouts
.
length
:
0
}
>
<
div
// selectedUser={store.selectedUser}
>
<
/div
>
<
/TabPane
>
<
/TabContent>
<
/CardBody>
<
/CardBody>
<
/Card>
<
/Card>
<
/Col
>
<
/Col
>
...
...
src/views/playlists/projectplaylists/card/plataform.js
deleted
100644 → 0
View file @
9797b0aa
import
{
Fragment
,
useState
,
useEffect
,
useRef
,
memo
}
from
'react'
import
{
Media
,
Button
,
Label
,
Form
,
FormGroup
,
Input
,
Table
,
CustomInput
,
Card
,
CardBody
,
Row
,
Col
,
Nav
,
NavItem
,
NavLink
,
TabContent
,
TabPane
,
Alert
,
UncontrolledButtonDropdown
}
from
'reactstrap'
// ** Store & Actions
import
{
useDispatch
}
from
'react-redux'
// ** Store & Actions
import
{
getData_platforms
}
from
'../../../settings/store/actions'
import
{
Lock
,
Edit
,
Trash2
}
from
'react-feather'
import
{
useForm
}
from
'react-hook-form'
import
classnames
from
'classnames'
import
{
circle
}
from
'leaflet'
import
moduleSettings
from
'../module'
const
ElementPlatform
=
({
dataElement
,
setElement
,
store
})
=>
{
const
dispatch
=
useDispatch
(),
{
register
,
errors
,
handleSubmit
}
=
useForm
()
const
[
plataforms
,
setPlataforms
]
=
useState
(
null
),
[
selectedOption
,
setSelectedOption
]
=
useState
(
null
),
platformsIDs
=
[
0
]
// console.log(dataElement)
// console.log(store)
// ** Function to get user on mount
useEffect
(()
=>
{
if
(
!
store
.
allDataPlatforms
||
store
.
allDataPlatforms
.
length
<
1
)
{
dispatch
(
getData_platforms
({
start
:
1
,
length
:
1000
,
q
:
null
}))
}
},
[
dispatch
])
useEffect
(()
=>
{
setPlataforms
(
store
.
allDataPlatforms
)
},
[
store
.
allDataPlatforms
])
const
handleGridChange
=
(
value
,
index
,
field
)
=>
{
// console.log([value, index, field])
const
newData
=
dataElement
.
platforms
.
map
((
platform
,
i
)
=>
{
if
(
i
===
index
)
platform
.
pivot
[
field
]
=
value
// if (i === index) {
// if (field === 'type') platform.pivot.type = value
// if (field === 'slug') platform.pivot.slug = value
// }
})
setElement
(
{
...
dataElement
})
}
return
!!
dataElement
?
(
<
div
clssName
=
'permissions border mt-1'
>
<
h6
className
=
'py-1 mx-1 mb-0 font-medium-2'
>
<
Lock
size
=
{
18
}
className
=
'mr-25'
/>
<
span
className
=
'align-middle'
>
Platforms
<
/span
>
<
/h6
>
<
Table
borderless
striped
responsive
>
<
thead
className
=
'thead-light'
>
<
tr
>
<
th
>
plataform
<
/th
>
{
Object
.
keys
(
moduleSettings
.
newElement
).
map
(
name
=>
{
return
(
<
th
>
{
name
.
split
(
'_'
).
join
(
' '
)}
<
/th
>
)
})
}
<
/tr
>
<
/thead
>
<
tbody
>
{
!!
dataElement
&&
!!
dataElement
.
platforms
&&
dataElement
.
platforms
.
map
((
platform
,
index
)
=>
{
const
plataformsOptions
=
platform
.
pivot
,
locked
=
plataformsOptions
.
locked
platformsIDs
.
push
(
`
${
platform
.
id
}
`
)
return
(
<
tr
key
=
{
platform
.
id
}
>
<
td
>
{
platform
.
name
}
<
/td
>
{
Object
.
keys
(
moduleSettings
.
newElement
).
map
(
name
=>
{
return
(
<
td
>
<
Input
type
=
{
moduleSettings
.
elementsOption
[
name
]
?
'select'
:
'text'
}
name
=
{
name
}
id
=
{
name
}
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'0'
defaultValue
=
{
plataformsOptions
&&
plataformsOptions
[
name
]}
className
=
{
classnames
({
'is-invalid'
:
errors
[{
name
}]
})}
onChange
=
{(
e
)
=>
handleGridChange
(
e
.
target
.
value
,
index
,
name
)}
>
{
moduleSettings
.
elementsOption
[
name
]
?
moduleSettings
.
elementsOption
[
name
].
map
((
name
,
key
)
=>
{
return
(
<
option
key
=
{
key
}
name
=
{
name
}
>
{
name
}
<
/option
>
)
})
:
<
span
><
/span>
}
<
/Input>
<
/td
>
)
})
}
<
/tr>
)
})
}
<
/tbody
>
<
/Table
>
<
Col
md
=
'12'
sm
=
'12'
>
<
br
/>
<
/Col
>
<
Row
>
<
Col
md
=
'4'
sm
=
'4'
>
<
FormGroup
>
<
Label
for
=
'addoption'
>
Add
Platforms
<
/Label
>
<
Input
type
=
'select'
name
=
'addoption'
id
=
'addoption'
onChange
=
{(
e
)
=>
setSelectedOption
(
e
.
target
.
value
)}
>>
<
option
><
/option
>
{
!!
plataforms
&&
plataforms
.
map
(
option
=>
{
return
<
option
key
=
{
option
.
id
}
value
=
{
`
${
option
.
id
}
.
${
option
.
name
}
`
}
>
{
option
.
name
}
<
/option
>
})}
<
/Input
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'3'
sm
=
'4'
>
<
FormGroup
>
<
Label
for
=
'addoptionbutton'
>&
nbsp
;
<
/Label
>
<
Button
.
Ripple
color
=
'secondary'
name
=
"addoptionbutton"
outline
asyncOptions
=
{
e
=>
console
.
log
(
e
.
getOptions
)
}
onClick
=
{()
=>
{
if
(
!
selectedOption
)
return
const
plataform
=
selectedOption
.
split
(
'.'
)
if
(
platformsIDs
.
indexOf
(
plataform
[
0
])
>
0
)
return
const
elementAdded
=
dataElement
.
platforms
.
push
({
name
:
plataform
[
1
],
id
:
plataform
[
0
],
key
:
plataform
[
0
],
pivot
:
moduleSettings
.
newElement
})
setElement
(
{
...
dataElement
,
elementAdded
}
)
}}
>
add
<
/Button.Ripple
>
<
/FormGroup
>
<
/Col
>
<
/Row>
<
/div
>
)
:
(
<
Fragment
>
<
/Fragment
>
)
}
export
default
ElementPlatform
src/views/playlists/projectplaylists/data.js
View file @
267ca079
...
@@ -217,8 +217,8 @@ export const serverSideColumns = [
...
@@ -217,8 +217,8 @@ export 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'
,
cell
:
row
=>
(
cell
:
row
=>
(
...
@@ -230,7 +230,7 @@ export const serverSideColumns = [
...
@@ -230,7 +230,7 @@ export const serverSideColumns = [
className
=
'user-name text-truncate mb-0'
className
=
'user-name text-truncate mb-0'
// onClick={() => store.dispatch(cleanLayoutMenu(row.id))}
// onClick={() => store.dispatch(cleanLayoutMenu(row.id))}
>
>
<
span
className
=
'font-weight-bold'
>
{
row
.
system_nam
e
}
<
/span
>
<
span
className
=
'font-weight-bold'
>
{
row
.
titl
e
}
<
/span
>
<
/Link
>
<
/Link
>
<
small
className
=
'text-truncate text-muted mb-0'
>
edit
<
/small
>
<
small
className
=
'text-truncate text-muted mb-0'
>
edit
<
/small
>
<
/div
>
<
/div
>
...
@@ -238,8 +238,8 @@ export const serverSideColumns = [
...
@@ -238,8 +238,8 @@ export const serverSideColumns = [
)
)
},
},
{
{
name
:
'
Order
'
,
name
:
'
Dynamic
'
,
selector
:
'
order
'
,
selector
:
'
dynamic
'
,
sortable
:
true
,
sortable
:
true
,
minWidth
:
'225px'
minWidth
:
'225px'
}
}
...
...
src/views/playlists/projectplaylists/edit/index.js
View file @
267ca079
...
@@ -18,7 +18,7 @@ import moduleSettings from '../module'
...
@@ -18,7 +18,7 @@ import moduleSettings from '../module'
const
Tables
=
()
=>
{
const
Tables
=
()
=>
{
return
(
return
(
<
Fragment
>
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'P
ages'
breadCrumbParent
=
'Page
s'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Breadcrumbs
breadCrumbTitle
=
'P
laylists'
breadCrumbParent
=
'Playlist
s'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
Col
sm
=
'12'
>
<
Link
to
=
{
moduleSettings
.
baseURL
}
>
Back
to
{
moduleSettings
.
mainTitleSingle
}
<
/Link
>
<
Link
to
=
{
moduleSettings
.
baseURL
}
>
Back
to
{
moduleSettings
.
mainTitleSingle
}
<
/Link
>
...
...
src/views/playlists/projectplaylists/edit/main.js
View file @
267ca079
...
@@ -2,7 +2,7 @@ import { useState, useEffect, Fragment } from 'react'
...
@@ -2,7 +2,7 @@ import { useState, useEffect, Fragment } from 'react'
import
{
useParams
,
Link
}
from
'react-router-dom'
import
{
useParams
,
Link
}
from
'react-router-dom'
// ** Store & Actions
// ** Store & Actions
import
{
get
menupages
,
updatemenupages
}
from
'../../store/actions'
import
{
get
playlist
,
updateplaylist
}
from
'../../store/actions'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
...
@@ -15,7 +15,7 @@ import moduleSettings from '../module'
...
@@ -15,7 +15,7 @@ import moduleSettings from '../module'
const
ElementEdit
=
()
=>
{
const
ElementEdit
=
()
=>
{
// ** States & Vars
// ** States & Vars
const
store
=
useSelector
(
state
=>
state
.
menupage
s
),
const
store
=
useSelector
(
state
=>
state
.
playlist
s
),
[
dataElement
,
setElementData
]
=
useState
(
null
),
[
dataElement
,
setElementData
]
=
useState
(
null
),
dispatch
=
useDispatch
(),
dispatch
=
useDispatch
(),
{
id
}
=
useParams
()
{
id
}
=
useParams
()
...
@@ -23,16 +23,14 @@ const ElementEdit = () => {
...
@@ -23,16 +23,14 @@ const ElementEdit = () => {
const
onSubmitHandler
=
values
=>
{
const
onSubmitHandler
=
values
=>
{
console
.
log
(
values
)
console
.
log
(
values
)
dispatch
(
dispatch
(
update
menupages
({
update
playlist
({
...
dataElement
,
...
dataElement
,
idproject
:
values
.
idproject
,
idproject
:
values
.
idproject
,
system_name
:
values
.
system_name
,
title
:
values
.
title
,
last_seen
:
values
.
last_seen
,
layout_id
:
values
.
layout_id
,
layout_page_id
:
values
.
layout_page_id
,
dynamic
:
values
.
dynamic
,
type
:
values
.
type
,
special
:
values
.
special
,
display
:
values
.
display
,
special_id
:
values
.
special_id
pagetypeid
:
values
.
pagetypeid
,
order
:
values
.
order
})
})
)
)
...
@@ -40,21 +38,21 @@ const ElementEdit = () => {
...
@@ -40,21 +38,21 @@ const ElementEdit = () => {
// ** Function to get user on mount
// ** Function to get user on mount
useEffect
(()
=>
{
useEffect
(()
=>
{
dispatch
(
get
menupages
(
id
))
dispatch
(
get
playlist
(
id
))
},
[
dispatch
])
},
[
dispatch
])
// ** Update user image on mount or change
// ** Update user image on mount or change
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
store
.
selected
MenuPage
!==
null
||
(
store
.
selectedMenuPage
!==
null
&&
dataElement
!==
null
&&
store
.
selectedMenuPage
.
id
!==
dataElement
.
id
))
{
if
(
store
.
selected
Playlist
!==
null
||
(
store
.
selectedPlaylist
!==
null
&&
dataElement
!==
null
&&
store
.
selectedPlaylist
.
id
!==
dataElement
.
id
))
{
return
setElementData
(
store
.
selected
MenuPage
)
return
setElementData
(
store
.
selected
Playlist
)
}
}
},
[
store
.
selected
MenuPage
])
},
[
store
.
selected
Playlist
])
return
store
.
selected
MenuPage
!==
null
&&
store
.
selectedMenuPage
!==
undefined
?
(
return
store
.
selected
Playlist
!==
null
&&
store
.
selectedPlaylist
!==
undefined
?
(
<
ElementCard
<
ElementCard
selectedElement
=
{
store
.
selected
MenuPage
}
selectedElement
=
{
store
.
selected
Playlist
}
onSubmitHandler
=
{
onSubmitHandler
}
onSubmitHandler
=
{
onSubmitHandler
}
/>
/>
)
:
(
)
:
(
...
...
src/views/playlists/projectplaylists/index.js
View file @
267ca079
...
@@ -17,7 +17,7 @@ import moduleSettings from './module'
...
@@ -17,7 +17,7 @@ import moduleSettings from './module'
const
Tables
=
()
=>
{
const
Tables
=
()
=>
{
return
(
return
(
<
Fragment
>
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'
Screens'
breadCrumbParent
=
'Screen
s'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Breadcrumbs
breadCrumbTitle
=
'
Playlists'
breadCrumbParent
=
'Playlist
s'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
Col
sm
=
'12'
>
<
DataTable
/>
<
DataTable
/>
...
...
src/views/playlists/projectplaylists/table.js
View file @
267ca079
...
@@ -3,7 +3,7 @@ import { Fragment, useState, useEffect, memo } from 'react'
...
@@ -3,7 +3,7 @@ import { Fragment, useState, useEffect, memo } from 'react'
// ** Table Columns
// ** Table Columns
import
{
serverSideColumns
}
from
'./data'
import
{
serverSideColumns
}
from
'./data'
// ** Store & Actions
// ** Store & Actions
import
{
getData_
menupage
s
}
from
'../store/actions'
import
{
getData_
playlist
s
}
from
'../store/actions'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
import
DataTableServerSide
from
'@components/datatable'
import
DataTableServerSide
from
'@components/datatable'
...
@@ -12,16 +12,16 @@ import moduleSettings from './module'
...
@@ -12,16 +12,16 @@ import moduleSettings from './module'
const
DataTable
=
()
=>
{
const
DataTable
=
()
=>
{
// ** Store Vars
// ** Store Vars
const
dispatch
=
useDispatch
()
const
dispatch
=
useDispatch
()
const
store
=
useSelector
(
state
=>
state
.
menupage
s
)
const
store
=
useSelector
(
state
=>
state
.
playlist
s
)
return
(
return
(
<
DataTableServerSide
<
DataTableServerSide
cardTitle
=
{
moduleSettings
.
mainTitle
}
cardTitle
=
{
moduleSettings
.
mainTitle
}
allData
=
{
store
.
allData
MenuPage
s
}
allData
=
{
store
.
allData
Playlist
s
}
getData
=
{
getData_
menupage
s
}
getData
=
{
getData_
playlist
s
}
serverSideColumns
=
{
serverSideColumns
}
serverSideColumns
=
{
serverSideColumns
}
linkAddButton
=
{
`
${
moduleSettings
.
baseURL
}
/add`
}
linkAddButton
=
{
`
${
moduleSettings
.
baseURL
}
/add`
}
total
=
{
store
.
total
MenuPage
s
}
total
=
{
store
.
total
Playlist
s
}
/
>
/
>
)
)
...
...
src/views/playlists/store/actions/playlists.js
View file @
267ca079
...
@@ -36,7 +36,7 @@ export const getData_playlists = params => {
...
@@ -36,7 +36,7 @@ export const getData_playlists = params => {
.
then
(
response
=>
{
.
then
(
response
=>
{
dispatch
({
dispatch
({
type
:
'ADD_PLAYLIST'
,
type
:
'ADD_PLAYLIST'
,
params
:
newparams
params
})
})
})
})
.
then
(()
=>
{
.
then
(()
=>
{
...
...
src/views/playlists/store/reducer/index.js
View file @
267ca079
...
@@ -49,7 +49,7 @@ const playlists = (state = initialState, action) => {
...
@@ -49,7 +49,7 @@ const playlists = (state = initialState, action) => {
return
{
...
state
,
return
{
...
state
,
selectedPlaylist
:
action
.
data
selectedPlaylist
:
action
.
data
}
}
case
'GET_
MENU
PLAYLIST'
:
case
'GET_PLAYLIST'
:
return
{
...
state
,
return
{
...
state
,
selectedPlaylist
:
action
.
data
selectedPlaylist
:
action
.
data
}
}
...
...
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