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
fce739c5
Commit
fce739c5
authored
May 02, 2021
by
PDuarte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding layout details
parent
dfcdc24c
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1312 additions
and
3 deletions
+1312
-3
screens.js
src/navigation/global/screens.js
+6
-0
screens.js
src/router/routes/screens.js
+25
-1
index.js
src/views/screens/layoutdetails/add/index.js
+73
-0
index.js
src/views/screens/layoutdetails/card/index.js
+274
-0
plataform.js
src/views/screens/layoutdetails/card/plataform.js
+320
-0
data.js
src/views/screens/layoutdetails/data.js
+290
-0
index.js
src/views/screens/layoutdetails/edit/index.js
+44
-0
main.js
src/views/screens/layoutdetails/edit/main.js
+71
-0
index.js
src/views/screens/layoutdetails/index.js
+30
-0
module.js
src/views/screens/layoutdetails/module.js
+23
-0
table.js
src/views/screens/layoutdetails/table.js
+31
-0
index.js
src/views/screens/store/actions/index.js
+1
-0
layoutdetail.js
src/views/screens/store/actions/layoutdetail.js
+91
-0
index.js
src/views/screens/store/reducer/index.js
+33
-2
No files found.
src/navigation/global/screens.js
View file @
fce739c5
...
...
@@ -23,6 +23,12 @@ export default [
title
:
'layout epgs'
,
icon
:
<
Briefcase
/>
,
navLink
:
'/screens/layoutepgs'
},
{
id
:
'layoutdetailsDash'
,
title
:
'layout details'
,
icon
:
<
Briefcase
/>
,
navLink
:
'/screens/layoutdetails'
}
]
}
...
...
src/router/routes/screens.js
View file @
fce739c5
...
...
@@ -73,8 +73,32 @@ const ScreensRoutes = [
{
path
:
'/screens/layoutepgs'
,
component
:
lazy
(()
=>
import
(
'../../views/screens/layoutepgs'
))
},
// layout details
{
path
:
'/screens/layoutdetails/edit'
,
exact
:
true
,
component
:
()
=>
<
Redirect
to
=
'/screens/layoutdetails/edit/1'
/>
},
{
path
:
'/screens/layoutdetails/add'
,
component
:
lazy
(()
=>
import
(
'../../views/screens/layoutdetails/add'
)),
meta
:
{
navLink
:
'/screens/layoutdetails/add'
}
},
{
path
:
'/screens/layoutdetails/edit/:id'
,
component
:
lazy
(()
=>
import
(
'../../views/screens/layoutdetails/edit'
)),
meta
:
{
navLink
:
'/screens/layoutdetails/edit'
}
},
{
path
:
'/screens/layoutdetails'
,
component
:
lazy
(()
=>
import
(
'../../views/screens/layoutdetails'
))
}
]
export
default
ScreensRoutes
\ No newline at end of file
src/views/screens/layoutdetails/add/index.js
0 → 100644
View file @
fce739c5
// ** React Imports
import
{
Fragment
}
from
'react'
import
{
Link
}
from
'react-router-dom'
// ** Store & Actions
import
{
addlayoutDetails
}
from
'../../store/actions'
import
{
useDispatch
}
from
'react-redux'
// ** Custom Components
import
Breadcrumbs
from
'@components/breadcrumbs'
// ** Third Party Components
import
{
Row
,
Col
}
from
'reactstrap'
// module settings
import
moduleSettings
from
'../module'
// ** Tables
import
ElementCard
from
'../card'
// ** Styles
import
'@styles/react/libs/tables/react-dataTable-component.scss'
const
Tables
=
()
=>
{
const
dispatch
=
useDispatch
()
const
onSubmitHandler
=
values
=>
{
dispatch
(
addlayoutDetails
({
name
:
values
.
name
,
slug
:
values
.
slug
,
movies
:
values
.
movies
,
series
:
values
.
series
,
seasons
:
values
.
seasons
,
episodes
:
values
.
episodes
,
channels
:
values
.
channels
,
events
:
values
.
events
,
platforms
:
values
.
platforms
})
)
}
return
(
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'Screens'
breadCrumbParent
=
'Screens'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Row
>
<
Col
sm
=
'12'
>
<
Link
to
=
{
moduleSettings
.
baseURL
}
>
Back
to
{
moduleSettings
.
mainTitle
}
<
/Link
>
<
/Col
>
<
/Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
div
className
=
"card"
>
<
div
className
=
"card-header"
>
<
h4
className
=
"card-title"
>
New
{
moduleSettings
.
mainTitleSingle
}
<
/h4
>
<
/div
>
<
div
className
=
"card-body"
>
<
ElementCard
selectedElement
=
{{
id
:
'<generate>'
,
name
:
''
,
slug
:
''
,
platforms
:
[]
}}
onSubmitHandler
=
{
onSubmitHandler
}
/
>
<
/div
>
<
/div
>
<
/Col
>
<
/Row
>
<
/Fragment
>
)
}
export
default
Tables
src/views/screens/layoutdetails/card/index.js
0 → 100644
View file @
fce739c5
// ** React Imports
import
{
useState
,
useEffect
,
Fragment
}
from
'react'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
import
{
toast
}
from
'react-toastify'
import
Avatar
from
'@components/avatar'
import
{
Media
,
Button
,
Label
,
Form
,
FormGroup
,
Input
,
Table
,
CustomInput
,
Card
,
CardBody
,
Row
,
Col
,
Nav
,
NavItem
,
NavLink
,
TabContent
,
TabPane
,
Alert
,
CardHeader
,
CardTitle
,
CardText
}
from
'reactstrap'
import
{
isObjEmpty
}
from
'@utils'
import
{
Bell
,
Check
,
X
,
AlertTriangle
,
Info
}
from
'react-feather'
// ** Store & Actions
import
{
updateProject
,
resetResults
,
getPlatform
}
from
'../../store/actions'
import
{
useForm
}
from
'react-hook-form'
import
classnames
from
'classnames'
import
Swal
from
'sweetalert2'
import
withReactContent
from
'sweetalert2-react-content'
import
ElementPlatform
from
'./plataform'
const
SuccessProgressToast
=
()
=>
(
<
Fragment
>
<
div
className
=
'toastify-header'
>
<
div
className
=
'title-wrapper'
>
<
Avatar
size
=
'sm'
color
=
'success'
icon
=
{
<
Check
size
=
{
12
}
/>} /
>
<
h6
className
=
'toast-title'
>
Saved
!<
/h6
>
<
/div
>
<
small
className
=
'text-muted'
><
/small
>
<
/div
>
<
div
className
=
'toastify-body'
>
<
span
role
=
'img'
aria
-
label
=
'toast-text'
>
👋
Good
job
.
<
/span
>
<
/div
>
<
/Fragment
>
)
const
ElementCard
=
({
selectedElement
,
onSubmitHandler
})
=>
{
const
store
=
useSelector
(
state
=>
state
.
projectsettings
)
const
[
PlatformName
,
setPlatformName
]
=
useState
(
'Web'
)
const
MySwal
=
withReactContent
(
Swal
)
const
handleError
=
(
text
)
=>
{
return
MySwal
.
fire
({
title
:
'Error!'
,
text
,
icon
:
'error'
,
customClass
:
{
confirmButton
:
'btn btn-primary'
},
buttonsStyling
:
false
})
}
const
[
dataElement
,
setElementData
]
=
useState
(
null
),
{
register
,
errors
,
handleSubmit
}
=
useForm
(),
dispatch
=
useDispatch
(),
notifySuccessProgress
=
()
=>
toast
.
success
(
<
SuccessProgressToast
/>
),
onSubmit
=
values
=>
{
if
(
isObjEmpty
(
errors
))
{
const
submitElement
=
{
...
dataElement
,
name
:
values
.
name
,
slug
:
values
.
slug
,
movies
:
values
.
movies
,
series
:
values
.
series
,
seasons
:
values
.
seasons
,
episodes
:
values
.
episodes
,
channels
:
values
.
channels
,
events
:
values
.
events
}
onSubmitHandler
(
submitElement
)
}
}
useEffect
(()
=>
{
if
(
selectedElement
!==
null
||
(
selectedElement
!==
null
&&
dataElement
!==
null
&&
selectedElement
.
id
!==
dataElement
.
id
))
{
return
setElementData
(
selectedElement
)
}
},
[
selectedElement
])
useEffect
(()
=>
{
if
(
store
.
errorMsg
!==
''
)
{
handleError
(
store
.
errorMsg
)
dispatch
(
resetResults
())
}
},
[
store
.
errorMsg
])
useEffect
(()
=>
{
if
(
store
.
saveSucces
)
{
notifySuccessProgress
()
dispatch
(
resetResults
())
}
},
[
store
.
saveSucces
])
return
(
<
Fragment
>
<
Form
onSubmit
=
{
handleSubmit
(
onSubmit
)}
>
<
Row
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'email'
>
ID
<
/Label
>
<
Input
readOnly
=
{
true
}
type
=
'text'
name
=
'id'
id
=
'id'
placeholder
=
'id'
defaultValue
=
{
dataElement
&&
dataElement
.
id
}
/
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'name'
>
Name
<
/Label
>
<
Input
type
=
'text'
name
=
'name'
id
=
'name'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'Name'
defaultValue
=
{
dataElement
&&
dataElement
.
name
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'name'
]
})}
/
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'slug'
>
Slug
<
/Label
>
<
Input
type
=
'text'
name
=
'slug'
id
=
'slug'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'Slug'
defaultValue
=
{
dataElement
&&
dataElement
.
slug
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'slug'
]
})}
/
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'movies'
>
movies
<
/Label
>
<
Input
type
=
'text'
name
=
'movies'
id
=
'movies'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'movies'
defaultValue
=
{
dataElement
&&
dataElement
.
movies
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'movies'
]
})}
/
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'series'
>
series
<
/Label
>
<
Input
type
=
'text'
name
=
'series'
id
=
'series'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'series'
defaultValue
=
{
dataElement
&&
dataElement
.
series
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'series'
]
})}
/
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'seasons'
>
seasons
<
/Label
>
<
Input
type
=
'text'
name
=
'seasons'
id
=
'seasons'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'seasons'
defaultValue
=
{
dataElement
&&
dataElement
.
seasons
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'seasons'
]
})}
/
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'seasons'
>
seasons
<
/Label
>
<
Input
type
=
'text'
name
=
'seasons'
id
=
'seasons'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'seasons'
defaultValue
=
{
dataElement
&&
dataElement
.
seasons
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'seasons'
]
})}
/
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'episodes'
>
episodes
<
/Label
>
<
Input
type
=
'text'
name
=
'episodes'
id
=
'episodes'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'episodes'
defaultValue
=
{
dataElement
&&
dataElement
.
episodes
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'episodes'
]
})}
/
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'channels'
>
channels
<
/Label
>
<
Input
type
=
'text'
name
=
'channels'
id
=
'channels'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'channels'
defaultValue
=
{
dataElement
&&
dataElement
.
channels
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'channels'
]
})}
/
>
<
/FormGroup
>
<
/Col
>
<
Col
md
=
'4'
sm
=
'12'
>
<
FormGroup
>
<
Label
for
=
'events'
>
events
<
/Label
>
<
Input
type
=
'text'
name
=
'events'
id
=
'events'
innerRef
=
{
register
({
required
:
true
})}
placeholder
=
'events'
defaultValue
=
{
dataElement
&&
dataElement
.
events
}
className
=
{
classnames
({
'is-invalid'
:
errors
[
'events'
]
})}
/
>
<
/FormGroup
>
<
/Col
>
<
Col
sm
=
'12'
>
<
ElementPlatform
dataElement
=
{
dataElement
}
setElement
=
{
setElementData
}
store
=
{
store
}
/
>
<
/Col
>
<
Col
className
=
'd-flex flex-sm-row flex-column mt-2'
sm
=
'12'
>
<
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> */
}
<
/Col
>
<
/Row
>
<
/Form
>
<
/Fragment
>
)
}
export
default
ElementCard
\ No newline at end of file
src/views/screens/layoutdetails/card/plataform.js
0 → 100644
View file @
fce739c5
This diff is collapsed.
Click to expand it.
src/views/screens/layoutdetails/data.js
0 → 100644
View file @
fce739c5
// ** React Imports
import
{
Link
}
from
'react-router-dom'
import
{
cleanLayoutMenu
}
from
'../store/actions'
import
{
store
}
from
'@store/storeConfig/store'
// ** Custom Components
import
Avatar
from
'@components/avatar'
// module settings
import
moduleSettings
from
'./module'
// ** Third Party Components
import
axios
from
'axios'
import
{
MoreVertical
,
Edit
,
FileText
,
Archive
,
Trash
}
from
'react-feather'
import
{
Badge
,
UncontrolledDropdown
,
DropdownToggle
,
DropdownMenu
,
DropdownItem
}
from
'reactstrap'
// ** Vars
const
states
=
[
'success'
,
'danger'
,
'warning'
,
'info'
,
'dark'
,
'primary'
,
'secondary'
]
const
status
=
{
1
:
{
title
:
'Current'
,
color
:
'light-primary'
},
2
:
{
title
:
'Professional'
,
color
:
'light-success'
},
3
:
{
title
:
'Rejected'
,
color
:
'light-danger'
},
4
:
{
title
:
'Resigned'
,
color
:
'light-warning'
},
5
:
{
title
:
'Applied'
,
color
:
'light-info'
}
}
export
let
data
// ** Get initial Data
axios
.
get
(
'/api/datatables/initial-data'
).
then
(
response
=>
{
data
=
response
.
data
})
// ** Table Zero Config Column
export
const
basicColumns
=
[
{
name
:
'ID'
,
selector
:
'id'
,
sortable
:
true
,
maxWidth
:
'100px'
},
{
name
:
'Name'
,
selector
:
'name'
,
sortable
:
true
,
minWidth
:
'225px'
},
{
name
:
'Email'
,
selector
:
'email'
,
sortable
:
true
,
minWidth
:
'310px'
},
{
name
:
'Position'
,
selector
:
'post'
,
sortable
:
true
,
minWidth
:
'250px'
},
{
name
:
'Age'
,
selector
:
'age'
,
sortable
:
true
,
minWidth
:
'100px'
},
{
name
:
'Salary'
,
selector
:
'salary'
,
sortable
:
true
,
minWidth
:
'175px'
}
]
// ** Expandable table component
const
ExpandableTable
=
({
data
})
=>
{
return
(
<
div
className
=
'expandable-content p-2'
>
<
p
>
<
span
className
=
'font-weight-bold'
>
City
:
<
/span> {data.city
}
<
/p
>
<
p
>
<
span
className
=
'font-weight-bold'
>
Experience
:
<
/span> {data.experience
}
<
/p
>
<
p
className
=
'm-0'
>
<
span
className
=
'font-weight-bold'
>
Post
:
<
/span> {data.post
}
<
/p
>
<
/div
>
)
}
// ** Table Common Column
export
const
columns
=
[
{
name
:
'Name'
,
selector
:
'name'
,
sortable
:
true
,
minWidth
:
'250px'
,
cell
:
row
=>
(
<
div
className
=
'd-flex align-items-center'
>
{
row
.
avatar
===
''
?
(
<
Avatar
color
=
{
`light-
${
states
[
row
.
status
]}
`
}
content
=
{
row
.
full_name
}
initials
/>
)
:
(
<
Avatar
img
=
{
require
(
`@src/assets/images/portrait/small/avatar-s-
${
row
.
avatar
}
`
).
default
}
/
>
)}
<
div
className
=
'user-info text-truncate ml-1'
>
<
span
className
=
'd-block font-weight-bold text-truncate'
>
{
row
.
full_name
}
<
/span
>
<
small
>
{
row
.
post
}
<
/small
>
<
/div
>
<
/div
>
)
},
{
name
:
'Status'
,
selector
:
'status'
,
sortable
:
true
,
minWidth
:
'150px'
,
cell
:
row
=>
{
return
(
<
Badge
color
=
{
status
[
row
.
status
].
color
}
pill
>
{
status
[
row
.
status
].
title
}
<
/Badge
>
)
}
},
{
name
:
'Actions'
,
allowOverflow
:
true
,
cell
:
row
=>
{
return
(
<
div
className
=
'd-flex'
>
<
UncontrolledDropdown
>
<
DropdownToggle
className
=
'pr-1'
tag
=
'span'
>
<
MoreVertical
size
=
{
15
}
/
>
<
/DropdownToggle
>
<
DropdownMenu
right
>
<
DropdownItem
tag
=
'a'
href
=
'/'
className
=
'w-100'
onClick
=
{
e
=>
e
.
preventDefault
()}
>
<
FileText
size
=
{
15
}
/
>
<
span
className
=
'align-middle ml-50'
>
Details
<
/span
>
<
/DropdownItem
>
<
DropdownItem
tag
=
'a'
href
=
'/'
className
=
'w-100'
onClick
=
{
e
=>
e
.
preventDefault
()}
>
<
Archive
size
=
{
15
}
/
>
<
span
className
=
'align-middle ml-50'
>
Archive
<
/span
>
<
/DropdownItem
>
<
DropdownItem
tag
=
'a'
href
=
'/'
className
=
'w-100'
onClick
=
{
e
=>
e
.
preventDefault
()}
>
<
Trash
size
=
{
15
}
/
>
<
span
className
=
'align-middle ml-50'
>
Delete
<
/span
>
<
/DropdownItem
>
<
/DropdownMenu
>
<
/UncontrolledDropdown
>
<
Edit
size
=
{
15
}
/
>
<
/div
>
)
}
}
]
// ** Table Intl Column
export
const
multiLingColumns
=
[
{
name
:
'Name'
,
selector
:
'name'
,
sortable
:
true
,
minWidth
:
'200px'
},
{
name
:
'Status'
,
selector
:
'status'
,
sortable
:
true
,
minWidth
:
'150px'
,
cell
:
row
=>
{
return
(
<
Badge
color
=
{
status
[
row
.
status
].
color
}
pill
>
{
status
[
row
.
status
].
title
}
<
/Badge
>
)
}
},
{
name
:
'Actions'
,
allowOverflow
:
true
,
cell
:
row
=>
{
return
(
<
div
className
=
'd-flex'
>
<
UncontrolledDropdown
>
<
DropdownToggle
className
=
'pr-1'
tag
=
'span'
>
<
MoreVertical
size
=
{
15
}
/
>
<
/DropdownToggle
>
<
DropdownMenu
right
>
<
DropdownItem
>
<
FileText
size
=
{
15
}
/
>
<
span
className
=
'align-middle ml-50'
>
Details
<
/span
>
<
/DropdownItem
>
<
DropdownItem
>
<
Archive
size
=
{
15
}
/
>
<
span
className
=
'align-middle ml-50'
>
Archive
<
/span
>
<
/DropdownItem
>
<
DropdownItem
>
<
Trash
size
=
{
15
}
/
>
<
span
className
=
'align-middle ml-50'
>
Delete
<
/span
>
<
/DropdownItem
>
<
/DropdownMenu
>
<
/UncontrolledDropdown
>
<
Edit
size
=
{
15
}
/
>
<
/div
>
)
}
}
]
// ** Table Server Side Column
export
const
serverSideColumns
=
[
{
name
:
'ID'
,
selector
:
'id'
,
sortable
:
true
,
minWidth
:
'25px'
},
{
name
:
'Name'
,
selector
:
'name'
,
sortable
:
true
,
minWidth
:
'225px'
,
cell
:
row
=>
(
<
div
className
=
'd-flex justify-content-left align-items-center'
>
<
div
className
=
'd-flex flex-column'
>
<
Link
to
=
{
`
${
moduleSettings
.
baseURL
}
/edit/
${
row
.
id
}
`
}
className
=
'user-name text-truncate mb-0'
onClick
=
{()
=>
store
.
dispatch
(
cleanLayoutMenu
(
row
.
id
))}
>
<
span
className
=
'font-weight-bold'
>
{
row
.
name
}
<
/span
>
<
/Link
>
<
small
className
=
'text-truncate text-muted mb-0'
>
edit
<
/small
>
<
/div
>
<
/div
>
)
},
{
name
:
'Slug'
,
selector
:
'slug'
,
sortable
:
true
,
minWidth
:
'225px'
}
]
// ** Table Adv Search Column
export
const
advSearchColumns
=
[
{
name
:
'Name'
,
selector
:
'full_name'
,
sortable
:
true
,
minWidth
:
'200px'
},
{
name
:
'Email'
,
selector
:
'email'
,
sortable
:
true
,
minWidth
:
'250px'
},
{
name
:
'Post'
,
selector
:
'post'
,
sortable
:
true
,
minWidth
:
'250px'
},
{
name
:
'City'
,
selector
:
'city'
,
sortable
:
true
,
minWidth
:
'150px'
},
{
name
:
'Date'
,
selector
:
'start_date'
,
sortable
:
true
,
minWidth
:
'150px'
},
{
name
:
'Salary'
,
selector
:
'salary'
,
sortable
:
true
,
minWidth
:
'100px'
}
]
export
default
ExpandableTable
src/views/screens/layoutdetails/edit/index.js
0 → 100644
View file @
fce739c5
// ** React Imports
import
{
Fragment
}
from
'react'
import
{
Link
}
from
'react-router-dom'
// ** Custom Components
import
Breadcrumbs
from
'@components/breadcrumbs'
// ** Third Party Components
import
{
Row
,
Col
}
from
'reactstrap'
// ** Tables
import
ElementEdit
from
'./main'
// ** Styles
import
'@styles/react/libs/tables/react-dataTable-component.scss'
// module settings
import
moduleSettings
from
'../module'
const
Tables
=
()
=>
{
return
(
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'Screens'
breadCrumbParent
=
'Screens'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Row
>
<
Col
sm
=
'12'
>
<
Link
to
=
{
moduleSettings
.
baseURL
}
>
Back
to
{
moduleSettings
.
mainTitleSingle
}
<
/Link
>
<
/Col
>
<
/Row
>
<
Row
>
<
Col
sm
=
'12'
>
<
div
className
=
"card"
>
<
div
className
=
"card-header"
>
<
h4
className
=
"card-title"
>
{
moduleSettings
.
mainTitleSingle
}
<
/h4
>
<
/div
>
<
div
className
=
"card-body"
>
<
ElementEdit
/>
<
/div
>
<
/div
>
<
/Col
>
<
/Row
>
<
/Fragment
>
)
}
export
default
Tables
src/views/screens/layoutdetails/edit/main.js
0 → 100644
View file @
fce739c5
import
{
useState
,
useEffect
,
Fragment
}
from
'react'
import
{
useParams
,
Link
}
from
'react-router-dom'
// ** Store & Actions
import
{
getLayoutDetails
,
updateLayoutDetails
}
from
'../../store/actions'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
import
{
Alert
}
from
'reactstrap'
import
ElementCard
from
'../card'
// module settings
import
moduleSettings
from
'../module'
const
ElementEdit
=
()
=>
{
// ** States & Vars
const
store
=
useSelector
(
state
=>
state
.
screens
),
[
dataElement
,
setElementData
]
=
useState
(
null
),
dispatch
=
useDispatch
(),
{
id
}
=
useParams
()
const
onSubmitHandler
=
values
=>
{
dispatch
(
updateLayoutDetails
({
...
dataElement
,
id
:
values
.
id
,
name
:
values
.
name
,
slug
:
values
.
slug
,
movies
:
values
.
movies
,
series
:
values
.
series
,
seasons
:
values
.
seasons
,
episodes
:
values
.
episodes
,
channels
:
values
.
channels
,
events
:
values
.
events
,
platforms
:
values
.
platforms
})
)
}
// ** Function to get user on mount
useEffect
(()
=>
{
dispatch
(
getLayoutDetails
(
id
))
},
[
dispatch
])
// ** Update user image on mount or change
useEffect
(()
=>
{
if
(
store
.
selectedLayoutDetails
!==
null
||
(
store
.
selectedLayoutDetails
!==
null
&&
dataElement
!==
null
&&
store
.
selectedLayoutDetails
.
id
!==
dataElement
.
id
))
{
return
setElementData
(
store
.
selectedLayoutDetails
)
}
},
[
store
.
selectedLayoutDetails
])
return
store
.
selectedLayoutDetails
!==
null
&&
store
.
selectedLayoutDetails
!==
undefined
?
(
<
ElementCard
selectedElement
=
{
store
.
selectedLayoutDetails
}
onSubmitHandler
=
{
onSubmitHandler
}
/>
)
:
(
<
Alert
color
=
'info'
>
<
h4
className
=
'alert-heading'
>
Loading
{
moduleSettings
.
mainTitleSingle
}
<
/h4
>
<
div
className
=
'alert-body'
>
If
{
moduleSettings
.
mainTitleSingle
}
with
id
:
{
id
}
doesn
't exist. Check list of all {moduleSettings.mainTitle}: <Link to={moduleSettings.baseURL}>{moduleSettings.mainTitle} List</Link>
</div>
</Alert>
)
}
export default ElementEdit
src/views/screens/layoutdetails/index.js
0 → 100644
View file @
fce739c5
// ** React Imports
import
{
Fragment
}
from
'react'
// ** Custom Components
import
Breadcrumbs
from
'@components/breadcrumbs'
// ** Third Party Components
import
{
Row
,
Col
}
from
'reactstrap'
// ** Tables
import
DataTable
from
'./table'
// ** Styles
import
'@styles/react/libs/tables/react-dataTable-component.scss'
// module settings
import
moduleSettings
from
'./module'
const
Tables
=
()
=>
{
return
(
<
Fragment
>
<
Breadcrumbs
breadCrumbTitle
=
'Screens'
breadCrumbParent
=
'Screens'
breadCrumbActive
=
{
moduleSettings
.
mainTitle
}
/
>
<
Row
>
<
Col
sm
=
'12'
>
<
DataTable
/>
<
/Col
>
<
/Row
>
<
/Fragment
>
)
}
export
default
Tables
src/views/screens/layoutdetails/module.js
0 → 100644
View file @
fce739c5
const
moduleSettings
=
{
mainTitle
:
'Layout Details'
,
mainTitleSingle
:
'Layout Details'
,
apiBaseURL
:
'/api/layoutdetails'
,
baseURL
:
'/screens/layoutdetails'
,
newElement
:
{
type
:
0
,
screen_type
:
0
,
expand_episode_cell
:
0
,
compact_season_selection
:
0
,
b_type
:
'none'
,
b_image_template
:
0
,
size
:
0
,
image_template
:
0
,
color
:
0
,
aspect_ratio
:
0
,
season_selection_type
:
null
,
show_video_provider
:
0
,
hide_seasons_if_one
:
0
}
}
export
default
moduleSettings
\ No newline at end of file
src/views/screens/layoutdetails/table.js
0 → 100644
View file @
fce739c5
import
{
Fragment
,
useState
,
useEffect
,
memo
}
from
'react'
// ** Table Columns
import
{
serverSideColumns
}
from
'./data'
// ** Store & Actions
import
{
getData_layoutDetails
}
from
'../store/actions'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
import
DataTableServerSide
from
'@components/datatable'
// module settings
import
moduleSettings
from
'./module'
const
DataTable
=
()
=>
{
// ** Store Vars
const
dispatch
=
useDispatch
()
const
store
=
useSelector
(
state
=>
state
.
screens
)
return
(
<
DataTableServerSide
cardTitle
=
{
moduleSettings
.
mainTitle
}
allData
=
{
store
.
allDataLayoutDetails
}
getData
=
{
getData_layoutDetails
}
serverSideColumns
=
{
serverSideColumns
}
linkAddButton
=
{
`
${
moduleSettings
.
baseURL
}
/add`
}
total
=
{
store
.
totalLayoutDetails
}
/
>
)
}
export
default
memo
(
DataTable
)
src/views/screens/store/actions/index.js
View file @
fce739c5
export
*
from
'./layoutmenus'
export
*
from
'./layoutplayer'
export
*
from
'./layoutepg'
export
*
from
'./layoutdetail'
export
const
resetResults
=
id
=>
{
return
async
dispatch
=>
{
...
...
src/views/screens/store/actions/layoutdetail.js
0 → 100644
View file @
fce739c5
import
axios
from
'axios'
import
{
setSaveSatus
,
setErrorMsg
}
from
'../../../../redux/actions/api'
import
moduleSettings
from
'../../layoutdetails/module'
// ** Get table Data ///api/datatables/data
export
const
getData_layoutDetails
=
params
=>
{
console
.
log
(
params
)
return
async
dispatch
=>
{
await
axios
.
get
(
`
${
process
.
env
.
REACT_APP_API
}${
moduleSettings
.
apiBaseURL
}
`
,
{
params
}
).
then
(
response
=>
{
dispatch
({
type
:
'GET_DATA_LAYOUT_DETAILS'
,
allData
:
response
.
data
.
data
,
// datalayoumenus: response.data.invoices,
totalPages
:
response
.
data
.
recordsTotal
,
params
:
response
.
data
.
params
})
})
}
}
export
const
addlayoutDetails
=
params
=>
{
return
(
dispatch
,
getState
)
=>
{
axios
.
post
(
`
${
process
.
env
.
REACT_APP_API
}${
moduleSettings
.
apiBaseURL
}
`
,
params
)
.
then
(
response
=>
{
dispatch
({
type
:
'ADD_LAYOUTDETAILS'
,
params
})
})
.
then
(()
=>
{
dispatch
(
setSaveSatus
(
true
))
// dispatch(getlayoumenu(layoumenu.id))
// dispatch(getData_layoumenus())
})
.
catch
(
err
=>
{
const
errosMsg
=
!
err
.
response
?
'error'
:
err
.
response
.
data
.
message
console
.
log
(
errosMsg
)
dispatch
(
setErrorMsg
(
errosMsg
))
})
}
}
export
const
getLayoutDetails
=
id
=>
{
return
async
dispatch
=>
{
await
axios
.
get
(
`
${
process
.
env
.
REACT_APP_API
}${
moduleSettings
.
apiBaseURL
}
/
${
id
}
`
)
.
then
(
response
=>
{
// console.log('leu')
// console.log(response)
dispatch
({
type
:
'GET_LAYOUTDETAILS'
,
data
:
response
.
data
.
data
})
})
.
catch
(
err
=>
console
.
log
(
err
))
}
}
export
const
cleanLayoutDetails
=
id
=>
{
return
async
dispatch
=>
{
dispatch
({
type
:
'GET_LAYOUTDETAILS'
,
data
:
null
})
}
}
export
const
updateLayoutDetails
=
params
=>
{
return
(
dispatch
,
getState
)
=>
{
axios
.
put
(
`
${
process
.
env
.
REACT_APP_API
}${
moduleSettings
.
apiBaseURL
}
/
${
params
.
id
}
`
,
params
)
.
then
(
response
=>
{
dispatch
({
type
:
'UPDATE_LAYOUTDETAILS'
,
params
})
})
.
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/screens/store/reducer/index.js
View file @
fce739c5
...
...
@@ -23,7 +23,13 @@ const initialState = {
totalLayoutEPGs
:
1
,
paramsLayoutEPGs
:
{},
allDataLayoutEPGs
:
[],
selectedLayoutEPG
:
null
selectedLayoutEPG
:
null
,
dataLayoutDetails
:
[],
totalLayoutDetails
:
1
,
paramsLayoutDetails
:
{},
allDataLayoutDetails
:
[],
selectedLayoutDetail
:
null
}
...
...
@@ -130,7 +136,32 @@ const screens = (state = initialState, action) => {
case
'ADD_LAYOUTEPG'
:
return
{
...
state
}
//
// layout DETAIL
case
'GET_DATA_LAYOUT_DETAILS'
:
return
{
...
state
,
allDataLayoutDetails
:
action
.
allData
,
dataLayoutDetails
:
action
.
data
,
totalLayoutDetails
:
action
.
totalPages
,
paramsLayoutDetails
:
action
.
params
}
case
'ADD_LAYOUTDETAILS'
:
return
{
...
state
}
case
'GET_PROJECT'
:
return
{
...
state
,
selectedLayoutDetails
:
action
.
data
}
case
'GET_LAYOUTDETAILS'
:
return
{
...
state
,
selectedLayoutDetails
:
action
.
data
}
case
'UPDATE_LAYOUTDETAILS'
:
return
{
...
state
}
case
'ADD_LAYOUTDETAILS'
:
return
{
...
state
}
// default
default
:
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