@eohjsc/react-native-smart-city 0.4.58 → 0.4.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commons/Action/ItemQuickAction.js +4 -0
- package/src/commons/Calendar/styles.js +1 -1
- package/src/commons/WheelDateTimePicker/styles.js +1 -1
- package/src/screens/Automate/AddNewAction/SelectMonitorDevices.js +3 -8
- package/src/screens/Automate/AddNewAction/SetupConfigCondition.js +2 -2
- package/src/screens/Automate/AddNewAction/__test__/SetupConfigCondition.test.js +2 -2
package/package.json
CHANGED
|
@@ -10,12 +10,7 @@ import { AUTOMATE_TYPE } from '../../../configs/Constants';
|
|
|
10
10
|
|
|
11
11
|
const SelectMonitorDevices = ({ route }) => {
|
|
12
12
|
const t = useTranslations();
|
|
13
|
-
const {
|
|
14
|
-
automate = {},
|
|
15
|
-
isCreateNewAction,
|
|
16
|
-
closeScreen,
|
|
17
|
-
unit,
|
|
18
|
-
} = route?.params || {};
|
|
13
|
+
const { automate = {}, isCreateNewAction, closeScreen } = route?.params || {};
|
|
19
14
|
|
|
20
15
|
const [stations, setStations] = useState([]);
|
|
21
16
|
const [listStation, setListStation] = useState([]);
|
|
@@ -31,7 +26,7 @@ const SelectMonitorDevices = ({ route }) => {
|
|
|
31
26
|
configs.params.type = 'event';
|
|
32
27
|
}
|
|
33
28
|
await fetchWithCache(
|
|
34
|
-
API.UNIT.DEVICE_SENSOR(automate?.unit
|
|
29
|
+
API.UNIT.DEVICE_SENSOR(automate?.unit),
|
|
35
30
|
configs,
|
|
36
31
|
(response) => {
|
|
37
32
|
const { success, data } = response;
|
|
@@ -50,7 +45,7 @@ const SelectMonitorDevices = ({ route }) => {
|
|
|
50
45
|
}
|
|
51
46
|
);
|
|
52
47
|
setLoading(false);
|
|
53
|
-
}, [automate?.type, automate?.unit
|
|
48
|
+
}, [automate?.type, automate?.unit]);
|
|
54
49
|
|
|
55
50
|
useEffect(() => {
|
|
56
51
|
if (!automate?.sensor_id) {
|
|
@@ -58,13 +58,13 @@ const SetupConfigCondition = () => {
|
|
|
58
58
|
if (item.evaluate_template === 'boolean') {
|
|
59
59
|
return [
|
|
60
60
|
{
|
|
61
|
-
title: item.evaluate_configuration?.
|
|
61
|
+
title: item.evaluate_configuration?.off?.text,
|
|
62
62
|
condition: 'value_evaluation',
|
|
63
63
|
config: item.id,
|
|
64
64
|
value: 0,
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
|
-
title: item.evaluate_configuration?.
|
|
67
|
+
title: item.evaluate_configuration?.on?.text,
|
|
68
68
|
condition: 'value_evaluation',
|
|
69
69
|
config: item.id,
|
|
70
70
|
value: 1,
|
|
@@ -172,8 +172,8 @@ describe('Test SetupConfigCondition', () => {
|
|
|
172
172
|
);
|
|
173
173
|
const texts = modalCustom.findAllByType(Text);
|
|
174
174
|
expect(texts).toHaveLength(2);
|
|
175
|
-
expect(texts[
|
|
176
|
-
expect(texts[
|
|
175
|
+
expect(texts[1].props.children).toEqual('Case On');
|
|
176
|
+
expect(texts[0].props.children).toEqual('Case Off');
|
|
177
177
|
});
|
|
178
178
|
|
|
179
179
|
const testConditionValue = async (value, message) => {
|