[Hacktoberfest][Web2.0] Implement Monitoring Observers page - #1077
Open
cristian-ist wants to merge 1 commit into
Open
[Hacktoberfest][Web2.0] Implement Monitoring Observers page#1077cristian-ist wants to merge 1 commit into
cristian-ist wants to merge 1 commit into
Conversation
|
@cristian-ist is attempting to deploy a commit to the Code for Romania Team on Vercel. A member of the Team first needs to authorize it. |
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
Finishes the monitoring observers page: the table now shows everything the
current admin app shows, the row actions work, and filtering, sorting and paging
all round-trip through the url.
Closes #1006
Pagination did not work
The page already declared
pageNumberin its search schema, but the table wasleft on the hook's default key,
page. Changing page wrote?page=2into theurl,
validateSearchdropped it as unknown,pageNumberstayed at 1, and thelist never moved. The table now passes
pageNumber/pageSizeexplicitly, whichis what the issue is about in the first place.
Other fixes to the existing page
rowActionwas assigned and never read, whichtscrejects with
TS6133. It went away with the dead action menu it belonged to.isFilteredreadtable.getState().columnFilters, which is always empty because every filterhere writes to the search params instead. It now reads the url, and
onResetnavigates to a clean state rather than logging
'reset'to the console.keystroke. It now keeps its value locally and rewrites the url once, 500ms
after the user stops, matching how the forms page does it. Every filter also
resets to the first page, since the current one may not exist after filtering.
ensureQueryDataand strips empty filters out of the url.What the table shows now
All six columns from the current app: name, email, observer tags, phone,
observer status as a badge, and latest activity at. Only the first two existed
before, even though the model already carried the rest.
Tags render the first three and collapse the rest into a
+Nbadge with thefull list in its tooltip — an observer with many tags would otherwise push every
other column off screen. Observers who have never opened the mobile app show
"Never" rather than an empty cell.
Row actions
The menu matches the current admin app: View, Edit, Resend invitation
email, in that order.
Resend is wired to
monitoring-observers:resend-invitesbehind a confirmation,and is only enabled for observers who are still
Pendingon a round that is notarchived — the same condition as today.
View links to the observer route, which is still a generated placeholder in this
app, so the entry will start working the moment that page is built. Edit stays
disabled: there is no edit route here at all yet. Both keep their place in the
menu rather than being dropped and re-added later.
Note
mapMonitoringObserverStatusinsrc/lib/i18n.tsis unused, and currentlyunusable: it looks up
observers.status.*, and those keys are not in the localefiles, so calling it prints the key instead of a word. The status badge writes
the value directly for that reason. Left untouched, but worth fixing or removing.
Verification
tscreports no errors in the new codeeslintreports no errors beyond the repo-widereact/react-in-jsx-scoperuleprettier --checkpassesknipreports nothing unused from this changeChecked against 24 observers on a test deployment: paging with a reduced page
size, sorting per column, and the status and tag filters all survive a reload and
a shared link.