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
befd5801
Commit
befd5801
authored
May 20, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
basic asset crud
parent
41ddd740
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
125 additions
and
106 deletions
+125
-106
assets.js
src/navigation/global/assets.js
+17
-0
playllists.js
src/navigation/global/playllists.js
+5
-5
assets.js
src/router/routes/assets.js
+33
-0
index.js
src/router/routes/index.js
+3
-1
index.js
src/views/assets/index.js
+0
-0
index.js
src/views/assets/projectassets/add/index.js
+12
-17
index.js
src/views/assets/projectassets/card/index.js
+35
-62
index.js
src/views/assets/projectassets/edit/index.js
+1
-1
main.js
src/views/assets/projectassets/edit/main.js
+12
-13
index.js
src/views/assets/projectassets/index.js
+1
-1
table.js
src/views/assets/projectassets/table.js
+5
-5
index.js
src/views/assets/store/reducer/index.js
+1
-1
No files found.
src/navigation/global/assets.js
0 → 100644
View file @
befd5801
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/global/playllists.js
View file @
befd5801
...
...
@@ -2,15 +2,15 @@ import { Package, Briefcase, HardDrive, Globe, Flag } from 'react-feather'
export
default
[
{
id
:
'
Playlis
ts'
,
title
:
'
Playlis
ts'
,
id
:
'
Asse
ts'
,
title
:
'
Asse
ts'
,
icon
:
<
Package
/>
,
children
:
[
{
id
:
'
playlis
tsDash'
,
title
:
'Project
Playlis
ts'
,
id
:
'
asse
tsDash'
,
title
:
'Project
Asse
ts'
,
icon
:
<
Briefcase
/>
,
navLink
:
'/
playlists/projectplaylis
ts'
navLink
:
'/
assets/projectasse
ts'
}
]
}
...
...
src/router/routes/assets.js
0 → 100644
View file @
befd5801
import
{
lazy
}
from
'react'
import
{
Redirect
}
from
'react-router-dom'
const
AssetsRoutes
=
[
// settingss
{
path
:
'/assets/projectassets/edit'
,
exact
:
true
,
component
:
()
=>
<
Redirect
to
=
'/assets/projectassets/edit/1'
/>
},
{
path
:
'/assets/projectassets/edit/:id'
,
component
:
lazy
(()
=>
import
(
'../../views/assets/projectassets/edit'
)),
meta
:
{
navLink
:
'/assets/projectassets/edit'
}
},
{
path
:
'/assets/projectassets/add'
,
component
:
lazy
(()
=>
import
(
'../../views/assets/projectassets/add'
)),
meta
:
{
navLink
:
'/assets/projectassets/add'
}
},
{
path
:
'/assets/projectassets'
,
component
:
lazy
(()
=>
import
(
'../../views/assets/projectassets'
))
}
]
export
default
AssetsRoutes
src/router/routes/index.js
View file @
befd5801
...
...
@@ -13,6 +13,7 @@ import SettingsRoutes from './Settings'
import
ScreensRoutes
from
'./screens'
import
MenuPagesRoutes
from
'./menupages'
import
PlaylistsRoutes
from
'./playlists'
import
AssetsRoutes
from
'./assets'
// ** Document title
const
TemplateTitle
=
'%s - Vuexy React Admin Template'
...
...
@@ -34,7 +35,8 @@ const Routes = [
...
ScreensRoutes
,
...
PlaylistsRoutes
,
...
MenuPagesRoutes
,
...
SettingsRoutes
...
SettingsRoutes
,
...
AssetsRoutes
]
export
{
DefaultRoute
,
TemplateTitle
,
Routes
}
src/views/assets/index.js
deleted
100644 → 0
View file @
41ddd740
src/views/assets/projectassets/add/index.js
View file @
befd5801
...
...
@@ -3,7 +3,7 @@ import { Fragment } from 'react'
import
{
Link
}
from
'react-router-dom'
// ** Store & Actions
import
{
add
playlis
t
}
from
'../../store/actions'
import
{
add
asse
t
}
from
'../../store/actions'
import
{
useDispatch
}
from
'react-redux'
// ** Custom Components
...
...
@@ -23,13 +23,12 @@ const Tables = () => {
const
dispatch
=
useDispatch
()
const
onSubmitHandler
=
values
=>
{
dispatch
(
add
playlis
t
({
idproject
:
values
.
idproject
,
add
asse
t
({
projectid
:
values
.
projectid
,
title
:
values
.
title
,
layout_id
:
values
.
layout_id
,
dynamic
:
values
.
dynamic
,
special
:
values
.
special
,
special_id
:
values
.
special_id
parentid
:
values
.
parentid
,
parenttype
:
values
.
parenttype
,
external_id
:
values
.
external_id
}
)
)
...
...
@@ -37,7 +36,7 @@ const Tables = () => {
return
(
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'
Playlists'
breadCrumbParent
=
'Playlis
ts'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Breadcrumbs
breadCrumbTitle
=
'
Assets'
breadCrumbParent
=
'Asse
ts'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Row
>
<
Col
sm
=
'12'
>
<
Link
to
=
{
moduleSettings
.
baseURL
}
>
Back
to
{
moduleSettings
.
mainTitle
}
<
/Link
>
...
...
@@ -52,15 +51,11 @@ const Tables = () => {
<
div
className
=
"card-body"
>
<
ElementCard
selectedElement
=
{{
id
:
'<generate>'
,
idproject
:
'2'
,
system_name
:
''
,
last_seen
:
''
,
layout_page_id
:
''
,
type
:
''
,
display
:
''
,
pagetypeid
:
''
,
order
:
'0'
,
menu_page_layouts
:
[]
projectid
:
'2'
,
title
:
''
,
parentid
:
null
,
parenttype
:
null
,
external_id
:
''
}}
onSubmitHandler
=
{
onSubmitHandler
}
/
>
...
...
src/views/assets/projectassets/card/index.js
View file @
befd5801
...
...
@@ -86,10 +86,9 @@ const handleError = (text) => {
...
dataElement
,
idproject
:
values
.
idproject
,
title
:
values
.
title
,
layout_id
:
values
.
layout_id
,
dynamic
:
values
.
dynamic
,
special
:
values
.
special
,
special_id
:
values
.
special_id
parentid
:
values
.
parentid
,
parenttype
:
values
.
parenttype
,
external_id
:
values
.
external_id
}
onSubmitHandler
(
submitElement
)
...
...
@@ -185,12 +184,12 @@ return (
<
Input
readOnly
=
{
true
}
type
=
'text'
name
=
'
idproject
'
id
=
'
idproject
'
name
=
'
projectid
'
id
=
'
projectid
'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'
idproject
'
defaultValue
=
{
dataElement
&&
dataElement
.
idproject
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'
idproject
'
]
})}
placeholder
=
'
projectid
'
defaultValue
=
{
dataElement
&&
dataElement
.
projectid
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'
projectid
'
]
})}
/
>
<
/FormGroup
>
<
/Col
>
...
...
@@ -210,79 +209,53 @@ return (
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'
layout_id'
>
Layout
Playlist
<
/Label
>
<
Label
for
=
'
parenttype'
>
Parent
Type
<
/Label
>
<
Input
type
=
'select'
name
=
'layout_id'
id
=
'layout_id'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'layout_id'
defaultValue
=
{
dataElement
&&
dataElement
.
layout_id
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'layout_id'
]
})}
>
{
!!
layoutplaylists
?
layoutplaylists
.
map
(
option
=>
{
return
<
option
key
=
{
option
.
id
}
selected
=
{
option
.
id
===
dataElement
.
layout_id
?
option
.
id
:
''
}
value
=
{
option
.
id
}
>
{
option
.
name
}
<
/option
>
})
:
<
option
>
Loading
<
/option>
}
<
/Input
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'dynamic'
>
dynamic
<
/Label
>
<
Input
type
=
'select'
name
=
'dynamic'
id
=
'dynamic'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'dynamic'
defaultValue
=
{
dataElement
&&
dataElement
.
dynamic
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'dynamic'
]
})}
>
<
option
value
=
'0'
>
No
<
/option
>
<
option
value
=
'1'
>
Yes
<
/option
>
<
/Input>
type
=
'text'
name
=
'parenttype'
id
=
'parenttype'
innerRef
=
{
register
({
required
:
false
})}
placeholder
=
'parenttype'
defaultValue
=
{
dataElement
&&
dataElement
.
parenttype
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'parenttype'
]
})}
/
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'
special'
>
special
<
/Label
>
<
Label
for
=
'
parentid'
>
Parent
Id
<
/Label
>
<
Input
type
=
'select'
name
=
'special'
id
=
'special'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'special'
defaultValue
=
{
dataElement
&&
dataElement
.
special
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'special'
]
})}
>
<
option
value
=
'0'
>
No
<
/option
>
<
option
value
=
'1'
>
Yes
<
/option>
<
/Input
>
type
=
'text'
name
=
'parentid'
id
=
'parentid'
innerRef
=
{
register
({
required
:
false
})}
placeholder
=
'parentid'
defaultValue
=
{
dataElement
&&
dataElement
.
parentid
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'parentid'
]
})}
/>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'
special_id'
>
special_i
d
<
/Label
>
<
Label
for
=
'
external_id'
>
External
I
d
<
/Label
>
<
Input
type
=
'text'
name
=
'
speci
al_id'
id
=
'
speci
al_id'
innerRef
=
{
register
({
required
:
fals
e
})}
placeholder
=
'
speci
al_id'
defaultValue
=
{
dataElement
&&
dataElement
.
speci
al_id
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'
speci
al_id'
]
})}
name
=
'
extern
al_id'
id
=
'
extern
al_id'
innerRef
=
{
register
({
required
:
tru
e
})}
placeholder
=
'
extern
al_id'
defaultValue
=
{
dataElement
&&
dataElement
.
extern
al_id
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'
extern
al_id'
]
})}
/
>
<
/FormGroup
>
<
/Col
>
<
/Row
>
<
Row
className
=
'app-user-edit'
>
{
/*
<Row className='app-user-edit'>
<Col sm='12'>
<ManageAssets dataElement={dataElement && dataElement.assets} />
/</Col>
<
/Row
>
</Row>
*/
}
<
Row
className
=
'app-user-edit'
>
<
Col
className
=
'd-flex flex-sm-row flex-column mt-2'
sm
=
'12'
>
...
...
src/views/assets/projectassets/edit/index.js
View file @
befd5801
...
...
@@ -18,7 +18,7 @@ import moduleSettings from '../module'
const
Tables
=
()
=>
{
return
(
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'
Playlists'
breadCrumbParent
=
'Playlis
ts'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Breadcrumbs
breadCrumbTitle
=
'
Assets'
breadCrumbParent
=
'Asse
ts'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Row
>
<
Col
sm
=
'12'
>
<
Link
to
=
{
moduleSettings
.
baseURL
}
>
Back
to
{
moduleSettings
.
mainTitleSingle
}
<
/Link
>
...
...
src/views/assets/projectassets/edit/main.js
View file @
befd5801
...
...
@@ -2,7 +2,7 @@ import { useState, useEffect, Fragment } from 'react'
import
{
useParams
,
Link
}
from
'react-router-dom'
// ** Store & Actions
import
{
get
playlist
,
updateplaylis
t
}
from
'../../store/actions'
import
{
get
asset
,
updateasse
t
}
from
'../../store/actions'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
...
...
@@ -15,7 +15,7 @@ import moduleSettings from '../module'
const
ElementEdit
=
()
=>
{
// ** States & Vars
const
store
=
useSelector
(
state
=>
state
.
playlis
ts
),
const
store
=
useSelector
(
state
=>
state
.
asse
ts
),
[
dataElement
,
setElementData
]
=
useState
(
null
),
dispatch
=
useDispatch
(),
{
id
}
=
useParams
()
...
...
@@ -23,14 +23,13 @@ const ElementEdit = () => {
const
onSubmitHandler
=
values
=>
{
console
.
log
(
values
)
dispatch
(
update
playlis
t
({
update
asse
t
({
...
dataElement
,
idproject
:
values
.
idproject
,
title
:
values
.
title
,
layout_id
:
values
.
layout_id
,
dynamic
:
values
.
dynamic
,
special
:
values
.
special
,
special_id
:
values
.
special_id
parentid
:
values
.
parentid
,
parenttype
:
values
.
parenttype
,
external_id
:
values
.
external_id
})
)
...
...
@@ -38,21 +37,21 @@ const ElementEdit = () => {
// ** Function to get user on mount
useEffect
(()
=>
{
dispatch
(
get
playlis
t
(
id
))
dispatch
(
get
asse
t
(
id
))
},
[
dispatch
])
// ** Update user image on mount or change
useEffect
(()
=>
{
if
(
store
.
selected
Playlist
!==
null
||
(
store
.
selectedPlaylist
!==
null
&&
dataElement
!==
null
&&
store
.
selectedPlaylis
t
.
id
!==
dataElement
.
id
))
{
return
setElementData
(
store
.
selected
Playlis
t
)
if
(
store
.
selected
Asset
!==
null
||
(
store
.
selectedAsset
!==
null
&&
dataElement
!==
null
&&
store
.
selectedAsse
t
.
id
!==
dataElement
.
id
))
{
return
setElementData
(
store
.
selected
Asse
t
)
}
},
[
store
.
selected
Playlis
t
])
},
[
store
.
selected
Asse
t
])
return
store
.
selected
Playlist
!==
null
&&
store
.
selectedPlaylis
t
!==
undefined
?
(
return
store
.
selected
Asset
!==
null
&&
store
.
selectedAsse
t
!==
undefined
?
(
<
ElementCard
selectedElement
=
{
store
.
selected
Playlis
t
}
selectedElement
=
{
store
.
selected
Asse
t
}
onSubmitHandler
=
{
onSubmitHandler
}
/>
)
:
(
...
...
src/views/assets/projectassets/index.js
View file @
befd5801
...
...
@@ -17,7 +17,7 @@ import moduleSettings from './module'
const
Tables
=
()
=>
{
return
(
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'
Playlists'
breadCrumbParent
=
'Playlis
ts'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Breadcrumbs
breadCrumbTitle
=
'
Assets'
breadCrumbParent
=
'Asse
ts'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Row
>
<
Col
sm
=
'12'
>
<
DataTable
/>
...
...
src/views/assets/projectassets/table.js
View file @
befd5801
...
...
@@ -3,7 +3,7 @@ import { Fragment, useState, useEffect, memo } from 'react'
// ** Table Columns
import
{
serverSideColumns
}
from
'./data'
// ** Store & Actions
import
{
getData_
playlists
}
from
'../store/actions'
import
{
getData_
assets
}
from
'../store/actions'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
import
DataTableServerSide
from
'@components/datatable'
...
...
@@ -12,16 +12,16 @@ import moduleSettings from './module'
const
DataTable
=
()
=>
{
// ** Store Vars
const
dispatch
=
useDispatch
()
const
store
=
useSelector
(
state
=>
state
.
playlis
ts
)
const
store
=
useSelector
(
state
=>
state
.
asse
ts
)
return
(
<
DataTableServerSide
cardTitle
=
{
moduleSettings
.
mainTitle
}
allData
=
{
store
.
allData
Playlis
ts
}
getData
=
{
getData_
playlis
ts
}
allData
=
{
store
.
allData
Asse
ts
}
getData
=
{
getData_
asse
ts
}
serverSideColumns
=
{
serverSideColumns
}
linkAddButton
=
{
`
${
moduleSettings
.
baseURL
}
/add`
}
total
=
{
store
.
total
Playlis
ts
}
total
=
{
store
.
total
Asse
ts
}
/
>
)
...
...
src/views/assets/store/reducer/index.js
View file @
befd5801
...
...
@@ -48,7 +48,7 @@ const assets = (state = initialState, action) => {
case
'GET_ASSET'
:
return
{
...
state
,
selected
Playlis
t
:
action
.
data
selected
Asse
t
:
action
.
data
}
case
'UPDATE_ASSET'
:
...
...
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