Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ const MemoizedSetting = ({
<Field className={className}>
<InputComponent
value={value}
hint={hint}
editor={editor}
onChangeValue={onChangeValue}
onChangeEditor={onChangeEditor}
{...inputProps}
disabled={disabled}
/>
{hint && <Field.Hint>{hint}</Field.Hint>}
{hint && type !== 'code' && <Field.Hint>{hint}</Field.Hint>}
{callout && (
<Margins block='x16'>
<Callout type='warning'>{callout}</Callout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ WithValue.args = {
placeholder: 'Placeholder',
};

export const WithDescription = Template.bind({});
WithDescription.args = {
_id: 'setting_id',
label: 'Label',
hint: 'Description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
value: 'console.log("Hello World!");',
placeholder: 'Placeholder',
};

export const WithResetButton = Template.bind({});
WithResetButton.args = {
_id: 'setting_id',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import CodeMirror from './CodeMirror';
type CodeSettingInputProps = {
_id: string;
label: string;
hint: string;
value?: string;
code: string;
placeholder?: string;
Expand All @@ -24,6 +25,7 @@ type CodeSettingInputProps = {
function CodeSettingInput({
_id,
label,
hint,
value = '',
code,
placeholder,
Expand Down Expand Up @@ -51,6 +53,7 @@ function CodeSettingInput({
</Field.Label>
{hasResetButton && <ResetSettingButton data-qa-reset-setting-id={_id} onClick={onResetButtonClick} />}
</Box>
{hint && <Field.Hint>{hint}</Field.Hint>}
</Flex.Container>
<div className={['code-mirror-box', fullScreen && 'code-mirror-box-fullscreen content-background-color'].filter(Boolean).join(' ')}>
<div className='title'>{label}</div>
Expand Down