@eohjsc/react-native-smart-city 0.3.91 → 0.3.93

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 (237) hide show
  1. package/package.json +5 -1
  2. package/src/Images/Common/reorder.svg +3 -0
  3. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/AutoLockStyles.js +1 -1
  4. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +3 -1
  5. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/index.js +3 -3
  6. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +3 -10
  7. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +1 -0
  8. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/SetupGeneratePasscodeStyles.js +1 -1
  9. package/src/commons/ActionGroup/OnOffTemplate/SwitchButtonTemplate.js +13 -5
  10. package/src/commons/ActionGroup/SliderRangeTemplate.js +100 -69
  11. package/src/commons/ActionGroup/SliderRangeTemplateStyles.js +27 -27
  12. package/src/commons/ActionGroup/StatesGridActionTemplate.js +4 -1
  13. package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +4 -1
  14. package/src/commons/ActionGroup/__test__/SliderRangeTemplate.test.js +56 -0
  15. package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +2 -2
  16. package/src/commons/ActionGroup/__test__/SwitchButtonTemplate.test.js +45 -8
  17. package/src/commons/ActionGroup/__test__/index.test.js +0 -19
  18. package/src/commons/ActionGroup/index.js +0 -3
  19. package/src/commons/ActionTemplate/CurtainAction.js +3 -3
  20. package/src/commons/ActionTemplate/CurtainActionStyles.js +1 -1
  21. package/src/commons/ActionTemplate/OnOffButtonAction.js +2 -2
  22. package/src/commons/ActionTemplate/OnOffButtonActionStyles.js +1 -1
  23. package/src/commons/ActionTemplate/OnOffSimpleAction.js +2 -2
  24. package/src/commons/ActionTemplate/OnOffSimpleActionStyles.js +1 -1
  25. package/src/commons/ActionTemplate/OnOffSmartLockAction.js +2 -2
  26. package/src/commons/ActionTemplate/OnOffSmartLockActionStyles.js +1 -1
  27. package/src/commons/ActionTemplate/OneButtonAction.js +1 -1
  28. package/src/commons/ActionTemplate/OneButtonActionStyles.js +1 -1
  29. package/src/commons/ActionTemplate/ThreeButtonAction.js +3 -3
  30. package/src/commons/ActionTemplate/ThreeButtonActionStyles.js +1 -1
  31. package/src/commons/AlertAction/index.js +5 -0
  32. package/src/commons/Auth/AccountList.js +1 -1
  33. package/src/commons/Auth/__test__/OtpInputList.test.js +13 -17
  34. package/src/commons/Automate/ItemAutomate.js +10 -4
  35. package/src/commons/Automate/__test__/ItemAutomate.test.js +11 -11
  36. package/src/commons/BottomButtonView/index.js +22 -4
  37. package/src/commons/Button/index.js +5 -0
  38. package/src/commons/Device/ConnectedViewHeader.js +0 -1
  39. package/src/commons/Device/DeviceAlertStatus.js +2 -1
  40. package/src/commons/Device/Emergency/EmergencyDetail.js +4 -2
  41. package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +4 -2
  42. package/src/commons/Device/ProgressBar/index.js +7 -11
  43. package/src/commons/Device/ProgressBar/styles.js +9 -4
  44. package/src/commons/Device/WindSpeed/Anemometer/index.js +3 -1
  45. package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +14 -1
  46. package/src/commons/Device/WindSpeed/LinearChart/index.js +4 -2
  47. package/src/commons/FlatListDnD/__test__/index.test.js +49 -0
  48. package/src/commons/FlatListDnD/index.js +37 -0
  49. package/src/commons/FlatListDnD/styles.js +12 -0
  50. package/src/commons/Form/__test__/TextInput.test.js +1 -1
  51. package/src/commons/Header/HeaderCustom.js +10 -19
  52. package/src/commons/HorizontalPicker/index.js +65 -38
  53. package/src/commons/IconComponent/index.js +3 -2
  54. package/src/commons/MediaPlayer/__test__/index.test.js +8 -3
  55. package/src/commons/MediaPlayer/index.js +11 -7
  56. package/src/commons/MenuActionMore/index.js +6 -4
  57. package/src/commons/Modal/ModalBottom.js +2 -3
  58. package/src/commons/Modal/ModalCustom.js +2 -3
  59. package/src/commons/NavBar/index.js +48 -50
  60. package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +1 -1
  61. package/src/commons/OneTapTemplate/NumberUpDownActionTemplateStyles.js +1 -1
  62. package/src/commons/OneTapTemplate/OptionsDropdownActionTemplate.js +1 -1
  63. package/src/commons/OneTapTemplate/OptionsDropdownActionTemplateStyles.js +1 -1
  64. package/src/commons/OneTapTemplate/StatesGridActionTemplate.js +1 -1
  65. package/src/commons/OneTapTemplate/StatesGridActionTemplateStyles.js +1 -1
  66. package/src/commons/PreventAccess/index.js +1 -1
  67. package/src/commons/Sharing/StationDevicePermissions.js +4 -4
  68. package/src/commons/Sharing/WrapHeaderScrollable.js +5 -5
  69. package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +2 -2
  70. package/src/commons/SubUnit/OneTap/ItemOneTap.js +12 -59
  71. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +16 -20
  72. package/src/commons/SubUnit/OneTap/index.js +20 -7
  73. package/src/commons/UnitSummary/AirQuality/__test__/index.test.js +4 -0
  74. package/src/commons/UnitSummary/ConfigHistoryChart/__test__/ConfigHistoryChart.test.js +1 -1
  75. package/src/commons/ViewButtonBottom/index.js +32 -4
  76. package/src/configs/API.js +9 -0
  77. package/src/configs/AccessibilityLabel.js +2 -0
  78. package/src/configs/BLE.js +1 -0
  79. package/src/configs/Colors.js +1 -1
  80. package/src/configs/Constants.js +12 -18
  81. package/src/context/actionType.ts +2 -1
  82. package/src/context/mockStore.ts +1 -0
  83. package/src/context/reducer.ts +12 -1
  84. package/src/hooks/Common/__test__/useStatusbar.test.js +5 -5
  85. package/src/hooks/Common/index.js +0 -2
  86. package/src/hooks/Common/useKeyboardShow.js +4 -4
  87. package/src/hooks/Common/useStatusBar.js +2 -2
  88. package/src/hooks/Common/useTitleHeader.js +5 -7
  89. package/src/hooks/Explore/useKeyboardAnimated.js +10 -4
  90. package/src/hooks/IoT/__test__/useRemoteControl.test.js +11 -0
  91. package/src/hooks/IoT/useBluetoothConnection.js +20 -29
  92. package/src/hooks/index.js +1 -2
  93. package/src/hooks/useMqtt.js +95 -0
  94. package/src/iot/Monitor.js +2 -1
  95. package/src/iot/RemoteControl/Bluetooth.js +56 -19
  96. package/src/iot/RemoteControl/__test__/Bluetooth.test.js +140 -0
  97. package/src/iot/mqtt.js +233 -0
  98. package/src/navigations/UnitStack.js +44 -12
  99. package/src/screens/AddLocationMaps/index.js +18 -16
  100. package/src/screens/AddLocationMaps/indexStyle.js +3 -0
  101. package/src/screens/AddNewGateway/SelectDeviceSubUnit.js +1 -2
  102. package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +5 -17
  103. package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +5 -13
  104. package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +9 -11
  105. package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +6 -14
  106. package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +6 -14
  107. package/src/screens/AddNewGateway/hooks/__Tests__/useWifiManage.test.js +3 -2
  108. package/src/screens/AddNewGateway/index.js +1 -1
  109. package/src/screens/AllCamera/index.js +2 -3
  110. package/src/screens/AllGateway/DetailConfigActionZigbee/__test__/index.test.js +0 -18
  111. package/src/screens/AllGateway/DetailConfigActionZigbee/index.js +1 -1
  112. package/src/screens/AllGateway/DeviceModbusDetail/__test__/index.test.js +5 -2
  113. package/src/screens/AllGateway/hooks/__test__/index.test.js +1 -1
  114. package/src/screens/{AddNewAction → Automate/AddNewAction}/ChooseAction.js +78 -119
  115. package/src/screens/{AddNewAction → Automate/AddNewAction}/ChooseConfig.js +45 -73
  116. package/src/screens/{AddNewAction → Automate/AddNewAction}/Components/LoadingSelectAction.js +1 -1
  117. package/src/screens/{AddNewAction → Automate/AddNewAction}/Components/SelectDevices.js +3 -3
  118. package/src/screens/{AddNewAction → Automate/AddNewAction}/Device/DeviceStyles.js +5 -1
  119. package/src/screens/{AddNewAction → Automate/AddNewAction}/Device/__test__/index.test.js +3 -3
  120. package/src/screens/{AddNewAction → Automate/AddNewAction}/Device/index.js +5 -4
  121. package/src/screens/{AddNewAction → Automate/AddNewAction}/NewActionWrapper.js +5 -7
  122. package/src/screens/{AddNewAction → Automate/AddNewAction}/SelectControlDevices.js +11 -49
  123. package/src/screens/{AddNewAction → Automate/AddNewAction}/SelectMonitorDevices.js +10 -42
  124. package/src/screens/{AddNewAction → Automate/AddNewAction}/SetupConfigCondition.js +52 -101
  125. package/src/screens/{AddNewAction → Automate/AddNewAction}/Styles/SelectActionStyles.js +1 -1
  126. package/src/screens/{AddNewAction → Automate/AddNewAction}/Styles/SelectSensorDevicesStyles.js +1 -1
  127. package/src/screens/{AddNewAction → Automate/AddNewAction}/Styles/SetupSensorStyles.js +4 -2
  128. package/src/screens/{AddNewAction → Automate/AddNewAction}/__test__/ChooseAction.test.js +10 -11
  129. package/src/screens/{AddNewAction → Automate/AddNewAction}/__test__/ChooseConfig.test.js +26 -27
  130. package/src/screens/{AddNewAction → Automate/AddNewAction}/__test__/SelectControlDevices.test.js +9 -9
  131. package/src/screens/{AddNewAction → Automate/AddNewAction}/__test__/SelectMonitorDevices.test.js +5 -5
  132. package/src/screens/{AddNewAction → Automate/AddNewAction}/__test__/SetupSensor.test.js +52 -16
  133. package/src/screens/Automate/AddNewAutoSmart/AddAutomationTypeSmart.js +25 -0
  134. package/src/screens/Automate/AddNewAutoSmart/AddTypeSmart.js +78 -0
  135. package/src/screens/Automate/AddNewAutoSmart/AddUnknownTypeSmart.js +29 -0
  136. package/src/screens/{AddNewAutoSmart → Automate/AddNewAutoSmart}/__test__/AddNewAutoSmart.test.js +18 -41
  137. package/src/screens/{AddNewAutoSmart → Automate/AddNewAutoSmart}/styles/AddNewAutoSmartStyles.js +1 -1
  138. package/src/screens/Automate/Components/InputName.js +64 -0
  139. package/src/screens/{AddNewOneTap/AddNewOneTapStyles.js → Automate/Components/InputNameStyles.js} +3 -3
  140. package/src/screens/{EditActionsList → Automate/EditActionsList}/Styles/indexStyles.js +5 -1
  141. package/src/screens/{EditActionsList → Automate/EditActionsList}/__tests__/index.test.js +17 -31
  142. package/src/screens/{EditActionsList → Automate/EditActionsList}/index.js +49 -51
  143. package/src/screens/Automate/MultiUnits.js +69 -67
  144. package/src/screens/Automate/OneTap/__test__/AddNewOneTap.test.js +134 -0
  145. package/src/screens/Automate/OneTap/index.js +16 -0
  146. package/src/screens/Automate/Scenario/ScenarioName.js +15 -0
  147. package/src/screens/{AddNewOneTap → Automate/Scenario}/__test__/AddNewOneTap.test.js +27 -45
  148. package/src/screens/Automate/ScriptDetail/Components/DeleteScript.js +45 -0
  149. package/src/screens/Automate/ScriptDetail/Components/RenameScript.js +58 -0
  150. package/src/screens/{ScriptDetail → Automate/ScriptDetail}/Styles/indexStyles.js +1 -1
  151. package/src/screens/{ScriptDetail → Automate/ScriptDetail}/__test__/index.test.js +110 -74
  152. package/src/screens/{ScriptDetail → Automate/ScriptDetail}/__test__/useStarredScript.test.js +7 -6
  153. package/src/screens/{ScriptDetail → Automate/ScriptDetail}/hooks/useStarredScript.js +4 -4
  154. package/src/screens/Automate/ScriptDetail/index.js +360 -0
  155. package/src/screens/{ScriptDetail → Automate/ScriptDetail}/utils.js +32 -31
  156. package/src/screens/{SetSchedule → Automate/SetSchedule}/__test__/SelectWeekday.test.js +2 -2
  157. package/src/screens/{SetSchedule → Automate/SetSchedule}/__test__/index.test.js +21 -46
  158. package/src/screens/{SetSchedule → Automate/SetSchedule}/components/RepeatOptionsPopup.js +4 -4
  159. package/src/screens/{SetSchedule → Automate/SetSchedule}/components/RowItem.js +2 -2
  160. package/src/screens/{SetSchedule → Automate/SetSchedule}/components/SelectWeekday.js +3 -3
  161. package/src/screens/Automate/SetSchedule/index.js +140 -0
  162. package/src/screens/{SetSchedule → Automate/SetSchedule}/styles/RepeatOptionsPopupStyles.js +1 -1
  163. package/src/screens/{SetSchedule → Automate/SetSchedule}/styles/RowItemStyles.js +1 -1
  164. package/src/screens/{SetSchedule → Automate/SetSchedule}/styles/SelectWeekdayStyles.js +1 -1
  165. package/src/screens/{SetSchedule → Automate/SetSchedule}/styles/indexStyles.js +1 -1
  166. package/src/screens/Automate/ValueChange/ValueChangeName.js +16 -0
  167. package/src/screens/Automate/__test__/MultiUnits.test.js +77 -121
  168. package/src/screens/Automate/__test__/index.test.js +3 -10
  169. package/src/screens/Automate/constants.js +0 -0
  170. package/src/screens/Automate/index.js +12 -23
  171. package/src/screens/ChangePosition/__test__/index.test.js +75 -0
  172. package/src/screens/ChangePosition/index.js +112 -0
  173. package/src/screens/ChangePosition/styles.js +87 -0
  174. package/src/screens/Device/__test__/detail.test.js +203 -258
  175. package/src/screens/Device/__test__/mqttDetail.test.js +599 -0
  176. package/src/screens/Device/__test__/sensorDisplayItem.test.js +4 -0
  177. package/src/screens/Device/components/SensorDisplayItem.js +3 -8
  178. package/src/screens/Device/components/VisualChart.js +55 -8
  179. package/src/screens/Device/detail.js +78 -30
  180. package/src/screens/Device/hooks/__test__/useEmergencyButton.test.js +35 -13
  181. package/src/screens/Device/hooks/useDeviceWatchConfigControl.js +13 -3
  182. package/src/screens/Device/hooks/useEvaluateValue.js +20 -2
  183. package/src/screens/Device/styles.js +7 -0
  184. package/src/screens/GuestInfo/components/__test__/AccessScheduleSheet.test.js +52 -0
  185. package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +18 -13
  186. package/src/screens/Notification/__test__/Notification.test.js +1 -1
  187. package/src/screens/PlayBackCamera/index.js +2 -3
  188. package/src/screens/SelectUnit/__test__/index.test.js +8 -13
  189. package/src/screens/SharedUnit/index.js +5 -4
  190. package/src/screens/Sharing/SelectUser.js +2 -2
  191. package/src/screens/Sharing/__test__/MemberList.test.js +9 -15
  192. package/src/screens/Sharing/__test__/MemberList2.test.js +10 -16
  193. package/src/screens/Sharing/__test__/SelectUser.test.js +8 -4
  194. package/src/screens/SideMenuDetail/SideMenuDetailStyles.js +1 -1
  195. package/src/screens/SmartAccount/__test__/SmartAccount.test.js +8 -4
  196. package/src/screens/SmartAccount/index.js +9 -9
  197. package/src/screens/SmartAccount/style.js +8 -7
  198. package/src/screens/SubUnit/ManageSubUnit.js +4 -4
  199. package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +9 -28
  200. package/src/screens/TDSGuide/index.js +1 -1
  201. package/src/screens/Template/GatewayList.js +4 -1
  202. package/src/screens/Template/__test__/detail.test.js +14 -20
  203. package/src/screens/Template/detail.js +1 -0
  204. package/src/screens/UVIndexGuide/index.js +2 -2
  205. package/src/screens/Unit/Detail.js +10 -24
  206. package/src/screens/Unit/SelectAddToFavorites.js +1 -1
  207. package/src/screens/Unit/Summaries.js +6 -17
  208. package/src/screens/Unit/__test__/ChooseLocation.test.js +8 -13
  209. package/src/screens/Unit/__test__/Detail.test.js +3 -1
  210. package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +1 -1
  211. package/src/screens/Unit/__test__/SmartAccount.test.js +8 -14
  212. package/src/screens/Unit/__test__/Summaries.test.js +2 -2
  213. package/src/screens/UnitSummary/components/UvIndex/__test__/index.test.js +4 -0
  214. package/src/screens/UnitSummary/components/WaterQuality/__test__/index.test.js +6 -11
  215. package/src/screens/WaterQualityGuide/index.js +10 -5
  216. package/src/utils/FactoryGateway.js +525 -0
  217. package/src/utils/I18n/translations/en.json +28 -19
  218. package/src/utils/I18n/translations/vi.json +26 -20
  219. package/src/utils/Route/index.js +5 -1
  220. package/src/utils/Utils.js +40 -0
  221. package/src/utils/__test__/Utils.test.js +6 -0
  222. package/src/commons/ActionGroup/CurtainButtonTemplate.js +0 -130
  223. package/src/commons/ActionGroup/__test__/CurtainButtonTemplate.test.js +0 -109
  224. package/src/commons/Auth/SocialButton.js +0 -54
  225. package/src/commons/Auth/__test__/SocialButton.test.js +0 -46
  226. package/src/commons/Device/SensorConnectedStatus.js +0 -56
  227. package/src/commons/Device/__test__/SensorConnectedStatus.test.js +0 -29
  228. package/src/commons/Sharing/__test__/StationDevicePermission.test.js +0 -85
  229. package/src/hooks/__test__/useInitDeepLink.test.js +0 -28
  230. package/src/hooks/useInitDeepLink.js +0 -25
  231. package/src/screens/AddNewAutoSmart/index.js +0 -149
  232. package/src/screens/AddNewOneTap/index.js +0 -156
  233. package/src/screens/ScriptDetail/hooks/index.js +0 -136
  234. package/src/screens/ScriptDetail/index.js +0 -446
  235. package/src/screens/SetSchedule/index.js +0 -200
  236. /package/src/screens/{AddNewAction → Automate/AddNewAction}/Components/index.js +0 -0
  237. /package/src/screens/{AddNewAction → Automate/AddNewAction}/__test__/LoadingSelectAction.test.js +0 -0
@@ -784,7 +784,7 @@
784
784
  "modbus_fail": "Modbus failrate",
785
785
  "rssi_node": "RSSI Node",
786
786
  "please_add_your_phone_number_and_chip_name": "Vui lòng thêm số điện thoại và tên chip của bạn",
787
- "Please_add_gateway_name" : "Vui lòng thêm tên gateway",
787
+ "Please_add_gateway_name": "Vui lòng thêm tên gateway",
788
788
  "phone_number_of_data_sim": "Số điện thoại của dữ liệu sim",
789
789
  "select_a_sub_unit": "Lựa chọn một khu vực",
790
790
  "all_camera": "All Cameras",
@@ -862,7 +862,7 @@
862
862
  "equal": "bằng",
863
863
  "please_choose_condition_before_continue": "Vui lòng chọn điều kiện trước khi tiếp tục!",
864
864
  "accept_invitation": "Chấp nhận lời mời",
865
- "write_not_available":"Ghi không sẵn dùng",
865
+ "write_not_available": "Ghi không sẵn dùng",
866
866
  "invalid_phone_number_or_email": "Số điện thoại hoặc email không hợp lệ",
867
867
  "phone_number_or_email": "Số điện thoại hoặc email",
868
868
  "quick_button_create_at_dashboard": "Tạo nút nhanh trên bảng điều khiển",
@@ -883,6 +883,7 @@
883
883
  "connected_via_internet": "Đã kết nối điều khiển thông qua Internet",
884
884
  "name_your_unit": "Đặt tên cho khu vực của bạn",
885
885
  "script_updated_by": "Kịch bản được cập nhật bởi",
886
+ "only_owner_has_permission_to_edit_this_script": "Chỉ chủ sở hữu mới có quyền chỉnh sửa kịch bản này",
886
887
  "qr_scan_guidelines": "Mã QR sẽ được phát hiện tự động khi nó được định vị trong các dòng hướng dẫn.",
887
888
  "move_to_another_sub_unit": "Chuyển sang khu vực khác",
888
889
  "now_playing": "Đang chạy",
@@ -914,7 +915,7 @@
914
915
  "choose_at_least_one": "Vui lòng chọn ít nhất 1 thiết bị.",
915
916
  "confirmation": "Xác Nhận",
916
917
  "enter_yes_to_perform": "Bạn cần nhập 'YES' để thực hiện hành động này",
917
- "please_enter_correct":"Vui lòng nhập đúng",
918
+ "please_enter_correct": "Vui lòng nhập đúng",
918
919
  "add_schedule": "Thêm lịch trình",
919
920
  "curtain_opens": "Rèm mở",
920
921
  "curtain_closes": "Rèm đóng",
@@ -926,7 +927,7 @@
926
927
  "location_permission_required_wifi_message": "Ứng dụng này cần có quyền định vị vì ứng dụng này được yêu cầu để quét các mạng Wi-Fi.",
927
928
  "deny": "Từ chối",
928
929
  "allow": "Cho phép",
929
- "avatar" : "Ảnh đại diện",
930
+ "avatar": "Ảnh đại diện",
930
931
  "mask_off": "Không có khẩu trang",
931
932
  "mask_on": "Có khẩu trang",
932
933
  "stranger": "Người lạ",
@@ -958,7 +959,7 @@
958
959
  "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.",
959
960
  "auto_lock_enabled": "Tự động khóa được bật",
960
961
  "auto_lock_when": "Tự động khóa khi",
961
- "instant":"Ngay lập tức",
962
+ "instant": "Ngay lập tức",
962
963
  "re_lock_timing": "Thời gian khóa lại",
963
964
  "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.",
964
965
  "code": "Mã số",
@@ -968,13 +969,13 @@
968
969
  "delete_passcode": "Xóa mật mã",
969
970
  "passcode_list": "Danh sách mật mã",
970
971
  "search": "Tìm kiếm",
971
- "connect_home_wifi" : "Kết nối Wifi của gia đình",
972
- "saving_contact_successful" : "Lưu liên hệ thành công",
972
+ "connect_home_wifi": "Kết nối Wifi của gia đình",
973
+ "saving_contact_successful": "Lưu liên hệ thành công",
973
974
  "maxmium_contacts": "Địa chỉ liên hệ tối đa",
974
975
  "note": "Lưu ý ",
975
976
  "back": "Quay lại",
976
977
  "invaild_data": "Dữ liệu không hợp lệ",
977
- "This {name} was removed!" : "{Name} này đã bị xóa!",
978
+ "This_name_was_removed": "{Name} này đã bị xóa!",
978
979
  "location_perm_denied": "Ứng dụng không cho phép truy cập vị trí.",
979
980
  "camera_request_permission": "Quyền yêu cầu máy ảnh",
980
981
  "camera_request_permission_des": "Để sử dụng máy ảnh, vui lòng mở khóa quyền đối với máy ảnh",
@@ -992,7 +993,7 @@
992
993
  "open": "Mở",
993
994
  "close": "Đóng",
994
995
  "create_contact_success": "Tạo liên hệ thành công!",
995
- "can_not_login_to_current_ssid":"Không thể đăng nhập vào SSID hiện tại",
996
+ "can_not_login_to_current_ssid": "Không thể đăng nhập vào SSID hiện tại",
996
997
  "confirm_password_not_match": "Mật khẩu xác nhận không trùng khớp",
997
998
  "dashboard": "Bảng điều khiển",
998
999
  "template": "Mẫu",
@@ -1057,17 +1058,17 @@
1057
1058
  "fail_to_discover_device_wifi": "Không phát hiện được wifi của thiết bị",
1058
1059
  "try_to_turn_on_device_or_try_again": "Thử bật thiết bị hoặc Thử lại",
1059
1060
  "go_to_eoh_web_to_see_firmware": "Vào web {appName} để xem cấu hình firmware",
1060
- "general_information":"Thông tin chung",
1061
+ "general_information": "Thông tin chung",
1061
1062
  "connection_methods": "Các phương thức kết nối",
1062
- "delete_gateway":"Xoá cửa ngõ",
1063
- "connection_time":"Thời gian kết nối",
1064
- "device_id":"ID thiết bị",
1065
- "auth_token":"Mã xác thực",
1066
- "activate_date":"Ngày kích hoạt",
1067
- "warranty_expiration_date":"Ngày hết hạn bảo hành",
1068
- "firmware_version":"Phiên bản phần mềm",
1063
+ "delete_gateway": "Xoá cửa ngõ",
1064
+ "connection_time": "Thời gian kết nối",
1065
+ "device_id": "ID thiết bị",
1066
+ "auth_token": "Mã xác thực",
1067
+ "activate_date": "Ngày kích hoạt",
1068
+ "warranty_expiration_date": "Ngày hết hạn bảo hành",
1069
+ "firmware_version": "Phiên bản phần mềm",
1069
1070
  "visit_eoh_web_to_set_up_other_connection": "Truy cập {appName} Web để thiết lập các tùy chọn kết nối khác.",
1070
- "delete_successfully":"Xoá thành công!",
1071
+ "delete_successfully": "Xoá thành công!",
1071
1072
  "reboot_successfully": "Khởi động lại thành công!",
1072
1073
  "message_delete_gateway": "Thao tác này sẽ loại bỏ hoàn toàn Gateway với Thông tin, Thiết bị, Luồng dữ liệu khỏi cổng.",
1073
1074
  "message_reboot_gateway": "Thao tác này sẽ khởi động lại Gateway. Bạn sẽ mất thời gian chờ đợi để khởi động lại thiết bị.",
@@ -1125,9 +1126,14 @@
1125
1126
  "data_address": "Địa chỉ dữ liệu",
1126
1127
  "methods": "{number} phương thức",
1127
1128
  "io_method": "Giao thức Input/Output",
1129
+ "change_position": "Thay đổi vị trí",
1130
+ "updated_widget_successfully": "Đã cập nhật tiện ích thành công",
1131
+ "sub_text_change_position": "Giữ và di chuyển để sắp xếp lại các vật dụng",
1128
1132
  "transfer_ownership": "Chuyển quyền sở hữu",
1129
1133
  "text_change_owner": "Quyền sở hữu đơn vị này cho người dùng bạn đã chọn.",
1130
1134
  "text_alert_change_owner": "Bạn sẽ bị xóa khỏi Unit này sau khi chuyển quyền sở hữu.",
1131
- "the_system_has_been_upgraded" : "Để mang lại trải nghiệm tốt hơn cho người dùng, [Era] sẽ tiến hành nâng cấp hệ thống.Việc nâng cấp sẽ diễn ra trong khoảng 10 phút.\n\nMột số chức năng điều khiển thiết bị sẽ bị gián đoạn trong thời gian nâng cấp.[Era] kính mong quý khách hàng thông cảm cho sự bất tiện này.\n\nTrân trọng "
1132
-
1135
+ "the_system_has_been_upgraded" : "Để mang lại trải nghiệm tốt hơn cho người dùng, [Era] sẽ tiến hành nâng cấp hệ thống.Việc nâng cấp sẽ diễn ra trong khoảng 10 phút.\n\nMột số chức năng điều khiển thiết bị sẽ bị gián đoạn trong thời gian nâng cấp.[Era] kính mong quý khách hàng thông cảm cho sự bất tiện này.\n\nTrân trọng ",
1136
+ "value_must_be_greater_than_min": "Giá trị phải lớn hơn {min}",
1137
+ "value_must_be_less_than_max": "Giá trị phải nhỏ hơn {max}",
1138
+ "value_must_be_a_number": "Giá trị phải là một số"
1133
1139
  }
@@ -126,7 +126,10 @@ const Routes = {
126
126
  EditActionsList: 'EditActionsList',
127
127
  PlaybackCamera: 'PlaybackCamera',
128
128
  SetupConfigCondition: 'SetupConfigCondition',
129
- AddNewAutoSmart: 'AddNewAutoSmart',
129
+ AddAutomationTypeSmart: 'AddAutomationTypeSmart',
130
+ AddUnknownTypeSmart: 'AddUnknownTypeSmart',
131
+ ScenarioName: 'ScenarioName',
132
+ ValueChangeName: 'ValueChangeName',
130
133
  AllCamera: 'AllCamera',
131
134
  AddNewOneTap: 'AddNewOneTap',
132
135
  SelectUnit: 'SelectUnit',
@@ -186,6 +189,7 @@ const Routes = {
186
189
  AllGateway: 'AllGateway',
187
190
  DetailConfigActionInternal: 'DetailConfigActionInternal',
188
191
  DeviceInternalDetail: 'DeviceInternalDetail',
192
+ ChangePosition: 'ChangePosition',
189
193
  };
190
194
 
191
195
  export default Routes;
@@ -1,5 +1,6 @@
1
1
  import { PixelRatio, Linking, Alert } from 'react-native';
2
2
  import Toast from 'react-native-toast-message';
3
+ import { decode } from 'base-64';
3
4
  import validator from 'validator';
4
5
  import api from './Apis/axios';
5
6
  import {
@@ -237,3 +238,42 @@ export default {
237
238
  isObjectEmpty,
238
239
  insertToString,
239
240
  };
241
+
242
+ // eslint-disable-next-line no-extend-native
243
+ Date.prototype.getWeek = function () {
244
+ let date = new Date(this.getTime());
245
+ date.setHours(0, 0, 0, 0);
246
+ date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7));
247
+ let week1 = new Date(date.getFullYear(), 0, 4);
248
+ return (
249
+ 1 +
250
+ Math.round(
251
+ ((date.getTime() - week1.getTime()) / 86400000 -
252
+ 3 +
253
+ ((week1.getDay() + 6) % 7)) /
254
+ 7
255
+ )
256
+ );
257
+ };
258
+
259
+ export const getDateRangeOfWeek = (weekNumber, year) => {
260
+ let d1, numOfDaysPastSinceLastMonday, rangeIsFrom, rangeIsTo;
261
+ d1 = new Date('' + year + '');
262
+ numOfDaysPastSinceLastMonday = d1.getDay() - 1;
263
+ d1.setDate(d1.getDate() - numOfDaysPastSinceLastMonday);
264
+ d1.setDate(d1.getDate() + 7 * (weekNumber - d1.getWeek()));
265
+ rangeIsFrom = d1.getDate() + '.' + (d1.getMonth() + 1);
266
+ d1.setDate(d1.getDate() + 6);
267
+ rangeIsTo = d1.getDate() + '.' + (d1.getMonth() + 1);
268
+ return rangeIsFrom + '-' + rangeIsTo;
269
+ };
270
+
271
+ export const base64ToHex = (str) => {
272
+ const raw = decode(str);
273
+ let result = '';
274
+ for (let i = 0; i < raw.length; i++) {
275
+ const hex = raw.charCodeAt(i).toString(16);
276
+ result += hex.length === 2 ? hex : '0' + hex;
277
+ }
278
+ return result.toUpperCase();
279
+ };
@@ -20,6 +20,7 @@ import {
20
20
  objectIds,
21
21
  notImplemented,
22
22
  roundNumber,
23
+ getDateRangeOfWeek,
23
24
  } from '../Utils';
24
25
 
25
26
  describe('Test utils', () => {
@@ -181,4 +182,9 @@ describe('Test utils', () => {
181
182
  result = await roundNumber(12.12);
182
183
  expect(result).toBe(12.12);
183
184
  });
185
+
186
+ it('Test getDateRangeOfWeek', async () => {
187
+ const range = await getDateRangeOfWeek(10, 2022);
188
+ expect(range).toBe('8.3-14.3');
189
+ });
184
190
  });
@@ -1,130 +0,0 @@
1
- import React, { memo, useCallback, useState } from 'react';
2
- import { TouchableOpacity, View, Switch, Image } from 'react-native';
3
- import styles from './CurtainButtonTemplateStyle';
4
- import Text from '../Text';
5
- import { AccessibilityLabel } from '../../configs/Constants';
6
- import { Colors, Images } from '../../configs';
7
- import IconComponent from '../IconComponent';
8
-
9
- const CurtainButtonTemplate = memo(({ actionGroup, doAction, sensor }) => {
10
- const { configuration } = actionGroup;
11
- const {
12
- open_action_data,
13
- stop_action_data,
14
- close_action_data,
15
- action_off_data,
16
- action_on_data,
17
- is_display_lock,
18
- text1,
19
- text3,
20
- text_door_lock,
21
- } = configuration || {};
22
- const [lock, setLock] = useState(false);
23
-
24
- const onButtonOpenPress = useCallback(() => {
25
- doAction(open_action_data, null);
26
- }, [open_action_data, doAction]);
27
-
28
- const onButtonStopPress = useCallback(() => {
29
- doAction(stop_action_data, null);
30
- }, [stop_action_data, doAction]);
31
-
32
- const onButtonClosePress = useCallback(() => {
33
- doAction(close_action_data, null);
34
- }, [close_action_data, doAction]);
35
-
36
- const onChangeSwitch = useCallback(() => {
37
- if (lock) {
38
- setLock(false);
39
- doAction(action_off_data, null);
40
- return;
41
- }
42
- doAction(action_on_data, null);
43
- setLock(true);
44
- }, [action_off_data, action_on_data, doAction, lock]);
45
-
46
- const RenderThreeButtonActions = () => {
47
- const buttons = [
48
- {
49
- style: styles.buttonActionCurtain,
50
- icon: Images.buttonLeftCurtain,
51
- text: text1,
52
- onPress: onButtonClosePress,
53
- accessibilityLabel: AccessibilityLabel.BUTTON_TEMPLATE_1,
54
- },
55
- {
56
- style: styles.buttonActionCurtainCenter,
57
- icon: Images.buttonPauseCurtain,
58
- text: '',
59
- onPress: onButtonStopPress,
60
- accessibilityLabel: AccessibilityLabel.BUTTON_TEMPLATE_2,
61
- },
62
- {
63
- style: styles.buttonActionCurtain,
64
- icon: Images.buttonRightCurtain,
65
- text: text3,
66
- onPress: onButtonOpenPress,
67
- accessibilityLabel: AccessibilityLabel.BUTTON_TEMPLATE_3,
68
- },
69
- ];
70
-
71
- return (
72
- <>
73
- {buttons.map((item, index) => (
74
- <TouchableOpacity
75
- accessibilityLabel={item.accessibilityLabel}
76
- style={item?.style}
77
- onPress={item.onPress}
78
- underlayColor={Colors.Gray2}
79
- >
80
- <Image source={item?.icon} />
81
- <Text style={styles.textCurtain}>{item?.text}</Text>
82
- </TouchableOpacity>
83
- ))}
84
- </>
85
- );
86
- };
87
- const itemLock = (icon, color) => {
88
- return (
89
- <>
90
- <View style={styles.lockDoor}>
91
- <IconComponent
92
- icon={icon}
93
- iconSize={15}
94
- color={color}
95
- style={styles.iconLock}
96
- />
97
- <Text
98
- style={styles.textLockDoor}
99
- accessibilityLabel={AccessibilityLabel.TEXT_DOOR_LOOK_ON_OFF}
100
- >
101
- {text_door_lock}{' '}
102
- </Text>
103
- </View>
104
- <Switch
105
- trackColor={{ false: Colors.Gray4, true: Colors.Primary }}
106
- thumbColor={Colors.White}
107
- ios_backgroundColor={Colors.Gray4}
108
- onValueChange={onChangeSwitch}
109
- value={lock}
110
- />
111
- </>
112
- );
113
- };
114
- return (
115
- <>
116
- <View style={styles.wrap}>
117
- <RenderThreeButtonActions />
118
- </View>
119
- <View style={styles.lockSwitch}>
120
- {is_display_lock &&
121
- itemLock(
122
- lock ? 'lock' : 'unlock',
123
- lock ? Colors.Primary : Colors.Gray6
124
- )}
125
- </View>
126
- </>
127
- );
128
- });
129
-
130
- export default CurtainButtonTemplate;
@@ -1,109 +0,0 @@
1
- import React from 'react';
2
- import renderer, { act } from 'react-test-renderer';
3
- import { TouchableOpacity, Switch } from 'react-native';
4
-
5
- import CurtainButtonTemplate from '../CurtainButtonTemplate';
6
- import { SCProvider } from '../../../context';
7
- import { mockSCStore } from '../../../context/mockStore';
8
-
9
- const mockDoAction = jest.fn();
10
- const mockActionOffData = jest.fn();
11
- const mockActionOnData = jest.fn();
12
- const mockCloseActionData = jest.fn();
13
-
14
- const wrapComponent = (actionGroup = {}, sensor = {}) => (
15
- <SCProvider initState={mockSCStore({})}>
16
- <CurtainButtonTemplate
17
- actionGroup={actionGroup}
18
- doAction={mockDoAction}
19
- sensor={sensor}
20
- />
21
- </SCProvider>
22
- );
23
-
24
- describe('Test CurtainButtonTemplate', () => {
25
- const sensor = {
26
- name: 'test',
27
- };
28
- const actionGroup = {
29
- configuration: {
30
- text_open: 'open',
31
- is_display_lock: true,
32
- action_off_data: mockActionOffData,
33
- action_on_data: mockActionOnData,
34
- close_action_data: mockCloseActionData,
35
- action1: '2b949045-8e03-4c07-a855-7794ade2e69c',
36
- action1_data: {
37
- color: '#00979D',
38
- command_prefer_over_bluetooth: true,
39
- command_prefer_over_googlehome: false,
40
- command_prefer_over_internet: false,
41
- googlehome_actions: [],
42
- icon: 'caret-up',
43
- id: 9,
44
- key: '2b949045-8e03-4c07-a855-7794ade2e69c',
45
- },
46
- action2: '38347d5e-4418-4ab0-978c-c82f4c034897',
47
- action2_data: {
48
- color: '#00979D',
49
- command_prefer_over_bluetooth: true,
50
- command_prefer_over_googlehome: false,
51
- command_prefer_over_internet: false,
52
- googlehome_actions: [],
53
- icon: 'stop',
54
- id: 11,
55
- key: '38347d5e-4418-4ab0-978c-c82f4c034897',
56
- },
57
- action3: 'a492e08c-8cb1-44ee-8ea0-46aaca4e5141',
58
- action3_data: {
59
- color: '#00979D',
60
- command_prefer_over_bluetooth: true,
61
- command_prefer_over_googlehome: false,
62
- command_prefer_over_internet: false,
63
- googlehome_actions: [],
64
- icon: 'caret-down',
65
- id: 10,
66
- key: 'a492e08c-8cb1-44ee-8ea0-46aaca4e5141',
67
- },
68
- icon1: 'caret-up',
69
- icon2: 'stop',
70
- icon3: 'caret-down',
71
- text1: 'UP',
72
- text2: 'STOP/UNLOCK',
73
- text3: 'DOWN',
74
- id: 1,
75
- template: 'curtain_button_action_template',
76
- },
77
- };
78
-
79
- let wrapper;
80
-
81
- it('render without params', async () => {
82
- await act(async () => {
83
- wrapper = renderer.create(wrapComponent());
84
- });
85
- const instance = wrapper.root;
86
- const touchableOpacities = instance.findAllByType(TouchableOpacity);
87
- expect(touchableOpacities.length).toEqual(3);
88
- });
89
-
90
- it('render CurtainButtonTemplate', async () => {
91
- await act(async () => {
92
- wrapper = renderer.create(wrapComponent(actionGroup, sensor));
93
- });
94
- const instance = wrapper.root;
95
- const touchableOpacities = instance.findAllByType(TouchableOpacity);
96
- expect(touchableOpacities.length).toEqual(3);
97
- await touchableOpacities[0].props.onPress();
98
- await touchableOpacities[1].props.onPress();
99
- await touchableOpacities[2].props.onPress();
100
- expect(mockDoAction).toBeCalledWith(mockCloseActionData, null);
101
-
102
- const Switchs = instance.findAllByType(Switch);
103
- expect(Switchs).toHaveLength(1);
104
- await Switchs[0].props.onValueChange();
105
- expect(mockDoAction).toBeCalledWith(mockActionOnData, null);
106
- await Switchs[0].props.onValueChange();
107
- expect(mockDoAction).toBeCalledWith(mockActionOffData, null);
108
- });
109
- });
@@ -1,54 +0,0 @@
1
- import React from 'react';
2
- import { IconFill } from '@ant-design/icons-react-native';
3
- import { TouchableOpacity, Image, StyleSheet } from 'react-native';
4
-
5
- import { Colors } from '../../configs';
6
-
7
- const SocialButton = ({
8
- icon, //'apple' | src facebook | src google-square
9
- text,
10
- onPress,
11
- textColor,
12
- wrapStyle,
13
- textWrapStyle,
14
- }) => {
15
- return (
16
- <TouchableOpacity onPress={onPress} style={[styles.wrap, wrapStyle]}>
17
- {icon === 'apple' ? (
18
- <IconFill name={icon} size={25} color={Colors.White} />
19
- ) : (
20
- <Image source={icon} style={[styles.icon]} resizeMode={'contain'} />
21
- )}
22
- </TouchableOpacity>
23
- );
24
- };
25
-
26
- const styles = StyleSheet.create({
27
- wrap: {
28
- // flex: 1,
29
- width: 50,
30
- height: 50,
31
- borderRadius: 25,
32
- overflow: 'hidden',
33
- borderWidth: 1,
34
- borderColor: Colors.Gray4,
35
- backgroundColor: Colors.White,
36
- flexDirection: 'row',
37
- alignItems: 'center',
38
- justifyContent: 'center',
39
- elevation: 3,
40
- shadowColor: Colors.Shadow,
41
- shadowOffset: {
42
- width: 0,
43
- height: 4,
44
- },
45
- shadowOpacity: 0.3,
46
- shadowRadius: 3,
47
- },
48
- icon: {
49
- width: 24,
50
- height: 24,
51
- },
52
- });
53
-
54
- export default SocialButton;
@@ -1,46 +0,0 @@
1
- import React from 'react';
2
- import { Image, TouchableOpacity } from 'react-native';
3
- import renderer, { act } from 'react-test-renderer';
4
- import { IconFill } from '@ant-design/icons-react-native';
5
-
6
- import SocialButton from '../SocialButton';
7
-
8
- describe('Test OtpInputList', () => {
9
- const mockFunc = jest.fn();
10
- let tree;
11
-
12
- it('create SocialButton', async () => {
13
- await act(async () => {
14
- tree = await renderer.create(
15
- <SocialButton icon={'apple'} onPress={mockFunc} />
16
- );
17
- });
18
-
19
- const instance = tree.root;
20
- const textInputs = instance.findAllByType(IconFill);
21
- expect(textInputs.length).toBe(1);
22
-
23
- const button = instance.findByType(TouchableOpacity);
24
- await act(async () => {
25
- button.props.onPress();
26
- });
27
- expect(mockFunc).toHaveBeenCalled();
28
- });
29
-
30
- it('create SocialButton icon null', async () => {
31
- await act(async () => {
32
- tree = await renderer.create(
33
- <SocialButton icon={''} onPress={mockFunc} />
34
- );
35
- });
36
-
37
- const instance = tree.root;
38
- const textInputs = instance.findAllByType(Image);
39
- expect(textInputs.length).toBe(1);
40
- const button = instance.findByType(TouchableOpacity);
41
- await act(async () => {
42
- button.props.onPress();
43
- });
44
- expect(mockFunc).toHaveBeenCalled();
45
- });
46
- });
@@ -1,56 +0,0 @@
1
- import React, { memo } from 'react';
2
- import { View, StyleSheet } from 'react-native';
3
- import { useTranslations } from '../../hooks/Common/useTranslations';
4
-
5
- import { Colors } from '../../configs';
6
- import Text from '../../commons/Text';
7
- import Connect from '../../../assets/images/Device/Connect.svg';
8
- import { AccessibilityLabel } from '../../configs/Constants';
9
-
10
- const SensorConnectedStatus = memo(({ txtSensor, timeLastUpdate }) => {
11
- const t = useTranslations();
12
- return (
13
- <View
14
- style={styles.container}
15
- accessibilityLabel={AccessibilityLabel.SENSOR_CONNECTED_STATUS}
16
- >
17
- <View style={styles.connectStatus}>
18
- <Connect />
19
- <Text color={Colors.Green6} size={14} style={styles.txtStatus}>
20
- {t('connected')}
21
- </Text>
22
- </View>
23
- <Text color={Colors.Gray9} size={16} style={styles.txtCurrent}>
24
- {txtSensor}
25
- </Text>
26
- <Text color={Colors.Gray7} size={12} style={styles.txtLastUpdate}>
27
- {t('last_updated_%{minutes}_minutes_ago', { minutes: timeLastUpdate })}
28
- </Text>
29
- </View>
30
- );
31
- });
32
-
33
- export default SensorConnectedStatus;
34
-
35
- const styles = StyleSheet.create({
36
- container: {
37
- alignItems: 'center',
38
- },
39
- connectStatus: {
40
- flexDirection: 'row',
41
- alignItems: 'center',
42
- },
43
- txtStatus: {
44
- marginLeft: 8,
45
- },
46
- txtCurrent: {
47
- marginLeft: 8,
48
- lineHeight: 24,
49
- marginTop: 16,
50
- },
51
- txtLastUpdate: {
52
- marginLeft: 8,
53
- lineHeight: 20,
54
- marginTop: 8,
55
- },
56
- });
@@ -1,29 +0,0 @@
1
- import SensorConnectedStatus from '../SensorConnectedStatus';
2
- import React from 'react';
3
- import renderer, { act } from 'react-test-renderer';
4
- import { AccessibilityLabel } from '../../../configs/Constants';
5
- import { SCProvider } from '../../../context';
6
- import { mockSCStore } from '../../../context/mockStore';
7
-
8
- const wrapComponent = () => (
9
- <SCProvider initState={mockSCStore({})}>
10
- <SensorConnectedStatus />
11
- </SCProvider>
12
- );
13
-
14
- describe('Test Sensor Connected Status', () => {
15
- let tree;
16
-
17
- it('render Sensor Connected Status', async () => {
18
- await act(async () => {
19
- tree = await renderer.create(wrapComponent());
20
- });
21
- const instance = tree.root;
22
- const item = instance.find(
23
- (el) =>
24
- el.props.accessibilityLabel ===
25
- AccessibilityLabel.SENSOR_CONNECTED_STATUS
26
- );
27
- expect(item).not.toBeUndefined();
28
- });
29
- });