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
f7793f8a
Commit
f7793f8a
authored
Jul 07, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist reload fix
parent
64768c25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
17 deletions
+21
-17
assets.js
src/views/assets/store/actions/assets.js
+7
-3
index.js
src/views/playlists/projectplaylists/card/index.js
+11
-0
manageassets.js
src/views/playlists/projectplaylists/card/manageassets.js
+3
-14
No files found.
src/views/assets/store/actions/assets.js
View file @
f7793f8a
...
...
@@ -24,13 +24,17 @@ const _getData_assets = params => {
}
export
const
getData_assets
=
params
=>
{
if
(
!!
params
.
idproject
&&
params
.
idproject
!==
null
)
{
return
_getData_assets
(
params
)
}
const
currentProject
=
store
.
getState
().
navbar
.
projectCurrent
const
newparams
=
{
const
newparams
=
{
...
params
,
idproject
:
!
currentProject
?
'%'
:
currentProject
.
value
}
return
_getData_assets
(
newparams
)
return
_getData_assets
(
newparams
)
}
export
const
addasset
=
params
=>
{
...
...
src/views/playlists/projectplaylists/card/index.js
View file @
f7793f8a
...
...
@@ -20,6 +20,7 @@ import ManageAssets from './manageassets'
// ** Store & Actions
import
{
resetResults
}
from
'../../store/actions'
import
{
getData_pagetypes
}
from
'../../../settings/store/actions'
import
{
getData_assets
}
from
'../../../assets/store/actions'
import
{
getData_layoutPlaylists
}
from
'../../../screens/store/actions'
...
...
@@ -169,6 +170,16 @@ const handleError = (text) => {
setLayoutplaylists
(
screensStore
.
allDataLayoutPlaylists
)
},
[
screensStore
.
allDataLayoutPlaylists
])
useEffect
(()
=>
{
if
(
dataElement
!==
null
&&
(
!
store
.
allDataLayoutAssets
||
store
.
allDataLayoutAssets
.
length
<
1
))
{
dispatch
(
getData_assets
({
start
:
0
,
length
:
1000
,
idproject
:
dataElement
.
idproject
,
q
:
null
}))
}
},
[
dataElement
])
return
(
<
Fragment
>
...
...
src/views/playlists/projectplaylists/card/manageassets.js
View file @
f7793f8a
...
...
@@ -6,7 +6,6 @@ import { Row, Col, FormGroup, Label, Input, Button } from 'reactstrap'
import
{
useForm
}
from
'react-hook-form'
import
classnames
from
'classnames'
import
{
getData_assets
}
from
'../../../assets/store/actions'
import
DataTableServerSide
from
'@components/datatable'
import
{
element
}
from
'prop-types'
...
...
@@ -126,21 +125,11 @@ const ManageAssets = ({dataElement, handleChange}) => {
setavaliableAssets
(
filtered
)
},
[
selectedAssets
])
useEffect
(()
=>
{
if
(
!
store
.
allDataLayoutAssets
||
store
.
allDataLayoutAssets
.
length
<
1
)
{
dispatch
(
getData_assets
({
start
:
0
,
length
:
1000
,
q
:
null
}))
}
},
[
dispatch
])
useEffect
(()
=>
{
if
(
dataElement
!==
null
)
{
setSelectedAssets
(
dataElement
)
}
if
(
dataElement
!==
null
)
{
setSelectedAssets
(
dataElement
)
}
},
[
dataElement
])
return
<
div
className
=
"card"
>
...
...
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