2026-06-16 Update#86
Merged
Merged
Conversation
Add data-quality (dirty data) and missing-hire-date reports with JSON caches and XLSX export support. Probe Graph API capabilities by decoding JWT roles (probe_graph_capabilities) and persist graph_capabilities.json; remove stale capabilities on startup. Enhance msgraph to detect Exchange mailboxes via assignedPlans, read/showInAddressList for GAL visibility, include state in records, and enrich last-login records with manager info so filters work correctly. Wire new filters and tagpicker state through reports, add mailbox/GAL/manager toggles to multiple report functions, and expose /api/graph-capabilities and /api/clear-data endpoints (clear caches and kick off a fresh sync). Update config to include new cache file paths and adjust repository dir location.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the admin reporting and sync workflow in SimpleOrgChart by adding data-quality and missing-hire-date reports, introducing Graph-permission capability probing to gate certain UI filters, and adding a “clear cached data & resync” management action.
Changes:
- Added new reports (missing hire date, dirty data) backed by JSON caches and XLSX export endpoints, plus UI selector/options and i18n strings.
- Added Graph capability probing +
/api/graph-capabilitiesand used it to gate report filters that require specific Graph permissions (MailboxSettings.Read, AuditLog.Read.All). - Enhanced Graph-derived employee metadata (mailbox presence/type, GAL visibility, state, manager presence) and wired new toggle/tagpicker filters through the reports pipeline.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/reports.html | Adds report selector options for the new reports. |
| templates/configure.html | Adds “Data Management” section with a clear-data action button. |
| static/reports.js | Adds report configs, new filters/tagpickers, capability gating, sync polling, and table rendering updates. |
| static/reports.css | Adds disabled button styling and compact filter group layout/unavailable chip styling. |
| static/locales/en-US.json | Adds i18n strings for new reports, filters, and UI messages. |
| static/configure.js | Implements the clear-data action (confirm → POST → start polling). |
| static/app.js | Improves click handling during drag and disables the sync button while syncing. |
| simple_org_chart/user_scanner_service.py | Updates repo install path documentation to data/repositories/.... |
| simple_org_chart/reports.py | Adds new filter parameters, state tagpicker support, and dirty-data detection/filter helpers. |
| simple_org_chart/msgraph.py | Adds JWT-role capability probe helpers and enriches user records with mailbox/GAL/manager/state metadata. |
| simple_org_chart/hierarchy.py | Adds state into flattened traversal output. |
| simple_org_chart/data_update.py | Writes new caches (capabilities, dirty data, missing hire date) and enriches last-login records with manager info. |
| simple_org_chart/config.py | Moves REPO_DIR under data/ and adds new cache path constants. |
| simple_org_chart/app_main.py | Adds new report routes/exports, new parsing for state + new toggles, /api/graph-capabilities, and /api/clear-data. |
| README.md | Updates feature list, permissions notes, and cache documentation. |
| AGENTS.md | Documents architecture and filter/capability wiring (needs a small correction). |
Comment on lines
+180
to
+184
| { | ||
| key: 'issues', | ||
| labelKey: 'reports.types.dirtyData.columns.issueDetail', | ||
| render: (record) => { | ||
| const issues = record.issues || []; |
Comment on lines
+98
to
+101
| **How it works:** | ||
| - `msgraph.probe_graph_capabilities(token)` runs 4 targeted API calls at the start of every sync and writes `data/graph_capabilities.json`. | ||
| - `GET /api/graph-capabilities` serves that file to the front end. | ||
| - `reports.js` fetches capabilities before first render; `_isFilterCapable(filter)` checks `filter.requiredCapability` against the loaded flags. |
Comment on lines
+57
to
+60
| payload = parts[1] | ||
| # Restore base64 padding | ||
| payload += '=' * (4 - len(payload) % 4) | ||
| decoded = base64.urlsafe_b64decode(payload.encode()) |
Comment on lines
+254
to
+258
| include_hidden_from_address_list: bool = True, | ||
| include_visible_in_address_list: bool = True, | ||
| include_with_mailbox: bool = True, | ||
| include_without_mailbox: bool = True, | ||
| include_with_manager: bool = True, |
Comment on lines
+625
to
+629
| if (!isCapable) { | ||
| button.className = `filter-chip filter-chip--unavailable`; | ||
| button.disabled = true; | ||
| button.title = t('reports.filters.missingCapability'); | ||
| } else { |
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.
Add data-quality (dirty data) and missing-hire-date reports with JSON caches and XLSX export support. Probe Graph API capabilities by decoding JWT roles (probe_graph_capabilities) and persist graph_capabilities.json; remove stale capabilities on startup. Enhance msgraph to detect Exchange mailboxes via assignedPlans, read/showInAddressList for GAL visibility, include state in records, and enrich last-login records with manager info so filters work correctly. Wire new filters and tagpicker state through reports, add mailbox/GAL/manager toggles to multiple report functions, and expose /api/graph-capabilities and /api/clear-data endpoints (clear caches and kick off a fresh sync). Update config to include new cache file paths and adjust repository dir location.