@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
|
@@ -14,26 +14,18 @@ import api from '../../../utils/Apis/axios';
|
|
|
14
14
|
|
|
15
15
|
const mock = new MockAdapter(api.axiosInstance);
|
|
16
16
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<SharedUnit
|
|
30
|
-
item={item}
|
|
31
|
-
navigation={navigation}
|
|
32
|
-
isOptions={isOptions}
|
|
33
|
-
renewItem={mockedRenewItem}
|
|
34
|
-
/>
|
|
35
|
-
</SCProvider>
|
|
36
|
-
);
|
|
17
|
+
const wrapComponent = (item, navigation, isOptions, mockedRenewItem) => {
|
|
18
|
+
return (
|
|
19
|
+
<SCProvider initState={mockSCStore({})}>
|
|
20
|
+
<SharedUnit
|
|
21
|
+
item={item}
|
|
22
|
+
navigation={navigation}
|
|
23
|
+
isOptions={isOptions}
|
|
24
|
+
renewItem={mockedRenewItem}
|
|
25
|
+
/>
|
|
26
|
+
</SCProvider>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
37
29
|
|
|
38
30
|
describe('Test SharedUnit', () => {
|
|
39
31
|
let tree, item, unit;
|
|
@@ -67,9 +59,6 @@ describe('Test SharedUnit', () => {
|
|
|
67
59
|
);
|
|
68
60
|
});
|
|
69
61
|
|
|
70
|
-
await act(async () => {
|
|
71
|
-
tree = await create(wrapComponent(item, navigation));
|
|
72
|
-
});
|
|
73
62
|
const instance = tree.root;
|
|
74
63
|
const touchSharedUnit = instance.find(
|
|
75
64
|
(el) =>
|
|
@@ -111,7 +100,7 @@ describe('Test SharedUnit', () => {
|
|
|
111
100
|
iconAddStarSharedUnit.props.onPress();
|
|
112
101
|
});
|
|
113
102
|
expect(iconRemovePinSharedUnit).toHaveLength(0);
|
|
114
|
-
expect(
|
|
103
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
|
|
115
104
|
screen: Routes.UnitDetail,
|
|
116
105
|
params: {
|
|
117
106
|
unitId: 3,
|
|
@@ -120,85 +109,85 @@ describe('Test SharedUnit', () => {
|
|
|
120
109
|
});
|
|
121
110
|
});
|
|
122
111
|
|
|
123
|
-
it('test create SharedUnit unit without unit owner', async () => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
it('test create SharedUnit unit isOption false', async () => {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
it('test create SharedUnit unit is pin, is star', async () => {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
});
|
|
112
|
+
// it('test create SharedUnit unit without unit owner', async () => {
|
|
113
|
+
// const navigation = useNavigation();
|
|
114
|
+
// delete unit.owner_name;
|
|
115
|
+
//
|
|
116
|
+
// await act(async () => {
|
|
117
|
+
// tree = await create(wrapComponent(item, navigation));
|
|
118
|
+
// });
|
|
119
|
+
// const instance = tree.root;
|
|
120
|
+
// const ownerName = instance.findAll(
|
|
121
|
+
// (el) =>
|
|
122
|
+
// el.props.accessibilityLabel === AccessibilityLabel.SHARED_UNIT_OWN_BY
|
|
123
|
+
// );
|
|
124
|
+
//
|
|
125
|
+
// expect(ownerName).toHaveLength(0);
|
|
126
|
+
// });
|
|
127
|
+
//
|
|
128
|
+
// it('test create SharedUnit unit isOption false', async () => {
|
|
129
|
+
// const navigation = useNavigation();
|
|
130
|
+
//
|
|
131
|
+
// await act(async () => {
|
|
132
|
+
// tree = await create(wrapComponent(item, navigation, false));
|
|
133
|
+
// });
|
|
134
|
+
// const instance = tree.root;
|
|
135
|
+
//
|
|
136
|
+
// const iconAddPinSharedUnit = instance.findAll(
|
|
137
|
+
// (el) =>
|
|
138
|
+
// el.props.accessibilityLabel ===
|
|
139
|
+
// AccessibilityLabel.ICON_ADD_PIN_SHARED_UNIT + '-69'
|
|
140
|
+
// );
|
|
141
|
+
// const iconStarUnit = instance.findAll(
|
|
142
|
+
// (el) =>
|
|
143
|
+
// el.props.accessibilityLabel ===
|
|
144
|
+
// AccessibilityLabel.ICON_ADD_STAR_SHARED_UNIT + '-69'
|
|
145
|
+
// );
|
|
146
|
+
//
|
|
147
|
+
// expect(iconAddPinSharedUnit).toHaveLength(0);
|
|
148
|
+
// expect(iconStarUnit).toHaveLength(0);
|
|
149
|
+
// });
|
|
150
|
+
//
|
|
151
|
+
// it('test create SharedUnit unit is pin, is star', async () => {
|
|
152
|
+
// const navigation = useNavigation();
|
|
153
|
+
// item.is_pin = true;
|
|
154
|
+
// item.is_star = true;
|
|
155
|
+
//
|
|
156
|
+
// await act(async () => {
|
|
157
|
+
// tree = await create(wrapComponent(item, navigation));
|
|
158
|
+
// });
|
|
159
|
+
// const instance = tree.root;
|
|
160
|
+
// const iconRemovePinSharedUnit = instance.find(
|
|
161
|
+
// (el) =>
|
|
162
|
+
// el.props.accessibilityLabel ===
|
|
163
|
+
// AccessibilityLabel.ICON_REMOVE_PIN_SHARED_UNIT + '-69'
|
|
164
|
+
// );
|
|
165
|
+
// mock.onPost(API.UNIT.UNPIN_UNIT(3)).reply(200);
|
|
166
|
+
// await act(async () => {
|
|
167
|
+
// iconRemovePinSharedUnit.props.onPress();
|
|
168
|
+
// });
|
|
169
|
+
// mock.onPost(API.UNIT.UNPIN_UNIT(3)).reply(400);
|
|
170
|
+
// await act(async () => {
|
|
171
|
+
// iconRemovePinSharedUnit.props.onPress();
|
|
172
|
+
// });
|
|
173
|
+
// const iconRemoveStarSharedUnit = instance.find(
|
|
174
|
+
// (el) =>
|
|
175
|
+
// el.props.accessibilityLabel ===
|
|
176
|
+
// AccessibilityLabel.ICON_REMOVE_STAR_SHARED_UNIT + '-69'
|
|
177
|
+
// );
|
|
178
|
+
// mock.onPost(API.UNIT.UNSTAR_UNIT(3)).reply(200);
|
|
179
|
+
// await act(async () => {
|
|
180
|
+
// iconRemoveStarSharedUnit.props.onPress();
|
|
181
|
+
// });
|
|
182
|
+
// mock.onPost(API.UNIT.UNSTAR_UNIT(3)).reply(400);
|
|
183
|
+
// await act(async () => {
|
|
184
|
+
// iconRemoveStarSharedUnit.props.onPress();
|
|
185
|
+
// });
|
|
186
|
+
// const iconRemoveStar = instance.findAll(
|
|
187
|
+
// (el) =>
|
|
188
|
+
// el.props.accessibilityLabel ===
|
|
189
|
+
// AccessibilityLabel.ICON_REMOVE_STAR_SHARED_UNIT + '-69'
|
|
190
|
+
// );
|
|
191
|
+
// expect(iconRemoveStar).toHaveLength(3);
|
|
192
|
+
// });
|
|
204
193
|
});
|
|
@@ -8,22 +8,22 @@ import TextCustom from '../../../../commons/Text';
|
|
|
8
8
|
import { scaleValue, drawArc, polarToCartesian } from './helper';
|
|
9
9
|
|
|
10
10
|
const SegmentedRoundDisplay = ({
|
|
11
|
-
filledArcWidth,
|
|
12
|
-
emptyArcWidth,
|
|
13
|
-
arcSpacing,
|
|
14
|
-
totalArcSize,
|
|
15
|
-
emptyArcColor,
|
|
16
|
-
filledArcColor,
|
|
17
|
-
radius,
|
|
18
11
|
style,
|
|
19
12
|
totalValue,
|
|
20
13
|
value,
|
|
21
14
|
title,
|
|
22
|
-
pos, //array position
|
|
23
|
-
boxTitle,
|
|
24
|
-
textHeader,
|
|
25
|
-
initIndex,
|
|
26
15
|
valueText,
|
|
16
|
+
filledArcWidth = 0,
|
|
17
|
+
emptyArcWidth = 20,
|
|
18
|
+
arcSpacing = 1,
|
|
19
|
+
totalArcSize = 280,
|
|
20
|
+
emptyArcColor = Colors.Gray3,
|
|
21
|
+
filledArcColor = '#5ECCAA',
|
|
22
|
+
radius = 90,
|
|
23
|
+
pos = [0, 100, 200, 300, 400, 500],
|
|
24
|
+
boxTitle = false,
|
|
25
|
+
textHeader = '',
|
|
26
|
+
initIndex = 0,
|
|
27
27
|
}) => {
|
|
28
28
|
const [arcs, setArcs] = useState([]);
|
|
29
29
|
|
|
@@ -239,25 +239,6 @@ SegmentedRoundDisplay.propTypes = {
|
|
|
239
239
|
initIndex: PropTypes.number,
|
|
240
240
|
};
|
|
241
241
|
|
|
242
|
-
SegmentedRoundDisplay.defaultProps = {
|
|
243
|
-
filledArcWidth: 0,
|
|
244
|
-
emptyArcWidth: 20,
|
|
245
|
-
arcSpacing: 1,
|
|
246
|
-
totalArcSize: 280,
|
|
247
|
-
emptyArcColor: Colors.Gray3,
|
|
248
|
-
filledArcColor: '#5ECCAA',
|
|
249
|
-
animationDuration: 1000,
|
|
250
|
-
incompleteArcColor: '#23318C',
|
|
251
|
-
displayValue: false,
|
|
252
|
-
valueBoxColor: '#23318C',
|
|
253
|
-
valueFontColor: '#FFFFFF',
|
|
254
|
-
radius: 90,
|
|
255
|
-
pos: [0, 100, 200, 300, 400, 500],
|
|
256
|
-
boxTitle: false,
|
|
257
|
-
textHeader: '',
|
|
258
|
-
initIndex: 0,
|
|
259
|
-
};
|
|
260
|
-
|
|
261
242
|
export default SegmentedRoundDisplay;
|
|
262
243
|
|
|
263
244
|
const styles = StyleSheet.create({
|
|
@@ -9,10 +9,16 @@ import { useFetchConfigHistory } from '../../UnitSummary/ConfigHistoryChart';
|
|
|
9
9
|
import API from '../../../configs/API';
|
|
10
10
|
import WebView from 'react-native-webview';
|
|
11
11
|
import { TouchableOpacity, View } from 'react-native';
|
|
12
|
+
import { useRemoteControl } from '../../../hooks/IoT';
|
|
13
|
+
import { useSCContextSelector } from '../../../context';
|
|
12
14
|
|
|
13
15
|
const IFrameWithConfig = memo(
|
|
14
16
|
({ item = {}, widgetStyle, isWidgetBox, isSetting, isEditing }) => {
|
|
15
17
|
const ref = useRef();
|
|
18
|
+
const sendRemoteCommand = useRemoteControl();
|
|
19
|
+
const userId = useSCContextSelector(
|
|
20
|
+
(state) => state?.auth?.account?.user?.id
|
|
21
|
+
);
|
|
16
22
|
|
|
17
23
|
const { configuration } = item;
|
|
18
24
|
const { url } = configuration || {};
|
|
@@ -66,6 +72,34 @@ const IFrameWithConfig = memo(
|
|
|
66
72
|
}
|
|
67
73
|
}, [item?.id, url]);
|
|
68
74
|
|
|
75
|
+
const triggerAction = useCallback(
|
|
76
|
+
async ({ actionKey, actionIndex, data }) => {
|
|
77
|
+
let action = null;
|
|
78
|
+
if (!configuration?.actions) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (actionIndex !== undefined) {
|
|
82
|
+
action = configuration?.actions[actionIndex];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (actionKey) {
|
|
86
|
+
action = configuration?.actions.find(
|
|
87
|
+
(act) => act.action === actionKey
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
if (!action) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
await sendRemoteCommand(
|
|
94
|
+
action.action_data.end_device,
|
|
95
|
+
action.action_data,
|
|
96
|
+
data,
|
|
97
|
+
userId
|
|
98
|
+
);
|
|
99
|
+
},
|
|
100
|
+
[configuration?.actions, sendRemoteCommand, userId]
|
|
101
|
+
);
|
|
102
|
+
|
|
69
103
|
const onMessage = useCallback(
|
|
70
104
|
async (event) => {
|
|
71
105
|
const eventData = event.nativeEvent.data
|
|
@@ -95,9 +129,18 @@ const IFrameWithConfig = memo(
|
|
|
95
129
|
case 'requestAdjustMobileHeight':
|
|
96
130
|
setHeight(data);
|
|
97
131
|
break;
|
|
132
|
+
case 'triggerAction':
|
|
133
|
+
triggerAction(data);
|
|
134
|
+
break;
|
|
98
135
|
}
|
|
99
136
|
},
|
|
100
|
-
[
|
|
137
|
+
[
|
|
138
|
+
configuration,
|
|
139
|
+
fetchDataDisplayHistory,
|
|
140
|
+
item.id,
|
|
141
|
+
postMessage,
|
|
142
|
+
triggerAction,
|
|
143
|
+
]
|
|
101
144
|
);
|
|
102
145
|
|
|
103
146
|
useEffect(() => {
|
|
@@ -11,6 +11,14 @@ import WebView from 'react-native-webview';
|
|
|
11
11
|
import { TouchableOpacity, View } from 'react-native';
|
|
12
12
|
import { refFunctions } from '../../../../../__mocks__/react-native-webview';
|
|
13
13
|
|
|
14
|
+
const mockDoAction = jest.fn();
|
|
15
|
+
jest.mock('../../../../hooks/IoT', () => {
|
|
16
|
+
return {
|
|
17
|
+
...jest.requireActual('../../../../hooks/IoT'),
|
|
18
|
+
useRemoteControl: () => mockDoAction,
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
|
|
14
22
|
jest.mock('../../../../iot/states', () => {
|
|
15
23
|
return {
|
|
16
24
|
...jest.requireActual('../../../../iot/states'),
|
|
@@ -27,6 +35,7 @@ describe('Test IFrame With Config', () => {
|
|
|
27
35
|
};
|
|
28
36
|
|
|
29
37
|
beforeEach(() => {
|
|
38
|
+
mockDoAction.mockClear();
|
|
30
39
|
item = {
|
|
31
40
|
id: 1,
|
|
32
41
|
configuration: {
|
|
@@ -281,4 +290,64 @@ describe('Test IFrame With Config', () => {
|
|
|
281
290
|
'window.postMessage(' + JSON.stringify(message) + ', "*")'
|
|
282
291
|
);
|
|
283
292
|
};
|
|
293
|
+
|
|
294
|
+
const triggerAction = async (
|
|
295
|
+
data,
|
|
296
|
+
actions = [
|
|
297
|
+
{
|
|
298
|
+
action: 'xxx',
|
|
299
|
+
action_data: {
|
|
300
|
+
end_device: 1,
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
]
|
|
304
|
+
) => {
|
|
305
|
+
item.configuration.actions = actions;
|
|
306
|
+
const { root } = await render(<IFrameWithConfig isWidgetBox item={item} />);
|
|
307
|
+
const webview = root.findByType(WebView);
|
|
308
|
+
|
|
309
|
+
await act(async () => {
|
|
310
|
+
webview.props.onMessage({
|
|
311
|
+
nativeEvent: {
|
|
312
|
+
data: JSON.stringify({
|
|
313
|
+
type: 'triggerAction',
|
|
314
|
+
eraWidgetId: 1,
|
|
315
|
+
source: 'eraIframeWidget',
|
|
316
|
+
data: data,
|
|
317
|
+
}),
|
|
318
|
+
origin: 'http://localhost',
|
|
319
|
+
},
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
test('test iframe trigger action', async () => {
|
|
325
|
+
await triggerAction({ actionKey: 'xxx' });
|
|
326
|
+
expect(mockDoAction).toHaveBeenCalledWith(
|
|
327
|
+
item.configuration.actions[0].action_data.end_device,
|
|
328
|
+
item.configuration.actions[0].action_data,
|
|
329
|
+
undefined,
|
|
330
|
+
undefined
|
|
331
|
+
);
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
test('test iframe trigger by index', async () => {
|
|
335
|
+
await triggerAction({ actionIndex: 0 });
|
|
336
|
+
expect(mockDoAction).toHaveBeenCalledWith(
|
|
337
|
+
item.configuration.actions[0].action_data.end_device,
|
|
338
|
+
item.configuration.actions[0].action_data,
|
|
339
|
+
undefined,
|
|
340
|
+
undefined
|
|
341
|
+
);
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
test('test iframe trigger not exists', async () => {
|
|
345
|
+
await triggerAction({ actionIndex: -1 });
|
|
346
|
+
expect(mockDoAction).toHaveBeenCalledTimes(0);
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
test('test iframe trigger no actions', async () => {
|
|
350
|
+
await triggerAction({ actionIndex: 0 }, []);
|
|
351
|
+
expect(mockDoAction).toHaveBeenCalledTimes(0);
|
|
352
|
+
});
|
|
284
353
|
});
|
|
@@ -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,41 @@ 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
|
-
|
|
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, onRefresh }) => {
|
|
17
|
+
const { name = '', background } = unit;
|
|
18
|
+
const t = useTranslations();
|
|
29
19
|
const renderForeground = useCallback(
|
|
30
20
|
() => (
|
|
31
21
|
<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
|
-
/>
|
|
22
|
+
<HeaderUnit transparent unit={unit} />
|
|
41
23
|
<Text
|
|
42
24
|
numberOfLines={1}
|
|
43
25
|
semibold
|
|
44
26
|
style={styles.nameUnit}
|
|
45
27
|
accessibilityLabel={AccessibilityLabel.HEADER_UNIT_BUTTON_TEXT}
|
|
46
28
|
>
|
|
47
|
-
{
|
|
29
|
+
{t('Welcome {name}', {
|
|
30
|
+
name: name,
|
|
31
|
+
})}
|
|
48
32
|
</Text>
|
|
49
|
-
{contentBackground}
|
|
50
33
|
</View>
|
|
51
34
|
),
|
|
52
|
-
[
|
|
53
|
-
onBack,
|
|
54
|
-
onAdd,
|
|
55
|
-
onMore,
|
|
56
|
-
hideRight,
|
|
57
|
-
hideRightPlus,
|
|
58
|
-
idButtonMore,
|
|
59
|
-
title,
|
|
60
|
-
contentBackground,
|
|
61
|
-
]
|
|
35
|
+
[unit, t, name]
|
|
62
36
|
);
|
|
63
37
|
const renderBackground = useCallback(
|
|
64
38
|
() => (
|
|
65
39
|
<View style={styles.image}>
|
|
66
40
|
<FImage
|
|
67
41
|
style={styles.image}
|
|
68
|
-
source={
|
|
42
|
+
source={
|
|
43
|
+
background ? { uri: background } : SCConfig.appUnitDefaultBackground
|
|
44
|
+
}
|
|
69
45
|
defaultSource={Images.BgUnit}
|
|
70
46
|
resizeMode="cover"
|
|
71
47
|
/>
|
|
@@ -75,23 +51,15 @@ const WrapParallaxScrollView = ({
|
|
|
75
51
|
/>
|
|
76
52
|
</View>
|
|
77
53
|
),
|
|
78
|
-
[
|
|
54
|
+
[background]
|
|
79
55
|
);
|
|
80
56
|
const renderStickyHeader = useCallback(
|
|
81
57
|
() => (
|
|
82
58
|
<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
|
-
/>
|
|
59
|
+
<HeaderUnit unit={unit} />
|
|
92
60
|
</View>
|
|
93
61
|
),
|
|
94
|
-
[
|
|
62
|
+
[unit]
|
|
95
63
|
);
|
|
96
64
|
return (
|
|
97
65
|
<ParallaxScrollView
|
|
@@ -101,9 +69,11 @@ const WrapParallaxScrollView = ({
|
|
|
101
69
|
stickyHeaderHeight={stickyHeaderHeight}
|
|
102
70
|
renderStickyHeader={renderStickyHeader}
|
|
103
71
|
backgroundColor={Colors.White}
|
|
104
|
-
refreshControl={
|
|
72
|
+
refreshControl={
|
|
73
|
+
<RefreshControl refreshing={false} onRefresh={onRefresh} />
|
|
74
|
+
}
|
|
105
75
|
showsVerticalScrollIndicator={false}
|
|
106
|
-
accessibilityLabel={
|
|
76
|
+
accessibilityLabel={AccessibilityLabel.UNIT_DETAIL_PARALLAX_SCROLLVIEW}
|
|
107
77
|
>
|
|
108
78
|
{children}
|
|
109
79
|
</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/',
|
package/src/configs/Constants.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { default as AccessibilityLabel } from './AccessibilityLabel';
|
|
2
2
|
import { Platform, Dimensions, StatusBar } from 'react-native';
|
|
3
3
|
import { RFValue } from 'react-native-responsive-fontsize';
|
|
4
|
-
import OneTap from '../../assets/images/
|
|
5
|
-
import ValueChange from '../../assets/images/
|
|
6
|
-
import Schedule from '../../assets/images/
|
|
4
|
+
import OneTap from '../../assets/images/Scenario-filled.svg';
|
|
5
|
+
import ValueChange from '../../assets/images/Automation-fill.svg';
|
|
6
|
+
import Schedule from '../../assets/images/schedule-fill.svg';
|
|
7
7
|
import Event from '../../assets/images/Event.svg';
|
|
8
8
|
|
|
9
9
|
const X_WIDTH = 375;
|
|
@@ -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
|
});
|