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
9408fd5e
Commit
9408fd5e
authored
Jul 10, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete pagesmenus and playlists UI
parent
f7793f8a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
12 deletions
+74
-12
index.js
src/views/menupages/mainpages/card/index.js
+6
-4
main.js
src/views/menupages/mainpages/edit/main.js
+8
-1
pages.js
src/views/menupages/store/actions/pages.js
+23
-1
index.js
src/views/playlists/projectplaylists/card/index.js
+6
-4
main.js
src/views/playlists/projectplaylists/edit/main.js
+8
-1
playlists.js
src/views/playlists/store/actions/playlists.js
+23
-1
No files found.
src/views/menupages/mainpages/card/index.js
View file @
9408fd5e
...
...
@@ -48,7 +48,7 @@ const SuccessProgressToast = () => (
)
const
ElementCard
=
({
selectedElement
,
onSubmitHandler
})
=>
{
const
ElementCard
=
({
selectedElement
,
onSubmitHandler
,
handelDelete
})
=>
{
const
store
=
useSelector
(
state
=>
state
.
projectsettings
)
const
[
PlatformName
,
setPlatformName
]
=
useState
(
'Web'
),
[
projectPlaylists
,
setProjectPlaylists
]
=
useState
(
null
)
...
...
@@ -389,9 +389,11 @@ return (
<
Button
.
Ripple
className
=
'mb-1 mb-sm-0 mr-0 mr-sm-1'
type
=
'submit'
color
=
'primary'
>
Save
Changes
<
/Button.Ripple
>
{
/* <Button.Ripple color='secondary' outline onClick={() => dispatch(getPlatform(selectedElement.id))} >
Reset
</Button.Ripple> */
}
{
!!
handelDelete
&&
<
Button
.
Ripple
style
=
{{
marginLeft
:
'auto'
}}
color
=
'danger'
outline
onClick
=
{()
=>
handelDelete
()}
>
Delete
<
/Button.Ripple
>
}
<
/Col
>
<
/Row
>
<
/Form
>
...
...
src/views/menupages/mainpages/edit/main.js
View file @
9408fd5e
...
...
@@ -2,7 +2,7 @@ import { useState, useEffect, Fragment } from 'react'
import
{
useParams
,
Link
}
from
'react-router-dom'
// ** Store & Actions
import
{
getmenupages
,
updatemenupages
}
from
'../../store/actions'
import
{
getmenupages
,
updatemenupages
,
deletePage
}
from
'../../store/actions'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
...
...
@@ -38,6 +38,12 @@ const ElementEdit = () => {
}
const
handelDelete
=
()
=>
{
if
(
!
confirm
(
'Delete'
))
return
dispatch
(
deletePage
({
...
dataElement
})
)
}
// ** Function to get user on mount
useEffect
(()
=>
{
dispatch
(
getmenupages
(
id
))
...
...
@@ -56,6 +62,7 @@ const ElementEdit = () => {
<
ElementCard
selectedElement
=
{
store
.
selectedMenuPage
}
onSubmitHandler
=
{
onSubmitHandler
}
handelDelete
=
{
handelDelete
}
/>
)
:
(
<
Alert
color
=
'info'
>
...
...
src/views/menupages/store/actions/pages.js
View file @
9408fd5e
...
...
@@ -108,3 +108,25 @@ export const getData_menupages = params => {
}
return
_getData_menupages
(
newparams
)
}
export
const
deletePage
=
params
=>
{
return
(
dispatch
,
getState
)
=>
{
axios
.
delete
(
`
${
process
.
env
.
REACT_APP_API
}${
moduleSettings
.
apiBaseURL
}
/
${
params
.
id
}
`
,
params
)
.
then
(
response
=>
{
dispatch
({
type
:
'GET_MENUPAGE'
,
data
:
null
})
})
.
then
(()
=>
{
dispatch
(
setSaveSatus
(
true
))
})
.
catch
(
err
=>
{
const
errosMsg
=
!
err
.
response
?
'error'
:
err
.
response
.
data
.
message
console
.
log
(
errosMsg
)
dispatch
(
setErrorMsg
(
errosMsg
))
})
}
}
\ No newline at end of file
src/views/playlists/projectplaylists/card/index.js
View file @
9408fd5e
...
...
@@ -51,7 +51,7 @@ const SuccessProgressToast = () => (
)
const
ElementCard
=
({
selectedElement
,
onSubmitHandler
})
=>
{
const
ElementCard
=
({
selectedElement
,
onSubmitHandler
,
handelDelete
})
=>
{
const
store
=
useSelector
(
state
=>
state
.
projectsettings
)
const
[
PlatformName
,
setPlatformName
]
=
useState
(
'Web'
)
...
...
@@ -311,9 +311,11 @@ return (
<
Button
.
Ripple
className
=
'mb-1 mb-sm-0 mr-0 mr-sm-1'
type
=
'submit'
color
=
'primary'
>
Save
Changes
<
/Button.Ripple
>
{
/* <Button.Ripple color='secondary' outline onClick={() => dispatch(getPlatform(selectedElement.id))} >
Reset
</Button.Ripple> */
}
{
!!
handelDelete
&&
<
Button
.
Ripple
style
=
{{
marginLeft
:
'auto'
}}
color
=
'danger'
outline
onClick
=
{()
=>
handelDelete
()}
>
Delete
<
/Button.Ripple
>
}
<
/Col
>
<
/Row
>
<
/Form
>
...
...
src/views/playlists/projectplaylists/edit/main.js
View file @
9408fd5e
...
...
@@ -2,7 +2,7 @@ import { useState, useEffect, Fragment } from 'react'
import
{
useParams
,
Link
}
from
'react-router-dom'
// ** Store & Actions
import
{
getplaylist
,
updateplaylist
}
from
'../../store/actions'
import
{
getplaylist
,
updateplaylist
,
deletePlaylist
}
from
'../../store/actions'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
...
...
@@ -37,6 +37,12 @@ const ElementEdit = () => {
}
const
handelDelete
=
()
=>
{
if
(
!
confirm
(
'Delete'
))
return
dispatch
(
deletePlaylist
({
...
dataElement
})
)
}
// ** Function to get user on mount
useEffect
(()
=>
{
dispatch
(
getplaylist
(
id
))
...
...
@@ -55,6 +61,7 @@ const ElementEdit = () => {
<
ElementCard
selectedElement
=
{
store
.
selectedPlaylist
}
onSubmitHandler
=
{
onSubmitHandler
}
handelDelete
=
{
handelDelete
}
/>
)
:
(
<
Alert
color
=
'info'
>
...
...
src/views/playlists/store/actions/playlists.js
View file @
9408fd5e
...
...
@@ -106,3 +106,25 @@ export const getData_playlists = params => {
})
}
}
export
const
deletePlaylist
=
params
=>
{
return
(
dispatch
,
getState
)
=>
{
axios
.
delete
(
`
${
process
.
env
.
REACT_APP_API
}${
moduleSettings
.
apiBaseURL
}
/
${
params
.
id
}
`
,
params
)
.
then
(
response
=>
{
dispatch
({
type
:
'GET_PLAYLIST'
,
data
:
null
})
})
.
then
(()
=>
{
dispatch
(
setSaveSatus
(
true
))
})
.
catch
(
err
=>
{
const
errosMsg
=
!
err
.
response
?
'error'
:
err
.
response
.
data
.
message
console
.
log
(
errosMsg
)
dispatch
(
setErrorMsg
(
errosMsg
))
})
}
}
\ No newline at end of file
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