Commit 0aba0ae4 authored by PDuarte's avatar PDuarte

geolocations UI add

parent b33b3f7e
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
{name: 'Antigua and Barbuda', code: 'AG'},
{name: 'Argentina', code: 'AR'},
{name: 'Armenia', code: 'AM'},
{name: 'Aruba', code: 'AW'},
{name: 'Australia', code: 'AU'},
{name: 'Austria', code: 'AT'},
{name: 'Azerbaijan', code: 'AZ'},
{name: 'Bahamas', code: 'BS'},
{name: 'Bahrain', code: 'BH'},
{name: 'Bangladesh', code: 'BD'},
{name: 'Barbados', code: 'BB'},
{name: 'Belarus', code: 'BY'},
{name: 'Belgium', code: 'BE'},
{name: 'Belize', code: 'BZ'},
{name: 'Benin', code: 'BJ'},
{name: 'Bermuda', code: 'BM'},
{name: 'Bhutan', code: 'BT'},
{name: 'Bolivia', code: 'BO'},
{name: 'Bosnia and Herzegovina', code: 'BA'},
{name: 'Botswana', code: 'BW'},
{name: 'Bouvet Island', code: 'BV'},
{name: 'Brazil', code: 'BR'},
{name: 'British Indian Ocean Territory', code: 'IO'},
{name: 'Brunei Darussalam', code: 'BN'},
{name: 'Bulgaria', code: 'BG'},
{name: 'Burkina Faso', code: 'BF'},
{name: 'Burundi', code: 'BI'},
{name: 'Cambodia', code: 'KH'},
{name: 'Cameroon', code: 'CM'},
{name: 'Canada', code: 'CA'},
{name: 'Cape Verde', code: 'CV'},
{name: 'Cayman Islands', code: 'KY'},
{name: 'Central African Republic', code: 'CF'},
{name: 'Chad', code: 'TD'},
{name: 'Chile', code: 'CL'},
{name: 'China', code: 'CN'},
{name: 'Christmas Island', code: 'CX'},
{name: 'Cocos (Keeling) Islands', code: 'CC'},
{name: 'Colombia', code: 'CO'},
{name: 'Comoros', code: 'KM'},
{name: 'Congo', code: 'CG'},
{name: 'Congo, The Democratic Republic of the', code: 'CD'},
{name: 'Cook Islands', code: 'CK'},
{name: 'Costa Rica', code: 'CR'},
{name: 'Cote D\'Ivoire', code: 'CI'},
{name: 'Croatia', code: 'HR'},
{name: 'Cuba', code: 'CU'},
{name: 'Cyprus', code: 'CY'},
{name: 'Czech Republic', code: 'CZ'},
{name: 'Denmark', code: 'DK'},
{name: 'Djibouti', code: 'DJ'},
{name: 'Dominica', code: 'DM'},
{name: 'Dominican Republic', code: 'DO'},
{name: 'Ecuador', code: 'EC'},
{name: 'Egypt', code: 'EG'},
{name: 'El Salvador', code: 'SV'},
{name: 'Equatorial Guinea', code: 'GQ'},
{name: 'Eritrea', code: 'ER'},
{name: 'Estonia', code: 'EE'},
{name: 'Ethiopia', code: 'ET'},
{name: 'Falkland Islands (Malvinas)', code: 'FK'},
{name: 'Faroe Islands', code: 'FO'},
{name: 'Fiji', code: 'FJ'},
{name: 'Finland', code: 'FI'},
{name: 'France', code: 'FR'},
{name: 'French Guiana', code: 'GF'},
{name: 'French Polynesia', code: 'PF'},
{name: 'French Southern Territories', code: 'TF'},
{name: 'Gabon', code: 'GA'},
{name: 'Gambia', code: 'GM'},
{name: 'Georgia', code: 'GE'},
{name: 'Germany', code: 'DE'},
{name: 'Ghana', code: 'GH'},
{name: 'Gibraltar', code: 'GI'},
{name: 'Greece', code: 'GR'},
{name: 'Greenland', code: 'GL'},
{name: 'Grenada', code: 'GD'},
{name: 'Guadeloupe', code: 'GP'},
{name: 'Guam', code: 'GU'},
{name: 'Guatemala', code: 'GT'},
{name: 'Guernsey', code: 'GG'},
{name: 'Guinea', code: 'GN'},
{name: 'Guinea-Bissau', code: 'GW'},
{name: 'Guyana', code: 'GY'},
{name: 'Haiti', code: 'HT'},
{name: 'Heard Island and Mcdonald Islands', code: 'HM'},
{name: 'Holy See (Vatican City State)', code: 'VA'},
{name: 'Honduras', code: 'HN'},
{name: 'Hong Kong', code: 'HK'},
{name: 'Hungary', code: 'HU'},
{name: 'Iceland', code: 'IS'},
{name: 'India', code: 'IN'},
{name: 'Indonesia', code: 'ID'},
{name: 'Iran, Islamic Republic Of', code: 'IR'},
{name: 'Iraq', code: 'IQ'},
{name: 'Ireland', code: 'IE'},
{name: 'Isle of Man', code: 'IM'},
{name: 'Israel', code: 'IL'},
{name: 'Italy', code: 'IT'},
{name: 'Jamaica', code: 'JM'},
{name: 'Japan', code: 'JP'},
{name: 'Jersey', code: 'JE'},
{name: 'Jordan', code: 'JO'},
{name: 'Kazakhstan', code: 'KZ'},
{name: 'Kenya', code: 'KE'},
{name: 'Kiribati', code: 'KI'},
{name: 'Korea, Democratic People\'S Republic of', code: 'KP'},
{name: 'Korea, Republic of', code: 'KR'},
{name: 'Kuwait', code: 'KW'},
{name: 'Kyrgyzstan', code: 'KG'},
{name: 'Lao People\'S Democratic Republic', code: 'LA'},
{name: 'Latvia', code: 'LV'},
{name: 'Lebanon', code: 'LB'},
{name: 'Lesotho', code: 'LS'},
{name: 'Liberia', code: 'LR'},
{name: 'Libyan Arab Jamahiriya', code: 'LY'},
{name: 'Liechtenstein', code: 'LI'},
{name: 'Lithuania', code: 'LT'},
{name: 'Luxembourg', code: 'LU'},
{name: 'Macao', code: 'MO'},
{name: 'Macedonia, The Former Yugoslav Republic of', code: 'MK'},
{name: 'Madagascar', code: 'MG'},
{name: 'Malawi', code: 'MW'},
{name: 'Malaysia', code: 'MY'},
{name: 'Maldives', code: 'MV'},
{name: 'Mali', code: 'ML'},
{name: 'Malta', code: 'MT'},
{name: 'Marshall Islands', code: 'MH'},
{name: 'Martinique', code: 'MQ'},
{name: 'Mauritania', code: 'MR'},
{name: 'Mauritius', code: 'MU'},
{name: 'Mayotte', code: 'YT'},
{name: 'Mexico', code: 'MX'},
{name: 'Micronesia, Federated States of', code: 'FM'},
{name: 'Moldova, Republic of', code: 'MD'},
{name: 'Monaco', code: 'MC'},
{name: 'Mongolia', code: 'MN'},
{name: 'Montserrat', code: 'MS'},
{name: 'Morocco', code: 'MA'},
{name: 'Mozambique', code: 'MZ'},
{name: 'Myanmar', code: 'MM'},
{name: 'Namibia', code: 'NA'},
{name: 'Nauru', code: 'NR'},
{name: 'Nepal', code: 'NP'},
{name: 'Netherlands', code: 'NL'},
{name: 'Netherlands Antilles', code: 'AN'},
{name: 'New Caledonia', code: 'NC'},
{name: 'New Zealand', code: 'NZ'},
{name: 'Nicaragua', code: 'NI'},
{name: 'Niger', code: 'NE'},
{name: 'Nigeria', code: 'NG'},
{name: 'Niue', code: 'NU'},
{name: 'Norfolk Island', code: 'NF'},
{name: 'Northern Mariana Islands', code: 'MP'},
{name: 'Norway', code: 'NO'},
{name: 'Oman', code: 'OM'},
{name: 'Pakistan', code: 'PK'},
{name: 'Palau', code: 'PW'},
{name: 'Palestinian Territory, Occupied', code: 'PS'},
{name: 'Panama', code: 'PA'},
{name: 'Papua New Guinea', code: 'PG'},
{name: 'Paraguay', code: 'PY'},
{name: 'Peru', code: 'PE'},
{name: 'Philippines', code: 'PH'},
{name: 'Pitcairn', code: 'PN'},
{name: 'Poland', code: 'PL'},
{name: 'Portugal', code: 'PT'},
{name: 'Puerto Rico', code: 'PR'},
{name: 'Qatar', code: 'QA'},
{name: 'Reunion', code: 'RE'},
{name: 'Romania', code: 'RO'},
{name: 'Russian Federation', code: 'RU'},
{name: 'RWANDA', code: 'RW'},
{name: 'Saint Helena', code: 'SH'},
{name: 'Saint Kitts and Nevis', code: 'KN'},
{name: 'Saint Lucia', code: 'LC'},
{name: 'Saint Pierre and Miquelon', code: 'PM'},
{name: 'Saint Vincent and the Grenadines', code: 'VC'},
{name: 'Samoa', code: 'WS'},
{name: 'San Marino', code: 'SM'},
{name: 'Sao Tome and Principe', code: 'ST'},
{name: 'Saudi Arabia', code: 'SA'},
{name: 'Senegal', code: 'SN'},
{name: 'Serbia and Montenegro', code: 'CS'},
{name: 'Seychelles', code: 'SC'},
{name: 'Sierra Leone', code: 'SL'},
{name: 'Singapore', code: 'SG'},
{name: 'Slovakia', code: 'SK'},
{name: 'Slovenia', code: 'SI'},
{name: 'Solomon Islands', code: 'SB'},
{name: 'Somalia', code: 'SO'},
{name: 'South Africa', code: 'ZA'},
{name: 'South Georgia and the South Sandwich Islands', code: 'GS'},
{name: 'Spain', code: 'ES'},
{name: 'Sri Lanka', code: 'LK'},
{name: 'Sudan', code: 'SD'},
{name: 'Suriname', code: 'SR'},
{name: 'Svalbard and Jan Mayen', code: 'SJ'},
{name: 'Swaziland', code: 'SZ'},
{name: 'Sweden', code: 'SE'},
{name: 'Switzerland', code: 'CH'},
{name: 'Syrian Arab Republic', code: 'SY'},
{name: 'Taiwan, Province of China', code: 'TW'},
{name: 'Tajikistan', code: 'TJ'},
{name: 'Tanzania, United Republic of', code: 'TZ'},
{name: 'Thailand', code: 'TH'},
{name: 'Timor-Leste', code: 'TL'},
{name: 'Togo', code: 'TG'},
{name: 'Tokelau', code: 'TK'},
{name: 'Tonga', code: 'TO'},
{name: 'Trinidad and Tobago', code: 'TT'},
{name: 'Tunisia', code: 'TN'},
{name: 'Turkey', code: 'TR'},
{name: 'Turkmenistan', code: 'TM'},
{name: 'Turks and Caicos Islands', code: 'TC'},
{name: 'Tuvalu', code: 'TV'},
{name: 'Uganda', code: 'UG'},
{name: 'Ukraine', code: 'UA'},
{name: 'United Arab Emirates', code: 'AE'},
{name: 'United Kingdom', code: 'GB'},
{name: 'United States', code: 'US'},
{name: 'United States Minor Outlying Islands', code: 'UM'},
{name: 'Uruguay', code: 'UY'},
{name: 'Uzbekistan', code: 'UZ'},
{name: 'Vanuatu', code: 'VU'},
{name: 'Venezuela', code: 'VE'},
{name: 'Viet Nam', code: 'VN'},
{name: 'Virgin Islands, British', code: 'VG'},
{name: 'Virgin Islands, U.S.', code: 'VI'},
{name: 'Wallis and Futuna', code: 'WF'},
{name: 'Western Sahara', code: 'EH'},
{name: 'Yemen', code: 'YE'},
{name: 'Zambia', code: 'ZM'},
{name: 'Zimbabwe', code: 'ZW'}
]
\ No newline at end of file
...@@ -42,6 +42,13 @@ const SettingsRoutes = [ ...@@ -42,6 +42,13 @@ const SettingsRoutes = [
component: lazy(() => import('../../views/settings/locations')), component: lazy(() => import('../../views/settings/locations')),
exact: true exact: true
}, },
{
path: '/settings/locations/edit/:id',
component: lazy(() => import('../../views/settings/locations/edit')),
meta: {
navLink: '/settings/locations/edit'
}
},
{ {
path: '/settings/locations/add', path: '/settings/locations/add',
component: lazy(() => import('../../views/settings/locations/add')), component: lazy(() => import('../../views/settings/locations/add')),
......
...@@ -22,19 +22,17 @@ import '@styles/react/libs/tables/react-dataTable-component.scss' ...@@ -22,19 +22,17 @@ import '@styles/react/libs/tables/react-dataTable-component.scss'
const Tables = () => { const Tables = () => {
const dispatch = useDispatch() const dispatch = useDispatch()
const storeNavbar = useSelector(state => state.navbar) const storeNavbar = useSelector(state => state.navbar)
const onSubmitHandler = (values, uploadFile) => { const onSubmitHandler = (values) => {
dispatch( dispatch(
addlocation({ addlocation({
projectid: values.projectid, projectid: values.projectid,
title: values.title, name: values.name,
parentid: values.parentid, order: values.order,
parenttype: values.parenttype, country: values.country,
external_id: values.external_id, state: values.state,
textual: values.textual, city: values.city,
availability: values.availability, ip: values.ip,
genres: values.genres, polyline: values.polyline
subgenres: values.subgenres,
data: uploadFile
} }
) )
) )
......
...@@ -14,18 +14,24 @@ import { ...@@ -14,18 +14,24 @@ import {
Tooltip Tooltip
} from 'react-leaflet' } from 'react-leaflet'
import { EditControl } from "react-leaflet-draw" import { EditControl } from "react-leaflet-draw"
import L from 'leaflet'
import { useLeafletContext } from '@react-leaflet/core'
import '@styles/map/leaflet.draw.css' import '@styles/map/leaflet.draw.css'
let polyline let polyline
const center = [51.505, -0.09] const center = [51.505, -0.09]
const MapTooltip = () => { const MapTooltip = ({gis, handleGis}) => {
const [clicked, setClicked] = useState(0) const [clicked, setClicked] = useState(0)
const [myControl, setmyControl] = useState({
const onClickCircle = () => { polygon: true,
setClicked(clicked + 1) rectangle: false,
} circle: false,
circlemarker: false,
const clickedText = clicked === 0 ? 'Click this Circle to change the Tooltip text' : `Circle click: ${clicked}` marker: false,
polyline:false
})
const _editableFG = null const _editableFG = null
...@@ -49,9 +55,11 @@ const MapTooltip = () => { ...@@ -49,9 +55,11 @@ const MapTooltip = () => {
let numEdited = 0 let numEdited = 0
e.layers.eachLayer((layer) => { e.layers.eachLayer((layer) => {
numEdited += 1 numEdited += 1
console.log(layer)
handleGis(layer._latlngs[0])
}) })
console.log(`_onEdited: edited ${numEdited} layers`, e) console.log(`_onEdited: edited ${numEdited} layers`, e)
console.log(gis)
_onChange() _onChange()
} }
...@@ -62,12 +70,15 @@ const MapTooltip = () => { ...@@ -62,12 +70,15 @@ const MapTooltip = () => {
// Do marker specific actions // Do marker specific actions
console.log('_onCreated: marker created', e) console.log('_onCreated: marker created', e)
} else { } else {
console.log('_onCreated: something else created:', type, e) console.log('_onCreated: something else created:', type, e)
console.log(layer)
} }
// Do whatever else you need to. (save to db etc) // Do whatever else you need to. (save to db etc)
handleGis(layer._latlngs[0])
_onChange()
// setmyControl({
// ...myControl,
// polygon: false
// })
} }
const _onDeleted = (e) => { const _onDeleted = (e) => {
...@@ -76,8 +87,14 @@ const MapTooltip = () => { ...@@ -76,8 +87,14 @@ const MapTooltip = () => {
numDeleted += 1 numDeleted += 1
}) })
console.log(`onDeleted: removed ${numDeleted} layers`, e) console.log(`onDeleted: removed ${numDeleted} layers`, e)
if (numDeleted < 1) return
const emptyA = []
handleGis(emptyA)
setmyControl({
...myControl,
polygon: true
})
_onChange()
} }
const _onMounted = (drawControl) => { const _onMounted = (drawControl) => {
...@@ -100,6 +117,11 @@ const MapTooltip = () => { ...@@ -100,6 +117,11 @@ const MapTooltip = () => {
console.log('_onDeleteStop', e) console.log('_onDeleteStop', e)
} }
const _onFeatureGroupReady = (reactFGref) => {
console.log(reactFGref)
}
const showAdd = gis.length < 1
return ( return (
<Card> <Card>
<CardHeader> <CardHeader>
...@@ -111,7 +133,7 @@ const MapTooltip = () => { ...@@ -111,7 +133,7 @@ const MapTooltip = () => {
<FeatureGroup <FeatureGroup
ref={(reactFGref) => { ref={(reactFGref) => {
// this._onFeatureGroupReady(reactFGref) _onFeatureGroupReady(reactFGref)
}} }}
> >
<EditControl <EditControl
...@@ -124,13 +146,7 @@ const MapTooltip = () => { ...@@ -124,13 +146,7 @@ const MapTooltip = () => {
onEditStop={_onEditStop} onEditStop={_onEditStop}
onDeleteStart={_onDeleteStart} onDeleteStart={_onDeleteStart}
onDeleteStop={_onDeleteStop} onDeleteStop={_onDeleteStop}
draw={{ draw={myControl}
rectangle: false,
circle: false,
circlemarker: false,
marker: false,
polyline:false
}}
/> />
</FeatureGroup> </FeatureGroup>
......
...@@ -27,6 +27,8 @@ import withReactContent from 'sweetalert2-react-content' ...@@ -27,6 +27,8 @@ import withReactContent from 'sweetalert2-react-content'
import MapTooltip from './MapTooltip' import MapTooltip from './MapTooltip'
// import countries from '@assets/countries.json'
// ** Styles // ** Styles
import '@styles/react/apps/app-users.scss' import '@styles/react/apps/app-users.scss'
import '@styles/react/libs/flatpickr/flatpickr.scss' import '@styles/react/libs/flatpickr/flatpickr.scss'
...@@ -53,6 +55,7 @@ const SuccessProgressToast = () => ( ...@@ -53,6 +55,7 @@ const SuccessProgressToast = () => (
const ElementCard = ({ selectedElement, onSubmitHandler }) => { const ElementCard = ({ selectedElement, onSubmitHandler }) => {
const store = useSelector(state => state.projectsettings) const store = useSelector(state => state.projectsettings)
const [gis, setGis] = useState([])
const [PlatformName, setPlatformName] = useState('Web') const [PlatformName, setPlatformName] = useState('Web')
const MySwal = withReactContent(Swal) const MySwal = withReactContent(Swal)
...@@ -90,12 +93,15 @@ const handleError = (text) => { ...@@ -90,12 +93,15 @@ const handleError = (text) => {
const submitElement = { const submitElement = {
...dataElement, ...dataElement,
idproject: values.idproject, idproject: values.idproject,
title: values.title, name: values.name,
parentid: values.parentid, order: values.order,
parenttype: values.parenttype, country: values.country,
external_id: values.external_id state: values.state,
city: values.city,
ip: values.ip,
polyline: gis
} }
onSubmitHandler(submitElement, uploadFiles) onSubmitHandler(submitElement)
} }
}, },
...@@ -114,107 +120,12 @@ const handleError = (text) => { ...@@ -114,107 +120,12 @@ const handleError = (text) => {
} }
setElementData(newData) setElementData(newData)
}, },
updateGenres = (value) => { handleGis = (value) => {
const newValue = value.map(elm => { setGis(value)
return { }
id: elm.value,
idproject: dataElement.projectid,
name: elm.label,
pivot: {
idasset: dataElement.id,
idgenres:elm.value1
}
}
})
const newData = {
...dataElement,
genres: newValue
}
setElementData(newData)
},
updateSubGenres = (value) => {
const newValue = value.map(elm => {
return {
id: elm.value,
idproject: dataElement.projectid,
name: elm.label,
pivot: {
idasset: dataElement.id,
idgenres:elm.value1
}
}
})
const newData = {
...dataElement,
subgenres: newValue
}
setElementData(newData)
},
genreOnChange = (value, { action, removedValue }) => {
switch (action) {
case 'remove-value':
case 'pop-value':
if (removedValue.isFixed) {
return
}
setGenresAsset(value)
break
case 'clear':
value = genresAllOptions.filter(v => v.isFixed)
setGenresAsset(value)
break
default:
setGenresAsset(value)
break
}
updateGenres(value)
},
genreSubOnChange = (value, { action, removedValue }) => {
switch (action) {
case 'remove-value':
case 'pop-value':
if (removedValue.isFixed) {
return
}
setGenresSubAsset(value)
break
case 'clear':
value = genresAllOptions.filter(v => v.isFixed)
setGenresSubAsset(value)
break
default:
setGenresSubAsset(value)
break
}
updateSubGenres(value)
},
handleImageryChange = (prop, file, lang) => {
let newUpload = uploadFiles.filter(elm => elm.type !== prop || elm.langcode.langcode !== lang.langcode)
newUpload = newUpload.concat({
type: prop,
langcode: lang,
obj: file
})
setUploadFile(newUpload)
}
useEffect(() => { useEffect(() => {
if (selectedElement !== null || (selectedElement !== null && dataElement !== null && selectedElement.id !== dataElement.id)) { if (selectedElement !== null || (selectedElement !== null && dataElement !== null && selectedElement.id !== dataElement.id)) {
const genres = selectedElement.genres.map(elm => {
return {
value: elm.id,
label: elm.name
}
})
setGenresAsset(genres)
const subgenres = selectedElement.subgenres.map(elm => {
return {
value: elm.id,
label: elm.name
}
})
setGenresSubAsset(subgenres)
return setElementData(selectedElement) return setElementData(selectedElement)
} }
}, [selectedElement]) }, [selectedElement])
...@@ -276,6 +187,9 @@ const handleError = (text) => { ...@@ -276,6 +187,9 @@ const handleError = (text) => {
setLayoutplaylists(screensStore.allDataLayoutPlaylists) setLayoutplaylists(screensStore.allDataLayoutPlaylists)
}, [screensStore.allDataLayoutPlaylists]) }, [screensStore.allDataLayoutPlaylists])
useEffect(() => {
console.log(gis, gis.length)
}, [gis])
return ( return (
<Fragment> <Fragment>
...@@ -360,7 +274,7 @@ return ( ...@@ -360,7 +274,7 @@ return (
type='text' type='text'
name='state' name='state'
id='state' id='state'
innerRef={register({ required: true })} innerRef={register({ required: false })}
placeholder='state' placeholder='state'
defaultValue={dataElement && dataElement.state} defaultValue={dataElement && dataElement.state}
className={classnames({ 'is-invalid': errors['state'] })} className={classnames({ 'is-invalid': errors['state'] })}
...@@ -374,7 +288,7 @@ return ( ...@@ -374,7 +288,7 @@ return (
type='text' type='text'
name='city' name='city'
id='city' id='city'
innerRef={register({ required: true })} innerRef={register({ required: false })}
placeholder='city' placeholder='city'
defaultValue={dataElement && dataElement.city} defaultValue={dataElement && dataElement.city}
className={classnames({ 'is-invalid': errors['city'] })} className={classnames({ 'is-invalid': errors['city'] })}
...@@ -388,7 +302,7 @@ return ( ...@@ -388,7 +302,7 @@ return (
type='text' type='text'
name='ip' name='ip'
id='ip' id='ip'
innerRef={register({ required: true })} innerRef={register({ required: false })}
placeholder='ip' placeholder='ip'
defaultValue={dataElement && dataElement.ip} defaultValue={dataElement && dataElement.ip}
className={classnames({ 'is-invalid': errors['ip'] })} className={classnames({ 'is-invalid': errors['ip'] })}
...@@ -399,7 +313,7 @@ return ( ...@@ -399,7 +313,7 @@ return (
<Row> <Row>
<Col sm='12'> <Col sm='12'>
<MapTooltip /> <MapTooltip gis={gis} handleGis={handleGis}/>
</Col> </Col>
</Row> </Row>
......
...@@ -9,7 +9,7 @@ import Breadcrumbs from '@components/breadcrumbs' ...@@ -9,7 +9,7 @@ import Breadcrumbs from '@components/breadcrumbs'
import { Row, Col } from 'reactstrap' import { Row, Col } from 'reactstrap'
// ** Tables // ** Tables
import ElementEdit from './main' import ElementEdit from '../card'
// ** Styles // ** Styles
import '@styles/react/libs/tables/react-dataTable-component.scss' import '@styles/react/libs/tables/react-dataTable-component.scss'
// module settings // module settings
...@@ -18,7 +18,7 @@ import moduleSettings from '../module' ...@@ -18,7 +18,7 @@ import moduleSettings from '../module'
const Tables = () => { const Tables = () => {
return ( return (
<Fragment> <Fragment>
<Breadcrumbs breadCrumbTitle='Assets' breadCrumbParent='Assets' breadCrumbActive={moduleSettings.mainTitle} /> <Breadcrumbs breadCrumbTitle='Assets' breadCrumbParent='Assets' breadCrumbActive={moduleSettings.mainTitle} />
<Row> <Row>
<Col sm='12'> <Col sm='12'>
<Link to={moduleSettings.baseURL}>Back to {moduleSettings.mainTitleSingle}</Link> <Link to={moduleSettings.baseURL}>Back to {moduleSettings.mainTitleSingle}</Link>
......
...@@ -205,8 +205,9 @@ export const addlocation = location => { ...@@ -205,8 +205,9 @@ export const addlocation = location => {
dispatch(setSaveSatus(true)) dispatch(setSaveSatus(true))
}) })
.catch(err => { .catch(err => {
dispatch(setErrorMsg(err.response.data.message)) // dispatch(setErrorMsg(err.response.data.message))
console.log(err.response.data) dispatch(setErrorMsg(err))
console.log(err)
}) })
} }
} }
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