@eohjsc/react-native-smart-city 0.6.2 → 0.7.0
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 +1 -1
- package/android/build.gradle +7 -10
- package/package.json +53 -70
- 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 +2 -2
- 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 +2 -2
- 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/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 +2 -2
- 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 +84 -84
- 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/WrapParallaxScrollView/index.js +21 -50
- package/src/configs/API.js +1 -2
- 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/AutomateStack.js +2 -2
- package/src/navigations/EmergencyContactsStack.js +2 -2
- package/src/navigations/SharedStack.js +6 -4
- package/src/navigations/UnitStack.js +2 -10
- 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/__test__/MultiUnits.test.js +7 -7
- package/src/screens/Automate/__test__/index.test.js +6 -6
- package/src/screens/Automate/index.js +2 -2
- 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/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 +12 -53
- 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 +1 -11
- 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 +2 -2
- 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 +2 -2
- 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 +4 -8
- 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/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,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import { StatusBar, View, StyleSheet } from 'react-native';
|
|
2
|
+
import { StatusBar, View, StyleSheet, RefreshControl } from 'react-native';
|
|
3
3
|
import LinearGradient from 'react-native-linear-gradient';
|
|
4
4
|
|
|
5
5
|
import { Colors, Device, Images, SCConfig } from '../../configs';
|
|
@@ -7,65 +7,42 @@ import Text from '../Text';
|
|
|
7
7
|
import HeaderUnit from '../Unit/HeaderUnit';
|
|
8
8
|
import { AccessibilityLabel } from '../../configs/Constants';
|
|
9
9
|
import FImage from '../FImage';
|
|
10
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
10
11
|
import ParallaxScrollView from '../../libs/react-native-parallax-scroll-view';
|
|
11
12
|
|
|
12
13
|
const stickyHeaderHeight =
|
|
13
14
|
Device.TopbarHeight + (Device.isIOS ? 0 : StatusBar.currentHeight);
|
|
14
15
|
|
|
15
|
-
const WrapParallaxScrollView = ({
|
|
16
|
-
|
|
17
|
-
refreshControl,
|
|
18
|
-
title,
|
|
19
|
-
uriImg,
|
|
20
|
-
onBack,
|
|
21
|
-
onAdd,
|
|
22
|
-
onMore,
|
|
23
|
-
hideRight,
|
|
24
|
-
hideRightPlus,
|
|
25
|
-
contentBackground,
|
|
26
|
-
accessibilityLabel,
|
|
27
|
-
idButtonMore = AccessibilityLabel.HEADER_UNIT_BUTTON_MORE,
|
|
28
|
-
}) => {
|
|
16
|
+
const WrapParallaxScrollView = ({ children, unit, unitData, onRefresh }) => {
|
|
17
|
+
const t = useTranslations();
|
|
29
18
|
const renderForeground = useCallback(
|
|
30
19
|
() => (
|
|
31
20
|
<View style={styles.wrap}>
|
|
32
|
-
<HeaderUnit
|
|
33
|
-
transparent
|
|
34
|
-
onBack={onBack}
|
|
35
|
-
onAdd={onAdd}
|
|
36
|
-
onMore={onMore}
|
|
37
|
-
hideRight={hideRight}
|
|
38
|
-
hideRightPlus={hideRightPlus}
|
|
39
|
-
idButtonMore={idButtonMore}
|
|
40
|
-
/>
|
|
21
|
+
<HeaderUnit unit={unit} unitData={unitData} />
|
|
41
22
|
<Text
|
|
42
23
|
numberOfLines={1}
|
|
43
24
|
semibold
|
|
44
25
|
style={styles.nameUnit}
|
|
45
26
|
accessibilityLabel={AccessibilityLabel.HEADER_UNIT_BUTTON_TEXT}
|
|
46
27
|
>
|
|
47
|
-
{
|
|
28
|
+
{t('Welcome {name}', {
|
|
29
|
+
name: unit?.name ? unit.name : '',
|
|
30
|
+
})}
|
|
48
31
|
</Text>
|
|
49
|
-
{contentBackground}
|
|
50
32
|
</View>
|
|
51
33
|
),
|
|
52
|
-
[
|
|
53
|
-
onBack,
|
|
54
|
-
onAdd,
|
|
55
|
-
onMore,
|
|
56
|
-
hideRight,
|
|
57
|
-
hideRightPlus,
|
|
58
|
-
idButtonMore,
|
|
59
|
-
title,
|
|
60
|
-
contentBackground,
|
|
61
|
-
]
|
|
34
|
+
[unit, unitData, t]
|
|
62
35
|
);
|
|
63
36
|
const renderBackground = useCallback(
|
|
64
37
|
() => (
|
|
65
38
|
<View style={styles.image}>
|
|
66
39
|
<FImage
|
|
67
40
|
style={styles.image}
|
|
68
|
-
source={
|
|
41
|
+
source={
|
|
42
|
+
unit?.background
|
|
43
|
+
? { uri: unit.background }
|
|
44
|
+
: SCConfig.appUnitDefaultBackground
|
|
45
|
+
}
|
|
69
46
|
defaultSource={Images.BgUnit}
|
|
70
47
|
resizeMode="cover"
|
|
71
48
|
/>
|
|
@@ -75,23 +52,15 @@ const WrapParallaxScrollView = ({
|
|
|
75
52
|
/>
|
|
76
53
|
</View>
|
|
77
54
|
),
|
|
78
|
-
[
|
|
55
|
+
[unit]
|
|
79
56
|
);
|
|
80
57
|
const renderStickyHeader = useCallback(
|
|
81
58
|
() => (
|
|
82
59
|
<View style={styles.stickyHeader}>
|
|
83
|
-
<HeaderUnit
|
|
84
|
-
title={title}
|
|
85
|
-
onBack={onBack}
|
|
86
|
-
onAdd={onAdd}
|
|
87
|
-
onMore={onMore}
|
|
88
|
-
hideRight={hideRight}
|
|
89
|
-
hideRightPlus={hideRightPlus}
|
|
90
|
-
idButtonMore={idButtonMore}
|
|
91
|
-
/>
|
|
60
|
+
<HeaderUnit unit={unit} unitData={unitData} />
|
|
92
61
|
</View>
|
|
93
62
|
),
|
|
94
|
-
[
|
|
63
|
+
[unit, unitData]
|
|
95
64
|
);
|
|
96
65
|
return (
|
|
97
66
|
<ParallaxScrollView
|
|
@@ -101,9 +70,11 @@ const WrapParallaxScrollView = ({
|
|
|
101
70
|
stickyHeaderHeight={stickyHeaderHeight}
|
|
102
71
|
renderStickyHeader={renderStickyHeader}
|
|
103
72
|
backgroundColor={Colors.White}
|
|
104
|
-
refreshControl={
|
|
73
|
+
refreshControl={
|
|
74
|
+
<RefreshControl refreshing={false} onRefresh={onRefresh} />
|
|
75
|
+
}
|
|
105
76
|
showsVerticalScrollIndicator={false}
|
|
106
|
-
accessibilityLabel={
|
|
77
|
+
accessibilityLabel={AccessibilityLabel.UNIT_DETAIL_PARALLAX_SCROLLVIEW}
|
|
107
78
|
>
|
|
108
79
|
{children}
|
|
109
80
|
</ParallaxScrollView>
|
package/src/configs/API.js
CHANGED
|
@@ -195,8 +195,7 @@ const API = {
|
|
|
195
195
|
},
|
|
196
196
|
},
|
|
197
197
|
NOTIFICATION: {
|
|
198
|
-
LIST_EOH_NOTIFICATIONS: (page
|
|
199
|
-
`/notifications/eoh/?page=${page}&type=${type}`,
|
|
198
|
+
LIST_EOH_NOTIFICATIONS: (page) => `/notifications/eoh/?page=${page}`,
|
|
200
199
|
SET_READ: (id) => `/notifications/eoh/${id}/set_read/`,
|
|
201
200
|
},
|
|
202
201
|
VALUE_EVALUATIONS: () => '/property_manager/config_value_evaluations/',
|
|
@@ -4,6 +4,7 @@ import { renderHook } from '@testing-library/react-hooks';
|
|
|
4
4
|
import { useAndroidTranslucentStatusBar } from '../index';
|
|
5
5
|
import { SCProvider } from '../../../context';
|
|
6
6
|
import { mockSCStore } from '../../../context/mockStore';
|
|
7
|
+
import { useNavigation } from '@react-navigation/native';
|
|
7
8
|
|
|
8
9
|
const mockedSetAction = jest.fn();
|
|
9
10
|
|
|
@@ -16,20 +17,8 @@ const mockUseContext = jest.fn().mockImplementation(() => ({
|
|
|
16
17
|
|
|
17
18
|
React.useContext = mockUseContext;
|
|
18
19
|
|
|
19
|
-
const mockAddListener = jest.fn();
|
|
20
|
-
jest.mock('@react-navigation/native', () => {
|
|
21
|
-
return {
|
|
22
|
-
...jest.requireActual('@react-navigation/native'),
|
|
23
|
-
useNavigation: () => ({
|
|
24
|
-
addListener: mockAddListener,
|
|
25
|
-
}),
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
|
|
29
20
|
describe('test useAndroidTranslucentStatusBar', () => {
|
|
30
|
-
|
|
31
|
-
mockAddListener.mockClear();
|
|
32
|
-
});
|
|
21
|
+
const { addListener } = useNavigation();
|
|
33
22
|
|
|
34
23
|
it('test useAndroidTranslucentStatusBar android', async () => {
|
|
35
24
|
Platform.OS = 'android';
|
|
@@ -39,7 +28,7 @@ describe('test useAndroidTranslucentStatusBar', () => {
|
|
|
39
28
|
wrapper,
|
|
40
29
|
}
|
|
41
30
|
);
|
|
42
|
-
expect(
|
|
31
|
+
expect(addListener).not.toBeCalled();
|
|
43
32
|
});
|
|
44
33
|
|
|
45
34
|
it('test useAndroidTranslucentStatusBar ios', async () => {
|
|
@@ -50,6 +39,6 @@ describe('test useAndroidTranslucentStatusBar', () => {
|
|
|
50
39
|
wrapper,
|
|
51
40
|
}
|
|
52
41
|
);
|
|
53
|
-
expect(
|
|
42
|
+
expect(addListener).not.toBeCalled();
|
|
54
43
|
});
|
|
55
44
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
2
|
import { renderHook } from '@testing-library/react-hooks';
|
|
3
3
|
import { SCProvider } from '../../../context';
|
|
4
4
|
import { mockSCStore } from '../../../context/mockStore';
|
|
@@ -9,24 +9,6 @@ const mockedSetAction = jest.fn();
|
|
|
9
9
|
|
|
10
10
|
const wrapper = ({ children }) => <SCProvider>{children}</SCProvider>;
|
|
11
11
|
|
|
12
|
-
jest.mock('react', () => {
|
|
13
|
-
return {
|
|
14
|
-
...jest.requireActual('react'),
|
|
15
|
-
useCallback: (func) => func(),
|
|
16
|
-
useContext: () => ({
|
|
17
|
-
stateData: mockSCStore({}),
|
|
18
|
-
setAction: mockedSetAction,
|
|
19
|
-
}),
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
jest.mock('@react-navigation/native', () => {
|
|
24
|
-
return {
|
|
25
|
-
...jest.requireActual('@react-navigation/native'),
|
|
26
|
-
useFocusEffect: (func) => func(),
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
|
|
30
12
|
jest.mock('../../../iot/Monitor');
|
|
31
13
|
|
|
32
14
|
describe('Test useWatchConfigs', () => {
|
|
@@ -34,14 +16,17 @@ describe('Test useWatchConfigs', () => {
|
|
|
34
16
|
jest.useFakeTimers();
|
|
35
17
|
watchMultiConfigs.mockClear();
|
|
36
18
|
unwatchMultiConfigs.mockClear();
|
|
19
|
+
useContext.mockReturnValue({
|
|
20
|
+
stateData: mockSCStore({}),
|
|
21
|
+
setAction: mockedSetAction,
|
|
22
|
+
});
|
|
37
23
|
});
|
|
38
24
|
|
|
39
25
|
it('test unitId null', async () => {
|
|
40
26
|
renderHook(() => useWatchConfigs([1]), {
|
|
41
27
|
wrapper,
|
|
42
28
|
});
|
|
43
|
-
jest.
|
|
29
|
+
jest.runOnlyPendingTimers();
|
|
44
30
|
expect(watchMultiConfigs).toBeCalledWith([1]);
|
|
45
|
-
expect(unwatchMultiConfigs).toBeCalledWith([1]);
|
|
46
31
|
});
|
|
47
32
|
});
|
|
@@ -127,7 +127,7 @@ export const homeAssistantConnect = async (
|
|
|
127
127
|
for (let i = 0; i < options.length; i++) {
|
|
128
128
|
const option = options[i];
|
|
129
129
|
|
|
130
|
-
option.config_maps
|
|
130
|
+
option.config_maps?.forEach((configMap) => {
|
|
131
131
|
if (option.text_maps) {
|
|
132
132
|
textMaps[configMap.entity_id] = option.text_maps;
|
|
133
133
|
}
|