accounts: show table row when clicking into details, more usage of

RadioBasedTabs

when clicking a username in the accounts tab, the details comes up with
a copy of the row you clicked, so you can view logs and edit the user.
Also decided not to use a RadioBasedTab here, instead providing a link
to the activity tab with a search for the user (added the ability to do
that, ?user=username). FIXME: handle deleting the user or just generally
editing them.
This commit is contained in:
Harvey Tindall
2025-12-23 20:37:29 +00:00
parent c3bac6c51c
commit 748acc13c0
6 changed files with 140 additions and 142 deletions

View File

@@ -159,6 +159,7 @@ window.notifications = new notificationBox(document.getElementById("notification
// Determine if url references an invite or account
let isInviteURL = window.invites.isInviteURL();
let isAccountURL = accounts.isAccountURL();
let isActivityURL = activity.isActivityURL();
// load tabs
const tabs: { id: string; url: string; reloader: () => void; unloader?: () => void }[] = [
@@ -183,6 +184,8 @@ const tabs: { id: string; url: string; reloader: () => void; unloader?: () => vo
accounts.loadAccountURL();
// Don't keep loading the same item on every tab refresh
isAccountURL = false;
// Since accounts and activity accept ?user=x, wipe the other one.
isActivityURL = false;
}
accounts.bindPageEvents();
}),
@@ -192,7 +195,15 @@ const tabs: { id: string; url: string; reloader: () => void; unloader?: () => vo
id: "activity",
url: "activity",
reloader: () => {
activity.reload();
activity.reload(() => {
if (isActivityURL) {
activity.loadActivityURL();
// Don't keep loading the same item on every tab refresh
isActivityURL = false;
// Since accounts and activity accept ?user=x, wipe the other one.
isAccountURL = false;
}
});
activity.bindPageEvents();
},
unloader: activity.unbindPageEvents,