Repository navigation
feat(standup): add occupancy slide - #30
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
386492f to
b2fca58
Compare
| --color-info: #0277bd; | ||
| --color-info-text: #01579b; | ||
|
|
||
| --color-warning: #f9a825; |
There was a problem hiding this comment.
Need to check if the colorschemes need these.
| displayName | ||
| displayPicture | ||
| } | ||
| days { |
There was a problem hiding this comment.
For normalized cache, we should always fetch the unique key.
By default, id is the unique key.
If the unique key is different, then it needs to be defined so that the normalized cache works as expected.
| function parseDate(value: string) { | ||
| const [year, month, day] = value.split('-').map(Number); | ||
| return new Date(year ?? 0, (month ?? 1) - 1, day ?? 1); | ||
| } |
There was a problem hiding this comment.
Check if we don't have these functions in @togglecorp/fujs
Only implement the functions if they are not in fujs.
Also, suggest if this needs to go into fujs if it's generic enough.
| getKey: (date: Date, value: string) => string, | ||
| getLabel: (date: Date) => string, | ||
| ) { | ||
| return dates.reduce<DateGroup[]>( |
There was a problem hiding this comment.
When using map/reduce, do not mutate the entities.
If you want to mutate, use forEach or for loop
There was a problem hiding this comment.
For this example, let's use listToGroupList and mapToList from @togglecorp/fujs library for better readability
| return isNotDefined(day.occupancy); | ||
| } | ||
|
|
||
| function getLeaveLabel(leave: JournalLeaveTypeEnum | null | undefined) { |
There was a problem hiding this comment.
If this is a ENUM, use enum_display for the label for the ENUM
| styles.cell, | ||
| boundaryClassName, | ||
| day.leave && styles.halfLeave, | ||
| day.occupancy < 0.5 ? styles.low : styles.high, |
There was a problem hiding this comment.
Let's have 3 scale for the color depending on the percent:
- 66 to 100 (green)
- 33 to 66 (yellow)
- 0 to 33 (red)
| let missingSeverity = 2; | ||
| if (hasOlderMissing) { | ||
| missingSeverity = 0; | ||
| } else if (missingDays.length > 0) { | ||
| missingSeverity = 1; | ||
| } |
There was a problem hiding this comment.
Let's rename this to severity.
0 is low severity
2 is high severity
Then for severity we can sort descending
| } | ||
| return { | ||
| ...item, | ||
| displayName: item.user.displayName ?? `User#${item.user.id}`, |
There was a problem hiding this comment.
The displayName should always be provided by the backend so that front-end does not need to add a fallback.
| className={styles.occupancySection} | ||
| variant="general" | ||
| > | ||
| <div className={styles.content}> |
There was a problem hiding this comment.
Check if we can use the existing component for the slide page
Summary
Adds an "Is your Timur up to date?" slide to the daily standup, between the last project slide and the quote. It shows each person's logged hours per working day, so people who haven't filled in their entries or leave are easy to spot.
Requires the backend
dailyStandup.occupancyfield:What the slide shows
?: no entries and no leave.W36) and day rows, with gaps between weeks and a line between months.Other changes
--color-warningand--color-warning-texttothemes.css(light and dark).Screenshots
Testing
pnpm typecheck,pnpm lint,pnpm lint:unusedpass.🤖 Generated with Claude Code