mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-09 12:30:49 +02:00
Minor role display refactor (#2578)
This commit is contained in:
parent
19e57474dc
commit
66a459234d
@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { usePopup } from "@/components/admin/connectors/Popup";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useState } from "react";
|
||||
import { ConnectorTitle } from "@/components/admin/connectors/ConnectorTitle";
|
||||
import { AddMemberForm } from "./AddMemberForm";
|
||||
import { updateUserGroup, updateCuratorStatus } from "./lib";
|
||||
@ -11,6 +11,7 @@ import {
|
||||
User,
|
||||
UserGroup,
|
||||
UserRole,
|
||||
USER_ROLE_LABELS,
|
||||
} from "@/lib/types";
|
||||
import { AddConnectorForm } from "./AddConnectorForm";
|
||||
import {
|
||||
@ -106,7 +107,7 @@ const UserRoleDropdown = ({
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
return <div>{localRole}</div>;
|
||||
return <div>{USER_ROLE_LABELS[localRole]}</div>;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { type User, UserStatus, UserRole } from "@/lib/types";
|
||||
import { type User, UserStatus, UserRole, USER_ROLE_LABELS } from "@/lib/types";
|
||||
import CenteredPageSelector from "./CenteredPageSelector";
|
||||
import { type PageSelectorProps } from "@/components/PageSelector";
|
||||
import { HidableSection } from "@/app/admin/assistants/HidableSection";
|
||||
@ -21,13 +21,6 @@ import { useState } from "react";
|
||||
import { usePaidEnterpriseFeaturesEnabled } from "@/components/settings/usePaidEnterpriseFeaturesEnabled";
|
||||
import { DeleteEntityModal } from "@/components/modals/DeleteEntityModal";
|
||||
|
||||
const USER_ROLE_LABELS: Record<UserRole, string> = {
|
||||
[UserRole.BASIC]: "Basic",
|
||||
[UserRole.ADMIN]: "Admin",
|
||||
[UserRole.GLOBAL_CURATOR]: "Global Curator",
|
||||
[UserRole.CURATOR]: "Curator",
|
||||
};
|
||||
|
||||
interface Props {
|
||||
users: Array<User>;
|
||||
setPopup: (spec: PopupSpec) => void;
|
||||
|
@ -23,6 +23,13 @@ export enum UserRole {
|
||||
GLOBAL_CURATOR = "global_curator",
|
||||
}
|
||||
|
||||
export const USER_ROLE_LABELS: Record<UserRole, string> = {
|
||||
[UserRole.BASIC]: "Basic",
|
||||
[UserRole.ADMIN]: "Admin",
|
||||
[UserRole.GLOBAL_CURATOR]: "Global Curator",
|
||||
[UserRole.CURATOR]: "Curator",
|
||||
};
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user