-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search Feature [In-Progress] #37
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a187922
added the searchbar in navbar
tarunsinghofficial 04f409f
created the API route, worked on search feature(inprogress)
tarunsinghofficial ed0210b
removes minimum length of 2 for searching (some routes may be only 1 …
aaronbrethorst eee9096
Catch errors from search results that don't return results and turn t…
aaronbrethorst c6cfaf0
implemented the search to get results
tarunsinghofficial b8a3f29
Remove extra `<Header>` element from rendered page
aaronbrethorst 9e4dffa
modal pane appears on search by pressing enter
tarunsinghofficial e6aa74a
added open modalpane on search, show TODO on click of route
tarunsinghofficial 2cceb1d
fix: ensure modal displays 'No results found' when search yields no r…
tarunsinghofficial 8374fcd
Add `.vscode/launch.json` file to facilitate easier server-side debug…
aaronbrethorst 642d9c8
Fixes search API endpoint output
aaronbrethorst e15388d
Recenter the map on the selected stop from search results
aaronbrethorst 7e6d222
Show the compass direction on search results
aaronbrethorst dd74953
formatter
aaronbrethorst a565384
linting
aaronbrethorst 2f90702
fix: update the search to submit on enter
tarunsinghofficial 9d9f151
style: search-pane to have lower z-index than stop modal
tarunsinghofficial 46bd003
fix: searchbar text color in darkmode
tarunsinghofficial 8c11f9c
linter fixes
aaronbrethorst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"command": "npm run dev", | ||
"name": "Run development server", | ||
"request": "launch", | ||
"type": "node-terminal" | ||
} | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
.scroll-hidden { | ||
-ms-overflow-style: none; /* Internet Explorer 10+ */ | ||
scrollbar-width: none; /* Firefox */ | ||
} | ||
.scroll-hidden::-webkit-scrollbar { | ||
display: none; /* Safari and Chrome */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<script> | ||
export let searchResults = null; | ||
import { createEventDispatcher } from 'svelte'; | ||
import { compassDirection } from '$lib/formatters'; | ||
|
||
const dispatch = createEventDispatcher(); | ||
|
||
function handleStopClick(stop) { | ||
dispatch('stopSelected', { stop }); | ||
} | ||
|
||
function handleRouteClick(route) { | ||
alert(`TODO: show route ${route.id}`); | ||
} | ||
</script> | ||
|
||
<div class="p-2"> | ||
<h2 class="mb-4 text-xl font-semibold uppercase text-[#86858B]">Search Results</h2> | ||
|
||
<h3 class="mb-2 text-lg font-semibold dark:text-white">Routes</h3> | ||
{#if searchResults?.routeSearchResults?.list?.length > 0} | ||
<ul class="overflow-hidden rounded-lg"> | ||
{#each searchResults.routeSearchResults.list as route} | ||
<li> | ||
<button | ||
on:click={() => handleRouteClick(route)} | ||
class="flex h-auto w-full items-center justify-between border-b-[1px] border-[#C6C6C8] bg-[#ffffff] p-4 hover:cursor-pointer hover:bg-[#e3e3e3] dark:border-[#313135] dark:bg-[#1c1c1c] dark:text-white hover:dark:bg-[#363636]" | ||
> | ||
{route.name || `Route ${route.id}`} | ||
</button> | ||
</li> | ||
{/each} | ||
</ul> | ||
{:else} | ||
<p>No routes found.</p> | ||
{/if} | ||
|
||
<h3 class="mb-2 mt-4 text-lg font-semibold dark:text-white">Stops</h3> | ||
{#if searchResults?.stopSearchResults?.list?.length > 0} | ||
<ul class="overflow-hidden rounded-lg"> | ||
{#each searchResults.stopSearchResults.list as stop} | ||
<li> | ||
<button | ||
on:click={() => handleStopClick(stop)} | ||
class="flex h-auto w-full items-center justify-between border-b-[1px] border-[#C6C6C8] bg-[#ffffff] p-4 hover:cursor-pointer hover:bg-[#e3e3e3] dark:border-[#313135] dark:bg-[#1c1c1c] dark:text-white hover:dark:bg-[#363636]" | ||
> | ||
{stop.name} ({compassDirection(stop.direction)}) | ||
</button> | ||
</li> | ||
{/each} | ||
</ul> | ||
{:else} | ||
<p>No stops found.</p> | ||
{/if} | ||
</div> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍