Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions server/db/flights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@

function sanitizeFlightForClient(flight: FlightsTable): ClientFlight {
const {
user_id: _uid,

Check warning on line 67 in server/db/flights.ts

View workflow job for this annotation

GitHub Actions / build

'_uid' is assigned a value but never used

Check warning on line 67 in server/db/flights.ts

View workflow job for this annotation

GitHub Actions / build

'_uid' is assigned a value but never used
ip_address: _ip,

Check warning on line 68 in server/db/flights.ts

View workflow job for this annotation

GitHub Actions / build

'_ip' is assigned a value but never used

Check warning on line 68 in server/db/flights.ts

View workflow job for this annotation

GitHub Actions / build

'_ip' is assigned a value but never used
acars_token: _tok,

Check warning on line 69 in server/db/flights.ts

View workflow job for this annotation

GitHub Actions / build

'_tok' is assigned a value but never used

Check warning on line 69 in server/db/flights.ts

View workflow job for this annotation

GitHub Actions / build

'_tok' is assigned a value but never used
cruisingfl,
clearedfl,
...rest
Expand All @@ -81,7 +81,7 @@
function sanitizeFlightForOwner(
flight: FlightsTable
): ClientFlight & { acars_token?: string } {
const { user_id: _uid, ip_address: _ip, cruisingfl, clearedfl, ...rest } =

Check warning on line 84 in server/db/flights.ts

View workflow job for this annotation

GitHub Actions / build

'_uid' is assigned a value but never used

Check warning on line 84 in server/db/flights.ts

View workflow job for this annotation

GitHub Actions / build

'_uid' is assigned a value but never used
flight;
return {
...rest,
Expand Down Expand Up @@ -340,6 +340,9 @@
}

if (!flightData.sid) {
if (!flightData.icao && flightData.departure) {
flightData.icao = flightData.departure as string;
}
const sidResult = await generateSID(flightData);
flightData.sid = sidResult.sid;
}
Expand Down
4 changes: 2 additions & 2 deletions server/routes/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ router.post(
const userSessions = await getSessionsByUser(createdBy);

const userRoles = await getUserRoles(createdBy);
const hasSpecialRole =
const isTester =
isAdmin(createdBy) ||
userRoles.some(
(role) => role.name === 'Tester' || role.name === 'Event Controller'
);
const maxSessions = hasSpecialRole ? 50 : 10;
const maxSessions = isTester ? 100 : 50;

if (userSessions.length >= maxSessions) {
return res.status(400).json({
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/AtisReminderModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default function AtisReminderModal({

return (
<div className="fixed inset-0 bg-black/80 backdrop-blur-sm flex items-center justify-center z-50 p-4">
<div className="bg-gradient-to-b from-zinc-900 to-zinc-950 border-2 border-zinc-500/50 rounded-2xl p-8 max-w-2xl w-full">
<div className="bg-gradient-to-b from-zinc-900 to-zinc-950 border-2 border-zinc-500/50 rounded-4xl p-6 max-w-2xl w-full">
<h2 className="text-3xl font-bold text-blue-400 mb-4">
PFATC Network ATIS Format Reminder
</h2>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function Create() {
if (user) {
fetchMySessions()
.then((sessions) => {
const maxSessions = user.isAdmin || user.isTester ? 50 : 10;
const maxSessions = user.isAdmin || user.isTester ? 100 : 50;
setSessionCount(sessions.length);
setSessionLimitReached(sessions.length >= maxSessions);
})
Expand Down Expand Up @@ -163,7 +163,7 @@ export default function Create() {
}

if (sessionLimitReached) {
const maxSessions = user?.isAdmin || user?.isTester ? 50 : 10;
const maxSessions = user?.isAdmin || user?.isTester ? 100 : 50;
setError(
`Session limit reached. You can create up to ${maxSessions} sessions.`
);
Expand Down Expand Up @@ -302,7 +302,7 @@ export default function Create() {
/>
<span>
Sessions: {sessionCount}/
{user?.isAdmin || user?.isTester ? 50 : 10}
{user?.isAdmin || user?.isTester ? 100 : 50}
{sessionLimitReached && ' (Limit reached)'}
</span>
</div>
Expand Down
13 changes: 7 additions & 6 deletions src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default function Login() {
</div>

<div className="container mx-auto max-w-md px-4 pb-8 relative z-10">
<div className="bg-gray-900/70 backdrop-blur-md border border-gray-800 rounded-3xl p-8 space-y-6 shadow-2xl animate-fade-in">
<div className="bg-gray-900/70 backdrop-blur-md border border-gray-800 rounded-[3rem] p-6 space-y-6 animate-fade-in">
<Button
onClick={handleLogin}
disabled={!agreed}
Expand All @@ -95,7 +95,7 @@ export default function Login() {
<hr className="w-full border-gray-700" />

<div
className={`w-full flex items-center border-2 border-blue-600 rounded-2xl px-5 py-4 gap-3 transition-all duration-200 shadow-sm
className={`w-full flex items-center border-2 border-blue-600 rounded-3xl px-5 py-4 gap-3 transition-all duration-200 shadow-sm
${agreed ? 'bg-blue-600/30' : 'bg-blue-600/10'}
hover:shadow-blue-700/20 focus-within:shadow-blue-700/30`}
>
Expand Down Expand Up @@ -140,10 +140,11 @@ export default function Login() {
/>
</div>

<p className="text-xs text-gray-500 text-center max-w-xs">
PFConnect Studios is an independent service and is not in any way
affiliated with Project Flight.
</p>
<div className="flex w-full justify-center">
<p className="text-xs text-gray-500 text-center max-w-xs">
PFConnect Studios is an independent service and is not in any way affiliated with Project Flight.
</p>
</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Sessions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function Sessions() {
const [availableImages, setAvailableImages] = useState<AvailableImage[]>([]);
const [customLoaded, setCustomLoaded] = useState(false);

const maxSessions = user?.isAdmin || user?.isTester ? 50 : 10;
const maxSessions = user?.isAdmin || user?.isTester ? 100 : 50;

useEffect(() => {
if (!user) {
Expand Down
Loading