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:
@ -28,7 +28,7 @@ export const ApiKeyInput = ({ apiKey }: ApiKeyInputProps) => {
|
||||
return (
|
||||
<StyledContainer>
|
||||
<StyledLinkContainer>
|
||||
<TextInput value={apiKey} fullWidth />
|
||||
<TextInput instanceId="api-key-display" value={apiKey} fullWidth />
|
||||
</StyledLinkContainer>
|
||||
<Button
|
||||
Icon={IconCopy}
|
||||
|
||||
@ -56,9 +56,12 @@ export const ApiKeyNameInput = ({
|
||||
return debouncedUpdate.cancel;
|
||||
}, [debouncedUpdate, apiKeyName]);
|
||||
|
||||
const nameTextInputId = `${apiKeyId}-name`;
|
||||
|
||||
return (
|
||||
<StyledComboInputContainer>
|
||||
<TextInput
|
||||
instanceId={nameTextInputId}
|
||||
placeholder="E.g. backoffice integration"
|
||||
onChange={onNameUpdate}
|
||||
fullWidth
|
||||
|
||||
@ -115,6 +115,10 @@ export const SettingsDevelopersWebhookForm = ({
|
||||
{ label: 'Deleted', value: 'deleted', Icon: IconTrash },
|
||||
];
|
||||
|
||||
const descriptionTextAreaId = `${webhookId}-description`;
|
||||
const targetUrlTextInputId = `${webhookId}-target-url`;
|
||||
const secretTextInputId = `${webhookId}-secret`;
|
||||
|
||||
return (
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
<FormProvider {...formConfig}>
|
||||
@ -156,6 +160,7 @@ export const SettingsDevelopersWebhookForm = ({
|
||||
}) => {
|
||||
return (
|
||||
<TextInput
|
||||
instanceId={targetUrlTextInputId}
|
||||
placeholder={t`https://example.com/webhook`}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
@ -177,6 +182,7 @@ export const SettingsDevelopersWebhookForm = ({
|
||||
control={formConfig.control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<TextArea
|
||||
textAreaId={descriptionTextAreaId}
|
||||
placeholder={t`Write a description`}
|
||||
minRows={4}
|
||||
value={value || ''}
|
||||
@ -242,6 +248,7 @@ export const SettingsDevelopersWebhookForm = ({
|
||||
control={formConfig.control}
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<TextInput
|
||||
instanceId={secretTextInputId}
|
||||
placeholder={t`Secret (optional)`}
|
||||
value={value || ''}
|
||||
onChange={onChange}
|
||||
|
||||
Reference in New Issue
Block a user