mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-07 19:38:19 +02:00
Some additional curator polish (#2253)
This commit is contained in:
parent
8afa53c6bf
commit
e4e67c61ef
@ -69,7 +69,7 @@ logger = setup_logger()
|
||||
|
||||
def validate_curator_request(groups: list | None, is_public: bool) -> None:
|
||||
if is_public:
|
||||
detail = "User does not have permission to create public credentials"
|
||||
detail = "Curators cannot create public objects"
|
||||
logger.error(detail)
|
||||
raise HTTPException(
|
||||
status_code=401,
|
||||
|
@ -486,27 +486,10 @@ export default function AddConnector({
|
||||
/>
|
||||
{isPaidEnterpriseFeaturesEnabled && (
|
||||
<>
|
||||
<Divider className="my-0 py-0" />
|
||||
{formikProps.values.groups.length > 0 ? (
|
||||
<IsPublicGroupSelector
|
||||
formikProps={formikProps}
|
||||
objectName="Connector"
|
||||
/>
|
||||
) : (
|
||||
<AdminBooleanFormField
|
||||
subtext={`If set, then documents indexed by this connector will be visible to all users. If turned off, then only users who explicitly have been given access to the documents (e.g. through a User Group) will have access`}
|
||||
checked={formikProps.values.is_public}
|
||||
onChange={(e) => {
|
||||
const value = e.target.checked;
|
||||
formikProps.setFieldValue("is_public", value);
|
||||
if (value) {
|
||||
formikProps.setFieldValue("groups", []);
|
||||
}
|
||||
}}
|
||||
label={"Documents are Public?"}
|
||||
name={"is_public"}
|
||||
/>
|
||||
)}
|
||||
<IsPublicGroupSelector
|
||||
formikProps={formikProps}
|
||||
objectName="Connector"
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
@ -74,11 +74,13 @@ export const UserGroupsTable = ({
|
||||
<TableRow key={userGroup.id}>
|
||||
<TableCell>
|
||||
<Link
|
||||
className="whitespace-normal break-all flex cursor-pointer p-2 rounded hover:bg-hover w-fit"
|
||||
className="whitespace-nowrap overflow-hidden text-ellipsis inline-flex items-center cursor-pointer p-2 rounded hover:bg-hover max-w-full"
|
||||
href={`/admin/groups/${userGroup.id}`}
|
||||
>
|
||||
<FiEdit2 className="my-auto mr-2" />
|
||||
<p className="text font-medium">{userGroup.name}</p>
|
||||
<FiEdit2 className="mr-2 flex-shrink-0" />
|
||||
<span className="font-medium truncate">
|
||||
{userGroup.name}
|
||||
</span>
|
||||
</Link>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
|
@ -392,7 +392,7 @@ export const GroupDisplay = ({
|
||||
|
||||
<Divider />
|
||||
|
||||
<h2 className="text-xl font-bold mt-8 mb-2">Personas</h2>
|
||||
<h2 className="text-xl font-bold mt-8 mb-2">Assistants</h2>
|
||||
|
||||
<div>
|
||||
{userGroup.document_sets.length > 0 ? (
|
||||
@ -410,7 +410,7 @@ export const GroupDisplay = ({
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<Text>No Personas in this group...</Text>
|
||||
<Text>No Assistants in this group...</Text>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
@ -28,6 +28,9 @@ export const IsPublicGroupSelector = <T extends IsPublicGroupSelectorFormType>({
|
||||
useEffect(() => {
|
||||
if (user && userGroups) {
|
||||
const isUserAdmin = user.role === UserRole.ADMIN;
|
||||
if (!isUserAdmin) {
|
||||
formikProps.setFieldValue("is_public", false);
|
||||
}
|
||||
if (userGroups.length === 1 && !isUserAdmin) {
|
||||
formikProps.setFieldValue("groups", [userGroups[0].id]);
|
||||
setShouldHideContent(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user