Skip to content
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

feat: Detours channel #2908

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

feat: Detours channel #2908

wants to merge 18 commits into from

Conversation

hannahpurcell
Copy link
Collaborator

@hannahpurcell hannahpurcell commented Dec 11, 2024

Asana Ticket: https://app.asana.com/0/1205385723132845/1208600990461875

Depends on:

To try it out, I call

const skateDetours = useActiveDetoursByRoute(socket, selectedRouteIds)
console.log("skatedetours: ", skateDetours)

in routeLadders.tsx, and useActiveDetours(socket), usePastDetours(socket), and useDraftDetours(socket) in detourListPage.tsx.

Needs:

  • tests

@hannahpurcell hannahpurcell requested a review from a team as a code owner December 11, 2024 00:21
@hannahpurcell hannahpurcell changed the base branch from main to hp/move-user-filter-for-drafts December 11, 2024 19:35
@hannahpurcell hannahpurcell changed the base branch from hp/move-user-filter-for-drafts to main December 11, 2024 19:38
@hannahpurcell hannahpurcell force-pushed the hp/skate-detours-channel branch 2 times, most recently from a864baa to 5af2080 Compare December 19, 2024 22:34
@hannahpurcell hannahpurcell force-pushed the hp/skate-detours-channel branch from 5af2080 to 2c9023f Compare December 19, 2024 22:39
{:ok, %{conn: conn, socket: socket}}
end

def populate_db(conn) do
Copy link
Member

@firestack firestack Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit(non-blocking): btw I'm running into issues with this pattern in detours_controller_test with populate_db_and_get_user and would prefer that we try and do these(initializations) in the tests themselves, but I'll leave that up to you, as we can refactor later.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also prefer we don't hardcode Ids, but the whole (insert into db, pull out, update snapshot with id, put back into db) rigamarole is annoying, so no worries. Just a small concern.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmm I see I see. Let's talk when you get back. I can see the frustration with this, but want to confirm the better pattern (if there is one) before trying to edit

@@ -112,6 +131,10 @@ defmodule Skate.Detours.Detours do

def categorize_detour(_detour_context), do: :draft

@spec get_detour_route(detour :: map()) :: String.t()
defp get_detour_route(%{state: %{"context" => %{"route" => %{"name" => route_name}}}}),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matching on the name could potentially cause some issues with matching routes where the id does not match the name ie SL4 vs 741.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants