Merge remote-tracking branch 'upstream/master' into feature/table-url-state

# Conflicts:
#	packages/web_ui/src/components/HostsPage.tsx
#	packages/web_ui/src/components/InstanceList.tsx
#	packages/web_ui/src/components/ModsPage.tsx
#	packages/web_ui/src/components/PluginsPage.tsx
#	packages/web_ui/src/components/RolesPage.tsx
#	packages/web_ui/src/components/UserViewPage.tsx
#	packages/web_ui/src/components/UsersTable.tsx
#	packages/web_ui/src/index.ts
This commit is contained in:
bbassie committed 2026-06-29 22:37:03 +00:00
commit 0874c26208
56 files changed
+961 -232

No files matched your search

+9 -7
View File
@@ -13,6 +13,8 @@ import PageLayout from "./PageLayout";
import PluginExtra from "./PluginExtra";
import useTableQueryState from "../util/useTableQueryState";
import useColumnSearch from "../util/useColumnSearch";
import useRowNavigation from "../util/useRowNavigation";
import Link from "./Link";
const strcmp = new Intl.Collator(undefined, { numeric: true, sensitivity: "base" }).compare;
@@ -47,7 +49,7 @@ function CreateRoleButton() {
open={open}
onOk={() => { createRole().catch(notifyErrorHandler("Error creating role")); }}
onCancel={() => { setOpen(false); }}
destroyOnClose
destroyOnHidden
>
<Form form={form}>
<Form.Item name="roleName" label="Name">
@@ -63,10 +65,10 @@ function CreateRoleButton() {
export default function RolesPage() {
let account = useAccount();
let navigate = useNavigate();
const [roles] = useRoles();
const tableState = useTableQueryState<lib.Role>({ namespace: "role" });
const nameSearch = useColumnSearch<lib.Role>(role => role.name, "Search roles");
const rowNav = useRowNavigation();
return <PageLayout nav={[{ name: "Roles" }]}>
<PageHeader
@@ -81,6 +83,10 @@ export default function RolesPage() {
sorter: (a, b) => strcmp(a.name, b.name),
sortOrder: tableState.sortOrder("name"),
filteredValue: tableState.filteredValue("name"),
className: "table-link-cell",
render: (_, role) => <Link to={`/roles/${role.id}/view`} style={{ color: "inherit" }}>
{role.name}
</Link>,
...nameSearch,
},
{
@@ -92,11 +98,7 @@ export default function RolesPage() {
pagination={tableState.pagination}
rowKey={role => role.id}
onChange={tableState.onChange}
onRow={(role, rowIndex) => ({
onClick: event => {
navigate(`/roles/${role.id}/view`);
},
})}
onRow={role => rowNav(`/roles/${role.id}/view`)}
/>
<PluginExtra component="RolesPage" />
</PageLayout>;