Commit 9797b0aa authored by PDuarte's avatar PDuarte

*add menu page fix

* datable components fix
parent 1ea2548f
...@@ -20,7 +20,7 @@ const DataTableServerSide = ({cardTitle, allData, total, getData, serverSideColu ...@@ -20,7 +20,7 @@ const DataTableServerSide = ({cardTitle, allData, total, getData, serverSideColu
// ** States // ** States
const [currentPage, setCurrentPage] = useState(1) const [currentPage, setCurrentPage] = useState(1)
const [rowsPerPage, setRowsPerPage] = useState(7) const [rowsPerPage, setRowsPerPage] = useState(10)
const [searchValue, setSearchValue] = useState('') const [searchValue, setSearchValue] = useState('')
const [searchTerm, setSearchTerm] = useState('') const [searchTerm, setSearchTerm] = useState('')
...@@ -77,7 +77,7 @@ const DataTableServerSide = ({cardTitle, allData, total, getData, serverSideColu ...@@ -77,7 +77,7 @@ const DataTableServerSide = ({cardTitle, allData, total, getData, serverSideColu
// ** Custom Pagination // ** Custom Pagination
const CustomPagination = () => { const CustomPagination = () => {
const count = Number((total / rowsPerPage).toFixed(0)) const count = Number((total / rowsPerPage).toFixed(0)) + 1
return ( return (
<ReactPaginate <ReactPaginate
previousLabel={''} previousLabel={''}
......
...@@ -21,7 +21,7 @@ const CustomHeader = ({ linkAddButton, handlePerPage, rowsPerPage, handleFilter, ...@@ -21,7 +21,7 @@ const CustomHeader = ({ linkAddButton, handlePerPage, rowsPerPage, handleFilter,
backgroundPosition: 'calc(100% - 3px) 11px, calc(100% - 20px) 13px, 100% 0' backgroundPosition: 'calc(100% - 3px) 11px, calc(100% - 20px) 13px, 100% 0'
}} }}
> >
<option value='10'>10</option> <option value='10' defaultValue>10</option>
<option value='25'>25</option> <option value='25'>25</option>
<option value='50'>50</option> <option value='50'>50</option>
</CustomInput> </CustomInput>
......
...@@ -63,7 +63,13 @@ const Tables = () => { ...@@ -63,7 +63,13 @@ const Tables = () => {
display: '', display: '',
pagetypeid: '', pagetypeid: '',
order: '0', order: '0',
menu_page_layouts: [] menu_page_layouts: [
{
order: 1,
layout_id:null,
playlists: []
}
]
}} }}
onSubmitHandler={onSubmitHandler} onSubmitHandler={onSubmitHandler}
/> />
......
...@@ -139,7 +139,7 @@ const handleError = (text) => { ...@@ -139,7 +139,7 @@ const handleError = (text) => {
useEffect(() => { useEffect(() => {
if (!settingStore.allDataPagetypes || settingStore.allDataPagetypes.length < 1) { if (!settingStore.allDataPagetypes || settingStore.allDataPagetypes.length < 1) {
dispatch(getData_pagetypes({ dispatch(getData_pagetypes({
start: 1, start: 0,
length: 1000, length: 1000,
q: null q: null
})) }))
...@@ -160,7 +160,7 @@ const handleError = (text) => { ...@@ -160,7 +160,7 @@ const handleError = (text) => {
useEffect(() => { useEffect(() => {
if (!screensStore.allDataLayoutMenus || screensStore.allDataLayoutMenus.length < 1) { if (!screensStore.allDataLayoutMenus || screensStore.allDataLayoutMenus.length < 1) {
dispatch(getData_layoutmenus({ dispatch(getData_layoutmenus({
start: 1, start: 0,
length: 1000, length: 1000,
q: null q: null
})) }))
...@@ -334,7 +334,7 @@ return ( ...@@ -334,7 +334,7 @@ return (
<Nav pills> <Nav pills>
{dataElement && dataElement.menu_page_layouts.map((block, index) => { {dataElement && dataElement.menu_page_layouts.map((block, index) => {
return <NavItem> return <NavItem key={index}>
<NavLink key={index} <NavLink key={index}
active={activeTab === index} active={activeTab === index}
onClick={() => toggle(index)} onClick={() => toggle(index)}
...@@ -356,7 +356,7 @@ return ( ...@@ -356,7 +356,7 @@ return (
activeTab={activeTab} activeTab={activeTab}
> >
{!!dataElement && dataElement.menu_page_layouts.map((block, index) => { {!!dataElement && dataElement.menu_page_layouts.map((block, index) => {
return <TabPane tabId={index}> return <TabPane tabId={index} key={index}>
<TabLayoutPlaylist block={block} selectedDataElement={dataElement} setElementData={setElementData} /> <TabLayoutPlaylist block={block} selectedDataElement={dataElement} setElementData={setElementData} />
</TabPane> </TabPane>
} }
......
...@@ -140,7 +140,7 @@ const ManagePlaylist = ({dataElement, selectedDataElement, handleChange}) => { ...@@ -140,7 +140,7 @@ const ManagePlaylist = ({dataElement, selectedDataElement, handleChange}) => {
return <div className="card"> return <div className="card">
<div className="card-header"> <div className="card-header">
<h4 className="card-title">playlist</h4> <h4 className="card-title">Playlists</h4>
</div> </div>
<div className="card-body"> <div className="card-body">
<Row> <Row>
......
...@@ -67,7 +67,7 @@ const TabLayoutPlaylist = ({block, selectedDataElement, setElementData}) => { ...@@ -67,7 +67,7 @@ const TabLayoutPlaylist = ({block, selectedDataElement, setElementData}) => {
<Col sm='12'> <Col sm='12'>
<div className="card"> <div className="card">
<div className="card-header"> <div className="card-header">
<h4 className="card-title">ElementCard {dataElement && dataElement.id} </h4> {/* <h4 className="card-title">ElementCard {dataElement && dataElement.id} </h4> */}
</div> </div>
<div className="card-body"> <div className="card-body">
<Row> <Row>
...@@ -99,6 +99,9 @@ const TabLayoutPlaylist = ({block, selectedDataElement, setElementData}) => { ...@@ -99,6 +99,9 @@ const TabLayoutPlaylist = ({block, selectedDataElement, setElementData}) => {
> >
{!!layoutPlaylists ? layoutPlaylists.map(option => { {!!layoutPlaylists ? layoutPlaylists.map(option => {
if (dataElement.layout_id === null) {
dataElement.layout_id = option.id
}
return <option key={option.id} return <option key={option.id}
selected={option.id === dataElement.layout_id ? option.id : ''} selected={option.id === dataElement.layout_id ? option.id : ''}
value={option.id}>{option.name}</option> value={option.id}>{option.name}</option>
......
...@@ -5,9 +5,13 @@ const moduleSettings = { ...@@ -5,9 +5,13 @@ const moduleSettings = {
baseURL: '/menupages/mainpages', baseURL: '/menupages/mainpages',
newElement: { newElement: {
slug: 0, slug: 0,
type: 0 type: 0,
menu_page_layouts: {
playlists: []
}
}, },
elementsOption: { elementsOption: {
playlists: []
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment