Compare commits
2 Commits
1d461780ab
...
fd213d6340
| Author | SHA1 | Date | |
|---|---|---|---|
| fd213d6340 | |||
| 3eceddf20a |
@@ -19,8 +19,7 @@
|
||||
"devDependencies": {
|
||||
"@eslint/compat": "^2.0.2",
|
||||
"@eslint/js": "^9.39.2",
|
||||
"@owlboard/api-schema-types": "^3.0.2-alpha1",
|
||||
"@owlboard/owlboard-ts": "^3.0.0-dev.20260324T1240",
|
||||
"@owlboard/owlboard-ts": "^3.0.0-dev.20260325T1023",
|
||||
"@playwright/test": "^1.58.1",
|
||||
"@sveltejs/adapter-static": "^3.0.10",
|
||||
"@sveltejs/kit": "^2.50.2",
|
||||
|
||||
@@ -27,13 +27,16 @@
|
||||
return LOCATIONS.data
|
||||
.filter((r) => tokens.every((t) => r.s.includes(t)))
|
||||
.sort((a, b) => {
|
||||
// Check if query matches CRS
|
||||
const aIsCrs = a.c?.toLowerCase() === lowerQuery;
|
||||
const bIsCrs = b.c?.toLowerCase() === lowerQuery;
|
||||
|
||||
// Sort matching CRS first
|
||||
if (aIsCrs && !bIsCrs) return -1;
|
||||
if (!aIsCrs && bIsCrs) return 1;
|
||||
// Priority One - Exact CRS Match
|
||||
const aExactCrs = a.c?.toLowerCase() === lowerQuery;
|
||||
const bExactCrs = b.c?.toLowerCase() === lowerQuery;
|
||||
if (aExactCrs && !bExactCrs) return -1;
|
||||
if (!aExactCrs && bExactCrs) return 1;
|
||||
|
||||
// Priority Two - 'Stations' with CRS
|
||||
if (!!a.c && !b.c) return -1;
|
||||
if (!a.c & !! b.c) return 1;
|
||||
|
||||
// Alphabetical Sort
|
||||
return a.n.localeCompare(b.n);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { OwlClient } from "./owlClient";
|
||||
import type { ApiLocationFilter } from "@owlboard/api-schema-types";
|
||||
import type { ApiLocationFilter } from '@owlboard/owlboard-ts'
|
||||
|
||||
class LocationStore {
|
||||
data = $state<ApiLocationFilter.LocationFilterObject[]>([]);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import PisStartEndCard from '$lib/components/ui/cards/pis/PisStartEndCard.svelte';
|
||||
import PisCode from '$lib/components/ui/cards/pis/PisCode.svelte';
|
||||
import Button from '$lib/components/ui/Button.svelte';
|
||||
import type { ApiPisObject } from '@owlboard/api-schema-types';
|
||||
import type { ApiPisObject } from '@owlboard/owlboard-ts';
|
||||
import { OwlClient, ApiError, ValidationError } from '$lib/owlClient';
|
||||
import TocStyle from '$lib/components/ui/TocStyle.svelte';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user