@eohjsc/react-native-smart-city 0.2.86 → 0.2.89

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 (126) hide show
  1. package/assets/images/Common/Calendar.svg +3 -0
  2. package/assets/images/Common/SmartPhone.svg +3 -0
  3. package/assets/images/Hanet/CaptureFaceID.svg +25 -0
  4. package/assets/images/Hanet/FaceFrame.svg +6 -0
  5. package/assets/images/brightnessBlack.svg +12 -0
  6. package/index.js +4 -0
  7. package/package.json +3 -3
  8. package/src/Images/SmartIr/AC.svg +14 -0
  9. package/src/Images/SmartIr/DIY.svg +3 -0
  10. package/src/Images/SmartIr/Fan.svg +10 -0
  11. package/src/Images/SmartIr/Fridge.svg +5 -0
  12. package/src/Images/SmartIr/Remote.svg +15 -0
  13. package/src/Images/SmartIr/SmartIr.svg +4 -0
  14. package/src/Images/SmartIr/TV.svg +10 -0
  15. package/src/Images/SmartIr/Union.svg +9 -0
  16. package/src/Images/SmartIr/WM.svg +11 -0
  17. package/src/Images/SmartIr/index.js +10 -0
  18. package/src/commons/ActionGroup/ColorPickerTemplate.js +51 -0
  19. package/src/commons/ActionGroup/ColorPickerTemplateStyles.js +17 -0
  20. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/AutoLockStyles.js +40 -0
  21. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +65 -0
  22. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapperStyles.js +43 -0
  23. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +48 -0
  24. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/index.js +57 -0
  25. package/src/commons/ActionGroup/{OnOffSmartLock.js → OnOffSmartLock/OnOffSmartLock.js} +5 -5
  26. package/src/commons/ActionGroup/{OnOffSmartLockStyle.js → OnOffSmartLock/OnOffSmartLockStyle.js} +1 -1
  27. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode.js +48 -0
  28. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscodeStyles.js +42 -0
  29. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/PasscodeListStyles.js +49 -0
  30. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +66 -0
  31. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +96 -0
  32. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/SetupGeneratePasscodeStyles.js +98 -0
  33. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +62 -0
  34. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/index.js +249 -0
  35. package/src/commons/ActionGroup/OnOffTemplate/index.js +4 -2
  36. package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +2 -1
  37. package/src/commons/ActionGroup/SliderRangeTemplate.js +64 -0
  38. package/src/commons/ActionGroup/{LightActionTemplateStyles.js → SliderRangeTemplateStyles.js} +0 -8
  39. package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +167 -186
  40. package/src/commons/ActionGroup/StatesGridActionTemplate.js +2 -1
  41. package/src/commons/ActionGroup/index.js +7 -4
  42. package/src/commons/BottomSheet/index.js +2 -1
  43. package/src/commons/Device/DisconnectedView.js +7 -1
  44. package/src/commons/Device/Hanet/ItemHanetDevice.js +109 -0
  45. package/src/commons/Device/HistoryChart.js +2 -2
  46. package/src/commons/Device/HorizontalBarChart.js +7 -0
  47. package/src/commons/Device/ItemDevice.js +18 -15
  48. package/src/commons/Device/LinearChart.js +14 -41
  49. package/src/commons/Device/__test__/DisconnectedView.test.js +13 -2
  50. package/src/commons/RowItem/index.js +12 -7
  51. package/src/commons/SubUnit/Favorites/index.js +2 -2
  52. package/src/commons/SubUnit/ShortDetail.js +39 -20
  53. package/src/commons/WheelDateTimePicker/index.js +18 -4
  54. package/src/configs/API.js +23 -1
  55. package/src/configs/Colors.js +1 -0
  56. package/src/configs/Constants.js +48 -0
  57. package/src/configs/SCConfig.js +1 -1
  58. package/src/context/actionType.ts +4 -0
  59. package/src/context/mockStore.ts +3 -0
  60. package/src/context/reducer.ts +20 -0
  61. package/src/iot/RemoteControl/Bluetooth.js +3 -22
  62. package/src/iot/RemoteControl/index.js +0 -1
  63. package/src/navigations/HanetCameraStack.js +41 -0
  64. package/src/navigations/SmartIrStack.js +31 -0
  65. package/src/navigations/SmartLockStack.js +51 -0
  66. package/src/navigations/UnitStack.js +46 -4
  67. package/src/screens/ActivityLog/hooks/index.js +1 -1
  68. package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +1 -1
  69. package/src/screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning.js +79 -72
  70. package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +155 -27
  71. package/src/screens/AddNewGateway/PlugAndPlay/__test__/ConnectWifiWarning.test.js +65 -0
  72. package/src/screens/AddNewGateway/PlugAndPlay/__test__/GatewayWifiList.test.js +26 -2
  73. package/src/screens/Device/__test__/detail.test.js +0 -10
  74. package/src/screens/Device/components/SensorConnectStatusViewHeader.js +13 -2
  75. package/src/screens/Device/detail.js +118 -38
  76. package/src/screens/Device/hooks/useDisconnectedDevice.js +28 -16
  77. package/src/screens/GuestInfo/components/AccessScheduleItem.js +9 -2
  78. package/src/screens/GuestInfo/components/RecurringDetail.js +3 -2
  79. package/src/screens/GuestInfo/components/TemporaryDetail.js +3 -2
  80. package/src/screens/GuestInfo/styles/AccessScheduleItemStyles.js +3 -0
  81. package/src/screens/HanetCamera/CaptureFaceID.js +210 -0
  82. package/src/screens/HanetCamera/Detail.js +252 -0
  83. package/src/screens/HanetCamera/ManageAccess.js +173 -0
  84. package/src/screens/HanetCamera/MemberInfo.js +208 -0
  85. package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +133 -0
  86. package/src/screens/HanetCamera/__test__/Detail.test.js +185 -0
  87. package/src/screens/HanetCamera/__test__/ManageAccess.test.js +152 -0
  88. package/src/screens/HanetCamera/__test__/MemberInfo.test.js +178 -0
  89. package/src/screens/HanetCamera/components/CheckinHeader.js +37 -0
  90. package/src/screens/HanetCamera/hooks/__test__/useHanetCheckinData.test.js +151 -0
  91. package/src/screens/HanetCamera/hooks/__test__/useHanetPlaceMembers.test.js +71 -0
  92. package/src/screens/HanetCamera/hooks/index.js +5 -0
  93. package/src/screens/HanetCamera/hooks/useHanetCheckinData.js +116 -0
  94. package/src/screens/HanetCamera/hooks/useHanetPlaceMembers.js +86 -0
  95. package/src/screens/HanetCamera/hooks/useStateAlertAction.js +62 -0
  96. package/src/screens/HanetCamera/styles/captureFaceIDStyles.js +50 -0
  97. package/src/screens/HanetCamera/styles/checkinHeaderStyles.js +24 -0
  98. package/src/screens/HanetCamera/styles/detailStyles.js +107 -0
  99. package/src/screens/HanetCamera/styles/manageAccessStyles.js +49 -0
  100. package/src/screens/HanetCamera/styles/memberInfoStyles.js +73 -0
  101. package/src/screens/HanetCamera/utils/Monitor.js +52 -0
  102. package/src/screens/Notification/__test__/NotificationItem.test.js +1 -0
  103. package/src/screens/Notification/components/NotificationItem.js +16 -0
  104. package/src/screens/SmartIr/__test__/ButtonsBottom.test.js +31 -0
  105. package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +80 -0
  106. package/src/screens/SmartIr/__test__/SelectBrand.test.js +65 -0
  107. package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +57 -0
  108. package/src/screens/SmartIr/__test__/SmartIr.test.js +1 -0
  109. package/src/screens/SmartIr/components/GroupButtonByType/ButtonsBottom.js +45 -0
  110. package/src/screens/SmartIr/components/GroupButtonByType/ButtonsBottomStyles.js +31 -0
  111. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +208 -0
  112. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByTypeStyles.js +113 -0
  113. package/src/screens/SmartIr/components/SelectBrand.js +61 -0
  114. package/src/screens/SmartIr/components/SelectBrandStyles.js +14 -0
  115. package/src/screens/SmartIr/components/SelectDeviceType.js +96 -0
  116. package/src/screens/SmartIr/components/SelectDeviceTypeStyles.js +30 -0
  117. package/src/screens/SmartIr/index.js +8 -3
  118. package/src/screens/Unit/Detail.js +7 -11
  119. package/src/screens/Unit/__test__/Detail.test.js +0 -10
  120. package/src/screens/Unit/components/MyUnitDevice/index.js +2 -4
  121. package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +38 -9
  122. package/src/utils/I18n/translations/en.json +51 -1
  123. package/src/utils/I18n/translations/vi.json +51 -1
  124. package/src/utils/Route/index.js +14 -1
  125. package/src/commons/ActionGroup/LightActionTemplate.js +0 -103
  126. package/src/commons/ActionGroup/__test__/LightActionTemplate.test.js +0 -59
@@ -1,33 +1,62 @@
1
1
  import React from 'react';
2
- import { View } from 'react-native';
2
+ import { View, TouchableOpacity } from 'react-native';
3
3
  import { act, create } from 'react-test-renderer';
4
4
  import { SCProvider } from '../../../../context';
5
5
  import { mockSCStore } from '../../../../context/mockStore';
6
6
  import MyUnitDevice from '../MyUnitDevice';
7
7
 
8
- const wrapComponent = (sensor) => (
8
+ const mockNavigate = jest.fn();
9
+ jest.mock('@react-navigation/native', () => {
10
+ return {
11
+ ...jest.requireActual('@react-navigation/native'),
12
+ useNavigation: () => ({
13
+ navigate: mockNavigate,
14
+ }),
15
+ };
16
+ });
17
+
18
+ const wrapComponent = (props) => (
9
19
  <SCProvider initState={mockSCStore({})}>
10
- <MyUnitDevice sensor={sensor} />
20
+ <MyUnitDevice {...props} />
11
21
  </SCProvider>
12
22
  );
13
23
 
14
24
  describe('Test MyUnitDevice', () => {
15
- let tree;
25
+ let tree, props;
26
+
27
+ beforeEach(() => {
28
+ props = {
29
+ sensor: {
30
+ status: 'Ok',
31
+ name: 'Test',
32
+ station_name: '',
33
+ },
34
+ unit: {
35
+ id: 1,
36
+ },
37
+ };
38
+ });
16
39
 
17
40
  it('Test render with status', async () => {
18
- await act(() => {
19
- tree = create(
20
- wrapComponent({ status: 'Ok', name: 'Test', station_name: '' })
21
- );
41
+ await act(async () => {
42
+ tree = await create(wrapComponent(props));
22
43
  });
23
44
  const instance = tree.root;
24
45
  const Views = instance.findAllByType(View);
25
46
  expect(Views).toHaveLength(10);
47
+
48
+ const touches = instance.findAllByType(TouchableOpacity);
49
+ expect(touches).toHaveLength(1);
50
+ await act(async () => {
51
+ await touches[0].props.onPress();
52
+ });
53
+ expect(mockNavigate).toHaveBeenCalled();
26
54
  });
27
55
 
28
56
  it('Test render without status', async () => {
57
+ props.sensor.status = undefined;
29
58
  await act(() => {
30
- tree = create(wrapComponent({ name: 'Test', station_name: '' }));
59
+ tree = create(wrapComponent(props));
31
60
  });
32
61
  const instance = tree.root;
33
62
  const Views = instance.findAllByType(View);
@@ -333,6 +333,11 @@
333
333
  "text_remove_sub_unit_fail": "Remove sub unit fail!",
334
334
  "camera": "Camera",
335
335
  "favorites": "Favorites",
336
+ "select_device_type": "Select device type",
337
+ "select_brand": "Select a brand",
338
+ "make_sure_3_button_available": "Please try to make sure more than 3 buttons is available",
339
+ "select_this_one": "Select this one",
340
+ "next_one": "Next one",
336
341
  "add_to_favorites": "Add to Favorites",
337
342
  "add_favorite": "Add Favorite",
338
343
  "remove_from_favorites": "Remove from Favorites",
@@ -340,6 +345,7 @@
340
345
  "add_new_device": "Add new device",
341
346
  "add_new_device_message_no_unit": "You cannot add new device. You have to add a new unit first.",
342
347
  "add_member": "Add member",
348
+ "add_new_member": "Add new member",
343
349
  "add_new_member_message_no_unit": "You cannot add new member. You have to add a new unit first.",
344
350
  "select_device": "Select Device",
345
351
  "select_sensor": "Select Sensor",
@@ -358,6 +364,7 @@
358
364
  "suggestions": "Suggestions",
359
365
  "check_the_power": "Check the power on your device.",
360
366
  "check_the_wifi": "Check the Wi-Fi/Cellular signal or try to reset it.",
367
+ "check_the_ble": "Check your Bluetooth status and try to use QUICK ACTION to control.",
361
368
  "disconnected": "Disconnected",
362
369
  "ggHomeDisconnected": "Google Home is disconnected",
363
370
  "rename_sub_unit": "Rename sub-unit",
@@ -682,6 +689,7 @@
682
689
  "text_notification_content_smoke": "Smoke appears in **%{unit_name}**. Please check your home and call the rescue team if there is a fire.",
683
690
  "text_notification_content_fire": "There is a fire at **%{unit_name}**, Please move out of the house immediately and call the rescue team.",
684
691
  "text_notification_content_active_sos": "SOS button is activating at **%{unit_name}**, Please check it NOW.",
692
+ "text_notification_content_replace_water_filter": "Filter **%{number_coil}** of **%{device_name}** in **%{unit_name}**: **%{sub_unit_name}** has less than 10h remaining. Check and replace now.",
685
693
  "text_notification_content_remove_unit_to_owner": "Unit **%{unit_name}** has been removed successfully.",
686
694
  "text_notification_content_remove_unit_to_member": "Unit **%{unit_name}** has been removed by **%{unit_owner_name}**. You cannot access to this unit anymore.",
687
695
  "text_notification_content_remove_member": "You were remove from **%{unit_name}** by **%{unit_owner_name}**. You cannot access to this unit anymore.",
@@ -849,6 +857,15 @@
849
857
  "higher_than": "higher than",
850
858
  "lower_than": "lower than",
851
859
  "equal": "equal",
860
+ "please": "Please",
861
+ "long_press": "Long press",
862
+ "the_button_to_study": "the button to study",
863
+ "point_at_center": "Point at center of the device",
864
+ "press": "Press",
865
+ "remote_control": "remote control",
866
+ "same_key": "same key",
867
+ "remained": "remained",
868
+ "detected_signal": "Tín hiệu đã phát hiện",
852
869
  "please_choose_condition_before_continue": "Please choose condition before continue!",
853
870
  "accept_invitation": "Accept invitation",
854
871
  "write_not_available":"Write not available",
@@ -918,9 +935,42 @@
918
935
  "error_share_permission": "{text} {data} does not exist!",
919
936
  "text_phone_share_permission": "The phone",
920
937
  "text_email_share_permission": "Email",
938
+ "mask_off": "Mask off",
939
+ "mask_on": "Mask on",
940
+ "stranger": "Stranger",
921
941
  "icon_unit": "Icon unit",
922
942
  "lock": "LOCK",
923
943
  "unlock": "UNLOCK",
924
944
  "door_is_open": "Door is open | unlocked",
925
- "door_is_close": "Door is close | locked"
945
+ "door_is_close": "Door is close | locked",
946
+ "member_info": "Member Information",
947
+ "set_photo_id": "Set photo ID",
948
+ "remove_member": "Remove Member",
949
+ "rename_member": "Rename Member",
950
+ "member_name": "Member's name",
951
+ "text_des_remove_hanet_member": "Are you sure you want to remove this member?",
952
+ "text_des_capture_face_id": "Capture identification face",
953
+ "begin": "Begin",
954
+ "text_des_locate_hanet_face_id": "Locate face in the frame",
955
+ "capture": "Capture",
956
+ "capture_again": "Capture again",
957
+ "finish": "Finish",
958
+ "capture_image": "Capture image",
959
+ "pick_available_image_from_your_phone": "Pick available image from your phone",
960
+ "setup_generate_passcode": "Setup generate passcode",
961
+ "choose_user": "Choose user",
962
+ "auto_lock": "Auto Lock",
963
+ "your_door_will_lock": "Your door will lock as soon as it is closed. If it hasn’t been opened, it will re-lock shortly after it’s unlocked.",
964
+ "auto_lock_enabled": "Auto-Lock Enabled",
965
+ "auto_lock_when": "Auto-Lock When",
966
+ "instant":"Instant",
967
+ "re_lock_timing": "Re-lock Timing",
968
+ "re_lock_will_lock": "Re-lock will lock your door if it has been unlocked, but not opened within specified time.",
969
+ "code": "Code",
970
+ "user": "User",
971
+ "create_time": "Create time",
972
+ "status": "Status",
973
+ "delete_passcode": "Delete Passcode",
974
+ "passcode_list": "Passcode list",
975
+ "search": "Search"
926
976
  }
@@ -347,6 +347,20 @@
347
347
  "choose_on_map": "Chọn trên bản đồ",
348
348
  "plan_and_zoom_to_adjust": "Di chuyển và phóng to để điều chỉnh",
349
349
  "add_remote_control": "Thêm điều khiển từ xa",
350
+ "select_device_type": "Chọn loại thiết bị",
351
+ "please": "Làm ơn",
352
+ "long_press": "nhấn giữ",
353
+ "the_button_to_study": "nút để học",
354
+ "point_at_center": "Chỉ vào trung tâm của thiết bị.",
355
+ "press": "Nhấn",
356
+ "remote_control": "điều khiển từ xa",
357
+ "same_key": "cùng một nút.",
358
+ "remained": "còn lại",
359
+ "detected_signal": "Tín hiệu đã phát hiện",
360
+ "select_brand": "Chọn một thương hiệu",
361
+ "make_sure_3_button_available": "Hãy cố gắng đảm bảo có nhiều hơn 3 nút",
362
+ "select_this_one": "Chọn cái này",
363
+ "next_one": "Tiếp theo",
350
364
  "manage_sub_unit": "Quản lý khu vực",
351
365
  "remove_sub_unit": "Xóa khu vực",
352
366
  "text_ble_is_powered_on": "Bluetooth đã được mở",
@@ -379,6 +393,7 @@
379
393
  "add_new_device": "Thêm thiết bị",
380
394
  "add_new_device_message_no_unit": "Để thêm thiết bị mới, trước tiên bạn cần tạo một địa điểm.",
381
395
  "add_member": "Thêm thành viên",
396
+ "add_new_member": "Thêm thành viên mới",
382
397
  "add_new_member_message_no_unit": "Để thêm thành viên mới, trước tiên bạn cần tạo một điạ điểm.",
383
398
  "select_device": "Lựa chọn thiết bị",
384
399
  "select_sensor": "Lựa chọn cảm biến",
@@ -397,6 +412,7 @@
397
412
  "suggestions": "Gợi ý",
398
413
  "check_the_power": "Kiểm tra lại nguồn điện của thiết bị.",
399
414
  "check_the_wifi": "Kiểm tra lại Wi-Fi/tín hiệu di động hoặc thử khởi động lại.",
415
+ "check_the_ble": "Kiểm tra trạng thái Bluetooth của bạn và thử sử dụng HÀNH ĐỘNG NHANH để điều khiển",
400
416
  "disconnected": "Ngắt kết nối",
401
417
  "ggHomeDisconnected": "Google Home bị ngắt kết nối",
402
418
  "rename_sub_unit": "Đổi tên khu vực",
@@ -690,6 +706,7 @@
690
706
  "text_notification_content_smoke": "Xuất hiện khói tại **%{unit_name}**. Vui lòng kiểm tra nhà của bạn và gọi cho đội cứu hộ nếu xảy ra hỏa hoạn.",
691
707
  "text_notification_content_fire": "Có đám cháy tại **%{unit_name}**, Vui lòng di chuyển ra khỏi nhà ngay lập tức và gọi cho đội cứu hộ.",
692
708
  "text_notification_content_active_sos": "Nút SOS đang kích hoạt tại **%{unit_name}**. Vui lòng kiểm tra nó NGAY BÂY GIỜ.",
709
+ "text_notification_content_replace_water_filter": "Lõi lọc **%{number_coil}** của **%{device_name}** thuộc **%{unit_name}**: **%{sub_unit_name}** còn ít hơn 10 giờ lọc. Vui lòng kiểm tra và thay lõi lọc mới.",
693
710
  "text_notification_content_remove_unit_to_owner": "Địa điểm **%{unit_name}** vừa được xoá thành công.",
694
711
  "text_notification_content_remove_unit_to_member": "Địa điểm **%{unit_name}** vừa được xoá bởi **%{unit_owner_name}**. Bạn không thể truy cập vào địa điểm này được nữa.",
695
712
  "text_notification_content_remove_member": "Bạn vừa được xoá khỏi **%{unit_name}** bởi **%{unit_owner_name}**. Bạn không thể truy cập vào địa điểm này được nữa.",
@@ -920,9 +937,42 @@
920
937
  "error_share_permission": "{text} {data} không tồn tại!",
921
938
  "text_phone_share_permission": "Số điện thoại",
922
939
  "text_email_share_permission": "Email",
940
+ "mask_off": "Không có khẩu trang",
941
+ "mask_on": "Có khẩu trang",
942
+ "stranger": "Người lạ",
923
943
  "icon_unit": "Ảnh đại diện địa điểm",
924
944
  "lock": "KHÓA",
925
945
  "unlock": "MỞ KHÓA",
926
946
  "door_is_open": "Cửa mở | mở khóa",
927
- "door_is_close": "Cửa đóng | bị khóa"
947
+ "door_is_close": "Cửa đóng | bị khóa",
948
+ "member_info": "Thông Tin Thành Viên",
949
+ "set_photo_id": "Chọn ảnh ID",
950
+ "remove_member": "Xóa Thành Viên",
951
+ "rename_member": "Đổi Tên Thành Viên",
952
+ "member_name": "Tên Thành Viên",
953
+ "text_des_remove_hanet_member": "Bạn có chắc chắn muốn xóa thành viên này không?",
954
+ "text_des_capture_face_id": "Chụp hình nhận diện khuôn mặt",
955
+ "begin": "Bắt đầu",
956
+ "text_des_locate_hanet_face_id": "Định vị khuôn mặt trong khung",
957
+ "capture": "Chụp",
958
+ "capture_again": "Chụp lại",
959
+ "finish": "Hoàn tất",
960
+ "capture_image": "Chụp ảnh",
961
+ "pick_available_image_from_your_phone": "Chọn ảnh có sẵn từ điện thoại",
962
+ "setup_generate_passcode": "Thiết lập tạo mật mã",
963
+ "choose_user": "Chọn người dùng",
964
+ "auto_lock": "khóa tự động",
965
+ "your_door_will_lock": "Cửa của bạn sẽ khóa ngay sau khi nó được đóng lại.Nếu nó chưa được mở,nó sẽ khóa lại ngay sau khi được mở khóa.",
966
+ "auto_lock_enabled": "Tự động khóa được bật",
967
+ "auto_lock_when": "Tự động khóa khi",
968
+ "instant":"Ngay lập tức",
969
+ "re_lock_timing": "Thời gian khóa lại",
970
+ "re_lock_will_lock": "Re-lock sẽ khóa cửa của bạn nếu nó đã được mở khóa, nhưng không được mở trong thời gian quy định.",
971
+ "code": "Mã số",
972
+ "user": "Người dùng",
973
+ "create_time": "Thời gian tạo",
974
+ "status": "Trạng thái",
975
+ "delete_passcode": "Xóa mật mã",
976
+ "passcode_list": "Danh sách mật mã",
977
+ "search": "Tìm kiếm"
928
978
  }
@@ -15,12 +15,18 @@ const Routes = {
15
15
  AddMemberStack: 'AddMemberStack',
16
16
  AddUnitStack: 'AddUnitStack',
17
17
  AddGatewayStack: 'AddGatewayStack',
18
+ SmartIrStack: 'SmartIrStack',
18
19
  EditSubUnit: 'EditSubUnit',
19
20
  Language: 'Language',
20
21
  MyAllUnit: 'MyAllUnit',
21
22
  SubUnit: 'SubUnit',
22
23
  SubUnitDetail: 'SubUnitDetail',
23
24
  DeviceDetail: 'DeviceDetail',
25
+ HanetCameraStack: 'HanetCameraStack',
26
+ HanetCameraDetail: 'HanetCameraDetail',
27
+ HanetManageAccess: 'HanetManageAccess',
28
+ HanetMemberInfo: 'HanetMemberInfo',
29
+ HanetCaptureFaceID: 'HanetCaptureFaceID',
24
30
  ListDevice: 'ListDevice',
25
31
  Sharing: 'Sharing',
26
32
  RunningDevices: 'RunningDevices',
@@ -129,7 +135,14 @@ const Routes = {
129
135
  ConfirmUnitDeletion: 'ConfirmUnitDeletion',
130
136
  SmartAccount: 'SmartAccount',
131
137
  SmartHomeDashboard: 'SmartHomeDashboard',
132
- SmartIrSelectDeviceType: 'SmartIrSelectDeviceType',
138
+ SetupGeneratePasscode: 'SetupGeneratePasscode',
139
+ SelectDeviceType: 'SelectDeviceType',
140
+ SelectBrand: 'SelectBrand',
141
+ GroupButtonByType: 'GroupButtonByType',
142
+ AutoLock: 'AutoLock',
143
+ SmartLockStack: 'SmartLockStack',
144
+ PasscodeList: 'PasscodeList',
145
+ ItemPasscode: 'ItemPasscode',
133
146
  };
134
147
 
135
148
  export default Routes;
@@ -1,103 +0,0 @@
1
- import React, { memo, useCallback, useState, useMemo } from 'react';
2
- import { Alert, View } from 'react-native';
3
- import { useTranslations } from '../../hooks/Common/useTranslations';
4
- import styles from './LightActionTemplateStyles';
5
- import Text from '../Text';
6
- import { Colors } from '../../configs';
7
- import { Card } from '../CardShadow';
8
- import ColorPicker from 'react-native-wheel-color-picker';
9
- import SvgBrightness from '../../../assets/images/brightness.svg';
10
- import Slider from 'react-native-slider';
11
- import OnOffButtonTemplate from './OnOffTemplate/OnOffButtonTemplate';
12
-
13
- const LightActionTemplate = memo(({ actionGroup, doAction, sensor }) => {
14
- const t = useTranslations();
15
- const { configuration, title } = actionGroup;
16
- const dataColor = useMemo(() => {
17
- return configuration?.config_color;
18
- }, [configuration]);
19
-
20
- const dataBrightness = useMemo(() => {
21
- return configuration?.config_brightness;
22
- }, [configuration]);
23
-
24
- const [valueComplete, setValueComplete] = useState(dataBrightness || 0);
25
- const [value, setValue] = useState(dataBrightness || 0);
26
- const [color, setColor] = useState(dataColor || '');
27
- const [isOn] = useState(true);
28
-
29
- const onChangeColor = useCallback(
30
- (color) => {
31
- setColor(color);
32
- Alert.alert(t('feature_under_development'));
33
- },
34
- [t]
35
- );
36
-
37
- const onChangeBrightness = useCallback(
38
- (value) => {
39
- setValueComplete(value);
40
- Alert.alert(t('feature_under_development'));
41
- },
42
- [t]
43
- );
44
-
45
- const triggerAction = useCallback(() => {
46
- Alert.alert(t('feature_under_development'));
47
- }, [t]);
48
-
49
- return (
50
- <View>
51
- <OnOffButtonTemplate
52
- isOn={isOn}
53
- triggerAction={triggerAction}
54
- actionGroup={actionGroup}
55
- isLight={true}
56
- />
57
- <Card title={!!title && t(title)}>
58
- <View style={styles.viewPickColor}>
59
- <ColorPicker
60
- style={styles.colorPicker}
61
- sliderHidden={true}
62
- swatches={false}
63
- color={color}
64
- onColorChangeComplete={(color) => onChangeColor(color)}
65
- thumbSize={16}
66
- />
67
- </View>
68
- <View style={styles.viewBrightness}>
69
- <View style={styles.LeftBrightness}>
70
- <SvgBrightness />
71
- <Text type="H4" style={styles.LeftTextBrightness}>
72
- {t('brightness')}
73
- </Text>
74
- </View>
75
- <View style={styles.RightBrightness}>
76
- <View style={styles.slider}>
77
- <Slider
78
- value={valueComplete}
79
- onSlidingComplete={(value) => onChangeBrightness(value)}
80
- onValueChange={(value) => setValue(value)}
81
- step={1}
82
- minimumValue={0}
83
- maximumValue={100}
84
- thumbTintColor={Colors.Gray3}
85
- minimumTrackTintColor={Colors.Primary}
86
- maximumTrackTintColor={Colors.Gray4}
87
- trackStyle={styles.trackSlider}
88
- thumbStyle={styles.thumbSlider}
89
- />
90
- </View>
91
- <View style={styles.valuePercent}>
92
- <Text type="Label" style={styles.textValuePercent}>
93
- {`${value || 0}%`}
94
- </Text>
95
- </View>
96
- </View>
97
- </View>
98
- </Card>
99
- </View>
100
- );
101
- });
102
-
103
- export default LightActionTemplate;
@@ -1,59 +0,0 @@
1
- import React from 'react';
2
- import renderer, { act } from 'react-test-renderer';
3
- import Slider from 'react-native-slider';
4
- import ColorPicker from 'react-native-wheel-color-picker';
5
-
6
- import LightActionTemplate from '../LightActionTemplate';
7
- import { SCProvider } from '../../../context';
8
- import { mockSCStore } from '../../../context/mockStore';
9
-
10
- const wrapComponent = (actionGroup) => (
11
- <SCProvider initState={mockSCStore({})}>
12
- <LightActionTemplate actionGroup={actionGroup} doAction={jest.fn()} />
13
- </SCProvider>
14
- );
15
-
16
- describe('Test CurtainButtonTemplate', () => {
17
- const actionGroup = {
18
- configuration: {
19
- action: 'b1be40f2-f482-4796-8c1a-0431ab49ab5a',
20
- action_data: {
21
- color: '#00979D',
22
- command_prefer_over_bluetooth: true,
23
- command_prefer_over_googlehome: false,
24
- command_prefer_over_internet: false,
25
- googlehome_actions: [Array],
26
- icon: '123231',
27
- icon_kit: null,
28
- id: 5,
29
- key: 'b1be40f2-f482-4796-8c1a-0431ab49ab5a',
30
- lg_actions: [Array],
31
- name: 'change color',
32
- },
33
- config_brightness: 18,
34
- config_color: 17,
35
- },
36
- id: 2,
37
- template: 'light_action_template',
38
- title: 'controller',
39
- };
40
-
41
- let wrapper;
42
-
43
- test('render LightActionTemplate', async () => {
44
- await act(() => {
45
- wrapper = renderer.create(wrapComponent(actionGroup));
46
- });
47
- const instance = wrapper.root;
48
- const slider = instance.findAllByType(Slider);
49
- const colorPicker = instance.findAllByType(ColorPicker);
50
- expect(slider.length).toEqual(1);
51
- expect(colorPicker.length).toEqual(1);
52
- await act(async () => {
53
- await slider[0].props.onSlidingComplete();
54
- });
55
- await act(async () => {
56
- await colorPicker[0].props.onColorChangeComplete();
57
- });
58
- });
59
- });