From 80a5e2c965e4b0e5d2a051d14e354fff96427d7a Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Mon, 19 Oct 2026 11:27:17 -0400 Subject: [PATCH] Add per-user closed statuses for the feed and ding SDP closes a resolved ticket on its own after 2 or 3 days, so watching only Closed gave the ding days late. Each user can now pick which statuses count as closed for the feed (feedStatuses, defaulting to STATUS_NAMES). With Resolved picked, tickets are timed by resolved_time so the automatic close later doesn't ding again. Co-Authored-By: Claude Opus 5.5 --- README.md | 5 +++-- docs/NOTES.md | 1 + docs/ROADMAP.md | 3 ++- src/public/index.html | 26 +++++++++++++++++++++----- src/routes.js | 4 +++- src/server.js | 6 ++++-- src/settings.js | 5 ++++- src/tickets.js | 26 ++++++++++++++++---------- 8 files changed, 54 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index c51ff97..a19eedb 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Copy `src/env.example` to a file named `.env` and fill it in. The region, timing | `PUBLIC_URL` | Yes when hosted | The address people open, with no trailing slash, e.g. `https://dashboard.example.com`. Zoho sends people back to `PUBLIC_URL/auth/callback`. Defaults to `http://localhost:3000`. Cookies are marked secure when it starts with `https://`. | | `SESSION_DAYS` | No | How many days a sign-in lasts before Zoho is asked again. Defaults to 7. | | `TECHNICIAN_NAMES` | No | Comma-separated technician names, spelled as they appear in SDP. One table row per name. Leave it empty to include every technician. | -| `STATUS_NAMES` | No | Statuses that count as "closed" for the ding and the Closed today count. Everything else counts as open. Defaults to `Closed,Resolved,Canceled`. | +| `STATUS_NAMES` | No | Statuses that count as "closed" for the Closed today count and the status table. Everything else counts as open. Also the default for which statuses put a ticket in the closed feed and ding, which each person can change in Settings. Defaults to `Closed,Resolved,Canceled`. | | `SITE_NAMES` | No | Only include requests from these sites (the region). Leave it empty for all sites. | | `GROUP_NAMES` | No | Only include requests in these support groups, e.g. `Customer Support`. Leave it empty for all groups. | | `UNASSIGNED_EXCLUDED_STATUSES` | No | Statuses the Unassigned requests counter leaves out. Defaults to `STATUS_NAMES`. | @@ -132,9 +132,10 @@ The full security model, its limits and the open items are in [docs/SECURITY.md] - **Sites, groups and technicians** to watch. Empty means everyone. Suggestions come from names seen on recent tickets anywhere in SDP (refreshed at most hourly and shared by everyone). Any name can be typed, but it must match SDP's spelling; a name that differs only in case is saved with SDP's spelling. - **Timing:** how often the status table recounts (2 to 60 minutes) and how long closed tickets stay in the feed (1 to 24 hours). The closed check itself always runs every minute. - **Weather location**, from the list of campuses in `src/places.js`. +- **Which statuses count as closed for the feed and ding.** Starts as `STATUS_NAMES`. SDP closes a resolved ticket on its own after a few days, so ticking **Resolved** gives the alert when the ticket is resolved instead. With Resolved ticked, a ticket's time in the feed is its resolve time, so the automatic close later doesn't ding again. - **What's shown:** the stat tiles, weather card and closed feed can be hidden (the ding still plays with the feed hidden), and so can individual status columns. -Settings are saved to the person's Zoho account on the server, so they follow them to any browser. Only the values that differ from `.env` are stored, so someone who never changed the region picks up later changes to `.env`. **Reset to defaults** goes back to `.env`. The closed and open status rules aren't per person; they stay in `.env`. +Settings are saved to the person's Zoho account on the server, so they follow them to any browser. Only the values that differ from `.env` are stored, so someone who never changed the region picks up later changes to `.env`. **Reset to defaults** goes back to `.env`. The closed and open status rules for the status table, Closed today and the unassigned count aren't per person; they stay in `.env`. The browser runs the checks, using the signed-in user's token, so every open dashboard makes its own SDP calls. That's one small query a minute and a recount at the person's chosen interval (`WORKLOAD_MINUTES` by default). On first load it fetches the feed's full length (12 hours by default) of closes. diff --git a/docs/NOTES.md b/docs/NOTES.md index ddd8e5a..aedc21c 100644 --- a/docs/NOTES.md +++ b/docs/NOTES.md @@ -39,6 +39,7 @@ Docs: