Compare commits

..

5 Commits

Author SHA1 Message Date
5de5a165da 122 fix flights skip take and order by (#123)
* fixing flights skip take order by

* fixing flights skip take order by

* fixing flights skip take order by
2026-03-22 10:19:06 -05:00
26c46fe6e8 updating verison number to 2.1.0 2026-03-22 09:44:06 -05:00
04e5e3e16b 119 fix pilot page responsiveness (#121)
* fixing pilot page responsiveness

* fixing pilot page responsiveness
2026-03-22 09:27:15 -05:00
0305b424eb fixing pilot page responsiveness (#120) 2026-03-22 09:14:24 -05:00
8652544471 115 add load more button to logbook mobile view (#118)
* fixing logbook page responsiveness

* fixing logbook page responsiveness

* fixing logbook page responsiveness

* fixing logbook page responsiveness
2026-03-21 20:57:22 -05:00
6 changed files with 66 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "api",
"version": "2.0.2",
"version": "2.1.1",
"description": "",
"author": "",
"private": true,

View File

@@ -19,6 +19,8 @@ describe('LogService', () => {
createQueryBuilder: jest.fn().mockReturnThis(),
innerJoinAndSelect: jest.fn().mockReturnThis(),
orderBy: jest.fn().mockReturnThis(),
skip: jest.fn().mockReturnThis(),
take: jest.fn().mockReturnThis(),
getManyAndCount: jest.fn()
}

View File

@@ -43,7 +43,9 @@ export class LogService {
.createQueryBuilder('logs')
.innerJoinAndSelect('logs.tracks', 'track')
.innerJoinAndSelect('logs.pilot', 'pilot')
.orderBy('date')
.orderBy('logs.date', 'DESC')
.skip(skip)
.take(take)
.getManyAndCount();
return {

View File

@@ -1,7 +1,7 @@
{
"name": "client",
"private": true,
"version": "2.0.2",
"version": "2.1.1",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -17,11 +17,31 @@ import { Pilot } from './Pilot.interface';
import Alert from '../alert/Alert';
import { useOidc } from '../../auth/oidcConfig';
interface ActionsProps {
id: string;
}
const Pilots: React.FC<unknown> = () => {
const [state, dispatch] = useReducer(reducer, initialState);
const { userRole } = useUserRole();
const { screenSize } = useBreakpoints();
const { isUserLoggedIn } = useOidc();
const Actions = ({ id }: ActionsProps) => {
return (
<div className='dropdown dropdown-end'>
<div tabIndex={0} role='button' className='btn btn-ghost'><FontAwesomeIcon icon={faEllipsisVertical} /></div>
<ul tabIndex={-1} className="dropdown-content menu bg-base-100 rounded-box z-1 w-52 p-2 shadow-sm border border-base-300">
{isUserLoggedIn && userRole === UserRole.WRITE &&
<li><a onClick={() => onOpenClosePilotForm(FormMode.EDIT, id)}><FontAwesomeIcon icon={faPen} />Edit</a></li>
}
<li><a onClick={() => onOpenClosePilotForm(FormMode.VIEW, id)}><FontAwesomeIcon icon={faEye} />View</a></li>
{isUserLoggedIn && userRole === UserRole.WRITE &&
<li><a onClick={() => onDeletePilot(id)}><FontAwesomeIcon icon={faTrash} />Delete</a></li>
}
</ul>
</div>
)
}
const getPilots = async () => {
try {
@@ -134,18 +154,7 @@ const Pilots: React.FC<unknown> = () => {
},
cell: (info: CellContext<Pilot, unknown>) => {
return (
<div className='dropdown dropdown-end'>
<div tabIndex={0} role='button' className='btn btn-ghost'><FontAwesomeIcon icon={faEllipsisVertical} /></div>
<ul tabIndex={-1} className="dropdown-content menu bg-base-100 rounded-box z-1 w-52 p-2 shadow-sm border border-base-300">
{isUserLoggedIn && userRole === UserRole.WRITE &&
<li><a onClick={() => onOpenClosePilotForm(FormMode.EDIT, info.row.original.id)}><FontAwesomeIcon icon={faPen} />Edit</a></li>
}
<li><a onClick={() => onOpenClosePilotForm(FormMode.VIEW, info.row.original.id)}><FontAwesomeIcon icon={faEye} />View</a></li>
{isUserLoggedIn && userRole === UserRole.WRITE &&
<li><a onClick={() => onDeletePilot(info.row.original.id)}><FontAwesomeIcon icon={faTrash} />Delete</a></li>
}
</ul>
</div>
<Actions id={info.row.original.id} />
)
}
}
@@ -172,11 +181,11 @@ const Pilots: React.FC<unknown> = () => {
return (
<>
<div className='mr-10 ml-10 grid grid-cols-12'>
<div className='prose max-w-none col-span-10 mt-5 mb-5' >
<div className={`${screenSize === ScreenSize.SM ? 'mr-4 ml-4' : 'mr-10 ml-10'} grid grid-cols-12`}>
<div className='prose max-w-none col-span-6 mt-5 mb-5' >
<h1>Pilots</h1>
</div>
<div className='col-span-2 justify-self-end self-center'>
<div className='col-span-6 justify-self-end self-center'>
{!state.isLoading && userRole === UserRole.WRITE &&
<button
className='btn btn-primary'
@@ -259,9 +268,40 @@ const Pilots: React.FC<unknown> = () => {
</table>
</div>
}
{/* {state.pilots.length > 0 && screenSize === ScreenSize.SM &&
<PilotCard pilots={state.pilots} onDelete={onDeletePilot} onOpenCloseForm={onOpenClosePilotForm} />
} */}
{state.pilots.length > 0 && screenSize === ScreenSize.SM &&
<div className='col-span-12'>
<>
{table.getRowModel().rows.map((row) => {
return (
<div className='card bg-base-100 border border-base-300 mb-5'>
<div className={`card-body ${screenSize === ScreenSize.SM || screenSize === ScreenSize.MD ? 'p-4' : ''}`} key={row.id}>
<div className={`grid grid-cols-12 gap-3`}>
<>
{row.getVisibleCells().map((cell) => {
return (
<>
{cell.column.columnDef.header !== 'Actions' &&
<>
<div className='col-span-10 self-center'>
<span>{flexRender(cell.column.columnDef.cell, cell.getContext())}</span>
</div>
<div className='col-span-2'>
<Actions id={row.original.id} />
</div>
</>
}
</>
)
})}
</>
</div>
</div>
</div>
)
})}
</>
</div>
}
</div>
{state.isFormOpen && (
<PilotForm

View File

@@ -1,6 +1,6 @@
{
"name": "@noahspan/flying",
"version": "2.0.2",
"version": "2.1.1",
"scripts": {
"start": "node api/dist/main",
"format": "prettier --write \"**/src/**/*.ts\" \"**/test/**/*.ts\"",