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

Schedule entry number cleanup #4600

Merged

Conversation

carlobeltrame
Copy link
Member

I noticed some minor errors in the description and usage of the scheduleEntryNumber field on schedule entries, while writing up #4597.

We don't need to sort because all schedule entries of the period are fetched when printing is started, and the schedule entries of a period are ordered correctly when fetching from the API. This might become relevant again far in the future if we introduce more offline functionality.

For now, the sorting was incorrect anyways, because it assumed that the scheduleEntryNumber was unique per day, which it isn't (there can be multiple numbering schemes leading to multiple of the same scheduleEntryNumbers on the same day).

We don't need to sort because all schedule entries of the period are
fetched when printing is started, and the schedule entries of a period
are ordered correctly when fetching from the API. This might become
relevant again far in the future if we introduce more offline
functionality.

For now, the sorting was incorrect anyways, because it assumed that the
scheduleEntryNumber was unique per day, which it isn't (there can be
multiple numbering schemes leading to multiple of the same
scheduleEntryNumbers on the same day).
@usu usu added the deploy! Creates a feature branch deployment for this PR label Feb 1, 2024
Copy link

github-actions bot commented Feb 1, 2024

Feature branch deployment currently inactive.

If the PR is still open, you can add the deploy! label to this PR to trigger a feature branch deployment.

Copy link
Member

@usu usu left a comment

Choose a reason for hiding this comment

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

We have 2 more places, where we sort scheduleEntries. Do we want to remove this sorting as well for consistency?

https://github.com/ecamp/ecamp3/blob/devel/pdf/src/campPrint/story/StoryDay.vue#L44
https://github.com/ecamp/ecamp3/blob/devel/frontend/src/components/story/StoryDay.vue#L83

@carlobeltrame
Copy link
Member Author

We have 2 more places, where we sort scheduleEntries. Do we want to remove this sorting as well for consistency?

https://github.com/ecamp/ecamp3/blob/devel/pdf/src/campPrint/story/StoryDay.vue#L44 https://github.com/ecamp/ecamp3/blob/devel/frontend/src/components/story/StoryDay.vue#L83

Nice catch! I removed the additional sorts. It's not exactly the same case in the frontend, but as per our convention, the story display is responsible to reload the schedule entries when it is mounted.

This snapshot was flawed because of the wrong sorting before. There are
some schedule entries with numberingScheme 'A' in the store data, and
these were previously incorrectly sorted:
dayNumber scheduleEntryNumber number startTime
1         1                   1.1    08:00
1         2                   1.2    09:00
1         1                   1.A    10:00

The last one was previously sorted before the second one, which is
incorrect.
@carlobeltrame carlobeltrame added this pull request to the merge queue Feb 24, 2024
Merged via the queue into ecamp:devel with commit 403b261 Feb 24, 2024
32 checks passed
@carlobeltrame carlobeltrame deleted the schedule-entry-number-cleanup branch February 25, 2024 03:17
@BacLuc BacLuc mentioned this pull request Mar 8, 2024
@BacLuc BacLuc mentioned this pull request Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy! Creates a feature branch deployment for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants