Few fixes before release 1.3.0 (#13791)
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ export const SettingsDataModelFieldIsUniqueForm = ({
|
||||
<SettingsOptionCardContentSelect
|
||||
Icon={IconKey}
|
||||
title={t`Unique`}
|
||||
description={t`Prevent users from assigining the same value to different records`}
|
||||
description={t`Prevent from assigining the same value to different records`}
|
||||
>
|
||||
<Toggle
|
||||
toggleSize="small"
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ import {
|
||||
import { FieldMetadataType } from '~/generated-metadata/graphql';
|
||||
|
||||
const isUniqueFieldFormSchema = z.object({
|
||||
isUnique: z.boolean().nullable().optional(),
|
||||
isUnique: z.boolean().nullable().default(false),
|
||||
});
|
||||
|
||||
const booleanFieldFormSchema = z
|
||||
|
||||
-4
@@ -4,7 +4,6 @@ import { z } from 'zod';
|
||||
|
||||
import { FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
|
||||
import { SettingsDataModelPreviewFormCard } from '@/settings/data-model/components/SettingsDataModelPreviewFormCard';
|
||||
import { SettingsDataModelFieldIsUniqueForm } from '@/settings/data-model/fields/forms/components/SettingsDataModelFieldIsUniqueForm';
|
||||
import {
|
||||
settingsDataModelFieldMultiSelectFormSchema,
|
||||
SettingsDataModelFieldSelectForm,
|
||||
@@ -68,9 +67,6 @@ export const SettingsDataModelFieldSelectSettingsFormCard = ({
|
||||
<SettingsDataModelFieldSelectForm
|
||||
fieldMetadataItem={fieldMetadataItem}
|
||||
/>
|
||||
<SettingsDataModelFieldIsUniqueForm
|
||||
fieldMetadataItem={fieldMetadataItem}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
|
||||
+4
@@ -6,6 +6,10 @@ import { FieldMetadataType } from 'twenty-shared/types';
|
||||
export const canBeUnique = (
|
||||
field: Pick<FieldMetadataItem, 'type' | 'isCustom'>,
|
||||
) => {
|
||||
if (field.isCustom === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
[FieldMetadataType.MORPH_RELATION, FieldMetadataType.RELATION].includes(
|
||||
field.type,
|
||||
|
||||
Reference in New Issue
Block a user