-
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
Create locations pages and map #1613
base: john/20024-zod-poc
Are you sure you want to change the base?
Conversation
} | ||
|
||
if (!data) { | ||
// todo: loading spinner (would be nice to use a spinner inside cards) |
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.
@@ -110,7 +110,7 @@ export default function SidebarLayout({ children }: { children: ReactNode }) { | |||
<SideBarListItem | |||
isCollapsed={isCollapsed} | |||
isCurrentPage={segments.includes("locations")} | |||
Icon={FaMap} | |||
Icon={FaLocationDot} |
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.
i changed the sidebar icon to the map marker, this feels a lot more intuitive to me than the folding map icon
// name: "cr3_crash_count", | ||
// relationshipName: "locations_list_view" | ||
// } | ||
}; |
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.
the current data cards can render relationships to lookup tables, but there no is mechanism to render card values through other relationships, like the locations
<> locations_list_view
one-to-one relationship. it felt like a big enough lift to leave out of scope. and probably not worth touching until we settle the question of if we want to stick with zod-generated types 🤔
@@ -0,0 +1,3 @@ | |||
import { locationColumns } from "./locationColumns"; | |||
|
|||
export const locationCardColumns = [locationColumns.location_id]; |
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.
this feels a bit silly but i'm matching the pattern i used to set up the crash data card column arrays 🤷
}) | ||
.optional(), | ||
coordinates: z.array(z.array(z.array(coordinateSchema))), | ||
}); |
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.
if we were going to define more geojson types i would go searching for a library that has already solved this problem
@@ -269,7 +281,7 @@ const getWhereExp = (filterGroups: FilterGroup[]): string => { | |||
.map((filterGroup) => filterGroupToWhereExp(filterGroup)) | |||
// remove any null values, which are returned when a fitler group is empty | |||
.filter((x) => !!x); | |||
return andExps.length > 0 ? `{ _and: [ ${andExps.join("\n")} ]}` : ""; | |||
return andExps.length > 0 ? `{ _and: [ ${andExps.join("\n")} ]}` : "{}"; |
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.
when building out the locations list i initially had no filters configured, and the querybuilder was generating an invalid where
condition as a result. the empty braces are valid graphql and fixed the problem 👍
/** | ||
* The search fields that are available to select from when searching | ||
*/ | ||
searchFields: SearchFilterField[]; |
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.
these used to be hardcoded specifically for crashes
Associated issues
Testing
URL to test: Local
crashesListViewQueryConfig
entry from your localstorageShip list
main
branch