Repository navigation
Open
Description
Overview
Every team with an admin other than the editor sends timesheet changes through approval, and the evidence each change needs is fixed in code: edits and deletes need a written description (10+ characters), and brand-new entries need a description and a walkthrough video. Not every team wants that level of ceremony — some trust their members to correct their own time, others want a video for every change. Teams should be able to choose what a change request requires, separately for edits and for new entries.
Current State
- Approval is implicit:
requiresApproval()is true whenever the team has an admin other than the requester (meteor-backend/server/timesheet-change-requests.js). There is no way to turn it off. - Requirements are hard-coded on both sides:
- Backend:
VIDEO_REQUIRED_ACTIONS = ['create']and a 10-character description minimum inassertJustification(). - Frontend:
timesheetVideoRequired()insrc/lib/timesheetApproval.tsreturnsaction === 'create'.
- Backend:
- The same rule applies to session edits (Timesheet), ticket time edits (Clock page /
WorkWeek.tsx) and admin edits (AdminTimesheetPanel.tsx).
Proposed Changes
1. Team setting: change requirements
- Add two team-level settings, each with three levels:
- Edits & deletes:
none·description·description + video - New entries:
none·description·description + video
- Edits & deletes:
nonemeans the change applies directly, with no approval request.- Defaults preserve today's behavior: edits =
description, new entries =description + video. - Shown in Team Settings (
src/features/settings/TeamSettings.tsx), editable by team admins only.
2. Backend enforcement
requiresApproval()andassertJustification()read the team's setting for the action instead of the hard-coded constants.- The backend stays the authority — a client that skips the form still gets
description-required/video-requirederrors. - Existing teams without the field fall back to the defaults (no migration needed).
3. Frontend follows the setting
- Replace
timesheetVideoRequired(action)with a helper that takes the team's setting, used byPersonalTimesheetPanel,WorkWeekandAdminTimesheetPanel. - When the level is
none, the justification fields are hidden and the change saves directly. - The walkthrough field reads "(optional)" when video isn't required, as today.
Acceptance Criteria
- Team admins can set edit and new-entry requirements independently in Team Settings
- Defaults match today's behavior for every existing team
-
noneapplies the change immediately with no approval request -
descriptionrequires 10+ characters and no video -
description + videorequires both, for edits as well as new entries - Backend rejects requests missing what the team requires, regardless of client
- All three edit surfaces (Timesheet, Clock page, admin timesheet) follow the setting
- Setting labels are externalized and the controls are accessible
- Release note added
Out of Scope (for Now)
- Per-member or per-role overrides
- Organization-wide defaults
- Different rules for deletes vs. edits
- Changing who approves (still the team's other admins)
Metadata
Metadata
Assignees
Labels
No labels
Activity