- Updated filters in multiple models such as AppPassword, AuditLog, Client, Courier, and others to include '_reference' and other relevant fields like 'createdAt' and 'updatedAt'. - This change improves data handling and consistency across the application, ensuring that all necessary fields are available for filtering.
171 lines
3.7 KiB
JavaScript
171 lines
3.7 KiB
JavaScript
import CourierIcon from '../../components/Icons/CourierIcon'
|
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
|
import EditIcon from '../../components/Icons/EditIcon'
|
|
import CheckIcon from '../../components/Icons/CheckIcon'
|
|
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
|
import BinIcon from '../../components/Icons/BinIcon'
|
|
|
|
export const Courier = {
|
|
name: 'courier',
|
|
label: 'Courier',
|
|
labelPlural: 'Couriers',
|
|
url: '/dashboard/management/couriers',
|
|
prefix: 'COR',
|
|
icon: CourierIcon,
|
|
actions: [
|
|
{
|
|
name: 'info',
|
|
label: 'Info',
|
|
default: true,
|
|
row: true,
|
|
icon: InfoCircleIcon,
|
|
url: (_id) => `/dashboard/management/couriers/info?courierId=${_id}`
|
|
},
|
|
{
|
|
name: 'edit',
|
|
label: 'Edit',
|
|
row: true,
|
|
icon: EditIcon,
|
|
url: (_id) =>
|
|
`/dashboard/management/couriers/info?courierId=${_id}&action=edit`,
|
|
visible: (objectData) => {
|
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
|
}
|
|
},
|
|
{
|
|
name: 'finishEdit',
|
|
label: 'Save Edits',
|
|
icon: CheckIcon,
|
|
url: (_id) =>
|
|
`/dashboard/management/couriers/info?courierId=${_id}&action=finishEdit`,
|
|
visible: (objectData) => {
|
|
return objectData?._isEditing && objectData?._isEditing == true
|
|
}
|
|
},
|
|
{
|
|
name: 'cancelEdit',
|
|
label: 'Cancel Edits',
|
|
icon: XMarkIcon,
|
|
url: (_id) =>
|
|
`/dashboard/management/couriers/info?courierId=${_id}&action=cancelEdit`,
|
|
visible: (objectData) => {
|
|
return objectData?._isEditing && objectData?._isEditing == true
|
|
}
|
|
},
|
|
{ type: 'divider' },
|
|
{
|
|
name: 'delete',
|
|
label: 'Delete',
|
|
icon: BinIcon,
|
|
danger: true,
|
|
url: (_id) =>
|
|
`/dashboard/management/couriers/info?courierId=${_id}&action=delete`
|
|
}
|
|
],
|
|
columns: ['_reference', 'name', 'country', 'email', 'website', 'createdAt'],
|
|
filters: [
|
|
'name',
|
|
'website',
|
|
'email',
|
|
'phone',
|
|
'contact',
|
|
'country',
|
|
'createdAt',
|
|
'updatedAt',
|
|
'_reference'
|
|
],
|
|
sorters: [
|
|
'name',
|
|
'country',
|
|
'email',
|
|
'createdAt',
|
|
'_id',
|
|
'updatedAt'
|
|
],
|
|
group: ['country'],
|
|
properties: [
|
|
{
|
|
name: '_id',
|
|
label: 'ID',
|
|
columnFixed: 'left',
|
|
type: 'id',
|
|
objectType: 'courier',
|
|
showCopy: true,
|
|
columnWidth: 140
|
|
},
|
|
{
|
|
name: 'createdAt',
|
|
label: 'Created At',
|
|
type: 'dateTime',
|
|
readOnly: true,
|
|
columnWidth: 175
|
|
},
|
|
{
|
|
name: '_reference',
|
|
label: 'Reference',
|
|
type: 'reference',
|
|
columnFixed: 'left',
|
|
objectType: 'courier',
|
|
showCopy: true,
|
|
readOnly: false,
|
|
required: true,
|
|
columnWidth: 180
|
|
},
|
|
{
|
|
name: 'name',
|
|
label: 'Name',
|
|
columnFixed: 'left',
|
|
required: true,
|
|
type: 'text',
|
|
columnWidth: 200
|
|
},
|
|
{
|
|
name: 'updatedAt',
|
|
label: 'Updated At',
|
|
type: 'dateTime',
|
|
readOnly: true,
|
|
columnWidth: 175
|
|
},
|
|
{
|
|
name: 'contact',
|
|
label: 'Contact',
|
|
type: 'text',
|
|
readOnly: false,
|
|
required: false,
|
|
columnWidth: 150
|
|
},
|
|
{
|
|
name: 'country',
|
|
label: 'Country',
|
|
type: 'country',
|
|
readOnly: false,
|
|
required: false,
|
|
columnWidth: 150
|
|
},
|
|
{
|
|
name: 'email',
|
|
label: 'Email',
|
|
columnWidth: 300,
|
|
type: 'email',
|
|
readOnly: false,
|
|
required: false
|
|
},
|
|
{
|
|
name: 'phone',
|
|
label: 'Phone',
|
|
type: 'phone',
|
|
readOnly: false,
|
|
required: false,
|
|
columnWidth: 140
|
|
},
|
|
{
|
|
name: 'website',
|
|
label: 'Website',
|
|
columnWidth: 300,
|
|
type: 'url',
|
|
readOnly: false,
|
|
required: false
|
|
}
|
|
]
|
|
}
|