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: extend line filter to include national organizations #270

Closed
wants to merge 4 commits into from

Conversation

jonasbrunvoll
Copy link
Contributor

@jonasbrunvoll jonasbrunvoll commented Mar 22, 2024

Closes https://github.com/AtB-AS/kundevendt/issues/17261

Background

As of today, the travel planner can only filter lines that are planned by the relevant organization. Better explained, this means that the travel planner of FRAM can only filter on journeys planned by FRAM, while the travel planner of NFK can only filter on journeys planned by NFK.

But, there are other national organizations that organize trips across counties and regions. Example: Vy, Sj Nord, Boreal and Fjord 1. The line search should be extended to be able to filter on such organizations.

Illustrations

screenshots/video/figma

Skjermbilde 2024-03-22 kl  15 11 26

Skjermbilde 2024-03-22 kl  15 11 48

Proposed solution

  • Find a different pattern to check whether a line number is valid or not.
  • Identify which organizations that should always be possible to preform line filter on.
  • Update the endpoint lines() in src/pages/api/assistant/lines/[authorityId].ts to include all the authorityIds as params.

Acceptance Criteria

  • Can filter on lines containing characters other than numbers.
  • Make sure that the user is able to provide line number in both upper end lower case when filtering.
  • Able to filter lines organized by the relevant organization.
  • Able to filter lines organized by the national organizations.

Copy link

vercel bot commented Mar 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
planner-web ✅ Ready (Inspect) Visit Preview Mar 22, 2024 2:15pm

@jonasbrunvoll
Copy link
Contributor Author

Come to think about it now. Are there any disadvantages or reason for why we should fetch all liners across all authorities?
If not, I could update the lines() endpoint to retrieve all lines, thus not not having to specify authorities. This way enables users to filter trips consisting of legs organized from different authorities. For example, the trip Trondheim - Molde, consisting of express boat (800) from Trondheim to Kristiansund (Atb), and bus 100 from Kristiansund to Molde (FRAM).

@mortennordseth
Copy link
Contributor

Come to think about it now. Are there any disadvantages or reason for why we should fetch all liners across all authorities? If not, I could update the lines() endpoint to retrieve all lines, thus not not having to specify authorities. This way enables users to filter trips consisting of legs organized from different authorities. For example, the trip Trondheim - Molde, consisting of express boat (800) from Trondheim to Kristiansund (Atb), and bus 100 from Kristiansund to Molde (FRAM).

A few possible disadvantages I can think of

  • Data size (slow)
  • Authorities use the same line numbers, so how do we decide which one to show or select? This could possibly be solved by having a drop-down where the items include line number and authority name

However, I think having the option to search for line numbers from different authorities makes sense and is something we should look into/discuss how to solve

@jonasbrunvoll
Copy link
Contributor Author

Come to think about it now. Are there any disadvantages or reason for why we should fetch all liners across all authorities? If not, I could update the lines() endpoint to retrieve all lines, thus not not having to specify authorities. This way enables users to filter trips consisting of legs organized from different authorities. For example, the trip Trondheim - Molde, consisting of express boat (800) from Trondheim to Kristiansund (Atb), and bus 100 from Kristiansund to Molde (FRAM).

A few possible disadvantages I can think of

  • Data size (slow)
  • Authorities use the same line numbers, so how do we decide which one to show or select? This could possibly be solved by having a drop-down where the items include line number and authority name

However, I think having the option to search for line numbers from different authorities makes sense and is something we should look into/discuss how to solve

Yes, the size of the return data is a disadvantage and could possibly slow the performance of the trip planner. Line filter will still work if authorities uses the same line numbers, as the lines are added to a whitelist when specified in line filter. F. example, if line "1" is specified, all trips across all authorities with public code "1" are included to the whitelist.

@mikaelbr
Copy link
Collaborator

I think this can be too implicit for the end user and there are some technical challenges (unnecessary large transfer payloads). So my suggestion is to temporary let this be and add an issue to solve this more conceptually for planner-web v1.1

@mikaelbr
Copy link
Collaborator

Closed in favour of extending features to be more intuitive for the user: https://github.com/AtB-AS/kundevendt/issues/17726

@mikaelbr mikaelbr closed this Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants