Final changes for RO closer.
This commit is contained in:
111
client/src/components/shop-info/shop-info.roguard.component.jsx
Normal file
111
client/src/components/shop-info/shop-info.roguard.component.jsx
Normal file
@@ -0,0 +1,111 @@
|
||||
import { Form, Input, InputNumber, Switch } from 'antd';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import LayoutFormRow from '../layout-form-row/layout-form-row.component';
|
||||
|
||||
export default function ShopInfoRoGuard({ form }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<LayoutFormRow header={t('bodyshop.labels.md_ro_guard')}>
|
||||
<Form.Item
|
||||
label={t('bodyshop.fields.md_ro_guard.enabled')}
|
||||
name={['md_ro_guard', 'enabled']}
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
</LayoutFormRow>
|
||||
<Form.Item noStyle dependencies={[['md_ro_guard', 'enabled']]}>
|
||||
{() => {
|
||||
const disabled = !form.getFieldValue(['md_ro_guard', 'enabled']);
|
||||
return (
|
||||
<LayoutFormRow noDivider>
|
||||
<Form.Item
|
||||
label={t('bodyshop.fields.md_ro_guard.totalgppercent_minimum')}
|
||||
name={['md_ro_guard', 'totalgppercent_minimum']}
|
||||
rules={[
|
||||
{
|
||||
required: !disabled,
|
||||
//message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber min={0} max={100} precision={1} disabled={disabled} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('bodyshop.fields.md_ro_guard.masterbypass')}
|
||||
name={['md_ro_guard', 'masterbypass']}
|
||||
rules={[
|
||||
{
|
||||
required: !disabled,
|
||||
//message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input type="password" allowClear disabled={disabled} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('bodyshop.fields.md_ro_guard.enforce_bills')}
|
||||
name={['md_ro_guard', 'enforce_bills']}
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch disabled={disabled} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t('bodyshop.fields.md_ro_guard.enforce_cm')}
|
||||
name={['md_ro_guard', 'enforce_cm']}
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch disabled={disabled} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('bodyshop.fields.md_ro_guard.enforce_profit')}
|
||||
name={['md_ro_guard', 'enforce_profit']}
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch disabled={disabled} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('bodyshop.fields.md_ro_guard.enforce_ar')}
|
||||
name={['md_ro_guard', 'enforce_ar']}
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch disabled={disabled} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('bodyshop.fields.md_ro_guard.enforce_sublet')}
|
||||
name={['md_ro_guard', 'enforce_sublet']}
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch disabled={disabled} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('bodyshop.fields.md_ro_guard.enforce_ppd')}
|
||||
name={['md_ro_guard', 'enforce_ppd']}
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch disabled={disabled} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('bodyshop.fields.md_ro_guard.enforce_labor')}
|
||||
name={['md_ro_guard', 'enforce_labor']}
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch disabled={disabled} />
|
||||
</Form.Item>
|
||||
</LayoutFormRow>
|
||||
);
|
||||
}}
|
||||
</Form.Item>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user