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: Shift schedule page #69

Merged
merged 25 commits into from
Nov 7, 2024
Merged

feat: Shift schedule page #69

merged 25 commits into from
Nov 7, 2024

Conversation

seandreassen
Copy link
Member

@seandreassen seandreassen commented Oct 27, 2024

I've made some progress on the front-end of the shift-schedule page, issue #34. The shift schedule table displays how many members are on shift for every day and time, and when pressing one of the shifts you can see who's on shift and have the option to register for it. There is also an administrator menu where members with the correct permission would be able to clear the shift schedule.

Changes before issue can be closed:

  • Administrator menu should not be visible to users without permission to use it
  • When clicking on a shift, users should be prompted to log in if they haven't already
  • The register button should turn into an unregister button when a member is already registered
  • Change the method to get which members are on shift (shouldn't get a list of all shifts from file)
  • Actual skill icons need to be added instead of [skill icons], [skill icons total], and [skill icons legend]
    Create Icons for skills and link them to skills from the DB #63
  • Registering and clearing shift schedule is not possible yet since I don't know how we're going to get or change the shift schedule yet

@seandreassen seandreassen linked an issue Oct 27, 2024 that may be closed by this pull request
5 tasks
@seandreassen
Copy link
Member Author

How the schedule table will look on small screens might also change. Currently, the shift schedule table is set to put each day in it's own table, and you can scroll down to check the schedule for every day (on the left). It's also been suggested to have a button that takes you to every day (would look something like on the right).

Copy link
Member

@ZeroWave022 ZeroWave022 left a comment

Choose a reason for hiding this comment

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

Please notice that getting the data will change drastically once we move this onto using a database.
Also, merge the dev branch into yours so we get all the new CI checks here as well.
Good job :)

src/app/[locale]/(default)/shift-schedule/loading.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/ScheduleTable.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/AdministratorMenu.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/ScheduleCellContent.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/ScheduleCellContent.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/ScheduleCellContent.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/ScheduleCellDialog.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/ScheduleTableSkeleton.tsx Outdated Show resolved Hide resolved
@ZeroWave022 ZeroWave022 marked this pull request as ready for review October 28, 2024 12:26
Copy link
Member

@michaelbrusegard michaelbrusegard left a comment

Choose a reason for hiding this comment

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

Good job!

messages/en.json Outdated Show resolved Hide resolved
messages/en.json Outdated Show resolved Hide resolved
src/app/[locale]/(default)/shift-schedule/loading.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/AdministratorMenu.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/AdministratorMenu.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/ScheduleCellDialog.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/ScheduleCellSkeleton.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/ScheduleTable.tsx Outdated Show resolved Hide resolved
src/components/ui/Checkbox.tsx Show resolved Hide resolved
src/mock-data/shiftSchedule.ts Outdated Show resolved Hide resolved
@michaelbrusegard
Copy link
Member

How the schedule table will look on small screens might also change. Currently, the shift schedule table is set to put each day in it's own table, and you can scroll down to check the schedule for every day (on the left). It's also been suggested to have a button that takes you to every day (would look something like on the right).

I actually liked the one with the buttons for each day here. It does not matter that much though

@michaelbrusegard
Copy link
Member

One thing I also forgot to mention is that there may be some missing aria labels, so if you have any interactive elements (buttons, links etc...) that does somehting and the text in the element is not descriptive enough it may be smart to add an aria-label

Copy link
Member

@ZeroWave022 ZeroWave022 left a comment

Choose a reason for hiding this comment

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

We're getting very close to this being ready.
There are some quirks when using conditionals in React, so it may be useful to take a look at https://react.dev/learn/conditional-rendering, especially the part about the && operator.
The solution for getting timestamps in ScheduleTable is quite wordy (even though it is the least wordy version of that approach), but I don't think there is any way to get that even cleaner, as least not without using some kind of additonal library for dates.

messages/en.json Outdated Show resolved Hide resolved
src/components/shift-schedule/RegisterSection.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/ScheduleCell.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/ScheduleCell.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/ScheduleCellDialog.tsx Outdated Show resolved Hide resolved
src/components/shift-schedule/ScheduleTable.tsx Outdated Show resolved Hide resolved
src/components/ui/Checkbox.tsx Show resolved Hide resolved
@ZeroWave022 ZeroWave022 self-requested a review November 7, 2024 15:09
Copy link
Member

@michaelbrusegard michaelbrusegard left a comment

Choose a reason for hiding this comment

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

LGTM

@michaelbrusegard michaelbrusegard merged commit 391d283 into dev Nov 7, 2024
6 checks passed
@michaelbrusegard michaelbrusegard deleted the shift-schedule-page branch November 7, 2024 17:57
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.

feat: Shift schedule page
3 participants