fix: hide archived/blocked projects from list, timer and time-entry dropdowns#193
Merged
Conversation
…oject list - Add BCStandardProject type and getBlockedProjectNumbers() to fetch blocked status from standard BC v2.0 API - Merge blocked status into project mapping (extension API may not expose it) - Map blocked projects to 'archived' status - Filter archived projects from ProjectList by default (status filter = 'all') - Filter to active-only in StartTimerModal and TimeEntryModal dropdowns Closes #191 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Thyme BC Extension now exposes the 'blocked' enum on the /projects
endpoint, so the parallel call to BC's standard /projects API just to
collect blocked-project numbers is no longer needed.
- BCProject.blocked is now the BC enum (' ' | 'Posting' | 'All') instead
of boolean. The standalone BCStandardProject type is removed.
- bcClient.getBlockedProjectNumbers() and the dual-API merge in
projectService.getProjects / projectDetailsService.getProjectDetails
are removed.
- BC OData JSON serializes the leading-space sentinel as the literal
string '_x0020_' (XML-escape for U+0020). Normalize it back to ' ' at
the boundary in bcClient so consumers can use the documented enum.
- isBlocked check becomes 'blocked && blocked !== " "', catching both
'Posting' and 'All' as archived.
Requires the latest Thyme BC Extension to be installed in the BC env;
older extension versions don't expose the blocked field on /projects.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Thyme’s Business Central project handling so BC’s blocked state is treated as Thyme’s archived status, then uses that status to hide archived projects across the main project-selection surfaces.
Changes:
- Adds
blockedto the BC project model and normalizes BC’s_x0020_sentinel back to the documented not-blocked enum value. - Maps blocked BC projects to Thyme’s
archivedstatus in both project list and project details services. - Hides archived projects by default in the project list and removes non-active projects from timer/time-entry project pickers.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/types/index.ts |
Extends BCProject with the new blocked field. |
src/services/bc/projectService.ts |
Maps BC blocked/completed status into Thyme project status. |
src/services/bc/projectDetailsService.ts |
Applies the same archived-status mapping for project details. |
src/services/bc/bcClient.ts |
Normalizes BC OData blocked values when reading projects. |
src/components/timesheet/TimeEntryModal.tsx |
Filters time-entry project choices down to active projects. |
src/components/timer/StartTimerModal.tsx |
Filters timer project choices down to active projects. |
src/components/projects/ProjectList.tsx |
Hides archived projects from the default list view unless explicitly filtered in. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- ProjectList: rename the "All Status" filter option to "Active &
Completed" so the user sees that the default view excludes archived.
- TimeEntryModal: derive customer and project dropdowns from a single
`availableProjects` list (active projects, plus the entry's current
project when editing). This fixes two bugs:
* if a customer's projects were all archived, the customer still
appeared in the customer dropdown but selecting them yielded an
empty project list;
* reopening an entry whose project had since been archived dropped
the original project from the dropdown.
- projectService: log a one-time console warning if no project in the
response carries a `blocked` field — signals the Thyme BC Extension
is older than the version that exposes the field, and the hide-
archived feature won't apply until it's upgraded.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BenGWeeks
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
blockedenum to Thyme'sarchivedstatus; hides archived projects from the project list by default and from the timer / time-entry dropdowns.blockedfield exposed by the latest Thyme BC Extension on the/projectsendpoint (no dual-API workaround)."_x0020_"serialization of the not-blocked sentinel back to a real space at the boundary inbcClient, so downstream code can use the documented enum (' ' | 'Posting' | 'All').BCStandardProjecttype andbcClient.getBlockedProjectNumbers().Requires
blockedon/projects).Test plan
/projects(no dual-API merge).Fixes #191
🤖 Generated with Claude Code