diff --git a/front/src/modules/companies/components/CompanyPickerCell.tsx b/front/src/modules/companies/components/CompanyPickerCell.tsx
index 4e6f58d0e..82ab41777 100644
--- a/front/src/modules/companies/components/CompanyPickerCell.tsx
+++ b/front/src/modules/companies/components/CompanyPickerCell.tsx
@@ -77,7 +77,13 @@ export function CompanyPickerCell({
});
setIsCreating(false);
}
-
+ const noUser: EntityForSelect = {
+ entityType: Entity.Company,
+ id: '',
+ name: 'No Company',
+ avatarType: 'rounded',
+ avatarUrl: '',
+ };
return isCreating ? (
);
}
diff --git a/front/src/modules/ui/input/relation-picker/components/SingleEntitySelect.tsx b/front/src/modules/ui/input/relation-picker/components/SingleEntitySelect.tsx
index 93f5fb9be..54e8e8967 100644
--- a/front/src/modules/ui/input/relation-picker/components/SingleEntitySelect.tsx
+++ b/front/src/modules/ui/input/relation-picker/components/SingleEntitySelect.tsx
@@ -27,6 +27,7 @@ export function SingleEntitySelect<
onCancel,
width,
disableBackgroundBlur = false,
+ noUser,
}: {
onCancel?: () => void;
onCreate?: () => void;
@@ -34,6 +35,7 @@ export function SingleEntitySelect<
onEntitySelected: (entity: CustomEntityForSelect | null | undefined) => void;
disableBackgroundBlur?: boolean;
width?: number;
+ noUser?: CustomEntityForSelect;
}) {
const containerRef = useRef(null);
@@ -53,7 +55,6 @@ export function SingleEntitySelect<
onCancel?.();
},
});
-
return (
{showCreateButton && (
<>
diff --git a/front/src/modules/ui/input/relation-picker/components/SingleEntitySelectBase.tsx b/front/src/modules/ui/input/relation-picker/components/SingleEntitySelectBase.tsx
index 784d47a20..dbb0ce6d5 100644
--- a/front/src/modules/ui/input/relation-picker/components/SingleEntitySelectBase.tsx
+++ b/front/src/modules/ui/input/relation-picker/components/SingleEntitySelectBase.tsx
@@ -1,8 +1,10 @@
import { useRef } from 'react';
+import { useTheme } from '@emotion/react';
import { Key } from 'ts-key-enum';
import { DropdownMenuItem } from '@/ui/dropdown/components/DropdownMenuItem';
import { DropdownMenuSelectableItem } from '@/ui/dropdown/components/DropdownMenuSelectableItem';
+import { IconBuildingSkyscraper, IconUserCircle } from '@/ui/icon';
import { StyledDropdownMenuItemsContainer } from '@/ui/dropdown/components/StyledDropdownMenuItemsContainer';
import { OverflowingTextWithTooltip } from '@/ui/tooltip/OverflowingTextWithTooltip';
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
@@ -12,6 +14,7 @@ import { isNonEmptyString } from '~/utils/isNonEmptyString';
import { useEntitySelectScroll } from '../hooks/useEntitySelectScroll';
import { EntityForSelect } from '../types/EntityForSelect';
+import { Entity } from '../types/EntityTypeForSelect';
import { RelationPickerHotkeyScope } from '../types/RelationPickerHotkeyScope';
import { DropdownMenuSkeletonItem } from './skeletons/DropdownMenuSkeletonItem';
@@ -30,10 +33,12 @@ export function SingleEntitySelectBase<
entities,
onEntitySelected,
onCancel,
+ noUser,
}: {
entities: EntitiesForSingleEntitySelect;
onEntitySelected: (entity: CustomEntityForSelect | null | undefined) => void;
onCancel?: () => void;
+ noUser?: CustomEntityForSelect;
}) {
const containerRef = useRef(null);
let entitiesInDropdown = isDefined(entities.selectedEntity)
@@ -71,9 +76,22 @@ export function SingleEntitySelectBase<
entitiesInDropdown = entitiesInDropdown.filter((entity) =>
isNonEmptyString(entity.name.trim()),
);
+ const theme = useTheme();
return (
+ {noUser && (
+ onEntitySelected(noUser)}>
+ {noUser.entityType === Entity.User ? (
+
+ ) : (
+
+ )}
+ {noUser.name}
+
+ )}
{entities.loading ? (
) : entitiesInDropdown.length === 0 ? (
diff --git a/front/src/modules/ui/table/hooks/useUpdateEntityField.ts b/front/src/modules/ui/table/hooks/useUpdateEntityField.ts
index d0c3a03af..074fb9bda 100644
--- a/front/src/modules/ui/table/hooks/useUpdateEntityField.ts
+++ b/front/src/modules/ui/table/hooks/useUpdateEntityField.ts
@@ -91,8 +91,7 @@ export function useUpdateEntityField() {
const newSelectedEntity = newFieldValueUnknown;
const fieldName = viewField.metadata.fieldName;
-
- if (!newSelectedEntity) {
+ if (!newSelectedEntity || newSelectedEntity.id === '') {
updateEntity({
variables: {
where: { id: currentEntityId },
diff --git a/front/src/modules/users/components/UserPicker.tsx b/front/src/modules/users/components/UserPicker.tsx
index 80fed0bd2..a8fa580e4 100644
--- a/front/src/modules/users/components/UserPicker.tsx
+++ b/front/src/modules/users/components/UserPicker.tsx
@@ -47,7 +47,13 @@ export function UserPicker({
) {
onSubmit(selectedUser ?? null);
}
-
+ const noUser: UserForSelect = {
+ entityType: Entity.User,
+ id: '',
+ name: 'No Owner',
+ avatarType: 'rounded',
+ avatarUrl: '',
+ };
return (
);
}
diff --git a/server/src/ability/ability.util.ts b/server/src/ability/ability.util.ts
index bba6c1681..ebf45c7a2 100644
--- a/server/src/ability/ability.util.ts
+++ b/server/src/ability/ability.util.ts
@@ -74,6 +74,10 @@ const simpleAbilityCheck: OperationAbilityChecker = async (
// Extract entity name from model name
const entity = camelCase(modelName);
+ //TODO: Fix boolean data types so that disconnects are possible
+ if (typeof data === 'boolean') {
+ return true;
+ }
// Handle all operations cases
const operations = !Array.isArray(data) ? [data] : data;
// Handle where case
@@ -139,7 +143,6 @@ export async function relationAbilityChecker(
// Extract operation name and value
const operationType = Object.keys(operation)[0] as OperationType;
const operationValue = operation[operationType];
-
// Get operation checker for the operation type
const operationChecker = operationAbilityCheckers[operationType];