-
Notifications
You must be signed in to change notification settings - Fork 0
move everything to joins page, update search/default page, etc #82
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
Changes from 5 commits
7ad85ac
788b145
281fcc4
8f62e42
d048bf3
a984c3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,13 +30,13 @@ | |
AdjustmentsHorizontal, | ||
ArrowsUpDown | ||
} from 'svelte-hero-icons'; | ||
import type { IconSource } from 'svelte-hero-icons'; | ||
import { goto } from '$app/navigation'; | ||
import { isMacOS } from '$lib/util/browser'; | ||
import { Badge } from '$lib/components/ui/badge'; | ||
import { getEntity, type Entity } from '$lib/types/Entity/Entity'; | ||
|
||
type Props = { | ||
navItems: { label: string; href: string; icon: IconSource }[]; | ||
navItems: Entity[]; | ||
user: { name: string; avatar: string }; | ||
}; | ||
|
||
|
@@ -130,16 +130,16 @@ | |
{#each navItems as item} | ||
<li> | ||
<Button | ||
variant={isActiveRoute(item.href) ? 'default' : 'ghost'} | ||
variant={isActiveRoute(item.path) ? 'default' : 'ghost'} | ||
size="nav" | ||
href={item.href} | ||
href={item.path} | ||
icon="leading" | ||
> | ||
<Icon | ||
src={item.icon} | ||
micro | ||
size="16" | ||
class={isActiveRoute(item.href) ? 'text-muted-icon-primary' : 'text-muted-icon-neutral'} | ||
class={isActiveRoute(item.path) ? 'text-muted-icon-primary' : 'text-muted-icon-neutral'} | ||
/> | ||
{item.label} | ||
</Button> | ||
|
@@ -202,9 +202,31 @@ | |
{:else} | ||
<CommandGroup heading={`Search for "${input}"`}> | ||
{#each searchResults as model} | ||
<CommandItem onSelect={() => handleSelect(`/models/${encodeURIComponent(model.name)}`)}> | ||
<CommandItem | ||
disabled | ||
onSelect={() => | ||
handleSelect(`${getEntity('models').path}/${encodeURIComponent(model.name)}`)} | ||
> | ||
<Icon src={getEntity('models').icon} micro size="16" /> | ||
{model.name} | ||
</CommandItem> | ||
<CommandItem | ||
onSelect={() => | ||
handleSelect(`${getEntity('joins').path}/${encodeURIComponent(model.join.name)}`)} | ||
> | ||
<Icon src={getEntity('joins').icon} micro size="16" /> | ||
{model.join.name} | ||
</CommandItem> | ||
{#each model.join.groupBys as groupBy} | ||
<CommandItem | ||
disabled | ||
onSelect={() => | ||
handleSelect(`${getEntity('groupbys').path}/${encodeURIComponent(groupBy.name)}`)} | ||
> | ||
<Icon src={getEntity('groupbys').icon} micro size="16" /> | ||
{groupBy.name} | ||
</CommandItem> | ||
{/each} | ||
Comment on lines
+205
to
+229
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Based on the search results, I can now generate a final response: Backend search endpoint needs to be updated for new entity types The current search implementation in
🔗 Analysis chainVerify search implementation for new entity types The search results now include joins and groupBys. Let's verify that the backend search endpoint properly handles these new entity types. Run the following script to check the search implementation: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify search endpoint implementation for new entity types
# Check the search endpoint implementation
rg -A 10 "search.*function|search.*endpoint" --type typescript
# Check for join/groupBy handling in search-related code
rg -A 5 "join.*search|groupBy.*search" --type typescript
Length of output: 193 Script: #!/bin/bash
# Let's try without typescript file type and use more specific patterns
# Check search-related implementations
rg -A 10 'search.*function|search.*endpoint|function.*search'
# Check for join/groupBy handling in search-related code
rg -A 5 'join.*search|groupBy.*search|search.*join|search.*groupBy'
# Look for API routes or handlers related to search
fd -e ts -e js "search" --exec cat {}
Length of output: 5185 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @piyush-zlai This is relevant - search only works for at the model level. i.e. a search of "foo" will not match a model named "bar" with a join named "foo" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
{/each} | ||
</CommandGroup> | ||
{/if} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Cube, PuzzlePiece, Square3Stack3d } from 'svelte-hero-icons'; | ||
|
||
export const entityConfig = [ | ||
{ | ||
label: 'Models', | ||
path: '/models', | ||
icon: Cube, | ||
id: 'models' | ||
}, | ||
{ | ||
label: 'GroupBys', | ||
path: '/groupbys', | ||
icon: PuzzlePiece, | ||
id: 'groupbys' | ||
}, | ||
{ | ||
label: 'Joins', | ||
path: '/joins', | ||
icon: Square3Stack3d, | ||
id: 'joins' | ||
} | ||
] as const; | ||
|
||
export type Entity = (typeof entityConfig)[number]; | ||
export type EntityId = Entity['id']; | ||
|
||
// Helper function to get entity by ID | ||
export function getEntity(id: EntityId): Entity { | ||
const entity = entityConfig.find((entity) => entity.id === id); | ||
if (!entity) throw new Error(`Entity with id "${id}" not found`); | ||
return entity; | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,60 @@ | ||
<script> | ||
import ComingSoonPage from '$lib/components/ComingSoonPage/ComingSoonPage.svelte'; | ||
<script lang="ts"> | ||
import type { Model } from '$lib/types/Model/Model'; | ||
import { | ||
Table, | ||
TableBody, | ||
TableCell, | ||
TableHead, | ||
TableHeader, | ||
TableRow | ||
} from '$lib/components/ui/table'; | ||
import TrueFalseBadge from '$lib/components/TrueFalseBadge/TrueFalseBadge.svelte'; | ||
import Separator from '$lib/components/ui/separator/separator.svelte'; | ||
import PageHeader from '$lib/components/PageHeader/PageHeader.svelte'; | ||
import ActionButtons from '$lib/components/ActionButtons/ActionButtons.svelte'; | ||
|
||
const { data } = $props(); | ||
const models: Model[] = $state(data.models.items); | ||
</script> | ||
|
||
<ComingSoonPage /> | ||
<PageHeader title="Joins"></PageHeader> | ||
|
||
<div class="w-full"> | ||
<ActionButtons class="mb-4" /> | ||
</div> | ||
<Separator fullWidthExtend={true} /> | ||
<Table> | ||
<TableHeader> | ||
<TableRow> | ||
<TableHead>Join</TableHead> | ||
<TableHead>Model</TableHead> | ||
<TableHead>Team</TableHead> | ||
<TableHead>Type</TableHead> | ||
<TableHead>Online</TableHead> | ||
<TableHead>Production</TableHead> | ||
</TableRow> | ||
</TableHeader> | ||
<TableBody> | ||
{#each models as model} | ||
<TableRow> | ||
<TableCell> | ||
<a href={'/joins/' + encodeURIComponent(model.join.name)} class="hover:underline"> | ||
{model.join.name} | ||
</a> | ||
</TableCell> | ||
<TableCell> | ||
{model.name} | ||
</TableCell> | ||
<TableCell>{model.team}</TableCell> | ||
<TableCell>{model.modelType}</TableCell> | ||
<TableCell> | ||
<TrueFalseBadge isTrue={model.online} /> | ||
</TableCell> | ||
<TableCell> | ||
<TrueFalseBadge isTrue={model.production} /> | ||
</TableCell> | ||
</TableRow> | ||
{/each} | ||
ken-zlai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</TableBody> | ||
</Table> | ||
<Separator fullWidthExtend={true} /> |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.