Skip to content

Commit

Permalink
Enable standard boolean field default value editing
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-elias committed Nov 18, 2024
1 parent 855b051 commit 74ba5e3
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { z } from 'zod';
import { FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { SettingsOptionCardContentSelect } from '@/settings/components/SettingsOptions/SettingsOptionCardContentSelect';
import { useBooleanSettingsFormInitialValues } from '@/settings/data-model/fields/forms/boolean/hooks/useBooleanSettingsFormInitialValues';
import { isDefined } from '~/utils/isDefined';

export const settingsDataModelFieldBooleanFormSchema = z.object({
defaultValue: z.boolean(),
Expand All @@ -26,7 +25,6 @@ export const SettingsDataModelFieldBooleanForm = ({
}: SettingsDataModelFieldBooleanFormProps) => {
const { control } = useFormContext<SettingsDataModelFieldBooleanFormValues>();

const isEditMode = isDefined(fieldMetadataItem?.defaultValue);
const { initialDefaultValue } = useBooleanSettingsFormInitialValues({
fieldMetadataItem,
});
Expand All @@ -44,9 +42,6 @@ export const SettingsDataModelFieldBooleanForm = ({
value={value}
onChange={onChange}
selectClassName={className}
// TODO: temporary fix - disabling edition because after editing the defaultValue,
// newly created records are not taking into account the updated defaultValue properly.
disabled={isEditMode}
dropdownId="object-field-default-value-select-boolean"
options={[
{
Expand Down

0 comments on commit 74ba5e3

Please sign in to comment.