@eohjsc/react-native-smart-city 0.6.2 → 0.7.3-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/android/build.gradle +7 -10
- package/assets/images/Automation-fill.svg +85 -0
- package/assets/images/Scenario-filled.svg +22 -0
- package/assets/images/schedule-fill.svg +48 -0
- package/package.json +53 -70
- package/src/commons/Action/ItemQuickAction.js +1 -1
- package/src/commons/Action/__test__/ItemQuickAction.test.js +2 -2
- package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +3 -3
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +3 -3
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/ItemPasscode.test.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +3 -3
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +3 -3
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +0 -15
- package/src/commons/ActionGroup/OnOffTemplate/OnOffSimpleTemplate.js +2 -2
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +2 -2
- package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +2 -2
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +5 -5
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +5 -5
- package/src/commons/ActionGroup/TerminalBoxTemplate.js +2 -2
- package/src/commons/ActionGroup/TextBoxTemplate.js +2 -2
- package/src/commons/ActionGroup/ThreeButtonTemplate/__test__/ThreeButtonTemplate.test.js +4 -4
- package/src/commons/ActionGroup/TimerActionTemplate.js +4 -5
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +2 -2
- package/src/commons/ActionGroup/__test__/ColorPickerTemplate.test.js +4 -9
- package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +2 -9
- package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +4 -11
- package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +2 -9
- package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +4 -18
- package/src/commons/ActionGroup/__test__/OneBigButtonTemplate.test.js +2 -2
- package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +1 -8
- package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +0 -7
- package/src/commons/ActionGroup/__test__/SwitchButtonTemplate.test.js +4 -15
- package/src/commons/ActionGroup/__test__/TerminalBoxTemplate.test.js +0 -7
- package/src/commons/ActionGroup/__test__/TextBoxTemplate.test.js +1 -8
- package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +8 -15
- package/src/commons/ActionGroup/__test__/TimerActionTemplateWithutConfigValue.test.js +2 -10
- package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +3 -20
- package/src/commons/ActionGroup/__test__/index.test.js +15 -23
- package/src/commons/ActionTemplate/__test__/index.test.js +2 -0
- package/src/commons/ActionTemplate/__test__/utils.js +21 -0
- package/src/commons/ActionTemplate/index.js +1 -2
- package/src/commons/BackDefault/index.js +2 -2
- package/src/commons/ButtonPopup/index.js +2 -2
- package/src/commons/Calendar/__test__/Calendar.test.js +0 -7
- package/src/commons/CircleButton/__test__/CircleButton.test.js +2 -2
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +11 -25
- package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +27 -20
- package/src/commons/Dashboard/MyUnit/index.js +0 -1
- package/src/commons/DateTimeRangeChange/DateTimeButton.js +2 -2
- package/src/commons/DateTimeRangeChange/__test__/DateTimeButton.test.js +4 -4
- package/src/commons/DateTimeRangeChange/index.js +3 -3
- package/src/commons/Device/ConnectedViewHeader.js +2 -2
- package/src/commons/Device/DisconnectedView.js +2 -2
- package/src/commons/Device/Emergency/EmergencyDetail.js +3 -3
- package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +2 -2
- package/src/commons/Device/FlatListItems.js +3 -3
- package/src/commons/Device/Hanet/ItemHanetDevice.js +3 -3
- package/src/commons/Device/Hanet/ItemHanetDevice.test.js +3 -11
- package/src/commons/Device/ItemAddNew/index.js +2 -2
- package/src/commons/Device/ItemDevice.js +5 -21
- package/src/commons/Device/SonosSpeaker/index.js +3 -3
- package/src/commons/Device/WaterPurifierStatus/AlertStatusMachine.js +2 -2
- package/src/commons/Device/WaterQualitySensor/QualityIndicatorsItem.js +2 -6
- package/src/commons/DisplayChecking/index.js +2 -2
- package/src/commons/EmergencyButton/AlertSendConfirm.js +2 -2
- package/src/commons/EmergencyButton/AlertSent.js +6 -2
- package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
- package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +5 -5
- package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +9 -9
- package/src/commons/Form/CurrencyInput.js +1 -15
- package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +1 -22
- package/src/commons/Header/HeaderCustom.js +8 -3
- package/src/commons/HeaderAni/index.js +2 -2
- package/src/commons/IconComponent/index.js +3 -3
- package/src/commons/MediaPlayerDetail/MediaPlayerFull.js +1 -1
- package/src/commons/MediaPlayerDetail/__test__/MediaPlayerFull.test.js +12 -48
- package/src/commons/MenuActionAddnew/__test__/MenuActionAddNew.test.js +1 -1
- package/src/commons/MenuActionList/__test__/MenuActionList.test.js +1 -0
- package/src/commons/MenuActionMore/MenuActionMoreStyles.js +2 -1
- package/src/commons/MenuActionMore/index.js +1 -1
- package/src/commons/NavBar/NavBarStyles.js +1 -1
- package/src/commons/NavBar/index.js +2 -2
- package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +3 -3
- package/src/commons/PreventAccess/__test__/PreventAccess.test.js +1 -13
- package/src/commons/Processing/__test__/Connecting.test.js +3 -14
- package/src/commons/SearchLocation/index.js +3 -3
- package/src/commons/SelectActionCard/index.js +2 -2
- package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +1 -18
- package/src/commons/SelectSubUnit/index.js +2 -2
- package/src/commons/SelectUnit/__test__/SelectUnit.test.js +1 -13
- package/src/commons/Sharing/BtnRemoveMember.js +2 -2
- package/src/commons/Sharing/StationDevicePermissions.js +2 -2
- package/src/commons/Sharing/WrapHeaderScrollable.js +1 -1
- package/src/commons/Sharing/__test__/ButtonRemoveMember.test.js +2 -2
- package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +1 -1
- package/src/commons/SubUnit/DeviceTemplate/ConfigAndEvaluation/ConfigAndEvaluation.js +2 -2
- package/src/commons/SubUnit/DeviceTemplate/ConfigValue/ConfigValue.js +2 -2
- package/src/commons/SubUnit/DeviceTemplate/EvaluationOverConfig/EvaluationOverConfig.js +2 -2
- package/src/commons/SubUnit/Item/index.js +3 -3
- package/src/commons/SubUnit/OneTap/ItemOneTap.js +5 -5
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +11 -8
- package/src/commons/SubUnit/__test__/Favorites.test.js +1 -13
- package/src/commons/SubUnit/__test__/ShortDetail.test.js +5 -16
- package/src/commons/SummaryItem/index.js +22 -23
- package/src/commons/Tabbar/__test__/index.test.js +0 -11
- package/src/commons/Unit/HeaderUnit/index.js +93 -85
- package/src/commons/Unit/SharedUnit.js +7 -7
- package/src/commons/Unit/__test__/HeaderUnit.test.js +29 -52
- package/src/commons/Unit/__test__/SharedUnit.test.js +94 -105
- package/src/commons/UnitSummary/AirQuality/SegmentedRoundDisplay/index.js +11 -30
- package/src/commons/Widgets/IFrameWithConfig/IFrameWithConfig.js +44 -1
- package/src/commons/Widgets/IFrameWithConfig/__tests__/IFrameWithConfig.test.js +69 -0
- package/src/commons/WrapParallaxScrollView/index.js +20 -50
- package/src/configs/API.js +1 -2
- package/src/configs/Constants.js +3 -3
- package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +4 -15
- package/src/hooks/Common/useIsOwnerOfUnit.js +1 -1
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +1 -1
- package/src/hooks/IoT/__test__/useWatchConfigs.test.js +6 -21
- package/src/iot/RemoteControl/HomeAssistant.js +1 -1
- package/src/iot/RemoteControl/__test__/Bluetooth.test.js +234 -232
- package/src/navigations/AddDeviceStack.js +2 -2
- package/src/navigations/AddGatewayStack.js +2 -2
- package/src/navigations/AddLGDeviceStack.js +2 -2
- package/src/navigations/AddMemberStack.js +2 -2
- package/src/navigations/AddSubUnitStack.js +2 -2
- package/src/navigations/AddUnitStack.js +2 -2
- package/src/navigations/AllGatewayStack.js +2 -2
- package/src/navigations/AutomateStack.js +4 -4
- package/src/navigations/EmergencyContactsStack.js +4 -4
- package/src/navigations/GatewayStack.js +2 -2
- package/src/navigations/HanetCameraStack.js +2 -2
- package/src/navigations/Main.js +2 -2
- package/src/navigations/NotificationStack.js +2 -2
- package/src/navigations/SharedStack.js +8 -6
- package/src/navigations/SmartAccountStack.js +2 -2
- package/src/navigations/SmartIrStack.js +2 -2
- package/src/navigations/SmartLockStack.js +2 -2
- package/src/navigations/SmartStack.js +2 -2
- package/src/navigations/TemplateStack.js +2 -2
- package/src/navigations/UnitStack.js +4 -12
- package/src/navigations/utils.js +1 -4
- package/src/screens/ActivityLog/hooks/index.js +7 -4
- package/src/screens/ActivityLog/index.js +2 -2
- package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +4 -21
- package/src/screens/AddCommon/__test__/SelectUnit.test.js +7 -19
- package/src/screens/AddLocationMaps/__test__/index.test.js +3 -13
- package/src/screens/AddLocationMaps/index.js +11 -6
- package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +3 -20
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +11 -18
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/ZigbeeDeviceConnectGuide.test.js +4 -21
- package/src/screens/AddNewGateway/RenameNewDevices.js +2 -2
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +3 -3
- package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +0 -17
- package/src/screens/AddNewGateway/__test__/ConnectingWifiDevice.test.js +4 -19
- package/src/screens/AddNewGateway/__test__/ConnectingWifiGuide.test.js +3 -15
- package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +31 -51
- package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +9 -22
- package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +12 -19
- package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +6 -16
- package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +4 -15
- package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +3 -3
- package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +18 -10
- package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +12 -9
- package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +12 -9
- package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +7 -21
- package/src/screens/AllGateway/DetailConfigActionInternal/__test__/index.test.js +0 -20
- package/src/screens/AllGateway/DetailConfigActionModbus/__test__/index.test.js +7 -24
- package/src/screens/AllGateway/DeviceGatewayInfo/__test__/index.test.js +0 -17
- package/src/screens/AllGateway/DeviceInternalDetail/__test__/index.test.js +84 -100
- package/src/screens/AllGateway/DeviceModbusDetail/__test__/index.test.js +64 -82
- package/src/screens/AllGateway/DeviceZigbeeDetail/__test__/index.test.js +36 -55
- package/src/screens/AllGateway/GatewayConnectionMethods/__test__/index.test.js +9 -18
- package/src/screens/AllGateway/GatewayDetail/__test__/index.test.js +10 -37
- package/src/screens/AllGateway/GatewayInfo/__test__/index.test.js +7 -32
- package/src/screens/AllGateway/__test__/index.test.js +1 -14
- package/src/screens/AllGateway/components/GatewayItem/__test__/index.test.js +0 -12
- package/src/screens/AllGateway/components/TabPaneCT/__test__/index.test.js +1 -13
- package/src/screens/AllGateway/components/TabPaneCT/index.js +1 -1
- package/src/screens/AllGateway/hooks/__test__/index.test.js +1 -8
- package/src/screens/AllGateway/test-utils.js +1 -1
- package/src/screens/Automate/AddNewAction/NewActionWrapper.js +2 -2
- package/src/screens/Automate/AddNewAction/SetupConfigCondition.js +27 -28
- package/src/screens/Automate/AddNewAction/__test__/ChooseAction.test.js +3 -3
- package/src/screens/Automate/AddNewAction/__test__/ChooseConfig.test.js +8 -5
- package/src/screens/Automate/AddNewAction/__test__/SelectControlDevices.test.js +2 -2
- package/src/screens/Automate/AddNewAction/__test__/SelectMonitorDevices.test.js +1 -18
- package/src/screens/Automate/AddNewAction/__test__/SetupConfigCondition.test.js +17 -15
- package/src/screens/Automate/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +4 -4
- package/src/screens/Automate/EditActionsList/__tests__/UpdateActionScript.test.js +38 -55
- package/src/screens/Automate/EditActionsList/__tests__/UpdateDelayScript.test.js +0 -18
- package/src/screens/Automate/EditActionsList/__tests__/UpdateNotifyScript.test.js +1 -19
- package/src/screens/Automate/EditActionsList/__tests__/index.test.js +14 -11
- package/src/screens/Automate/OneTap/__test__/AddNewOneTap.test.js +3 -3
- package/src/screens/Automate/Scenario/__test__/AddNewOneTap.test.js +2 -2
- package/src/screens/Automate/ScriptDetail/Components/AddActionScript.js +2 -2
- package/src/screens/Automate/ScriptDetail/__test__/index.test.js +33 -25
- package/src/screens/Automate/ScriptDetail/index.js +6 -6
- package/src/screens/Automate/SetSchedule/__test__/index.test.js +4 -4
- package/src/screens/Automate/SetSchedule/components/RowItem.js +3 -3
- package/src/screens/Automate/Styles/indexStyles.js +6 -0
- package/src/screens/Automate/__test__/MultiUnits.test.js +7 -7
- package/src/screens/Automate/__test__/index.test.js +9 -34
- package/src/screens/Automate/index.js +50 -33
- package/src/screens/ChangePosition/__test__/index.test.js +1 -14
- package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +1 -23
- package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +1 -11
- package/src/screens/Device/EditDevice/index.js +2 -2
- package/src/screens/Device/__test__/detail.test.js +11 -11
- package/src/screens/Device/__test__/sensorDisplayItem.test.js +0 -12
- package/src/screens/Device/detail.js +14 -12
- package/src/screens/Drawer/Drawer.test.js +3 -11
- package/src/screens/Drawer/index.js +3 -4
- package/src/screens/EmergencyContacts/EmergencyContactsList.js +4 -8
- package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +3 -3
- package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +4 -17
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +3 -14
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +0 -10
- package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
- package/src/screens/EnterPassword/__test__/EnterPassword.test.js +4 -17
- package/src/screens/GuestInfo/__test__/index.test.js +0 -11
- package/src/screens/GuestInfo/components/RowGuestInfo.js +2 -2
- package/src/screens/GuestInfo/index.js +2 -2
- package/src/screens/HanetCamera/Detail.js +6 -2
- package/src/screens/HanetCamera/ManageAccess.js +3 -4
- package/src/screens/HanetCamera/MemberInfo.js +4 -4
- package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +2 -16
- package/src/screens/HanetCamera/__test__/Detail.test.js +1 -12
- package/src/screens/HanetCamera/__test__/ManageAccess.test.js +5 -16
- package/src/screens/HanetCamera/__test__/MemberInfo.test.js +5 -18
- package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
- package/src/screens/ManageAccess/__test__/ManageAccess.test.js +3 -19
- package/src/screens/ManageAccess/index.js +3 -3
- package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +7 -7
- package/src/screens/Notification/__test__/Notification.test.js +5 -15
- package/src/screens/Notification/__test__/NotificationItem.test.js +9 -19
- package/src/screens/Notification/index.js +5 -5
- package/src/screens/PlayBackCamera/__test__/index.test.js +13 -22
- package/src/screens/PlayBackCamera/index.js +2 -2
- package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +0 -11
- package/src/screens/ScanChipQR/components/QRScan/index.js +3 -3
- package/src/screens/SelectUnit/__test__/index.test.js +9 -29
- package/src/screens/SelectUnit/index.js +2 -2
- package/src/screens/SharedUnit/TabHeader.js +2 -2
- package/src/screens/SharedUnit/index.js +5 -0
- package/src/screens/Sharing/Components/EndDevice.js +3 -3
- package/src/screens/Sharing/SelectUser.js +5 -4
- package/src/screens/Sharing/UnitMemberList.js +7 -6
- package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +9 -4
- package/src/screens/Sharing/__test__/SelectShareDevice.test.js +2 -15
- package/src/screens/Sharing/__test__/SelectUser.test.js +2 -22
- package/src/screens/Sharing/__test__/UnitMemberList.test.js +2 -2
- package/src/screens/Sharing/__test__/UpdateShareDevice.test.js +4 -17
- package/src/screens/Sharing/hooks/__test__/index.test.js +2 -13
- package/src/screens/SmartAccount/Connecting/index.js +0 -2
- package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +3 -18
- package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +11 -21
- package/src/screens/SmartAccount/SuccessfullyConnected/index.js +3 -4
- package/src/screens/SmartAccount/__test__/Connecting.test.js +30 -36
- package/src/screens/SmartAccount/__test__/SmartAccount.test.js +12 -21
- package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +8 -17
- package/src/screens/SmartIr/__test__/SelectBrand.test.js +1 -11
- package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +1 -12
- package/src/screens/SmartIr/__test__/SmartIr.test.js +3 -11
- package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +6 -5
- package/src/screens/SmartIr/components/SelectBrand.js +2 -2
- package/src/screens/SubUnit/AddSubUnit.js +1 -0
- package/src/screens/SubUnit/EditSubUnit.js +3 -2
- package/src/screens/SubUnit/ManageSubUnit.js +5 -5
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +9 -31
- package/src/screens/SubUnit/__test__/EditSubUnit.test.js +12 -30
- package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +2 -2
- package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +0 -12
- package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +7 -20
- package/src/screens/Template/__test__/EditTemplate.test.js +4 -15
- package/src/screens/Template/__test__/GatewayList.test.js +0 -9
- package/src/screens/Template/__test__/detail.test.js +8 -8
- package/src/screens/Template/__test__/index.test.js +3 -14
- package/src/screens/Template/detail.js +2 -2
- package/src/screens/Unit/Detail.js +10 -55
- package/src/screens/Unit/MoreMenu.js +6 -5
- package/src/screens/Unit/SelectAddToFavorites.js +2 -2
- package/src/screens/Unit/SelectAddress.js +9 -4
- package/src/screens/Unit/SmartAccountItem.js +2 -2
- package/src/screens/Unit/Station/__test__/index.test.js +2 -2
- package/src/screens/Unit/Summaries.js +24 -29
- package/src/screens/Unit/__test__/AddMenu.test.js +5 -2
- package/src/screens/Unit/__test__/CheckSendEmail.test.js +0 -12
- package/src/screens/Unit/__test__/ChooseLocation.test.js +1 -4
- package/src/screens/Unit/__test__/Detail.test.js +14 -12
- package/src/screens/Unit/__test__/ManageUnit.test.js +2 -17
- package/src/screens/Unit/__test__/MoreMenu.test.js +6 -12
- package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +3 -14
- package/src/screens/Unit/__test__/SelectAddress.test.js +4 -17
- package/src/screens/Unit/__test__/SmartAccount.test.js +14 -11
- package/src/screens/Unit/__test__/SmartAccountItem.test.js +0 -11
- package/src/screens/Unit/__test__/Summaries.test.js +2 -14
- package/src/screens/Unit/components/AutomateScript/index.js +5 -5
- package/src/screens/Unit/components/ButtonWrapper/index.js +3 -4
- package/src/screens/Unit/components/Header/index.js +5 -4
- package/src/screens/Unit/components/SharedUnit/index.js +5 -5
- package/src/screens/Unit/components/__test__/Header.test.js +1 -14
- package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +1 -11
- package/src/screens/Unit/components/__test__/SharedUnit.test.js +1 -11
- package/src/screens/UnitSummary/__test__/index.test.js +51 -17
- package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +8 -25
- package/src/screens/UnitSummary/components/AirQuality/__test__/index.test.js +1 -7
- package/src/screens/UnitSummary/components/AirQuality/index.js +8 -3
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +0 -11
- package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +1 -16
- package/src/screens/UnitSummary/components/Temperature/index.js +5 -1
- package/src/screens/UnitSummary/components/UvIndex/__test__/index.test.js +0 -8
- package/src/screens/UnitSummary/components/UvIndex/index.js +6 -2
- package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +3 -3
- package/src/screens/UnitSummary/components/WaterQuality/__test__/index.test.js +14 -18
- package/src/screens/UnitSummary/components/__test__/UnitSummary.test.js +8 -8
- package/src/screens/UnitSummary/index.js +6 -6
- package/src/utils/Apis/axios.js +4 -2
- package/src/utils/Converter/__test__/timer.test.js +8 -0
- package/src/utils/Functions/preloadImages.js +13 -14
- package/src/utils/Monitor.js +2 -3
- package/src/utils/Route/index.js +0 -1
- package/src/utils/Storage.js +1 -1
- package/assets/images/OneTap.svg +0 -14
- package/assets/images/Schedule.svg +0 -39
- package/assets/images/ValueChange.svg +0 -49
- package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +0 -48
- package/src/commons/Device/WindSpeed/LinearChart/index.js +0 -155
- package/src/screens/AddNewGateway/hooks/__Tests__/index.test.js +0 -27
- package/src/screens/AddNewGateway/hooks/index.js +0 -31
- package/src/screens/SubUnit/Detail.js +0 -150
- package/src/screens/SubUnit/__test__/Detail.test.js +0 -125
- package/src/screens/UnitSummary/components/Temperature/ChartAverage/index.js +0 -62
- package/src/screens/UnitSummary/components/Temperature/__test__/ChartAverage.test.js +0 -17
- package/src/utils/dateHelper/getTickValues.js +0 -22
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { memo, useCallback, useEffect, useContext } from 'react';
|
|
2
2
|
import { TouchableOpacity } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
4
4
|
import { useNavigation } from '@react-navigation/core';
|
|
5
|
-
import
|
|
5
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
6
6
|
import { SCContext } from '../context';
|
|
7
7
|
import { Action } from '../context/actionType';
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ import MultiUnits from '../screens/Automate/MultiUnits';
|
|
|
16
16
|
import { axiosGet } from '../utils/Apis/axios';
|
|
17
17
|
import { API } from '../configs';
|
|
18
18
|
|
|
19
|
-
const Stack =
|
|
19
|
+
const Stack = createNativeStackNavigator();
|
|
20
20
|
|
|
21
21
|
const AutomateStack = memo(() => {
|
|
22
22
|
const t = useTranslations();
|
|
@@ -44,7 +44,7 @@ const AutomateStack = memo(() => {
|
|
|
44
44
|
title: t('smart'),
|
|
45
45
|
headerLeft: () => (
|
|
46
46
|
<TouchableOpacity style={Theme.menuIcon} onPress={toggleDrawer}>
|
|
47
|
-
<
|
|
47
|
+
<MaterialIcons name={'menu'} color={Colors.Black} size={27} />
|
|
48
48
|
</TouchableOpacity>
|
|
49
49
|
),
|
|
50
50
|
headerTitleAlign: 'left',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
2
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
3
3
|
import React, { memo } from 'react';
|
|
4
4
|
import { StyleSheet } from 'react-native';
|
|
5
5
|
|
|
@@ -10,7 +10,7 @@ import { EmergencyContactsSelectContacts } from '../screens/EmergencyContacts/Em
|
|
|
10
10
|
import Route from '../utils/Route';
|
|
11
11
|
import { screenOptions } from './utils';
|
|
12
12
|
|
|
13
|
-
const Stack =
|
|
13
|
+
const Stack = createNativeStackNavigator();
|
|
14
14
|
|
|
15
15
|
export const EmergencyContactsStack = memo(() => {
|
|
16
16
|
return (
|
|
@@ -19,7 +19,7 @@ export const EmergencyContactsStack = memo(() => {
|
|
|
19
19
|
...screenOptions,
|
|
20
20
|
headerTitleAlign: 'center',
|
|
21
21
|
headerBackImage: () => (
|
|
22
|
-
<
|
|
22
|
+
<AntDesign
|
|
23
23
|
name="left"
|
|
24
24
|
size={27}
|
|
25
25
|
color={Colors.Black}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
3
3
|
|
|
4
4
|
import Routes from '../utils/Route';
|
|
5
5
|
import { screenOptions } from './utils';
|
|
6
6
|
import Gateway from '../screens/Gateway';
|
|
7
7
|
|
|
8
|
-
const Stack =
|
|
8
|
+
const Stack = createNativeStackNavigator();
|
|
9
9
|
|
|
10
10
|
const GatewayStack = memo(() => {
|
|
11
11
|
return (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
2
2
|
import React, { memo } from 'react';
|
|
3
3
|
import HanetCameraDetail from '../screens/HanetCamera/Detail';
|
|
4
4
|
import HanetManageAccess from '../screens/HanetCamera/ManageAccess';
|
|
@@ -7,7 +7,7 @@ import HanetCaptureFaceID from '../screens/HanetCamera/CaptureFaceID';
|
|
|
7
7
|
import Route from '../utils/Route';
|
|
8
8
|
import { screenOptions } from './utils';
|
|
9
9
|
|
|
10
|
-
const Stack =
|
|
10
|
+
const Stack = createNativeStackNavigator();
|
|
11
11
|
|
|
12
12
|
export const HanetCameraStack = memo(() => {
|
|
13
13
|
return (
|
package/src/navigations/Main.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// import { createDrawerNavigator } from '@react-navigation/drawer';
|
|
11
11
|
// import { useNavigation } from '@react-navigation/native';
|
|
12
12
|
// import { getStatusBarHeight } from 'react-native-iphone-x-helper';
|
|
13
|
-
// import {
|
|
13
|
+
// import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
14
14
|
|
|
15
15
|
// import Tabbar from '../commons/Tabbar';
|
|
16
16
|
// import { Colors, Constants, Images } from '../configs';
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
// const Tab = createBottomTabNavigator();
|
|
42
42
|
// const Drawer = createDrawerNavigator();
|
|
43
|
-
// const Stack =
|
|
43
|
+
// const Stack = createNativeStackNavigator();
|
|
44
44
|
|
|
45
45
|
// const getWidth = () => {
|
|
46
46
|
// const Width = Constants.width - 12;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
3
3
|
|
|
4
4
|
import Routes from '../utils/Route';
|
|
5
5
|
import Notification from '../screens/Notification';
|
|
6
6
|
import { screenOptions } from './utils';
|
|
7
7
|
|
|
8
|
-
const Stack =
|
|
8
|
+
const Stack = createNativeStackNavigator();
|
|
9
9
|
|
|
10
10
|
const NotificationStack = memo(() => {
|
|
11
11
|
return (
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
3
3
|
import { TouchableOpacity, StyleSheet } from 'react-native';
|
|
4
4
|
import { useNavigation, useRoute } from '@react-navigation/native';
|
|
5
|
-
import
|
|
5
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
6
6
|
import { useTranslations } from '../hooks/Common/useTranslations';
|
|
7
7
|
|
|
8
8
|
import Shared from '../screens/SharedUnit';
|
|
@@ -10,11 +10,12 @@ import { Colors } from '../configs';
|
|
|
10
10
|
import Routes from '../utils/Route';
|
|
11
11
|
import { screenOptions } from './utils';
|
|
12
12
|
|
|
13
|
-
const Stack =
|
|
13
|
+
const Stack = createNativeStackNavigator();
|
|
14
14
|
const SharedStack = memo(() => {
|
|
15
15
|
const t = useTranslations();
|
|
16
16
|
const { toggleDrawer, goBack } = useNavigation();
|
|
17
17
|
const { params } = useRoute();
|
|
18
|
+
const { isMainSource } = params || {};
|
|
18
19
|
return (
|
|
19
20
|
<Stack.Navigator>
|
|
20
21
|
<Stack.Screen
|
|
@@ -26,11 +27,12 @@ const SharedStack = memo(() => {
|
|
|
26
27
|
headerLeft: () => (
|
|
27
28
|
<TouchableOpacity
|
|
28
29
|
style={styles.btnMenu}
|
|
29
|
-
onPress={() => (
|
|
30
|
+
onPress={() => (isMainSource ? toggleDrawer() : goBack())}
|
|
30
31
|
>
|
|
31
|
-
<
|
|
32
|
-
name={
|
|
32
|
+
<MaterialIcons
|
|
33
|
+
name={isMainSource ? 'menu' : 'chevron-left'}
|
|
33
34
|
color={Colors.Black}
|
|
35
|
+
size={27}
|
|
34
36
|
/>
|
|
35
37
|
</TouchableOpacity>
|
|
36
38
|
),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
2
2
|
import React, { memo } from 'react';
|
|
3
3
|
import SmartAccount from '../screens/SmartAccount';
|
|
4
4
|
import SmartAccountConnecting from '../screens/SmartAccount/Connecting';
|
|
@@ -8,7 +8,7 @@ import SuccessfullyConnected from '../screens/SmartAccount/SuccessfullyConnected
|
|
|
8
8
|
import Route from '../utils/Route';
|
|
9
9
|
import { screenOptions } from './utils';
|
|
10
10
|
|
|
11
|
-
const Stack =
|
|
11
|
+
const Stack = createNativeStackNavigator();
|
|
12
12
|
|
|
13
13
|
export const SmartAccountStack = memo(() => {
|
|
14
14
|
return (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
2
2
|
import React, { memo } from 'react';
|
|
3
3
|
|
|
4
4
|
import SelectIrDeviceType from '../screens/SmartIr/components/SelectIrDeviceType';
|
|
@@ -7,7 +7,7 @@ import GroupButtonByType from '../screens/SmartIr/components/GroupButtonByType/G
|
|
|
7
7
|
import Route from '../utils/Route';
|
|
8
8
|
import { screenOptions } from './utils';
|
|
9
9
|
|
|
10
|
-
const Stack =
|
|
10
|
+
const Stack = createNativeStackNavigator();
|
|
11
11
|
|
|
12
12
|
export const SmartIrStack = memo(() => {
|
|
13
13
|
return (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
2
2
|
import React, { memo } from 'react';
|
|
3
3
|
|
|
4
4
|
import Route from '../utils/Route';
|
|
@@ -8,7 +8,7 @@ import AutoLock from '../commons/ActionGroup/OnOffSmartLock/AutoLock/index';
|
|
|
8
8
|
import PasscodeList from '../commons/ActionGroup/OnOffSmartLock/PasscodeList/index';
|
|
9
9
|
import ItemPasscode from '../commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode';
|
|
10
10
|
|
|
11
|
-
const Stack =
|
|
11
|
+
const Stack = createNativeStackNavigator();
|
|
12
12
|
|
|
13
13
|
export const SmartLockStack = memo(() => {
|
|
14
14
|
return (
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
3
3
|
|
|
4
4
|
import Routes from '../utils/Route';
|
|
5
5
|
import { screenOptions } from './utils';
|
|
6
6
|
import Smart from '../screens/Smart';
|
|
7
7
|
|
|
8
|
-
const Stack =
|
|
8
|
+
const Stack = createNativeStackNavigator();
|
|
9
9
|
|
|
10
10
|
const SmartStack = memo(() => {
|
|
11
11
|
return (
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
3
3
|
|
|
4
4
|
import Routes from '../utils/Route';
|
|
5
5
|
import { screenOptions } from './utils';
|
|
6
6
|
import Template from '../screens/Template';
|
|
7
7
|
|
|
8
|
-
const Stack =
|
|
8
|
+
const Stack = createNativeStackNavigator();
|
|
9
9
|
|
|
10
10
|
const TemplateStack = memo(() => {
|
|
11
11
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { memo, useContext, useEffect } from 'react';
|
|
2
2
|
import { AppState, View } from 'react-native';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
|
+
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
5
5
|
import { BleManager } from 'react-native-ble-plx';
|
|
6
6
|
import NetInfo from '@react-native-community/netinfo';
|
|
7
7
|
import { get } from 'lodash';
|
|
@@ -25,7 +25,6 @@ import SelectAddress from '../screens/Unit/SelectAddress';
|
|
|
25
25
|
import ChooseLocation from '../screens/Unit/ChooseLocation';
|
|
26
26
|
import ManageUnit from '../screens/Unit/ManageUnit';
|
|
27
27
|
import ListSmartAccount from '../screens/Unit/SmartAccount';
|
|
28
|
-
import SubUnitDetail from '../screens/SubUnit/Detail';
|
|
29
28
|
import UnitDetail from '../screens/Unit/Detail';
|
|
30
29
|
import UnitSummary from '../screens/UnitSummary';
|
|
31
30
|
import UVIndexGuide from '../screens/UVIndexGuide';
|
|
@@ -70,7 +69,7 @@ import SetupScriptNotify from '../screens/Automate/AddNewAction/SetupScriptNotif
|
|
|
70
69
|
import SetupScriptDelay from '../screens/Automate/AddNewAction/SetupScriptDelay';
|
|
71
70
|
import UpdateActionScript from '../screens/Automate/EditActionsList/UpdateActionScript';
|
|
72
71
|
|
|
73
|
-
const Stack =
|
|
72
|
+
const Stack = createNativeStackNavigator();
|
|
74
73
|
|
|
75
74
|
const bleManager = new BleManager();
|
|
76
75
|
|
|
@@ -174,7 +173,7 @@ export const UnitStack = memo((props) => {
|
|
|
174
173
|
...screenOptions,
|
|
175
174
|
headerTitleAlign: 'center',
|
|
176
175
|
headerBackImage: () => (
|
|
177
|
-
<
|
|
176
|
+
<AntDesign
|
|
178
177
|
name="left"
|
|
179
178
|
size={27}
|
|
180
179
|
color={Colors.Black}
|
|
@@ -250,13 +249,6 @@ export const UnitStack = memo((props) => {
|
|
|
250
249
|
headerShown: false,
|
|
251
250
|
}}
|
|
252
251
|
/>
|
|
253
|
-
<Stack.Screen
|
|
254
|
-
name={Route.SubUnitDetail}
|
|
255
|
-
component={SubUnitDetail}
|
|
256
|
-
options={{
|
|
257
|
-
headerShown: false,
|
|
258
|
-
}}
|
|
259
|
-
/>
|
|
260
252
|
<Stack.Screen
|
|
261
253
|
name={Route.ManageSubUnit}
|
|
262
254
|
component={ManageSubUnit}
|
package/src/navigations/utils.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { CardStyleInterpolators } from '@react-navigation/stack';
|
|
3
2
|
import { StackActions } from '@react-navigation/native';
|
|
4
3
|
|
|
5
4
|
// NavigationContainer is referred here - Check NavigationStack
|
|
@@ -13,9 +12,7 @@ export function goBack() {
|
|
|
13
12
|
navigationRef.current?.goBack();
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
export const screenOptions = {
|
|
17
|
-
cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,
|
|
18
|
-
};
|
|
15
|
+
export const screenOptions = {};
|
|
19
16
|
|
|
20
17
|
export const popAction = (value) => StackActions.pop(value);
|
|
21
18
|
|
|
@@ -59,6 +59,9 @@ export default ({ id, type, share, filterEnabled }) => {
|
|
|
59
59
|
|
|
60
60
|
const permissions = useBackendPermission();
|
|
61
61
|
const fetchData = async (filters) => {
|
|
62
|
+
if (!api) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
62
65
|
if (api?.needPermission && !permissions?.[api?.needPermission]) {
|
|
63
66
|
setIsLoading(false);
|
|
64
67
|
setIsRefreshing(false);
|
|
@@ -81,12 +84,12 @@ export default ({ id, type, share, filterEnabled }) => {
|
|
|
81
84
|
setIsLoading(true);
|
|
82
85
|
}
|
|
83
86
|
const params = new URLSearchParams();
|
|
84
|
-
if (filterEnabled
|
|
87
|
+
if (filterEnabled?.user) {
|
|
85
88
|
filters.users.map((id) => {
|
|
86
89
|
params.append('users', id);
|
|
87
90
|
});
|
|
88
91
|
}
|
|
89
|
-
if (filterEnabled
|
|
92
|
+
if (filterEnabled?.date) {
|
|
90
93
|
params.append(
|
|
91
94
|
'date_from',
|
|
92
95
|
moment(filters.date_from).format('YYYY-MM-DD')
|
|
@@ -117,10 +120,10 @@ export default ({ id, type, share, filterEnabled }) => {
|
|
|
117
120
|
|
|
118
121
|
const fetchMembers = async () => {
|
|
119
122
|
const api = apiMaps[type];
|
|
120
|
-
if (!filterEnabled
|
|
123
|
+
if (!filterEnabled?.user) {
|
|
121
124
|
return;
|
|
122
125
|
}
|
|
123
|
-
const { success, data } = await axiosGet(api.memberUrl(share
|
|
126
|
+
const { success, data } = await axiosGet(api.memberUrl(share?.id));
|
|
124
127
|
if (success) {
|
|
125
128
|
data.unshift({ id: 0, name: t('all') });
|
|
126
129
|
setMembers(data);
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
TouchableOpacity,
|
|
8
8
|
} from 'react-native';
|
|
9
9
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
10
|
-
import
|
|
10
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
11
11
|
import { Colors } from '../../configs';
|
|
12
12
|
import { HeaderCustom } from '../../commons/Header';
|
|
13
13
|
import ItemLog from './ItemLog';
|
|
@@ -83,7 +83,7 @@ const ActivityLogScreen = ({ route }) => {
|
|
|
83
83
|
onPress={setShowFilterPopup}
|
|
84
84
|
accessibilityLabel={AccessibilityLabel.FILTER_BUTTON}
|
|
85
85
|
>
|
|
86
|
-
<
|
|
86
|
+
<AntDesign name={'filter'} size={27} color={Colors.Black} />
|
|
87
87
|
</TouchableOpacity>
|
|
88
88
|
),
|
|
89
89
|
[setShowFilterPopup]
|
|
@@ -15,19 +15,6 @@ import Routes from '../../../utils/Route';
|
|
|
15
15
|
|
|
16
16
|
const mock = new MockAdapter(api.axiosInstance);
|
|
17
17
|
|
|
18
|
-
const mockedGoBack = jest.fn();
|
|
19
|
-
const mockedNavigate = jest.fn();
|
|
20
|
-
jest.mock('@react-navigation/native', () => {
|
|
21
|
-
return {
|
|
22
|
-
...jest.requireActual('@react-navigation/native'),
|
|
23
|
-
useNavigation: () => ({
|
|
24
|
-
navigate: mockedNavigate,
|
|
25
|
-
goBack: mockedGoBack,
|
|
26
|
-
}),
|
|
27
|
-
useIsFocused: () => ({}),
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
|
|
31
18
|
const wrapComponent = (route) => (
|
|
32
19
|
<SCProvider initState={mockSCStore({})}>
|
|
33
20
|
<AddCommonSelectSubUnit route={route} />
|
|
@@ -35,10 +22,6 @@ const wrapComponent = (route) => (
|
|
|
35
22
|
);
|
|
36
23
|
|
|
37
24
|
describe('Test SelectSubUnit', () => {
|
|
38
|
-
beforeEach(() => {
|
|
39
|
-
mockedNavigate.mockClear();
|
|
40
|
-
mockedGoBack.mockClear();
|
|
41
|
-
});
|
|
42
25
|
let tree;
|
|
43
26
|
|
|
44
27
|
it('test ViewButtonBottom onRightClick', async () => {
|
|
@@ -51,14 +34,14 @@ describe('Test SelectSubUnit', () => {
|
|
|
51
34
|
await act(async () => {
|
|
52
35
|
viewButtonBottom.props.onRightClick();
|
|
53
36
|
});
|
|
54
|
-
expect(mockedNavigate).toHaveBeenCalled();
|
|
37
|
+
expect(global.mockedNavigate).toHaveBeenCalled();
|
|
55
38
|
});
|
|
56
39
|
});
|
|
57
40
|
|
|
58
41
|
describe('Test SelectSubUnit container', () => {
|
|
59
42
|
beforeEach(() => {
|
|
60
|
-
mockedNavigate.mockClear();
|
|
61
|
-
mockedGoBack.mockClear();
|
|
43
|
+
global.mockedNavigate.mockClear();
|
|
44
|
+
global.mockedGoBack.mockClear();
|
|
62
45
|
});
|
|
63
46
|
let tree;
|
|
64
47
|
const list_type = ['AddHassiDevice'];
|
|
@@ -109,7 +92,7 @@ describe('Test SelectSubUnit container', () => {
|
|
|
109
92
|
|
|
110
93
|
switch (type) {
|
|
111
94
|
case 'AddHassiDevice':
|
|
112
|
-
expect(mockedNavigate).toHaveBeenCalledWith(
|
|
95
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(
|
|
113
96
|
Routes.SmartAccountStack,
|
|
114
97
|
{
|
|
115
98
|
screen: Routes.SmartAccountConnecting,
|
|
@@ -14,18 +14,6 @@ import SelectUnit from '../../../commons/SelectUnit';
|
|
|
14
14
|
|
|
15
15
|
const mock = new MockAdapter(api.axiosInstance);
|
|
16
16
|
|
|
17
|
-
const mockedGoBack = jest.fn();
|
|
18
|
-
const mockedNavigate = jest.fn();
|
|
19
|
-
jest.mock('@react-navigation/native', () => {
|
|
20
|
-
return {
|
|
21
|
-
...jest.requireActual('@react-navigation/native'),
|
|
22
|
-
useNavigation: () => ({
|
|
23
|
-
navigate: mockedNavigate,
|
|
24
|
-
goBack: mockedGoBack,
|
|
25
|
-
}),
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
|
|
29
17
|
const wrapComponent = (route) => (
|
|
30
18
|
<SCProvider initState={mockSCStore({})}>
|
|
31
19
|
<AddCommonSelectUnit route={route} />
|
|
@@ -34,8 +22,8 @@ const wrapComponent = (route) => (
|
|
|
34
22
|
|
|
35
23
|
describe('Test SelectUnit container', () => {
|
|
36
24
|
beforeEach(() => {
|
|
37
|
-
mockedNavigate.mockClear();
|
|
38
|
-
mockedGoBack.mockClear();
|
|
25
|
+
global.mockedNavigate.mockClear();
|
|
26
|
+
global.mockedGoBack.mockClear();
|
|
39
27
|
});
|
|
40
28
|
|
|
41
29
|
beforeEach(() => {
|
|
@@ -115,12 +103,12 @@ describe('Test SelectUnit container', () => {
|
|
|
115
103
|
|
|
116
104
|
switch (type) {
|
|
117
105
|
case 'AddSubUnit':
|
|
118
|
-
expect(mockedNavigate).toBeCalledWith('AddSubUnit', {
|
|
106
|
+
expect(global.mockedNavigate).toBeCalledWith('AddSubUnit', {
|
|
119
107
|
unit: { id: 1, name: 'Unit 1' },
|
|
120
108
|
});
|
|
121
109
|
break;
|
|
122
110
|
case 'AddDevice':
|
|
123
|
-
expect(mockedNavigate).toBeCalledWith('AddGatewayStack', {
|
|
111
|
+
expect(global.mockedNavigate).toBeCalledWith('AddGatewayStack', {
|
|
124
112
|
screen: 'SelectDeviceType',
|
|
125
113
|
params: {
|
|
126
114
|
unit: {
|
|
@@ -131,12 +119,12 @@ describe('Test SelectUnit container', () => {
|
|
|
131
119
|
});
|
|
132
120
|
break;
|
|
133
121
|
case 'AddMember':
|
|
134
|
-
expect(mockedNavigate).toBeCalledWith('SelectShareDevice', {
|
|
122
|
+
expect(global.mockedNavigate).toBeCalledWith('SelectShareDevice', {
|
|
135
123
|
unit: { id: 1, name: 'Unit 1' },
|
|
136
124
|
});
|
|
137
125
|
break;
|
|
138
126
|
case 'AddLGDevice':
|
|
139
|
-
expect(mockedNavigate).toBeCalledWith('AddLGDevice', {
|
|
127
|
+
expect(global.mockedNavigate).toBeCalledWith('AddLGDevice', {
|
|
140
128
|
code: 'CODE',
|
|
141
129
|
backend_url: 'https://doamin.com/',
|
|
142
130
|
unit_id: 1,
|
|
@@ -237,6 +225,6 @@ describe('test single SelectUnit', () => {
|
|
|
237
225
|
await act(async () => {
|
|
238
226
|
goBack.props.onPress();
|
|
239
227
|
});
|
|
240
|
-
expect(mockedGoBack).toBeCalled();
|
|
228
|
+
expect(global.mockedGoBack).toBeCalled();
|
|
241
229
|
});
|
|
242
230
|
});
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
OpenSetting,
|
|
17
17
|
} from '../../../utils/Permission/common';
|
|
18
18
|
import { RESULTS } from 'react-native-permissions';
|
|
19
|
+
import { useNavigation } from '@react-navigation/native';
|
|
19
20
|
|
|
20
21
|
const wrapComponent = (route) => (
|
|
21
22
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -25,18 +26,6 @@ const wrapComponent = (route) => (
|
|
|
25
26
|
|
|
26
27
|
const mock = new MockAdapter(api.axiosInstance);
|
|
27
28
|
|
|
28
|
-
const mockNavigate = jest.fn();
|
|
29
|
-
const mockGoBack = jest.fn();
|
|
30
|
-
jest.mock('@react-navigation/native', () => {
|
|
31
|
-
return {
|
|
32
|
-
...jest.requireActual('@react-navigation/native'),
|
|
33
|
-
useNavigation: () => ({
|
|
34
|
-
navigate: mockNavigate,
|
|
35
|
-
goBack: mockGoBack,
|
|
36
|
-
}),
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
|
|
40
29
|
jest.mock('react-native-maps', () => {
|
|
41
30
|
const { forwardRef } = require('react');
|
|
42
31
|
const { View } = require('react-native');
|
|
@@ -83,6 +72,7 @@ jest.mock('react-native-permissions', () => {
|
|
|
83
72
|
describe('Test SelectAddress', () => {
|
|
84
73
|
let tree, route, Platform;
|
|
85
74
|
const mockUpdateLocation = jest.fn();
|
|
75
|
+
const { navigate } = useNavigation();
|
|
86
76
|
|
|
87
77
|
beforeAll(() => {
|
|
88
78
|
Platform = require('react-native').Platform;
|
|
@@ -259,6 +249,6 @@ describe('Test SelectAddress', () => {
|
|
|
259
249
|
await act(async () => {
|
|
260
250
|
await button.props.onPress();
|
|
261
251
|
});
|
|
262
|
-
expect(
|
|
252
|
+
expect(navigate).toBeCalled();
|
|
263
253
|
});
|
|
264
254
|
});
|
|
@@ -2,7 +2,8 @@ import React, { memo, useState, useCallback, useRef, useEffect } from 'react';
|
|
|
2
2
|
import { View, ScrollView, TouchableOpacity } from 'react-native';
|
|
3
3
|
import MapView, { Marker, Circle, PROVIDER_GOOGLE } from 'react-native-maps';
|
|
4
4
|
import { useNavigation } from '@react-navigation/native';
|
|
5
|
-
import
|
|
5
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
6
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
6
7
|
import { check, RESULTS } from 'react-native-permissions';
|
|
7
8
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
8
9
|
|
|
@@ -204,7 +205,11 @@ const AddLocationMaps = memo(() => {
|
|
|
204
205
|
style={styles.button}
|
|
205
206
|
accessibilityLabel={AccessibilityLabel.BUTTON_YOUR_LOCATION}
|
|
206
207
|
>
|
|
207
|
-
<
|
|
208
|
+
<MaterialIcons
|
|
209
|
+
name="my-location"
|
|
210
|
+
size={27}
|
|
211
|
+
color={Colors.Primary}
|
|
212
|
+
/>
|
|
208
213
|
<Text
|
|
209
214
|
type="Body"
|
|
210
215
|
color={Colors.Gray9}
|
|
@@ -220,8 +225,8 @@ const AddLocationMaps = memo(() => {
|
|
|
220
225
|
style={styles.button}
|
|
221
226
|
accessibilityLabel={AccessibilityLabel.BUTTON_CHOOSE_ON_MAP}
|
|
222
227
|
>
|
|
223
|
-
<
|
|
224
|
-
name="
|
|
228
|
+
<AntDesign
|
|
229
|
+
name="enviroment"
|
|
225
230
|
size={27}
|
|
226
231
|
color={Colors.Primary}
|
|
227
232
|
/>
|
|
@@ -269,8 +274,8 @@ const AddLocationMaps = memo(() => {
|
|
|
269
274
|
}}
|
|
270
275
|
tracksViewChanges={false}
|
|
271
276
|
>
|
|
272
|
-
<
|
|
273
|
-
name="
|
|
277
|
+
<AntDesign
|
|
278
|
+
name="enviroment"
|
|
274
279
|
size={27}
|
|
275
280
|
color={Colors.Blue10}
|
|
276
281
|
/>
|
|
@@ -22,27 +22,10 @@ const wrapComponent = (route) => (
|
|
|
22
22
|
|
|
23
23
|
const mock = new MockAdapter(api.axiosInstance);
|
|
24
24
|
|
|
25
|
-
const mockedNavigate = jest.fn();
|
|
26
|
-
const mockedGoBack = jest.fn();
|
|
27
|
-
|
|
28
|
-
jest.mock('@react-navigation/native', () => {
|
|
29
|
-
return {
|
|
30
|
-
...jest.requireActual('@react-navigation/native'),
|
|
31
|
-
useNavigation: () => ({
|
|
32
|
-
navigate: mockedNavigate,
|
|
33
|
-
goBack: mockedGoBack,
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
|
|
38
25
|
describe('Test AddNewDevice', () => {
|
|
39
26
|
let tree;
|
|
40
27
|
let route;
|
|
41
28
|
|
|
42
|
-
afterEach(() => {
|
|
43
|
-
mockedNavigate.mockClear();
|
|
44
|
-
});
|
|
45
|
-
|
|
46
29
|
beforeEach(() => {
|
|
47
30
|
route = {
|
|
48
31
|
params: {
|
|
@@ -145,7 +128,7 @@ describe('Test AddNewDevice', () => {
|
|
|
145
128
|
await act(async () => {
|
|
146
129
|
viewButtonBottom.props.onLeftClick();
|
|
147
130
|
});
|
|
148
|
-
expect(mockedGoBack).toHaveBeenCalled();
|
|
131
|
+
expect(global.mockedGoBack).toHaveBeenCalled();
|
|
149
132
|
});
|
|
150
133
|
|
|
151
134
|
it('ViewButtonBottom onRightClick without select stationId', async () => {
|
|
@@ -157,7 +140,7 @@ describe('Test AddNewDevice', () => {
|
|
|
157
140
|
await act(async () => {
|
|
158
141
|
viewButtonBottom.props.onRightClick();
|
|
159
142
|
});
|
|
160
|
-
expect(mockedNavigate).toHaveBeenCalled();
|
|
143
|
+
expect(global.mockedNavigate).toHaveBeenCalled();
|
|
161
144
|
});
|
|
162
145
|
|
|
163
146
|
it('ViewButtonBottom onRightClick with stationId', async () => {
|
|
@@ -181,7 +164,7 @@ describe('Test AddNewDevice', () => {
|
|
|
181
164
|
await act(async () => {
|
|
182
165
|
viewButtonBottom.props.onRightClick();
|
|
183
166
|
});
|
|
184
|
-
expect(mockedNavigate).toHaveBeenCalledWith(Routes.ScanSensorQR, {
|
|
167
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.ScanSensorQR, {
|
|
185
168
|
station_id: 2,
|
|
186
169
|
unit_id: 1,
|
|
187
170
|
unit_name: 'Unit name',
|