Skip to content

feat(timeOff): add, change and delete time off types in Settings - #188

Merged
artem-broccoli merged 13 commits into
mainfrom
artem/bro-247-add-a-time-off-type-and-change-how-it-looks
Nov 8, 2026
Merged

artem-broccoli merged 13 commits into
mainfrom
artem/bro-247-add-a-time-off-type-and-change-how-it-looks

Conversation

@artem-broccoli

@artem-broccoli artem-broccoli commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Admins can now add a company time off type, change any type's name, icon, colour and privacy, and delete a type, in Settings › Time off.

  • The list shows each type by name, at the width of the Locations list.
  • "Add time off type" opens a dialog: name, an icon from 30, a colour from 10, and "Show the reason to colleagues".
  • Clicking a type opens its panel over the list (/settings/time-off/<id>), like a set of terms. Its fields are edited in place; Cancel and Save appear once something changed. The footer says that name, look and privacy are the same in every set of terms.
  • The panel's "More actions" menu deletes the type after a confirmation, Annual leave included. Its rules on every terms, people's exceptions and balances go with it. A type with any time off on record can't be deleted. People's panels reload, so they stop showing the deleted type's balance.
  • A new type has no rules on any terms, so every terms stack shows it as "Not offered here".
  • Names are unique, ignoring case and the spaces around them. The API refuses a duplicate with a field error, and a database index enforces the same rule.
  • All four standard types can be renamed and restyled; rules read the type's key, never its name. Sickness stays private: its switch is locked, and the API refuses to change that.
  • On a terms stack, a private type's rule line ends with "· Private".
  • Reset setup and Exit demo remove added types and bring the four standard types back as they were, deleted or changed. Otherwise a type added in the demo would leak into the next workspace and be offered automatically when time off is turned on again.
  • Deleting a type and an allowance run wait for each other, so a run never writes lines for rules that are gone. Allowance runs now take a shared lock on time off policies before locking people, the same order as reset and turn-on.
  • A terms stack reloads when it opens, so a type added meanwhile shows up there.
  • GraphQL: timeOff.createType, timeOff.changeType and timeOff.deleteType, each with a payload error (InvalidInputError; NotFoundError on change and delete; ConflictError on delete). TimeOffType gains private.

Screenshots

Settings › Time off:

Time off list

A type's panel:

Type panel

Deleting a type:

Delete confirmation

Add time off type:

Add dialog

A terms stack: "· Private" on private types, and a new type not offered:

Terms stack

Testing

  • Integration tests cover adding and changing a type, trimming, the length limit, duplicate names on add and on change, a type taking its own name in another case, renaming Annual leave while keeping its rules, Sickness's privacy, unknown ids, non-admins, and starting over (including standard types that swapped names and a deleted Annual leave).
  • Deleting: an added type offered on two terms, Annual leave, a type with a person's exception, refusal when time off is on record, unknown ids and non-admins.
  • Two e2e tests: adding and changing a type with a duplicate name as a payload error, and deleting a type with a second delete returning NotFoundError.
  • pnpm check, pnpm test:integration (1073) and pnpm test:e2e (250) pass.
  • Manually, with pnpm dev and the demo workspace:
    • added, renamed and deleted a type from its panel;
    • deleted Annual leave: Employment terms reads "Not offered", the terms stack and a person's panel no longer list it, and Exit demo brought it back with its name and look;
    • checked the duplicate-name error, Sickness's locked switch and "· Private" on the England and Wales stack;
    • picked icons and colours with the keyboard.
  • Not covered: a test that runs an allowance run and a delete at the same time; the lock order was checked by reading the callers.
  • The QA checklist docs/qa/time-off-settings.md covers the list, adding, the panel and deleting.

Release Notes:

  • Added: add your own time off types, change any type's name, icon, colour and privacy, and delete a type, in Settings › Time off.

@artem-broccoli
artem-broccoli requested a review from a team as a code owner November 6, 2026 14:18
@artem-broccoli artem-broccoli changed the title feat(timeOff): add a time off type and change its name, look and privacy feat(timeOff): add, change and delete time off types in Settings Nov 8, 2026
@artem-broccoli
artem-broccoli merged commit 3924e17 into main Nov 8, 2026
9 checks passed
@artem-broccoli
artem-broccoli deleted the artem/bro-247-add-a-time-off-type-and-change-how-it-looks branch November 8, 2026 16:30
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.

1 participant