Replace hotkey scopes by focus stack (Part 4 - Inputs) (#12933)
# Replace hotkey scopes by focus stack (Part 4 - Inputs) This PR is the 4th part of a refactoring aiming to deprecate the hotkey scopes api in favor of the new focus stack api which is more robust. Part 1: https://github.com/twentyhq/twenty/pull/12673 Part 2: https://github.com/twentyhq/twenty/pull/12798 Part 3: https://github.com/twentyhq/twenty/pull/12910 In this part, I refactored all inputs in the app so that each input has a unique id which can be used to track the focused element.
This commit is contained in:
+8
@@ -123,6 +123,10 @@ export const SettingsDataModelObjectAboutForm = ({
|
||||
});
|
||||
};
|
||||
|
||||
const descriptionTextAreaId = `${objectMetadataItem?.id}-description`;
|
||||
const labelSingularTextInputId = `${objectMetadataItem?.id}-label-singular`;
|
||||
const labelPluralTextInputId = `${objectMetadataItem?.id}-label-plural`;
|
||||
|
||||
return (
|
||||
<>
|
||||
<StyledInputsContainer>
|
||||
@@ -150,6 +154,7 @@ export const SettingsDataModelObjectAboutForm = ({
|
||||
defaultValue={objectMetadataItem?.labelSingular ?? ''}
|
||||
render={({ field: { onChange, value }, formState: { errors } }) => (
|
||||
<TextInput
|
||||
instanceId={labelSingularTextInputId}
|
||||
// TODO we should discuss on how to notify user about form validation schema issue, from now just displaying red borders
|
||||
noErrorHelper={true}
|
||||
error={errors.labelSingular?.message}
|
||||
@@ -181,6 +186,7 @@ export const SettingsDataModelObjectAboutForm = ({
|
||||
defaultValue={objectMetadataItem?.labelPlural ?? ''}
|
||||
render={({ field: { onChange, value }, formState: { errors } }) => (
|
||||
<TextInput
|
||||
instanceId={labelPluralTextInputId}
|
||||
// TODO we should discuss on how to notify user about form validation schema issue, from now just displaying red borders
|
||||
noErrorHelper={true}
|
||||
error={errors.labelPlural?.message}
|
||||
@@ -210,6 +216,7 @@ export const SettingsDataModelObjectAboutForm = ({
|
||||
control={control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<TextArea
|
||||
textAreaId={descriptionTextAreaId}
|
||||
placeholder={t`Write a description`}
|
||||
minRows={4}
|
||||
value={value ?? undefined}
|
||||
@@ -264,6 +271,7 @@ export const SettingsDataModelObjectAboutForm = ({
|
||||
}) => (
|
||||
<>
|
||||
<TextInput
|
||||
instanceId={`${objectMetadataItem?.id}-${fieldName}`}
|
||||
label={label}
|
||||
placeholder={placeholder}
|
||||
value={value}
|
||||
|
||||
Reference in New Issue
Block a user