fix: rename alarm property to is_alarm
This commit is contained in:
@@ -23,7 +23,7 @@ const DetailTag = (props) => {
|
|||||||
unit: '',
|
unit: '',
|
||||||
device_name: '', // Read-only, auto-display dari device yang dipilih
|
device_name: '', // Read-only, auto-display dari device yang dipilih
|
||||||
is_active: true,
|
is_active: true,
|
||||||
alarm: false,
|
is_alarm: false,
|
||||||
device_id: null, // akan set ketika user select device dari dropdown
|
device_id: null, // akan set ketika user select device dari dropdown
|
||||||
sub_section_id: null,
|
sub_section_id: null,
|
||||||
};
|
};
|
||||||
@@ -145,7 +145,7 @@ const DetailTag = (props) => {
|
|||||||
data_type: FormData.data_type,
|
data_type: FormData.data_type,
|
||||||
unit: FormData.unit,
|
unit: FormData.unit,
|
||||||
is_active: FormData.is_active,
|
is_active: FormData.is_active,
|
||||||
alarm: FormData.alarm,
|
is_alarm: FormData.is_alarm,
|
||||||
device_id: parseInt(FormData.device_id),
|
device_id: parseInt(FormData.device_id),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ const DetailTag = (props) => {
|
|||||||
const handleAlarmToggle = (isChecked) => {
|
const handleAlarmToggle = (isChecked) => {
|
||||||
setFormData({
|
setFormData({
|
||||||
...FormData,
|
...FormData,
|
||||||
alarm: isChecked,
|
is_alarm: isChecked,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -285,7 +285,7 @@ const DetailTag = (props) => {
|
|||||||
unit: props.selectedData.unit || '',
|
unit: props.selectedData.unit || '',
|
||||||
device_name: props.selectedData.device_name || '',
|
device_name: props.selectedData.device_name || '',
|
||||||
is_active: props.selectedData.is_active ?? true,
|
is_active: props.selectedData.is_active ?? true,
|
||||||
alarm: props.selectedData.alarm ?? false,
|
is_alarm: props.selectedData.is_alarm ?? false,
|
||||||
device_id: props.selectedData.device_id || null,
|
device_id: props.selectedData.device_id || null,
|
||||||
sub_section_id: props.selectedData.sub_section_id || null,
|
sub_section_id: props.selectedData.sub_section_id || null,
|
||||||
};
|
};
|
||||||
@@ -434,14 +434,14 @@ const DetailTag = (props) => {
|
|||||||
disabled={props.readOnly}
|
disabled={props.readOnly}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
FormData.alarm === true ? '#23A55A' : '#bfbfbf',
|
FormData.is_alarm === true ? '#23A55A' : '#bfbfbf',
|
||||||
}}
|
}}
|
||||||
checked={FormData.alarm === true}
|
checked={FormData.is_alarm === true}
|
||||||
onChange={handleAlarmToggle}
|
onChange={handleAlarmToggle}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Text>{FormData.alarm === true ? 'Yes' : 'No'}</Text>
|
<Text>{FormData.is_alarm === true ? 'Yes' : 'No'}</Text>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user