Fixed column width on mobile and added a note column
This commit is contained in:
@@ -155,7 +155,7 @@ class SettingsRegistry
|
|||||||
['value' => 'seat_type_id', 'label' => 'Seat Type'],
|
['value' => 'seat_type_id', 'label' => 'Seat Type'],
|
||||||
['value' => 'seat_number', 'label' => 'Seat Number'],
|
['value' => 'seat_number', 'label' => 'Seat Number'],
|
||||||
['value' => 'flight_reason_id', 'label' => 'Reason'],
|
['value' => 'flight_reason_id', 'label' => 'Reason'],
|
||||||
|
['value' => 'note', 'label' => 'Note'],
|
||||||
['value' => 'aircraft.display_name_short', 'label' => 'Aircraft Full Name'],
|
['value' => 'aircraft.display_name_short', 'label' => 'Aircraft Full Name'],
|
||||||
['value' => 'class_seat_combined', 'label' => 'Class/Seat Type/Seat Number Combined'],
|
['value' => 'class_seat_combined', 'label' => 'Class/Seat Type/Seat Number Combined'],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const props = defineProps<{
|
|||||||
const page = usePage<SharedProps>().props
|
const page = usePage<SharedProps>().props
|
||||||
const ITEMS_PER_PAGE = 25
|
const ITEMS_PER_PAGE = 25
|
||||||
|
|
||||||
const defaultColumns = ['airline', 'flight_number', 'departure_airport', 'arrival_airport', 'departure_date', 'departure_time', 'arrival_time', 'duration', 'distance', 'aircraft', 'registration', 'class_seat_combined']
|
const defaultColumns = ['airline', 'flight_number', 'departure_airport', 'arrival_airport', 'departure_date', 'departure_time', 'arrival_time', 'duration', 'distance', 'aircraft', 'registration', 'class_seat_combined', 'note']
|
||||||
const columnsToShow = computed(() => page.auth.user?.resolved_settings?.departure_board_columns ?? defaultColumns)
|
const columnsToShow = computed(() => page.auth.user?.resolved_settings?.departure_board_columns ?? defaultColumns)
|
||||||
const showColumn = (column: string) => columnsToShow.value.includes(column)
|
const showColumn = (column: string) => columnsToShow.value.includes(column)
|
||||||
|
|
||||||
@@ -44,6 +44,7 @@ const allHeaders = [
|
|||||||
{ title: 'SEAT TYPE', key: 'seat_type_id', sortable: true },
|
{ title: 'SEAT TYPE', key: 'seat_type_id', sortable: true },
|
||||||
{ title: 'SEAT NO.', key: 'seat_number', sortable: true },
|
{ title: 'SEAT NO.', key: 'seat_number', sortable: true },
|
||||||
{ title: 'REASON', key: 'flight_reason_id', sortable: true },
|
{ title: 'REASON', key: 'flight_reason_id', sortable: true },
|
||||||
|
{ title: 'NOTE', key: 'note', sortable: true },
|
||||||
{ title: '', key: 'actions', sortable: false },
|
{ title: '', key: 'actions', sortable: false },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const reasonBadgeVariant = (reason: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const showColumn = (column: string) => props.columnsToShow.includes(column)
|
const showColumn = (column: string) => props.columnsToShow.includes(column)
|
||||||
|
console.log(props.columnsToShow)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -170,6 +170,10 @@ const showColumn = (column: string) => props.columnsToShow.includes(column)
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<td v-if="showColumn('note')" class="v-data-table__td note-cell">
|
||||||
|
<span v-if="flight.note" class="note-text">{{ flight.note }}</span>
|
||||||
|
</td>
|
||||||
|
|
||||||
<td class="v-data-table__td actions-cell">
|
<td class="v-data-table__td actions-cell">
|
||||||
<UserFlightContextMenu :profile-user="user" :can-edit="canEdit" :flight="flight" />
|
<UserFlightContextMenu :profile-user="user" :can-edit="canEdit" :flight="flight" />
|
||||||
</td>
|
</td>
|
||||||
@@ -184,6 +188,17 @@ const showColumn = (column: string) => props.columnsToShow.includes(column)
|
|||||||
padding-right: 0 !important;
|
padding-right: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.note-cell {
|
||||||
|
min-width: 200px;
|
||||||
|
max-width: 320px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-text {
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
}
|
||||||
|
|
||||||
.city-name{
|
.city-name{
|
||||||
color: #556;
|
color: #556;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
@@ -211,23 +226,14 @@ const showColumn = (column: string) => props.columnsToShow.includes(column)
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
overflow-x: auto;
|
width: fit-content;
|
||||||
max-width: 160px;
|
|
||||||
/* Hide scrollbar but keep functionality */
|
|
||||||
scrollbar-width: none;
|
|
||||||
&::-webkit-scrollbar { display: none; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.iata {
|
.iata {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.class-cell {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
vertical-align: middle;
|
|
||||||
gap: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.actions-cell {
|
.actions-cell {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
@@ -277,15 +283,5 @@ const showColumn = (column: string) => props.columnsToShow.includes(column)
|
|||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.class-badges-cell {
|
|
||||||
max-width: 140px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.class-cell > *:not(:first-child) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user