Skip to content

Commit

Permalink
Make role tag in users table clickable
Browse files Browse the repository at this point in the history
As per issue clusterio#572
  • Loading branch information
Danielv123 committed Feb 9, 2024
1 parent bcda887 commit e2da9ac
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/web_ui/src/components/UsersPage.tsx
@@ -1,5 +1,5 @@
import React, { useEffect, useContext, useState } from "react";
import { useNavigate } from "react-router-dom";
import { Link, useNavigate } from "react-router-dom";
import { Button, Form, Input, Modal, Space, Table, Tag } from "antd";

import * as lib from "@clusterio/lib";
Expand Down Expand Up @@ -49,7 +49,7 @@ function CreateUserButton() {
>
<Form form={form}>
<Form.Item name="userName" label="Name">
<Input/>
<Input />
</Form.Item>
</Form>
</Modal>
Expand Down Expand Up @@ -97,7 +97,9 @@ export default function UsersPage() {
title: "Roles",
key: "roles",
render: (_, user) => (
[...user.roleIds].map(id => <Tag key={id}>{(roles.get(id) || { name: id }).name}</Tag>)
[...user.roleIds].map(id => <Link to={`/roles/${id}/view`} onClick={e => e.stopPropagation()}>
<Tag key={id}>{(roles.get(id) || { name: id }).name}</Tag>
</Link>)
),
},
{
Expand Down

0 comments on commit e2da9ac

Please sign in to comment.