test V1.1
This commit is contained in:
parent
cbd5ae0344
commit
167832a396
File diff suppressed because one or more lines are too long
38
backend/src/db/migrations/1753425156635.js
Normal file
38
backend/src/db/migrations/1753425156635.js
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
module.exports = {
|
||||||
|
/**
|
||||||
|
* @param {QueryInterface} queryInterface
|
||||||
|
* @param {Sequelize} Sequelize
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
async up(queryInterface, Sequelize) {
|
||||||
|
/**
|
||||||
|
* @type {Transaction}
|
||||||
|
*/
|
||||||
|
const transaction = await queryInterface.sequelize.transaction();
|
||||||
|
try {
|
||||||
|
|
||||||
|
await transaction.commit();
|
||||||
|
} catch (err) {
|
||||||
|
await transaction.rollback();
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @param {QueryInterface} queryInterface
|
||||||
|
* @param {Sequelize} Sequelize
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
async down(queryInterface, Sequelize) {
|
||||||
|
/**
|
||||||
|
* @type {Transaction}
|
||||||
|
*/
|
||||||
|
const transaction = await queryInterface.sequelize.transaction();
|
||||||
|
try {
|
||||||
|
|
||||||
|
await transaction.commit();
|
||||||
|
} catch (err) {
|
||||||
|
await transaction.rollback();
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -115,6 +115,15 @@ const CardUsers = ({
|
|||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className='flex justify-between gap-x-4 py-3'>
|
||||||
|
<dt className='text-gray-500 dark:text-dark-600'>Reimbursements</dt>
|
||||||
|
<dd className='flex items-start gap-x-2'>
|
||||||
|
<div className='font-medium line-clamp-4'>
|
||||||
|
{ item.reimbursements }
|
||||||
|
</div>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -65,6 +65,11 @@ const ListUsers = ({ users, loading, onDelete, currentPage, numPages, onPageChan
|
|||||||
<p className={'line-clamp-2'}>{ item.avatar }</p>
|
<p className={'line-clamp-2'}>{ item.avatar }</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className={'flex-1 px-3'}>
|
||||||
|
<p className={'text-xs text-gray-500'}>Reimbursements</p>
|
||||||
|
<p className={'line-clamp-2'}>{ item.reimbursements }</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
<ListActionsPopover
|
<ListActionsPopover
|
||||||
onDelete={onDelete}
|
onDelete={onDelete}
|
||||||
|
|||||||
@ -106,6 +106,19 @@ export const loadColumns = async (
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'reimbursements',
|
||||||
|
headerName: 'Reimbursements',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: true,
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'actions',
|
field: 'actions',
|
||||||
type: 'actions',
|
type: 'actions',
|
||||||
|
|||||||
@ -96,6 +96,25 @@ export default {
|
|||||||
return {label: val.station_id, id: val.id}
|
return {label: val.station_id, id: val.id}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
reimbursementsManyListFormatter(val) {
|
||||||
|
if (!val || !val.length) return []
|
||||||
|
return val.map((item) => item.request_date)
|
||||||
|
},
|
||||||
|
reimbursementsOneListFormatter(val) {
|
||||||
|
if (!val) return ''
|
||||||
|
return val.request_date
|
||||||
|
},
|
||||||
|
reimbursementsManyListFormatterEdit(val) {
|
||||||
|
if (!val || !val.length) return []
|
||||||
|
return val.map((item) => {
|
||||||
|
return {id: item.id, label: item.request_date}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
reimbursementsOneListFormatterEdit(val) {
|
||||||
|
if (!val) return ''
|
||||||
|
return {label: val.request_date, id: val.id}
|
||||||
|
},
|
||||||
|
|
||||||
companiesManyListFormatter(val) {
|
companiesManyListFormatter(val) {
|
||||||
if (!val || !val.length) return []
|
if (!val || !val.length) return []
|
||||||
return val.map((item) => item.name)
|
return val.map((item) => item.name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user