@eohjsc/react-native-smart-city 0.3.31 → 0.3.34

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 (411) hide show
  1. package/assets/images/AddNewDevice/add-gateway-icon.svg +13 -0
  2. package/assets/images/AddNewDevice/add-modbus-device-icon.svg +8 -0
  3. package/assets/images/AddNewDevice/add-wifi-device-icon.svg +4 -0
  4. package/assets/images/AddNewDevice/add-zigbee-device-icon.svg +4 -0
  5. package/assets/images/AddNewDevice/interact-smartphone-icon.svg +14 -0
  6. package/index.js +2 -0
  7. package/package.json +8 -5
  8. package/src/Images/SmartAccount/DienQuang.png +0 -0
  9. package/src/Images/SmartAccount/DienQuang@2x.png +0 -0
  10. package/src/Images/SmartAccount/DienQuang@3x.png +0 -0
  11. package/src/Images/SmartAccount/LG.png +0 -0
  12. package/src/Images/SmartAccount/LG@2x.png +0 -0
  13. package/src/Images/SmartAccount/LG@3x.png +0 -0
  14. package/src/Images/SmartAccount/Samsung.png +0 -0
  15. package/src/Images/SmartAccount/Samsung@2x.png +0 -0
  16. package/src/Images/SmartAccount/Samsung@3x.png +0 -0
  17. package/src/commons/Action/ItemQuickAction.js +20 -4
  18. package/src/commons/Action/__test__/ItemQuickAction.test.js +35 -11
  19. package/src/commons/ActionGroup/CurtainButtonTemplate.js +6 -6
  20. package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +9 -6
  21. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +5 -2
  22. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +10 -4
  23. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/index.js +4 -4
  24. package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLock.js +2 -2
  25. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode.js +1 -1
  26. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +2 -2
  27. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +2 -2
  28. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
  29. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +12 -6
  30. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/index.js +8 -4
  31. package/src/commons/ActionGroup/OnOffTemplate/OnOffButtonTemplate.js +4 -6
  32. package/src/commons/ActionGroup/OnOffTemplate/index.js +28 -10
  33. package/src/commons/ActionGroup/OneBigButtonTemplate.js +1 -1
  34. package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +25 -12
  35. package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +25 -9
  36. package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/ControlPlay.test.js +13 -7
  37. package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/RectangleButton.test.js +9 -5
  38. package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/SmartTiviActionTemplate.test.js +25 -9
  39. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +16 -6
  40. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +10 -4
  41. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/RectangleButton.js +7 -3
  42. package/src/commons/ActionGroup/StatesGridActionTemplate.js +21 -7
  43. package/src/commons/ActionGroup/ThreeButtonTemplate.js +5 -5
  44. package/src/commons/ActionGroup/TwoButtonTemplate/index.js +4 -4
  45. package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +7 -7
  46. package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +3 -3
  47. package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +3 -3
  48. package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +9 -5
  49. package/src/commons/ActionGroup/__test__/index.test.js +5 -3
  50. package/src/commons/ActionTemplate/OnOffButtonAction.js +14 -5
  51. package/src/commons/ActionTemplate/__test__/OnOffButtonAction.test.js +23 -2
  52. package/src/commons/ActionTemplate/__test__/index.test.js +2 -0
  53. package/src/commons/ActionTemplate/index.js +1 -0
  54. package/src/commons/AlertAction/index.js +2 -2
  55. package/src/commons/Auth/AccountItem.js +9 -3
  56. package/src/commons/Auth/__test__/AccountItem.test.js +6 -3
  57. package/src/commons/Automate/ItemAutomate.js +22 -3
  58. package/src/commons/BackDefault/index.js +2 -2
  59. package/src/commons/BottomButtonView/index.js +4 -5
  60. package/src/commons/Button/index.js +0 -2
  61. package/src/commons/ButtonPopup/index.js +3 -3
  62. package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +3 -2
  63. package/src/commons/Dashboard/MyPinnedSharedUnit/index.js +4 -2
  64. package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +6 -3
  65. package/src/commons/Dashboard/MyUnit/index.js +5 -3
  66. package/src/commons/Device/ConnectedViewHeader.js +2 -2
  67. package/src/commons/Device/DeviceAlertStatus.js +2 -2
  68. package/src/commons/Device/DisconnectedView.js +2 -2
  69. package/src/commons/Device/Emergency/EmergencyButton.js +2 -2
  70. package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +3 -2
  71. package/src/commons/Device/FlatListItems.js +2 -2
  72. package/src/commons/Device/ItemAddNew/index.js +7 -12
  73. package/src/commons/Device/ItemDevice.js +16 -11
  74. package/src/commons/Device/SensorConnectedStatus.js +5 -2
  75. package/src/commons/Device/WindDirection/Compass/index.js +5 -2
  76. package/src/commons/Device/__test__/DeviceAlertStatus.test.js +8 -4
  77. package/src/commons/Device/__test__/FlatListItems.test.js +3 -2
  78. package/src/commons/Device/__test__/SensorConnectedStatus.test.js +4 -2
  79. package/src/commons/Explore/ActivityIndicator/index.js +5 -2
  80. package/src/commons/Explore/SearchBox/__test__/SearchBox.test.js +3 -3
  81. package/src/commons/Explore/SearchBox/index.js +2 -2
  82. package/src/commons/FieldTemplate/ChooseUserField/ChoosePopup.js +4 -4
  83. package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +11 -8
  84. package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
  85. package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +3 -2
  86. package/src/commons/FieldTemplate/PasscodeField/index.js +2 -2
  87. package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +12 -7
  88. package/src/commons/Form/TextInput.js +2 -2
  89. package/src/commons/Form/TextInputPassword.js +2 -2
  90. package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +5 -3
  91. package/src/commons/GroupCheckBox/index.js +2 -2
  92. package/src/commons/HeaderAni/index.js +2 -3
  93. package/src/commons/MediaPlayerDetail/index.js +2 -2
  94. package/src/commons/MenuActionList/index.js +2 -2
  95. package/src/commons/MenuActionMore/index.js +2 -3
  96. package/src/commons/NavBar/index.js +2 -3
  97. package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +12 -6
  98. package/src/commons/OneTapTemplate/OptionsDropdownActionTemplate.js +7 -3
  99. package/src/commons/OneTapTemplate/StatesGridActionTemplate.js +4 -2
  100. package/src/commons/OneTapTemplate/__test__/NumberUpDownActionTemplate.test.js +11 -8
  101. package/src/commons/OneTapTemplate/__test__/OptionsDropdownActionTemplate.test.js +9 -5
  102. package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +5 -3
  103. package/src/commons/Popover/index.js +2 -13
  104. package/src/commons/PreventAccess/__test__/PreventAccess.test.js +5 -3
  105. package/src/commons/PreventAccess/index.js +3 -3
  106. package/src/commons/{Connecting → Processing}/__test__/Connecting.test.js +5 -4
  107. package/src/commons/Processing/index.js +93 -0
  108. package/src/commons/{Connecting → Processing}/styles.js +9 -1
  109. package/src/commons/SelectGateway/index.js +105 -0
  110. package/src/commons/SelectGateway/styles.js +55 -0
  111. package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +106 -0
  112. package/src/commons/SelectSubUnit/index.js +124 -0
  113. package/src/commons/SelectSubUnit/styles.js +52 -0
  114. package/src/commons/SelectUnit/__test__/SelectUnit.test.js +120 -0
  115. package/src/commons/SelectUnit/index.js +105 -0
  116. package/src/commons/SelectUnit/styles.js +53 -0
  117. package/src/commons/Sharing/WrapHeaderScrollable.js +2 -2
  118. package/src/commons/SubUnit/OneTap/ItemOneTap.js +4 -4
  119. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +25 -10
  120. package/src/commons/SubUnit/OneTap/index.js +9 -4
  121. package/src/commons/SubUnit/ShortDetail.js +11 -29
  122. package/src/commons/SubUnit/__test__/ShortDetail.test.js +15 -10
  123. package/src/commons/SummaryItem/index.js +2 -2
  124. package/src/commons/Tabbar/__test__/index.test.js +97 -0
  125. package/src/commons/Unit/HeaderUnit/index.js +4 -5
  126. package/src/commons/Unit/SharedUnit.js +10 -8
  127. package/src/commons/Unit/__test__/HeaderUnit.test.js +13 -5
  128. package/src/commons/Unit/__test__/SharedUnit.test.js +30 -11
  129. package/src/commons/UnitSummary/AirQuality/__test__/index.test.js +13 -8
  130. package/src/commons/UnitSummary/AirQuality/index.js +7 -3
  131. package/src/commons/UnitSummary/TotalPowerBox.js +2 -2
  132. package/src/commons/UnitSummary/TotalPowerConsumption/index.js +2 -2
  133. package/src/commons/UnitSummary/__test__/TotalPowerBox.test.js +3 -2
  134. package/src/commons/UnitSummary/__test__/TotalPowerConsumption.test.js +4 -2
  135. package/src/commons/ViewButtonBottom/index.js +4 -4
  136. package/src/commons/WheelDateTimePicker/index.js +5 -3
  137. package/src/commons/WrapParallaxScrollView/index.js +2 -1
  138. package/src/configs/API.js +16 -14
  139. package/src/configs/AccessibilityLabel.js +629 -0
  140. package/src/configs/Constants.js +1 -604
  141. package/src/configs/Images.js +2 -0
  142. package/src/context/actionType.ts +10 -3
  143. package/src/context/mockStore.ts +6 -3
  144. package/src/context/reducer.ts +45 -8
  145. package/src/hoc/__test__/withRemoteControl.test.js +24 -0
  146. package/src/hoc/withRemoteControl.js +1 -0
  147. package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +55 -0
  148. package/src/hooks/Common/index.js +2 -2
  149. package/src/hooks/Common/useDevicesStatus.js +19 -15
  150. package/src/hooks/Common/{useGGHomeDeviceConnected.js → useHomeAssistantDeviceConnected.js} +3 -3
  151. package/src/hooks/Common/usePopover.js +6 -1
  152. package/src/hooks/IoT/__test__/{useGGHomeConnection.test.js → useHomeAssistantConnection.test.js} +18 -18
  153. package/src/hooks/IoT/__test__/useRemoteControl.test.js +17 -12
  154. package/src/hooks/IoT/index.js +2 -2
  155. package/src/hooks/IoT/useHomeAssistantConnection.js +91 -0
  156. package/src/hooks/IoT/useRemoteControl.js +6 -6
  157. package/src/hooks/__test__/useInitDeepLink.test.js +28 -0
  158. package/src/hooks/useReceiveNotifications.js +2 -4
  159. package/src/iot/RemoteControl/{GoogleHome.js → HomeAssistant.js} +21 -17
  160. package/src/iot/RemoteControl/LG.js +2 -1
  161. package/src/iot/RemoteControl/__test__/{GoogleHome.test.js → HomeAssistant.test.js} +30 -30
  162. package/src/navigations/AddDeviceStack.js +0 -14
  163. package/src/navigations/AddGatewayStack.js +56 -21
  164. package/src/navigations/Main.js +2 -2
  165. package/src/navigations/SmartAccountStack.js +52 -0
  166. package/src/navigations/SmartIrStack.js +3 -3
  167. package/src/navigations/UnitStack.js +1 -1
  168. package/src/screens/AQIGuide/__test__/AQIGuide.test.js +5 -3
  169. package/src/screens/AQIGuide/index.js +5 -3
  170. package/src/screens/ActivityLog/FilterPopup.js +2 -2
  171. package/src/screens/ActivityLog/__test__/FilterPopup.test.js +2 -2
  172. package/src/screens/ActivityLog/__test__/index.test.js +3 -2
  173. package/src/screens/ActivityLog/index.js +3 -3
  174. package/src/screens/AddCommon/SelectSubUnit.js +49 -192
  175. package/src/screens/AddCommon/SelectUnit.js +58 -204
  176. package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +25 -61
  177. package/src/screens/AddCommon/__test__/SelectUnit.test.js +41 -32
  178. package/src/screens/AddLocationMaps/__test__/index.test.js +13 -7
  179. package/src/screens/AddLocationMaps/index.js +3 -3
  180. package/src/screens/AddNewAction/Device/index.js +2 -2
  181. package/src/screens/AddNewAction/SelectAction.js +16 -7
  182. package/src/screens/AddNewAction/SelectSensorDevices.js +3 -3
  183. package/src/screens/AddNewAction/__test__/SelectAction.test.js +2 -2
  184. package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +8 -3
  185. package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +11 -7
  186. package/src/screens/AddNewAutoSmart/index.js +9 -12
  187. package/src/screens/AddNewDevice/ConnectingDevices.js +1 -1
  188. package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +7 -4
  189. package/src/screens/AddNewDevice/index.js +4 -4
  190. package/src/screens/AddNewGateway/ConnectingDevice.js +40 -0
  191. package/src/screens/AddNewGateway/ConnectingModbusDevice.js +61 -0
  192. package/src/screens/AddNewGateway/ConnectingWifiDevice.js +70 -0
  193. package/src/screens/AddNewGateway/ConnectingWifiGuide.js +167 -0
  194. package/src/screens/AddNewGateway/ConnectingWifiGuideStyles.js +58 -0
  195. package/src/screens/AddNewGateway/ConnectingZigbeeDevice.js +60 -0
  196. package/src/screens/AddNewGateway/PlugAndPlay/FirstWarning.js +16 -8
  197. package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +23 -4
  198. package/src/screens/AddNewGateway/RenameNewDevices.js +141 -0
  199. package/src/screens/AddNewGateway/RenameNewDevicesStyles.js +75 -0
  200. package/src/screens/AddNewGateway/ScanGatewayQR.js +80 -0
  201. package/src/screens/AddNewGateway/ScanModbusQR.js +53 -0
  202. package/src/screens/AddNewGateway/ScanWifiDeviceQR.js +55 -0
  203. package/src/screens/AddNewGateway/SelectDeviceSubUnit.js +31 -0
  204. package/src/screens/AddNewGateway/SelectDeviceType.js +147 -0
  205. package/src/screens/AddNewGateway/SelectDeviceTypeStyles.js +51 -0
  206. package/src/screens/AddNewGateway/SelectDeviceUnit.js +29 -0
  207. package/src/screens/AddNewGateway/SelectModbusGateway.js +34 -0
  208. package/src/screens/AddNewGateway/SelectZigbeeGateway.js +34 -0
  209. package/src/screens/AddNewGateway/ShareWifiPassword.js +198 -0
  210. package/src/screens/AddNewGateway/ShareWifiPasswordStyles.js +44 -0
  211. package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +7 -4
  212. package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +63 -0
  213. package/src/screens/AddNewGateway/__test__/{SelectGateway.test.js → ConnectingWifiDevice.test.js} +15 -10
  214. package/src/screens/AddNewGateway/__test__/ConnectingWifiGuide.test.js +224 -0
  215. package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +62 -0
  216. package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +191 -0
  217. package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +72 -0
  218. package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +75 -0
  219. package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +73 -0
  220. package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +47 -0
  221. package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +124 -0
  222. package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +48 -0
  223. package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +77 -0
  224. package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +77 -0
  225. package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +155 -0
  226. package/src/screens/AddNewGateway/hooks/__Tests__/index.test.js +1 -1
  227. package/src/screens/AddNewGateway/index.js +4 -4
  228. package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +5 -4
  229. package/src/screens/AddNewOneTap/index.js +4 -4
  230. package/src/screens/Automate/__test__/index.test.js +2 -2
  231. package/src/screens/Automate/index.js +6 -2
  232. package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +3 -2
  233. package/src/screens/ConfirmUnitDeletion/index.js +3 -3
  234. package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +5 -5
  235. package/src/screens/Device/EditDevice/index.js +3 -3
  236. package/src/screens/Device/__test__/detail.test.js +38 -22
  237. package/src/screens/Device/components/SensorConnectStatusViewHeader.js +6 -6
  238. package/src/screens/Device/components/SensorDisplayItem.js +2 -2
  239. package/src/screens/Device/detail.js +28 -22
  240. package/src/screens/Device/hooks/useEvaluateValue.js +0 -2
  241. package/src/screens/DeviceInfo/__test__/index.test.js +8 -4
  242. package/src/screens/DeviceInfo/index.js +10 -6
  243. package/src/screens/Drawer/index.js +21 -9
  244. package/src/screens/EditActionsList/__tests__/index.test.js +120 -0
  245. package/src/screens/EditActionsList/index.js +15 -5
  246. package/src/screens/EmergencyContacts/EmergencyContactsAddNew.js +8 -4
  247. package/src/screens/EmergencyContacts/EmergencyContactsList.js +1 -1
  248. package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +5 -3
  249. package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +9 -5
  250. package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +7 -3
  251. package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +7 -3
  252. package/src/screens/EmergencySetting/__test__/DropDownItem.test.js +3 -2
  253. package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
  254. package/src/screens/EnterPassword/__test__/EnterPassword.test.js +6 -3
  255. package/src/screens/EnterPassword/index.js +5 -3
  256. package/src/screens/GuestInfo/__test__/index.test.js +18 -12
  257. package/src/screens/GuestInfo/components/AccessScheduleItem.js +2 -2
  258. package/src/screens/GuestInfo/components/AccessScheduleSheet.js +3 -3
  259. package/src/screens/GuestInfo/components/HeaderGuestInfo.js +2 -2
  260. package/src/screens/GuestInfo/components/RecurringDetail.js +4 -4
  261. package/src/screens/GuestInfo/components/TemporaryDetail.js +3 -3
  262. package/src/screens/GuestInfo/index.js +1 -1
  263. package/src/screens/HanetCamera/Detail.js +10 -4
  264. package/src/screens/HanetCamera/ManageAccess.js +4 -4
  265. package/src/screens/HanetCamera/MemberInfo.js +1 -1
  266. package/src/screens/HanetCamera/__test__/Detail.test.js +5 -3
  267. package/src/screens/HanetCamera/__test__/ManageAccess.test.js +10 -4
  268. package/src/screens/HanetCamera/__test__/MemberInfo.test.js +4 -2
  269. package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
  270. package/src/screens/ManageAccess/index.js +1 -1
  271. package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +4 -4
  272. package/src/screens/MoveToAnotherSubUnit/index.js +2 -2
  273. package/src/screens/PlayBackCamera/__test__/index.test.js +9 -6
  274. package/src/screens/PlayBackCamera/index.js +6 -6
  275. package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +1 -1
  276. package/src/screens/ScanChipQR/components/QRScan/index.js +10 -3
  277. package/src/screens/ScriptDetail/__test__/index.test.js +43 -38
  278. package/src/screens/ScriptDetail/index.js +26 -16
  279. package/src/screens/SelectUnit/__test__/index.test.js +4 -3
  280. package/src/screens/SelectUnit/index.js +3 -3
  281. package/src/screens/SetSchedule/index.js +1 -1
  282. package/src/screens/SharedUnit/__test__/ShareUnit.test.js +25 -0
  283. package/src/screens/SharedUnit/index.js +2 -0
  284. package/src/screens/Sharing/Components/{SensorItem.js → DeviceItem.js} +40 -30
  285. package/src/screens/Sharing/Components/Styles/{SensorItemStyles.js → DeviceItemStyles.js} +0 -0
  286. package/src/screens/Sharing/Components/__test__/{SensorItem.test.js → DeviceItem.test.js} +10 -8
  287. package/src/screens/Sharing/Components/index.js +2 -2
  288. package/src/screens/Sharing/InfoMemberUnit.js +7 -6
  289. package/src/screens/Sharing/MemberList.js +4 -4
  290. package/src/screens/Sharing/SelectPermission.js +139 -123
  291. package/src/screens/Sharing/SelectUser.js +9 -5
  292. package/src/screens/Sharing/Styles/SelectPermissionStyles.js +2 -2
  293. package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +3 -2
  294. package/src/screens/Sharing/__test__/SelectPermission.test.js +67 -14
  295. package/src/screens/Sharing/__test__/SelectUser.test.js +7 -4
  296. package/src/screens/SideMenuDetail/__test__/index.test.js +11 -7
  297. package/src/screens/SideMenuDetail/index.js +2 -2
  298. package/src/screens/SmartAccount/Connecting/index.js +171 -0
  299. package/src/{commons/ConnectingProcess/styles.js → screens/SmartAccount/Connecting/style.js} +3 -22
  300. package/src/screens/SmartAccount/ListDevice/DeviceItem.js +45 -0
  301. package/src/screens/SmartAccount/ListDevice/__test__/DeviceItem.test.js +34 -0
  302. package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +139 -0
  303. package/src/screens/SmartAccount/ListDevice/index.js +186 -0
  304. package/src/screens/SmartAccount/ListDevice/styles/DeviceItemStyles.js +70 -0
  305. package/src/screens/SmartAccount/ListDevice/styles/index.js +85 -0
  306. package/src/screens/SmartAccount/SuccessfullyConnected/DeviceItem.js +37 -0
  307. package/src/{commons/ConnectingProcess/DeviceItem → screens/SmartAccount/SuccessfullyConnected}/DeviceItemStyles.js +13 -5
  308. package/src/screens/SmartAccount/SuccessfullyConnected/__test__/DeviceItem.test.js +65 -0
  309. package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +88 -0
  310. package/src/screens/SmartAccount/SuccessfullyConnected/index.js +101 -0
  311. package/src/screens/SmartAccount/SuccessfullyConnected/styles.js +42 -0
  312. package/src/screens/SmartAccount/__test__/Connecting.test.js +86 -0
  313. package/src/screens/SmartAccount/__test__/SmartAccount.test.js +249 -0
  314. package/src/screens/SmartAccount/index.js +172 -0
  315. package/src/screens/SmartAccount/style.js +70 -0
  316. package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +4 -2
  317. package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +5 -5
  318. package/src/screens/SmartIr/__test__/SmartIr.test.js +14 -6
  319. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +4 -2
  320. package/src/screens/SmartIr/components/{SelectDeviceType.js → SelectIrDeviceType.js} +2 -2
  321. package/src/screens/SmartIr/index.js +1 -1
  322. package/src/screens/SubUnit/AddSubUnit.js +7 -3
  323. package/src/screens/SubUnit/Detail.js +6 -6
  324. package/src/screens/SubUnit/EditSubUnit.js +10 -6
  325. package/src/screens/SubUnit/ManageSubUnit.js +2 -2
  326. package/src/screens/SubUnit/__test__/AddSubUnit.test.js +6 -3
  327. package/src/screens/SubUnit/__test__/Detail.test.js +5 -3
  328. package/src/screens/SubUnit/__test__/EditSubUnit.test.js +9 -5
  329. package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +3 -2
  330. package/src/screens/SyncLGDevice/AddLGDevice.js +4 -4
  331. package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +44 -14
  332. package/src/screens/TDSGuide/__test__/TDSGuide.test.js +4 -2
  333. package/src/screens/TDSGuide/index.js +2 -2
  334. package/src/screens/Template/EditTemplate.js +2 -1
  335. package/src/screens/Template/__test__/detail.test.js +9 -1
  336. package/src/screens/Template/index.js +0 -1
  337. package/src/screens/UVIndexGuide/__test__/UVIndexGuide.test.js +3 -2
  338. package/src/screens/UVIndexGuide/index.js +2 -2
  339. package/src/screens/Unit/AddMenu.js +10 -25
  340. package/src/screens/Unit/ChooseLocation.js +1 -1
  341. package/src/screens/Unit/Detail.js +10 -10
  342. package/src/screens/Unit/ManageUnit.js +21 -15
  343. package/src/screens/Unit/MyAllUnit/index.js +1 -1
  344. package/src/screens/Unit/SelectAddToFavorites.js +7 -8
  345. package/src/screens/Unit/SelectAddress.js +4 -4
  346. package/src/screens/Unit/SmartAccount.js +8 -5
  347. package/src/screens/Unit/SmartAccountItem.js +3 -3
  348. package/src/screens/Unit/Station/__test__/index.test.js +1 -1
  349. package/src/screens/Unit/Station/index.js +2 -2
  350. package/src/screens/Unit/Summaries.js +2 -2
  351. package/src/screens/Unit/__test__/CheckSendEmail.test.js +6 -6
  352. package/src/screens/Unit/__test__/Detail.test.js +17 -12
  353. package/src/screens/Unit/__test__/ManageUnit.test.js +40 -18
  354. package/src/screens/Unit/__test__/SelectAddress.test.js +15 -8
  355. package/src/screens/Unit/__test__/SmartAccount.test.js +8 -5
  356. package/src/screens/Unit/__test__/SmartAccountItem.test.js +4 -3
  357. package/src/screens/Unit/components/AutomateScript/index.js +5 -2
  358. package/src/screens/Unit/components/ListMyAllUnit/index.js +1 -1
  359. package/src/screens/Unit/components/MyAllUnit/__test__/Header.test.js +9 -5
  360. package/src/screens/Unit/components/MyAllUnit/index.js +1 -1
  361. package/src/screens/Unit/components/MyUnitDevice/index.js +8 -5
  362. package/src/screens/Unit/components/SharedUnit/index.js +12 -6
  363. package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +2 -2
  364. package/src/screens/Unit/components/__test__/SharedUnit.test.js +24 -9
  365. package/src/screens/Unit/hook/useUnitConnectRemoteDevices.js +25 -11
  366. package/src/screens/UnitSummary/__test__/index.test.js +4 -2
  367. package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +4 -2
  368. package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +2 -2
  369. package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +4 -2
  370. package/src/screens/UnitSummary/components/PowerConsumption/index.js +2 -2
  371. package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +5 -4
  372. package/src/screens/UnitSummary/components/RunningDevices/index.js +6 -3
  373. package/src/screens/UnitSummary/components/TotalPowerBox/index.js +2 -2
  374. package/src/screens/UnitSummary/components/TotalPowerConsumption/index.js +2 -2
  375. package/src/screens/UnitSummary/components/__test__/TotalPowerBox.test.js +3 -2
  376. package/src/screens/UnitSummary/components/__test__/TotalPowerConsumption.test.js +4 -2
  377. package/src/screens/UnitSummary/index.js +10 -8
  378. package/src/screens/WaterQualityGuide/__test__/index.test.js +17 -12
  379. package/src/screens/WaterQualityGuide/index.js +26 -10
  380. package/src/utils/Apis/axios.js +1 -0
  381. package/src/utils/I18n/translations/en.json +36 -11
  382. package/src/utils/I18n/translations/vi.json +36 -10
  383. package/src/utils/Route/index.js +19 -10
  384. package/src/utils/Utils.js +6 -7
  385. package/src/utils/Validation.js +4 -0
  386. package/src/commons/Connecting/index.js +0 -67
  387. package/src/commons/ConnectingProcess/DeviceItem/DeviceItem.js +0 -28
  388. package/src/commons/ConnectingProcess/__test__/Connecting.test.js +0 -163
  389. package/src/commons/ConnectingProcess/__test__/DeviceItem.test.js +0 -19
  390. package/src/commons/ConnectingProcess/index.js +0 -213
  391. package/src/hooks/IoT/useGGHomeConnection.js +0 -91
  392. package/src/iot/RemoteControl/index.js +0 -55
  393. package/src/screens/AddNewDevice/ConnectDevices.js +0 -184
  394. package/src/screens/AddNewDevice/__test__/ConnectDevices.test.js +0 -131
  395. package/src/screens/AddNewGateway/ConnectedGateway.js +0 -139
  396. package/src/screens/AddNewGateway/ConnectingGateway.js +0 -137
  397. package/src/screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning.js +0 -214
  398. package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +0 -319
  399. package/src/screens/AddNewGateway/PlugAndPlay/__test__/ConnectWifiWarning.test.js +0 -75
  400. package/src/screens/AddNewGateway/PlugAndPlay/__test__/GatewayWifiList.test.js +0 -130
  401. package/src/screens/AddNewGateway/SelectGateway.js +0 -133
  402. package/src/screens/AddNewGateway/SetupGatewayWifi.js +0 -207
  403. package/src/screens/AddNewGateway/__test__/ConnectedGateway.test.js +0 -71
  404. package/src/screens/AddNewGateway/__test__/ConnectingGateway.test.js +0 -96
  405. package/src/screens/AddNewGateway/__test__/SetupGateway.test.js +0 -120
  406. package/src/screens/ScanChipQR/__test__/ScanChipQR.test.js +0 -115
  407. package/src/screens/ScanChipQR/hooks/index.js +0 -120
  408. package/src/screens/ScanChipQR/index.js +0 -29
  409. package/src/screens/ScanSensorQR/__test__/ScanSensorQR.test.js +0 -111
  410. package/src/screens/ScanSensorQR/hooks/index.js +0 -40
  411. package/src/screens/ScanSensorQR/index.js +0 -39
@@ -40,7 +40,7 @@ import {
40
40
  STATE_VALUE_SENSOR_TYPES,
41
41
  } from '../../configs/Constants';
42
42
  import { popAction } from '../../navigations/utils';
43
- import { TESTID } from '../../configs/Constants';
43
+ import { AccessibilityLabel } from '../../configs/Constants';
44
44
  import useKeyboardAnimated from '../../hooks/Explore/useKeyboardAnimated';
45
45
  import { REPEAT_OPTIONS } from '../SetSchedule/components/RepeatOptionsPopup';
46
46
  import { useSCContextSelector } from '../../context';
@@ -302,7 +302,7 @@ const ScriptDetail = ({ route }) => {
302
302
  <TouchableOpacity
303
303
  onPress={onPressAddAction}
304
304
  style={[styles.rightItemAdd]}
305
- testID={TESTID.BUTTON_ADD_SCRIPT_ACTION}
305
+ accessibilityLabel={AccessibilityLabel.BUTTON_ADD_SCRIPT_ACTION}
306
306
  >
307
307
  <Add />
308
308
  <Text type="H4" color={Colors.Gray8} style={styles.addAction}>
@@ -321,8 +321,7 @@ const ScriptDetail = ({ route }) => {
321
321
  <PreventDoubleTouch
322
322
  style={[styles.buttonStar, styles.headerButton]}
323
323
  onPress={onPressStar}
324
- testID={TESTID.HEADER_SCRIPT_DETAIL_BUTTON_STAR}
325
- accessibilityLabel={TESTID.HEADER_SCRIPT_DETAIL_BUTTON_STAR}
324
+ accessibilityLabel={AccessibilityLabel.HEADER_SCRIPT_DETAIL_BUTTON_STAR}
326
325
  >
327
326
  {isStarred ? (
328
327
  <IconFill name="star" size={25} color={Colors.Yellow6} />
@@ -363,17 +362,9 @@ const ScriptDetail = ({ route }) => {
363
362
  const isHaveScriptActions = data?.length > 0;
364
363
 
365
364
  const textCondition = useMemo(() => {
366
- const {
367
- condition,
368
- config_name,
369
- value,
370
- repeat,
371
- date_repeat,
372
- time_repeat,
373
- weekday_repeat,
374
- sensor_type,
375
- } = automate;
376
365
  if (type === AUTOMATE_TYPE.VALUE_CHANGE) {
366
+ const { condition, config_name, value, sensor_type } =
367
+ automate?.value_change;
377
368
  const stateConditionData = STATE_VALUE_SENSOR_TYPES.find(
378
369
  (i) => i.type === sensor_type
379
370
  );
@@ -389,6 +380,8 @@ const ScriptDetail = ({ route }) => {
389
380
  }
390
381
  return `${config_name} ${t(text)} ${isNumberValue ? value : ''}`;
391
382
  } else if (type === AUTOMATE_TYPE.SCHEDULE) {
383
+ const { repeat, time_repeat, date_repeat, weekday_repeat } =
384
+ automate?.schedule;
392
385
  const time =
393
386
  time_repeat?.length >= 8
394
387
  ? time_repeat.substring(0, time_repeat?.length - 3)
@@ -425,6 +418,21 @@ const ScriptDetail = ({ route }) => {
425
418
  const textWeekday = sortWeekday.map((item) => weekday[item]).join(', ');
426
419
  return `${textWeekday} ${t('at')} ${time}`;
427
420
  }
421
+ } else if (type === AUTOMATE_TYPE.EVENT) {
422
+ const { action, end_device_name, config_name, sensor_type, value } =
423
+ automate?.event;
424
+ let textEvent = '';
425
+ if (config_name) {
426
+ const stateConditionData = STATE_VALUE_SENSOR_TYPES.find(
427
+ (i) => i.type === sensor_type
428
+ );
429
+ textEvent = `${config_name} - ${t(
430
+ stateConditionData.stateValue[value]
431
+ )}`;
432
+ } else {
433
+ textEvent = `${end_device_name} - ${action}`;
434
+ }
435
+ return textEvent;
428
436
  }
429
437
  return null;
430
438
  }, [t, automate, type]);
@@ -451,7 +459,7 @@ const ScriptDetail = ({ route }) => {
451
459
  <TouchableOpacity
452
460
  onPress={handleScriptAction}
453
461
  style={styles.activeButton}
454
- testID={TESTID.BUTTON_ACTIVATE_ONE_TAP}
462
+ accessibilityLabel={AccessibilityLabel.BUTTON_ACTIVATE_ONE_TAP}
455
463
  >
456
464
  <Image source={Images.activeButton} />
457
465
  </TouchableOpacity>
@@ -465,7 +473,9 @@ const ScriptDetail = ({ route }) => {
465
473
  <TouchableOpacity
466
474
  onPress={onPressEdit}
467
475
  style={styles.editButton}
468
- testID={TESTID.BUTTON_EDIT_SCRIPT_ACTION}
476
+ accessibilityLabel={
477
+ AccessibilityLabel.BUTTON_EDIT_SCRIPT_ACTION
478
+ }
469
479
  >
470
480
  <Text type="Label" hilight>
471
481
  {t('edit')}
@@ -7,7 +7,7 @@ import MockAdapter from 'axios-mock-adapter';
7
7
  import SelectUnit from '../';
8
8
  import { SCProvider } from '../../../context';
9
9
  import { mockSCStore } from '../../../context/mockStore';
10
- import { TESTID } from '../../../configs/Constants';
10
+ import { AccessibilityLabel } from '../../../configs/Constants';
11
11
  import Routes from '../../../utils/Route';
12
12
  import api from '../../../utils/Apis/axios';
13
13
  import { API } from '../../../configs';
@@ -149,7 +149,7 @@ describe('Test Select unit screen', () => {
149
149
 
150
150
  const buttonContinue = instance.findAll(
151
151
  (el) =>
152
- el.props.testID === TESTID.BOTTOM_VIEW_MAIN &&
152
+ el.props.accessibilityLabel === AccessibilityLabel.BOTTOM_VIEW_MAIN &&
153
153
  el.type === TouchableOpacity
154
154
  );
155
155
 
@@ -179,7 +179,8 @@ describe('Test Select unit screen', () => {
179
179
 
180
180
  const iconClose = instance.findAll(
181
181
  (el) =>
182
- el.props.testID === TESTID.ICON_CLOSE && el.type === TouchableOpacity
182
+ el.props.accessibilityLabel === AccessibilityLabel.ICON_CLOSE &&
183
+ el.type === TouchableOpacity
183
184
  );
184
185
 
185
186
  expect(iconClose).toHaveLength(1);
@@ -12,7 +12,7 @@ import BottomButtonView from '../../commons/BottomButtonView';
12
12
  import { useNavigation, useRoute } from '@react-navigation/native';
13
13
  import { popAction } from '../../navigations/utils';
14
14
  import Routes from '../../utils/Route';
15
- import { TESTID } from '../../configs/Constants';
15
+ import { AccessibilityLabel } from '../../configs/Constants';
16
16
 
17
17
  const SelectUnit = () => {
18
18
  const t = useTranslations();
@@ -100,7 +100,7 @@ const SelectUnit = () => {
100
100
  key={id}
101
101
  onPress={onPressItem(item)}
102
102
  style={styles.wrapItem}
103
- testID={TESTID.ITEM_UNIT}
103
+ accessibilityLabel={AccessibilityLabel.ITEM_UNIT}
104
104
  >
105
105
  <View style={[styles.notSelected, isSelectedItem && styles.selected]}>
106
106
  {isSelectedItem && <View style={styles.childSelected} />}
@@ -131,7 +131,7 @@ const SelectUnit = () => {
131
131
  <TouchableOpacity
132
132
  style={styles.buttonClose}
133
133
  onPress={handleOnGoBackAndClose}
134
- testID={TESTID.ICON_CLOSE}
134
+ accessibilityLabel={AccessibilityLabel.ICON_CLOSE}
135
135
  >
136
136
  <Icon name={'close'} size={24} color={Colors.Black} />
137
137
  </TouchableOpacity>
@@ -29,7 +29,7 @@ const SetSchedule = ({ route }) => {
29
29
  automate = {},
30
30
  scriptName,
31
31
  oldType,
32
- } = route.params;
32
+ } = route?.params || {};
33
33
  const { navigate, dispatch, goBack } = useNavigation();
34
34
  const [repeat, setRepeat] = useState(automate.repeat || REPEAT_OPTIONS.ONCE);
35
35
 
@@ -4,6 +4,12 @@ import SharedUnit from '../index';
4
4
  import Modal from 'react-native-modal';
5
5
  import { SCProvider } from '../../../context';
6
6
  import { mockSCStore } from '../../../context/mockStore';
7
+ import { AccessibilityLabel } from '../../../configs/Constants';
8
+ import MockAdapter from 'axios-mock-adapter';
9
+ import api from '../../../utils/Apis/axios';
10
+ import { API } from '../../../configs';
11
+
12
+ const mock = new MockAdapter(api.axiosInstance);
7
13
 
8
14
  const wrapComponent = () => (
9
15
  <SCProvider initState={mockSCStore({})}>
@@ -16,9 +22,11 @@ jest.mock('react-redux', () => ({
16
22
  useSelector: jest.fn(),
17
23
  }));
18
24
 
25
+ const mockSetSharedUnits = jest.fn();
19
26
  jest.mock('react', () => ({
20
27
  ...jest.requireActual('react'),
21
28
  useLayoutEffect: jest.fn(),
29
+ useState: jest.fn((init) => [init, mockSetSharedUnits]),
22
30
  }));
23
31
 
24
32
  jest.mock('react-native-onesignal', () => {
@@ -37,4 +45,21 @@ describe('test SharedUnit', () => {
37
45
  const modalShareds = instance.findAllByType(Modal);
38
46
  expect(modalShareds[0]).not.toBeUndefined();
39
47
  });
48
+
49
+ test('render touch item filter', async () => {
50
+ mock.onGet(API.UNIT.FILTER_SHARED_UNITS()).reply(200, [{}]);
51
+
52
+ await act(async () => {
53
+ tree = await create(wrapComponent());
54
+ });
55
+ const instance = tree.root;
56
+ const item = instance.findAll(
57
+ (el) =>
58
+ el.props.accessibilityLabel === AccessibilityLabel.FILTER_SHARING_ITEM
59
+ );
60
+ await act(async () => {
61
+ item[0].props.onPress();
62
+ });
63
+ expect(mockSetSharedUnits).toBeCalled();
64
+ });
40
65
  });
@@ -12,6 +12,7 @@ import {
12
12
  useBoolean,
13
13
  useBlockBackAndroid,
14
14
  } from '../../hooks/Common';
15
+ import { AccessibilityLabel } from '../../configs/Constants';
15
16
 
16
17
  import styles from './styles';
17
18
  import TabHeader from './TabHeader';
@@ -185,6 +186,7 @@ const Shared = () => {
185
186
  style={styles.row}
186
187
  onPress={() => onFilter(item.filter, item.textFilter)}
187
188
  key={`filter-${index}`}
189
+ accessibilityLabel={`${AccessibilityLabel.FILTER_SHARING_ITEM}`}
188
190
  >
189
191
  <Text
190
192
  style={
@@ -1,21 +1,28 @@
1
1
  import React, { memo, useEffect, useMemo, useState } from 'react';
2
- import { View, Text, LayoutAnimation, Platform, UIManager } from 'react-native';
2
+ import {
3
+ View,
4
+ Text,
5
+ LayoutAnimation,
6
+ Platform,
7
+ UIManager,
8
+ TouchableOpacity,
9
+ } from 'react-native';
3
10
  import { IconOutline } from '@ant-design/icons-react-native';
4
11
  import { Colors } from '../../../configs';
5
- import styles from './Styles/SensorItemStyles';
12
+ import styles from './Styles/DeviceItemStyles';
6
13
  import FImage from '../../../commons/FImage';
7
14
  import { TitleCheckBox } from '.';
8
15
  import { CheckBoxCustom } from '.';
9
- import { TESTID } from '../../../configs/Constants';
16
+ import { AccessibilityLabel } from '../../../configs/Constants';
10
17
 
11
- const SensorItem = ({
18
+ const DeviceItem = ({
12
19
  item = {},
13
20
  isRenderSeparated,
14
21
  onTickedChild,
15
- onTickedSensor,
16
- titleGroup,
17
- activeItemId,
18
- setActiveItemId,
22
+ onTickedDevice,
23
+ onTickedDeviceIcon,
24
+ isItemExpanded,
25
+ toggleItem,
19
26
  idGroup,
20
27
  }) => {
21
28
  const {
@@ -31,14 +38,12 @@ const SensorItem = ({
31
38
  ...read_configs.map((i) => ({ ...i, isConfig: true })),
32
39
  ]);
33
40
 
34
- const expanded = activeItemId === id;
35
-
36
41
  const onPressItem = () => {
37
42
  if (dataConfig.length > 0) {
38
- expanded ? setActiveItemId(-1) : setActiveItemId(id);
43
+ toggleItem();
39
44
  LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
40
45
  } else {
41
- handleOnTickedSensor();
46
+ handleOnTickedDevice();
42
47
  }
43
48
  };
44
49
 
@@ -60,17 +65,22 @@ const SensorItem = ({
60
65
  );
61
66
  };
62
67
 
63
- const handleOnTickedSensor = () => {
64
- onTickedSensor && onTickedSensor(idGroup, id, !isChecked);
68
+ const isCheckedIcon = useMemo(() => {
69
+ return dataConfig.some((i) => i.isChecked);
70
+ }, [dataConfig]);
71
+
72
+ const handleOnTickedIcon = () => {
73
+ onTickedDeviceIcon && onTickedDeviceIcon(idGroup, id, isCheckedIcon);
74
+ };
75
+
76
+ const handleOnTickedDevice = () => {
77
+ onTickedDevice && onTickedDevice(idGroup, id, !isChecked);
65
78
  };
66
79
 
67
80
  useEffect(() => {
68
- if (
69
- Platform.OS === 'android' &&
70
- UIManager.setLayoutAnimationEnabledExperimental
71
- ) {
81
+ Platform.OS === 'android' &&
82
+ UIManager.setLayoutAnimationEnabledExperimental &&
72
83
  UIManager.setLayoutAnimationEnabledExperimental(true);
73
- }
74
84
  }, []);
75
85
 
76
86
  const renderData = useMemo(() => {
@@ -94,27 +104,27 @@ const SensorItem = ({
94
104
 
95
105
  return (
96
106
  <View style={[styles.wrap, !isRenderSeparated && styles.isRenderSeparated]}>
97
- <FImage
98
- source={{ uri: icon_kit }}
99
- style={styles.viewLeft}
100
- tintColor={
101
- dataConfig.some((i) => i.isChecked) ? Colors.Primary : Colors.Gray
102
- }
103
- />
107
+ <TouchableOpacity onPress={handleOnTickedIcon}>
108
+ <FImage
109
+ source={{ uri: icon_kit }}
110
+ style={styles.viewLeft}
111
+ tintColor={isCheckedIcon ? Colors.Primary : Colors.Gray}
112
+ />
113
+ </TouchableOpacity>
104
114
  <View style={styles.wrapRight}>
105
115
  <View style={styles.viewRight}>
106
116
  <Text
107
117
  numberOfLines={1}
108
118
  style={styles.text}
109
119
  onPress={onPressItem}
110
- testID={TESTID.TEXT_SENSOR_ITEM}
120
+ accessibilityLabel={AccessibilityLabel.TEXT_SENSOR_ITEM}
111
121
  >
112
122
  {name}
113
123
  </Text>
114
124
  {dataConfig.length > 0 ? (
115
125
  <IconOutline
116
126
  onPress={onPressItem}
117
- name={expanded ? 'up' : 'down'}
127
+ name={isItemExpanded ? 'up' : 'down'}
118
128
  size={20}
119
129
  color={Colors.Gray6}
120
130
  />
@@ -126,11 +136,11 @@ const SensorItem = ({
126
136
  />
127
137
  )}
128
138
  </View>
129
- {expanded && <View style={styles.wrapExpand}>{renderData}</View>}
139
+ {isItemExpanded && <View style={styles.wrapExpand}>{renderData}</View>}
130
140
  {isRenderSeparated && <View style={styles.viewSeparated} />}
131
141
  </View>
132
142
  </View>
133
143
  );
134
144
  };
135
145
 
136
- export default memo(SensorItem);
146
+ export default memo(DeviceItem);
@@ -3,9 +3,9 @@ import { create, act } from 'react-test-renderer';
3
3
 
4
4
  import { SCProvider } from '../../../../context';
5
5
  import { mockSCStore } from '../../../../context/mockStore';
6
- import SensorItem from '../SensorItem';
6
+ import DeviceItem from '../DeviceItem';
7
7
  import { Text } from 'react-native';
8
- import { TESTID } from '../../../../configs/Constants';
8
+ import { AccessibilityLabel } from '../../../../configs/Constants';
9
9
 
10
10
  jest.mock('react', () => {
11
11
  return {
@@ -14,21 +14,21 @@ jest.mock('react', () => {
14
14
  };
15
15
  });
16
16
 
17
- const mockOnTickedSensor = jest.fn();
17
+ const mockOnTickedDevice = jest.fn();
18
18
  const mockOnTickedChild = jest.fn();
19
19
  const wrapComponent = (item) => (
20
20
  <SCProvider initState={mockSCStore({})}>
21
- <SensorItem
21
+ <DeviceItem
22
22
  item={item}
23
23
  onTickedChild={mockOnTickedChild}
24
- onTickedSensor={mockOnTickedSensor}
24
+ onTickedSensor={mockOnTickedDevice}
25
25
  activeItemId={item.id}
26
26
  />
27
27
  </SCProvider>
28
28
  );
29
29
 
30
- describe('test SensorItem', () => {
31
- test('test SensorItem', () => {
30
+ describe('test DeviceItem', () => {
31
+ test('test DeviceItem', () => {
32
32
  const item = {
33
33
  id: 1,
34
34
  name: 'abc',
@@ -43,7 +43,9 @@ describe('test SensorItem', () => {
43
43
  });
44
44
  const instance = tree.root;
45
45
  const onPressText = instance.find(
46
- (el) => el.type === Text && el.props.testID === TESTID.TEXT_SENSOR_ITEM
46
+ (el) =>
47
+ el.type === Text &&
48
+ el.props.accessibilityLabel === AccessibilityLabel.TEXT_SENSOR_ITEM
47
49
  );
48
50
  expect(onPressText).toBeDefined();
49
51
  act(() => {
@@ -1,5 +1,5 @@
1
1
  import CheckBoxCustom from './CheckBoxCustom';
2
2
  import TitleCheckBox from './TitleCheckBox';
3
- import SensorItem from './SensorItem';
3
+ import DeviceItem from './DeviceItem';
4
4
 
5
- export { CheckBoxCustom, TitleCheckBox, SensorItem };
5
+ export { CheckBoxCustom, TitleCheckBox, DeviceItem };
@@ -17,14 +17,15 @@ import OwnerSvg from '../../Images/Common/owner.svg';
17
17
  import styles from './Styles/inforMemberUnitStyles';
18
18
  import { useNavigation, useIsFocused } from '@react-navigation/native';
19
19
  import Routes from '../../utils/Route';
20
- import { TESTID } from '../../configs/Constants';
20
+ import { AccessibilityLabel } from '../../configs/Constants';
21
21
 
22
22
  const InfoMemberUnit = memo(({ route }) => {
23
23
  const t = useTranslations();
24
- const { member, unit } = route.params || {
25
- member: {},
26
- unit: {},
27
- };
24
+ const { member, unit } = route?.params ||
25
+ {} || {
26
+ member: {},
27
+ unit: {},
28
+ };
28
29
  const { navigate } = useNavigation();
29
30
  const [isLoading, setIsLoading] = useState(true);
30
31
  const [memberInfo, setMemberInfo] = useState({});
@@ -236,7 +237,7 @@ const InfoMemberUnit = memo(({ route }) => {
236
237
  <TouchableOpacity
237
238
  style={styles.removeButton}
238
239
  onPress={() => onPressRemoveUser(member)}
239
- testID={TESTID.REMOVE_MEMBER}
240
+ accessibilityLabel={AccessibilityLabel.REMOVE_MEMBER}
240
241
  >
241
242
  <Text
242
243
  type={'H4'}
@@ -12,7 +12,7 @@ import { useIsOwnerOfUnit } from '../../hooks/Common';
12
12
  import AlertAction from '../../commons/AlertAction';
13
13
 
14
14
  import { useDataMember, useStateAlertAction } from './hooks';
15
- import { TESTID } from '../../configs/Constants';
15
+ import { AccessibilityLabel } from '../../configs/Constants';
16
16
  import { useSCContextSelector } from '../../context';
17
17
 
18
18
  const MemberList = ({ route }) => {
@@ -20,7 +20,7 @@ const MemberList = ({ route }) => {
20
20
  const { navigate } = useNavigation();
21
21
  const isFocused = useIsFocused();
22
22
  const account = useSCContextSelector((state) => state.auth.account);
23
- const { unitId, unit } = route.params;
23
+ const { unitId, unit } = route?.params || {};
24
24
  const { dataMembers, isRefresh, onRefresh, leaveUnit, loading } =
25
25
  useDataMember(unitId, unit?.user_id);
26
26
  const { isOwner } = useIsOwnerOfUnit(unit?.user_id);
@@ -54,7 +54,7 @@ const MemberList = ({ route }) => {
54
54
 
55
55
  const rightHeader = (
56
56
  <TouchableOpacity
57
- testID={TESTID.MEMBER_LIST_RIGHT_HEADER_TOUCH}
57
+ accessibilityLabel={AccessibilityLabel.MEMBER_LIST_RIGHT_HEADER_TOUCH}
58
58
  onPress={onPressRightHeader}
59
59
  style={styles.rightHeader}
60
60
  >
@@ -78,7 +78,7 @@ const MemberList = ({ route }) => {
78
78
  >
79
79
  {!loading && (
80
80
  <SharingMembers
81
- testID={TESTID.SHARING_MEMBER}
81
+ accessibilityLabel={AccessibilityLabel.SHARING_MEMBER}
82
82
  dataMember={dataMembers}
83
83
  unit={unit}
84
84
  ownerId={unit.user_id}