update list
for project routes
This commit is contained in:
parent
191f495abe
commit
0eddd112ae
@ -7,7 +7,7 @@ interface CustomDataGridProps extends DataGridProps {
|
||||
hasCoordinates?: boolean
|
||||
}
|
||||
|
||||
const DEV_FIELDS = ['id', 'city_id', 'carrier_id'] as const
|
||||
const DEV_FIELDS = ['id', 'code', 'country_code', 'city_id', 'carrier_id'] as const
|
||||
|
||||
export const CustomDataGrid = ({hasCoordinates = false, columns = [], ...props}: CustomDataGridProps) => {
|
||||
const isDev = import.meta.env.DEV
|
||||
|
@ -26,6 +26,14 @@ export const CarrierList = () => {
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
},
|
||||
{
|
||||
field: 'city',
|
||||
headerName: 'Город',
|
||||
type: 'string',
|
||||
minWidth: 150,
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
},
|
||||
{
|
||||
field: 'full_name',
|
||||
headerName: 'Полное имя',
|
||||
@ -42,11 +50,11 @@ export const CarrierList = () => {
|
||||
{
|
||||
field: 'actions',
|
||||
headerName: 'Действия',
|
||||
minWidth: 120,
|
||||
display: 'flex',
|
||||
align: 'right',
|
||||
headerAlign: 'center',
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
display: 'flex',
|
||||
renderCell: function render({row}) {
|
||||
return (
|
||||
<>
|
||||
|
@ -26,6 +26,14 @@ export const CityList = () => {
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
},
|
||||
{
|
||||
field: 'country',
|
||||
headerName: 'Cтрана',
|
||||
type: 'string',
|
||||
minWidth: 150,
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
headerName: 'Название',
|
||||
@ -36,11 +44,11 @@ export const CityList = () => {
|
||||
{
|
||||
field: 'actions',
|
||||
headerName: 'Действия',
|
||||
minWidth: 120,
|
||||
display: 'flex',
|
||||
align: 'right',
|
||||
headerAlign: 'center',
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
display: 'flex',
|
||||
renderCell: function render({row}) {
|
||||
return (
|
||||
<>
|
||||
|
@ -29,11 +29,11 @@ export const CountryList = () => {
|
||||
{
|
||||
field: 'actions',
|
||||
headerName: 'Действия',
|
||||
minWidth: 120,
|
||||
display: 'flex',
|
||||
align: 'right',
|
||||
headerAlign: 'center',
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
display: 'flex',
|
||||
renderCell: function render({row}) {
|
||||
return (
|
||||
<>
|
||||
|
@ -2,6 +2,7 @@ import {type GridColDef} from '@mui/x-data-grid'
|
||||
import {CustomDataGrid} from '../../components/CustomDataGrid'
|
||||
import {DeleteButton, EditButton, List, ShowButton, useDataGrid} from '@refinedev/mui'
|
||||
import React from 'react'
|
||||
import {MEDIA_TYPES} from '../../lib/constants'
|
||||
|
||||
import {localeText} from '../../locales/ru/localeText'
|
||||
|
||||
@ -10,6 +11,15 @@ export const MediaList = () => {
|
||||
|
||||
const columns = React.useMemo<GridColDef[]>(
|
||||
() => [
|
||||
{
|
||||
field: 'id',
|
||||
headerName: 'ID',
|
||||
type: 'number',
|
||||
minWidth: 350,
|
||||
display: 'flex',
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
},
|
||||
{
|
||||
field: 'filename',
|
||||
headerName: 'Название',
|
||||
@ -22,28 +32,23 @@ export const MediaList = () => {
|
||||
{
|
||||
field: 'media_type',
|
||||
headerName: 'Тип',
|
||||
type: 'number',
|
||||
minWidth: 150,
|
||||
display: 'flex',
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
headerName: 'ID',
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
display: 'flex',
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
flex: 1,
|
||||
renderCell: (params) => {
|
||||
const value = params.row.media_type
|
||||
return MEDIA_TYPES.find((type) => type.value === value)?.label || value
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'actions',
|
||||
headerName: 'Действия',
|
||||
align: 'right',
|
||||
headerAlign: 'right',
|
||||
minWidth: 120,
|
||||
display: 'flex',
|
||||
flex: 1,
|
||||
align: 'right',
|
||||
headerAlign: 'center',
|
||||
sortable: false,
|
||||
renderCell: function render({row}) {
|
||||
return (
|
||||
|
@ -31,6 +31,15 @@ export const RouteList = () => {
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
},
|
||||
{
|
||||
field: 'carrier',
|
||||
headerName: 'Перевозчик',
|
||||
type: 'string',
|
||||
minWidth: 150,
|
||||
display: 'flex',
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
},
|
||||
{
|
||||
field: 'route_number',
|
||||
headerName: 'Номер маршрута',
|
||||
|
@ -54,15 +54,23 @@ export const SightList = () => {
|
||||
display: 'flex',
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
},
|
||||
{
|
||||
field: 'city',
|
||||
headerName: 'Город',
|
||||
type: 'string',
|
||||
minWidth: 150,
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: 'actions',
|
||||
headerName: 'Действия',
|
||||
align: 'right',
|
||||
headerAlign: 'right',
|
||||
minWidth: 120,
|
||||
display: 'flex',
|
||||
flex: 1,
|
||||
align: 'right',
|
||||
headerAlign: 'center',
|
||||
sortable: false,
|
||||
renderCell: function render({row}) {
|
||||
return (
|
||||
|
@ -2,6 +2,7 @@ import {type GridColDef} from '@mui/x-data-grid'
|
||||
import {CustomDataGrid} from '../../components/CustomDataGrid'
|
||||
import {DeleteButton, EditButton, List, ShowButton, useDataGrid} from '@refinedev/mui'
|
||||
import React from 'react'
|
||||
import {VEHICLE_TYPES} from '../../lib/constants'
|
||||
|
||||
import {localeText} from '../../locales/ru/localeText'
|
||||
|
||||
@ -31,18 +32,29 @@ export const VehicleList = () => {
|
||||
{
|
||||
field: 'type',
|
||||
headerName: 'Тип',
|
||||
type: 'number',
|
||||
type: 'string',
|
||||
minWidth: 200,
|
||||
display: 'flex',
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
renderCell: (params) => {
|
||||
const value = params.row.type
|
||||
return VEHICLE_TYPES.find((type) => type.value === value)?.label || value
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'city_id',
|
||||
headerName: 'ID города',
|
||||
type: 'string',
|
||||
minWidth: 150,
|
||||
display: 'flex',
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
},
|
||||
{
|
||||
field: 'city_id',
|
||||
headerName: 'ID города',
|
||||
type: 'number',
|
||||
minWidth: 70,
|
||||
display: 'flex',
|
||||
field: 'city',
|
||||
headerName: 'Город',
|
||||
type: 'string',
|
||||
align: 'left',
|
||||
headerAlign: 'left',
|
||||
flex: 1,
|
||||
@ -50,12 +62,11 @@ export const VehicleList = () => {
|
||||
{
|
||||
field: 'actions',
|
||||
headerName: 'Действия',
|
||||
align: 'right',
|
||||
headerAlign: 'right',
|
||||
minWidth: 120,
|
||||
display: 'flex',
|
||||
flex: 1,
|
||||
align: 'right',
|
||||
headerAlign: 'center',
|
||||
sortable: false,
|
||||
|
||||
renderCell: function render({row}) {
|
||||
return (
|
||||
<>
|
||||
|
Loading…
Reference in New Issue
Block a user