@eohjsc/react-native-smart-city 0.4.84 → 0.4.86

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.
Files changed (54) hide show
  1. package/assets/images/Notify.svg +9 -0
  2. package/package.json +1 -1
  3. package/src/commons/Automate/ItemAutomate.js +6 -1
  4. package/src/commons/Device/PMSensor/PMSensorIndicator.js +15 -8
  5. package/src/commons/Device/WaterQualitySensor/ListQualityIndicator.js +23 -15
  6. package/src/commons/Device/WaterQualitySensor/QualityIndicatorsItem.js +10 -9
  7. package/src/commons/MenuActionAddnew/index.js +6 -0
  8. package/src/commons/Sharing/WrapHeaderScrollable.js +1 -1
  9. package/src/commons/SubUnit/DeviceTemplate/ConfigValue/ConfigValue.js +2 -8
  10. package/src/commons/SubUnit/DeviceTemplate/EvaluationOverConfig/EvaluationOverConfig.js +2 -10
  11. package/src/commons/SubUnit/OneTap/ItemOneTap.js +4 -3
  12. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +14 -1
  13. package/src/commons/SubUnit/ShortDetail.js +14 -4
  14. package/src/configs/API.js +10 -0
  15. package/src/configs/AccessibilityLabel.js +3 -0
  16. package/src/navigations/UnitStack.js +10 -2
  17. package/src/screens/Automate/AddNewAction/SetupScriptNotify.js +92 -0
  18. package/src/screens/Automate/AddNewAction/Styles/SetupScriptNotifyStyles.js +57 -0
  19. package/src/screens/Automate/AddNewAction/__test__/SetupConfigCondition.test.js +13 -0
  20. package/src/screens/Automate/AddNewAction/__test__/SetupScriptNotify.test.js +84 -0
  21. package/src/screens/Automate/EditActionsList/__tests__/index.test.js +15 -4
  22. package/src/screens/Automate/EditActionsList/index.js +130 -72
  23. package/src/screens/Automate/ScriptDetail/Components/AddActionScript.js +168 -0
  24. package/src/screens/Automate/ScriptDetail/__test__/index.test.js +75 -6
  25. package/src/screens/Automate/ScriptDetail/index.js +147 -84
  26. package/src/screens/Device/__test__/mqttDetail.test.js +20 -20
  27. package/src/screens/Device/detail.js +1 -3
  28. package/src/screens/Sharing/{MemberList.js → UnitMemberList.js} +4 -4
  29. package/src/screens/Sharing/__test__/{MemberList.test.js → UnitMemberList.test.js} +2 -2
  30. package/src/screens/UnitSummary/__test__/index.test.js +2 -1
  31. package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +37 -30
  32. package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +105 -166
  33. package/src/screens/UnitSummary/components/AirQuality/SegmentedRoundChart.js +32 -0
  34. package/src/{commons/UnitSummary → screens/UnitSummary/components}/AirQuality/__test__/index.test.js +25 -15
  35. package/src/{commons/UnitSummary → screens/UnitSummary/components}/AirQuality/index.js +55 -71
  36. package/src/{commons/UnitSummary → screens/UnitSummary/components}/AirQuality/styles.js +1 -2
  37. package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +26 -20
  38. package/src/screens/UnitSummary/components/PowerConsumption/index.js +59 -87
  39. package/src/screens/UnitSummary/components/RunningDevices/index.js +27 -23
  40. package/src/screens/UnitSummary/components/Temperature/ItemTemperature/index.js +33 -20
  41. package/src/screens/UnitSummary/components/Temperature/index.js +52 -79
  42. package/src/screens/UnitSummary/components/UvIndex/SegmentedRoundChart.js +36 -0
  43. package/src/screens/UnitSummary/components/UvIndex/__test__/index.test.js +8 -0
  44. package/src/screens/UnitSummary/components/UvIndex/index.js +16 -72
  45. package/src/screens/UnitSummary/components/UvIndex/styles.js +48 -0
  46. package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +6 -4
  47. package/src/screens/UnitSummary/components/WaterQuality/__test__/index.test.js +26 -12
  48. package/src/screens/UnitSummary/components/WaterQuality/index.js +93 -3
  49. package/src/screens/UnitSummary/index.js +1 -9
  50. package/src/utils/I18n/translations/en.js +16 -1
  51. package/src/utils/I18n/translations/vi.js +15 -1
  52. package/src/utils/Route/index.js +1 -0
  53. package/src/screens/UnitSummary/components/PowerConsumption/ItemPower/index.js +0 -53
  54. package/src/screens/UnitSummary/components/PowerConsumption/__test__/ItemPower.test.js +0 -20
@@ -179,6 +179,8 @@ export default {
179
179
  text_temperature: 'Nhiệt độ',
180
180
  text_wind: 'Gió',
181
181
  text_rain: 'Mưa',
182
+ rainy: 'Có mưa',
183
+ no_rain: 'Không mưa',
182
184
  text_win_direction: 'Hướng gió',
183
185
  text_good: 'Tốt',
184
186
  text_moderate: 'Trung bình',
@@ -739,6 +741,11 @@ export default {
739
741
  ok_and_got_it: 'Tôi đã hiểu',
740
742
  notify_back: 'Bạn có chắc chắn trở lại ko?',
741
743
  notifications: 'Thông báo',
744
+ notification: 'Thông báo',
745
+ send_notification: 'Gửi thông báo',
746
+ title_notification: 'Chủ đề: “Cảnh báo”',
747
+ message_notification:
748
+ 'Nội dung cảnh báo: “Nhiệt độ tại phòng làm việc đang cao vui lòng kiểm tra.”',
742
749
  promotions: 'Ưu đãi',
743
750
  news: 'Tin tức',
744
751
  system: 'Hệ thống',
@@ -1024,9 +1031,10 @@ export default {
1024
1031
  action: 'hành động',
1025
1032
  power: 'Nguồn điện',
1026
1033
  actions_list: 'Dánh sách hành động',
1027
- delette_action: 'Xoá hành động ?',
1034
+ delete_action: 'Xoá hành động ?',
1028
1035
  message_delete_action:
1029
1036
  'Bạn có chắc chắn muốn xóa hành động của {actionName} trong {stationName} không ?',
1037
+ message_delete_notify: 'Bạn có chắc chắn muốn xóa gửi thông báo không?',
1030
1038
  add_script: 'Thêm Kịch Bản',
1031
1039
  delete_script: 'Xóa kịch bản',
1032
1040
  title_delete_script: 'Xóa kịch bản "{scriptName}"?',
@@ -1051,6 +1059,12 @@ export default {
1051
1059
  update_smart: 'Cập nhật thông minh',
1052
1060
  automate: 'Tự động',
1053
1061
  smart: 'Thông minh',
1062
+ enable_this_script: 'Kích hoạt kịch bản này',
1063
+ this_script_has_been_disabled: 'Kịch bản này đã bị vô hiệu hoá',
1064
+ control_device: 'Thiết bị điều khiển',
1065
+ send_email: 'Gửi e-mail',
1066
+ send_app_notification: 'Gửi thông báo qua ứng dụng',
1067
+ delay_the_action: 'Trì hoãn hành động',
1054
1068
  smart_account: 'Tài khoản thông minh',
1055
1069
  delete_smart_account: 'Xóa tài khoản thông minh',
1056
1070
  end_device_not_support_script:
@@ -133,6 +133,7 @@ const Routes = {
133
133
  SetupConfigCondition: 'SetupConfigCondition',
134
134
  AddAutomationTypeSmart: 'AddAutomationTypeSmart',
135
135
  AddUnknownTypeSmart: 'AddUnknownTypeSmart',
136
+ SetupScriptNotify: 'SetupScriptNotify',
136
137
  ScenarioName: 'ScenarioName',
137
138
  ValueChangeName: 'ValueChangeName',
138
139
  AllCamera: 'AllCamera',
@@ -1,53 +0,0 @@
1
- import React, { memo } from 'react';
2
- import { View, StyleSheet } from 'react-native';
3
-
4
- import Text from '../../../../../commons/Text';
5
- import { Colors } from '../../../../../configs';
6
-
7
- const ItemPower = memo((props) => {
8
- const { svg, title, des, time, value } = props;
9
- return (
10
- <View style={styles.container}>
11
- {svg}
12
- <View style={styles.content}>
13
- <View style={styles.boxInfo}>
14
- <Text size={16} color={Colors.Gray9} style={styles.textMarginBottom}>
15
- {title}
16
- </Text>
17
- <Text size={14} color={Colors.Gray8} style={styles.textMarginBottom}>
18
- {des}
19
- </Text>
20
- <Text size={14} color={Colors.Gray8}>
21
- {time}
22
- </Text>
23
- </View>
24
- <Text size={14} color={Colors.Gray8}>
25
- {value}
26
- </Text>
27
- </View>
28
- </View>
29
- );
30
- });
31
-
32
- export default ItemPower;
33
-
34
- const styles = StyleSheet.create({
35
- container: {
36
- flexDirection: 'row',
37
- paddingTop: 16,
38
- },
39
- content: {
40
- flexDirection: 'row',
41
- paddingBottom: 16,
42
- flex: 1,
43
- marginLeft: 16,
44
- borderBottomWidth: 1,
45
- borderBottomColor: Colors.Gray4,
46
- },
47
- boxInfo: {
48
- flex: 1,
49
- },
50
- textMarginBottom: {
51
- marginBottom: 4,
52
- },
53
- });
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import { act, create } from 'react-test-renderer';
3
- import Text from '../../../../../commons/Text';
4
- import ItemPower from '../ItemPower';
5
-
6
- describe('test ItemPower', () => {
7
- it('render', async () => {
8
- let tree;
9
- let data = { svg: '', title: 'Title item', des: '', time: '', value: '' };
10
-
11
- await act(async () => {
12
- tree = await create(<ItemPower {...data} />);
13
- });
14
-
15
- const instance = tree.root;
16
- const texts = instance.findAllByType(Text);
17
- expect(texts).toHaveLength(4);
18
- expect(texts[0].props.children).toEqual('Title item');
19
- });
20
- });