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
3a84115e
Commit
3a84115e
authored
Apr 29, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
basic layout menu
parent
e319af13
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
13 deletions
+29
-13
data.js
src/views/screens/layoutmenus/data.js
+4
-1
index.js
src/views/screens/layoutmenus/edit/index.js
+4
-4
main.js
src/views/screens/layoutmenus/edit/main.js
+6
-6
index.js
src/views/screens/store/actions/index.js
+10
-1
index.js
src/views/screens/store/reducer/index.js
+5
-1
No files found.
src/views/screens/layoutmenus/data.js
View file @
3a84115e
// ** React Imports
// ** React Imports
import
{
Link
}
from
'react-router-dom'
import
{
Link
}
from
'react-router-dom'
import
{
cleanLayoutMenu
}
from
'../store/actions'
import
{
store
}
from
'@store/storeConfig/store'
// ** Custom Components
// ** Custom Components
import
Avatar
from
'@components/avatar'
import
Avatar
from
'@components/avatar'
// module settings
// module settings
...
@@ -225,7 +228,7 @@ export const serverSideColumns = [
...
@@ -225,7 +228,7 @@ export const serverSideColumns = [
<
Link
<
Link
to
=
{
`
${
moduleSettings
.
baseURL
}
/edit/
${
row
.
id
}
`
}
to
=
{
`
${
moduleSettings
.
baseURL
}
/edit/
${
row
.
id
}
`
}
className
=
'user-name text-truncate mb-0'
className
=
'user-name text-truncate mb-0'
// onClick={() => store.dispatch(cleanProject
(row.id))}
onClick
=
{()
=>
store
.
dispatch
(
cleanLayoutMenu
(
row
.
id
))}
>
>
<
span
className
=
'font-weight-bold'
>
{
row
.
name
}
<
/span
>
<
span
className
=
'font-weight-bold'
>
{
row
.
name
}
<
/span
>
<
/Link
>
<
/Link
>
...
...
src/views/screens/layoutmenus/edit/index.js
View file @
3a84115e
...
@@ -26,11 +26,11 @@ const Tables = () => {
...
@@ -26,11 +26,11 @@ const Tables = () => {
<
/Row
>
<
/Row
>
<
Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
Col
sm
=
'12'
>
<
div
class
=
"card"
>
<
div
class
Name
=
"card"
>
<
div
class
=
"card-header"
>
<
div
class
Name
=
"card-header"
>
<
h4
class
=
"card-title"
>
{
moduleSettings
.
mainTitleSingle
}
<
/h4
>
<
h4
class
Name
=
"card-title"
>
{
moduleSettings
.
mainTitleSingle
}
<
/h4
>
<
/div
>
<
/div
>
<
div
class
=
"card-body"
>
<
div
class
Name
=
"card-body"
>
<
ElementEdit
/>
<
ElementEdit
/>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
src/views/screens/layoutmenus/edit/main.js
View file @
3a84115e
...
@@ -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
.
projectsetting
s
),
const
store
=
useSelector
(
state
=>
state
.
screen
s
),
[
dataElement
,
setElementData
]
=
useState
(
null
),
[
dataElement
,
setElementData
]
=
useState
(
null
),
dispatch
=
useDispatch
(),
dispatch
=
useDispatch
(),
{
id
}
=
useParams
()
{
id
}
=
useParams
()
...
@@ -39,15 +39,15 @@ const ElementEdit = () => {
...
@@ -39,15 +39,15 @@ const ElementEdit = () => {
// ** Update user image on mount or change
// ** Update user image on mount or change
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
store
.
selected
Element
!==
null
||
(
store
.
selectedElement
!==
null
&&
dataElement
!==
null
&&
store
.
selectedElement
.
id
!==
dataElement
.
id
))
{
if
(
store
.
selected
LayoutMenu
!==
null
||
(
store
.
selectedLayoutMenu
!==
null
&&
dataElement
!==
null
&&
store
.
selectedLayoutMenu
.
id
!==
dataElement
.
id
))
{
return
setElementData
(
store
.
selected
Element
)
return
setElementData
(
store
.
selected
LayoutMenu
)
}
}
},
[
store
.
selected
Element
])
},
[
store
.
selected
LayoutMenu
])
return
store
.
selected
Element
!==
null
&&
store
.
selectedElement
!==
undefined
?
(
return
store
.
selected
LayoutMenu
!==
null
&&
store
.
selectedLayoutMenu
!==
undefined
?
(
<
ElementCard
<
ElementCard
selectedElement
=
{
store
.
selected
Element
}
selectedElement
=
{
store
.
selected
LayoutMenu
}
onSubmitHandler
=
{
onSubmitHandler
}
onSubmitHandler
=
{
onSubmitHandler
}
/>
/>
)
:
(
)
:
(
...
...
src/views/screens/store/actions/index.js
View file @
3a84115e
...
@@ -84,11 +84,20 @@ export const getData_layoutmenus = params => {
...
@@ -84,11 +84,20 @@ export const getData_layoutmenus = params => {
.
catch
(
err
=>
console
.
log
(
err
))
.
catch
(
err
=>
console
.
log
(
err
))
}
}
}
}
export
const
cleanLayoutMenu
=
id
=>
{
return
async
dispatch
=>
{
dispatch
({
type
:
'GET_LAYOUTMENU'
,
data
:
null
})
}
}
export
const
updateLayoutMenu
=
layoumenu
=>
{
export
const
updateLayoutMenu
=
layoumenu
=>
{
return
(
dispatch
,
getState
)
=>
{
return
(
dispatch
,
getState
)
=>
{
axios
axios
.
put
(
`
${
process
.
env
.
REACT_APP_API
}
/api/layou
menus/
${
layoumenu
.
id
}
`
,
project
)
.
put
(
`
${
process
.
env
.
REACT_APP_API
}
/api/layou
tmenus/
${
layoumenu
.
id
}
`
,
layoumenu
)
.
then
(
response
=>
{
.
then
(
response
=>
{
dispatch
({
dispatch
({
type
:
'UPDATE_LAYOUTMENU'
,
type
:
'UPDATE_LAYOUTMENU'
,
...
...
src/views/screens/store/reducer/index.js
View file @
3a84115e
...
@@ -57,7 +57,11 @@ const screens = (state = initialState, action) => {
...
@@ -57,7 +57,11 @@ const screens = (state = initialState, action) => {
return
{
...
state
,
return
{
...
state
,
selectedLayoutMenu
:
action
.
data
selectedLayoutMenu
:
action
.
data
}
}
case
'GET_LAYOUTMENU'
:
return
{
...
state
,
selectedLayoutMenu
:
action
.
data
}
case
'UPDATE_LAYOUTMENU'
:
case
'UPDATE_LAYOUTMENU'
:
return
{
...
state
}
return
{
...
state
}
...
...
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