Skip to content

Commit

Permalink
[#51] Add flag to disable use spesific object name setting
Browse files Browse the repository at this point in the history
  • Loading branch information
wayangalihpratama committed Sep 6, 2023
1 parent ff7e44a commit be4f043
Showing 1 changed file with 37 additions and 24 deletions.
61 changes: 37 additions & 24 deletions src/components/question-type/SettingCascade.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Form, Checkbox, Row, Col, Input, InputNumber, Select } from 'antd';
import styles from '../../styles.module.css';
import { UIStore, questionGroupFn } from '../../lib/store';

const showSettingUseSpesificObjectNameSetting = false;

const SettingCascade = ({
id,
questionGroupId,
Expand Down Expand Up @@ -121,33 +123,44 @@ const SettingCascade = ({
/>
</Form.Item>
</Col>
<Col>
<Form.Item name={`${namePreffix}-api_list_checkbox`}>
<Checkbox
onChange={(e) => handleChangeList(e?.target?.checked)}
checked={api?.list ? true : false}
>
{' '}
{UIText.inputQuestionListCheckbox}
</Checkbox>
</Form.Item>
</Col>
{api?.list && (
<Col span={8}>
<Form.Item
label={UIText.inputQuestionListLabel}
initialValue={
api?.list ? (api.list !== true ? api.list : null) : null
}
name={`${namePreffix}-api_list`}
{/* Use Spesific Object Name Setting */}
{showSettingUseSpesificObjectNameSetting && (
<Col>
<Row
align="bottom"
gutter={[24, 24]}
>
<Input
onChange={(e) => handleChangeList(e?.target?.value)}
allowClear
/>
</Form.Item>
<Col>
<Form.Item name={`${namePreffix}-api_list_checkbox`}>
<Checkbox
onChange={(e) => handleChangeList(e?.target?.checked)}
checked={api?.list ? true : false}
>
{' '}
{UIText.inputQuestionListCheckbox}
</Checkbox>
</Form.Item>
</Col>
{api?.list && (
<Col span={8}>
<Form.Item
label={UIText.inputQuestionListLabel}
initialValue={
api?.list ? (api.list !== true ? api.list : null) : null
}
name={`${namePreffix}-api_list`}
>
<Input
onChange={(e) => handleChangeList(e?.target?.value)}
allowClear
/>
</Form.Item>
</Col>
)}
</Row>
</Col>
)}
{/* EOL Use Spesific Object Name Setting */}
</Row>
</div>
);
Expand Down

0 comments on commit be4f043

Please sign in to comment.