Commit aead0649 authored by PDuarte's avatar PDuarte

project platforms layout

parent 330411df
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;1,400;1,500;1,600" href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;1,400;1,500;1,600"
/> />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css" crossorigin="" /> <link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css" crossorigin="" />
<title>Vuexy - React Admin Dashboard Template</title> <title>cmsTV - React Admin Dashboard </title>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
......
...@@ -17,19 +17,19 @@ export default [ ...@@ -17,19 +17,19 @@ export default [
title: 'platforms', title: 'platforms',
icon: <HardDrive />, icon: <HardDrive />,
navLink: '/settings/platforms' navLink: '/settings/platforms'
},
{
id: 'locationsDash',
title: 'locations',
icon: <Globe />,
navLink: '/settings/locations'
},
{
id: 'contriesDash',
title: 'Contries',
icon: <Flag />,
navLink: '/settings/contries'
} }
// {
// id: 'locationsDash',
// title: 'locations',
// icon: <Globe />,
// navLink: '/settings/locations'
// },
// {
// id: 'contriesDash',
// title: 'Contries',
// icon: <Flag />,
// navLink: '/settings/contries'
// }
] ]
} }
] ]
...@@ -13,7 +13,7 @@ import settings from './settings' ...@@ -13,7 +13,7 @@ import settings from './settings'
// ** Merge & Export // ** Merge & Export
export default [ export default [
...dashboards, // ...dashboards,
...settings ...settings
// ...apps, // ...apps,
// ...pages, // ...pages,
......
...@@ -17,19 +17,19 @@ export default [ ...@@ -17,19 +17,19 @@ export default [
title: 'platforms', title: 'platforms',
icon: <HardDrive />, icon: <HardDrive />,
navLink: '/settings/platforms' navLink: '/settings/platforms'
},
{
id: 'locationsDash',
title: 'locations',
icon: <Globe />,
navLink: '/settings/locations'
},
{
id: 'contriesDash',
title: 'Contries',
icon: <Flag />,
navLink: '/settings/contries'
} }
// {
// id: 'locationsDash',
// title: 'locations',
// icon: <Globe />,
// navLink: '/settings/locations'
// },
// {
// id: 'contriesDash',
// title: 'Contries',
// icon: <Flag />,
// navLink: '/settings/contries'
// }
] ]
} }
] ]
...@@ -3,8 +3,8 @@ import {Media, Button, Label, Form, FormGroup, Input, Table, CustomInput, Card, ...@@ -3,8 +3,8 @@ import {Media, Button, Label, Form, FormGroup, Input, Table, CustomInput, Card,
import { Lock, Edit, Trash2 } from 'react-feather' import { Lock, Edit, Trash2 } from 'react-feather'
const ProjectPlatform = () => { const ProjectPlatform = ({dataElement}) => {
console.log(dataElement)
return ( return (
<div clssName='permissions border mt-1'> <div clssName='permissions border mt-1'>
<h6 className='py-1 mx-1 mb-0 font-medium-2'> <h6 className='py-1 mx-1 mb-0 font-medium-2'>
...@@ -15,7 +15,10 @@ return ( ...@@ -15,7 +15,10 @@ return (
<thead className='thead-light'> <thead className='thead-light'>
<tr> <tr>
<th>Platforms</th> <th>Platforms</th>
<th>Active</th> <th>Locked</th>
<th>Menu start status</th>
<th>Min version</th>
<th>Menu orientation</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
......
import {Media, Button, Label, Form, FormGroup, Input, Table, CustomInput, Card, CardBody, Row, Col, Nav, NavItem, NavLink, TabContent, TabPane, Alert } from 'reactstrap' import { Fragment, useState, useEffect, memo } from 'react'
import {Media, Button, Label, Form, FormGroup, Input, Table, CustomInput, Card, CardBody, Row, Col, Nav, NavItem, NavLink, TabContent, TabPane, Alert, UncontrolledButtonDropdown } from 'reactstrap'
// ** Store & Actions
import { useDispatch } from 'react-redux'
// ** Store & Actions
import { getData_platforms } from '../../store/actions'
import { Lock, Edit, Trash2 } from 'react-feather' import { Lock, Edit, Trash2 } from 'react-feather'
import { useForm } from 'react-hook-form'
import classnames from 'classnames'
const ProjectPlatform = ({dataElement, store}) => {
const dispatch = useDispatch(),
{ register, errors, handleSubmit } = useForm()
const [plataforms, setPlataforms] = useState(null)
console.log(dataElement)
console.log(store)
// ** Function to get user on mount
useEffect(() => {
if (!store.allDataPlatforms || store.allDataPlatforms.length < 1) {
dispatch(getData_platforms({
start: 1,
length: 1000,
q: null
}))
}
}, [dispatch])
const ProjectPlatform = () => { useEffect(() => {
setPlataforms(store.allDataPlatforms)
}, [store.allDataPlatforms])
return ( return !!dataElement ? (
<div clssName='permissions border mt-1'> <div clssName='permissions border mt-1'>
<h6 className='py-1 mx-1 mb-0 font-medium-2'> <h6 className='py-1 mx-1 mb-0 font-medium-2'>
<Lock size={18} className='mr-25' /> <Lock size={18} className='mr-25' />
<span className='align-middle'>Platforms</span> <span className='align-middle'>Platforms</span>
</h6> </h6>
<Table borderless striped responsive> <Table borderless striped responsive>
<thead className='thead-light'> <thead className='thead-light'>
<tr> <tr>
<th>Platforms</th> <th>Platforms</th>
<th>Active</th> <th>Locked</th>
<th>Menu start status</th>
<th>Min version</th>
<th>Menu orientation</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> {
<td>IOS</td> !!dataElement && !!dataElement.platforms && dataElement.platforms.map(platform => {
<td> const plataformsOptions = platform.pivot,
<CustomInput type='checkbox' id='admin-1' label='' defaultChecked /> locked = plataformsOptions.locked
</td> return (
<tr key={platform.id}>
</tr> <td>{platform.name}</td>
<tr> <td>
<td>Android</td> <CustomInput type='checkbox' id='locked' label='' defaultChecked={locked ? 'true' : ''} />
<td> </td>
<CustomInput type='checkbox' id='staff-1' label='' /> <td>
</td> <Input type='select' name='menu_orientation' id='menu_orientation' defaultValue={plataformsOptions && plataformsOptions.menu_orientation}>
<option value='default'>default</option>
</tr> <option value='left'>left</option>
<tr> <option value='right'>right</option>
<td>Android Tv</td> <option value='top'>top</option>
<td> <option value='bottom'>bottom</option>
<CustomInput type='checkbox' id='author-1' label='' defaultChecked /> </Input>
</td> </td>
<td>
</tr> <Input
<tr> type='text'
<td>Roku</td> name='min_version'
<td> id='min_version'
<CustomInput type='checkbox' id='contributor-1' label='' /> innerRef={register({ required: true })}
</td> placeholder='0'
</tr> defaultValue={plataformsOptions && plataformsOptions.min_version}
<tr> className={classnames({ 'is-invalid': errors['min_version'] })}
<td>STV</td> />
<td> </td>
<CustomInput type='checkbox' id='user-1' label='' /> <td>
</td> <Input
</tr> type='text'
name='menu_start_status'
id='menu_start_status'
innerRef={register({ required: true })}
placeholder='0'
defaultValue={plataformsOptions && plataformsOptions.menu_start_status}
className={classnames({ 'is-invalid': errors['menu_start_status'] })}
/>
</td>
</tr>
)
})
}
</tbody> </tbody>
</Table> </Table>
<Col md='12' sm='12'>
<br />
</Col>
<Row>
<Col md='4' sm='4'>
<FormGroup>
<Label for='addoption'>Add Platforms</Label>
<Input type='select' name='addoption' id='addoption' >
{!!plataforms && plataforms.map(option => {
return <option key={option.id} value='{option.name}'>{option.name}</option>
})}
</Input>
</FormGroup>
</Col>
<Col md='3' sm='4'>
<FormGroup>
<Label for='addoptionbutton'>&nbsp;</Label>
<Button.Ripple color='secondary' name="addoptionbutton" outline onClick={() => {}} >
add
</Button.Ripple>
</FormGroup>
</Col>
</Row>
</div> </div>
) : (
<Fragment>
</Fragment>
) )
} }
export default ProjectPlatform export default ProjectPlatform
...@@ -163,8 +163,8 @@ return ( ...@@ -163,8 +163,8 @@ return (
</FormGroup> </FormGroup>
</Col> */} </Col> */}
<Col sm='6'> <Col sm='12'>
<ProjectPlatform /> <ProjectPlatform dataElement={dataProject} store={store} />
</Col> </Col>
<Col className='d-flex flex-sm-row flex-column mt-2' sm='12'> <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'> <Button.Ripple className='mb-1 mb-sm-0 mr-0 mr-sm-1' type='submit' color='primary'>
......
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