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
268d3528
Commit
268d3528
authored
Jun 05, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asset project selector
parent
146025c8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
8 deletions
+25
-8
index.js
src/redux/reducers/navbar/index.js
+1
-1
index.js
src/views/assets/projectassets/add/index.js
+7
-3
table.js
src/views/assets/projectassets/table.js
+9
-0
assets.js
src/views/assets/store/actions/assets.js
+8
-4
No files found.
src/redux/reducers/navbar/index.js
View file @
268d3528
src/views/assets/projectassets/add/index.js
View file @
268d3528
...
...
@@ -4,7 +4,7 @@ import { Link } from 'react-router-dom'
// ** Store & Actions
import
{
addasset
}
from
'../../store/actions'
import
{
useDispatch
}
from
'react-redux'
import
{
useDispatch
,
useSelector
}
from
'react-redux'
// ** Custom Components
import
Breadcrumbs
from
'@components/breadcrumbs'
...
...
@@ -21,6 +21,7 @@ import '@styles/react/libs/tables/react-dataTable-component.scss'
const
Tables
=
()
=>
{
const
dispatch
=
useDispatch
()
const
storeNavbar
=
useSelector
(
state
=>
state
.
navbar
)
const
onSubmitHandler
=
(
values
,
uploadFile
)
=>
{
dispatch
(
addasset
({
...
...
@@ -54,9 +55,11 @@ const Tables = () => {
<
h4
className
=
"card-title"
>
New
{
moduleSettings
.
mainTitleSingle
}
<
/h4
>
<
/div
>
<
div
className
=
"card-body"
>
<
ElementCard
selectedElement
=
{{
{
storeNavbar
.
projectCurrent
===
null
?
<
div
>
Select
Project
<
/div> : <ElementCard selectedElement={
{
id
:
'<generate>'
,
projectid
:
'2'
,
projectid
:
storeNavbar
.
projectCurrent
.
value
,
title
:
''
,
parentid
:
null
,
parenttype
:
null
,
...
...
@@ -69,6 +72,7 @@ const Tables = () => {
}}
onSubmitHandler
=
{
onSubmitHandler
}
/
>
}
<
/div
>
<
/div
>
...
...
src/views/assets/projectassets/table.js
View file @
268d3528
...
...
@@ -13,6 +13,15 @@ const DataTable = () => {
// ** Store Vars
const
dispatch
=
useDispatch
()
const
store
=
useSelector
(
state
=>
state
.
assets
)
const
storeNavbar
=
useSelector
(
state
=>
state
.
navbar
)
useEffect
(()
=>
{
dispatch
(
getData_assets
({
start
:
0
,
length
:
1000
}))
},
[
storeNavbar
.
projectCurrent
])
return
(
<
DataTableServerSide
...
...
src/views/assets/store/actions/assets.js
View file @
268d3528
import
{
useSelector
,
useStore
,
ReactReduxContext
}
from
'react-redux'
import
axios
from
'axios'
import
{
setSaveSatus
,
setErrorMsg
}
from
'../../../../redux/actions/api'
import
moduleSettings
from
'../../projectassets/module'
import
{
store
}
from
'@store/storeConfig/store'
// ** Get table Data ///api/datatables/data
const
_getData_assets
=
params
=>
{
return
async
dispatch
=>
{
...
...
@@ -21,10 +22,13 @@ const _getData_assets = params => {
})
}
}
export
const
getData_assets
=
params
=>
{
const
currentProject
=
store
.
getState
().
navbar
.
projectCurrent
const
newparams
=
{
...
params
,
idproject
:
2
idproject
:
!
currentProject
?
'%'
:
currentProject
.
value
}
return
_getData_assets
(
newparams
)
}
...
...
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