@eohjsc/react-native-smart-city 0.3.34 → 0.3.37
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/assets/images/AddNewDevice/on-icon.svg +5 -0
- package/assets/images/AddNewDevice/router-connect-icon.svg +3 -0
- package/package.json +1 -1
- package/src/commons/Action/__test__/ItemQuickAction.test.js +36 -32
- package/src/commons/ActionGroup/ColorPickerTemplate.js +61 -23
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/ItemPasscode.test.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +2 -2
- package/src/commons/ActionGroup/SliderRangeTemplate.js +35 -20
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/CircleButton.test.js +12 -12
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/ControlPlay.test.js +10 -10
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/RectangleButton.test.js +7 -7
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/SmartTiviActionTemplate.test.js +23 -23
- package/src/commons/ActionGroup/StatesGridActionTemplate.js +1 -3
- package/src/commons/ActionGroup/__test__/ColorPickerTemplate.test.js +1 -1
- package/src/commons/ActionGroup/__test__/CurtainButtonTemplate.test.js +4 -4
- package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +14 -14
- package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +12 -12
- package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +2 -2
- package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +10 -10
- package/src/commons/ActionGroup/__test__/OneBigButtonTemplate.test.js +2 -2
- package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +7 -7
- package/src/commons/ActionGroup/__test__/SliderRangeTemplate.test.js +1 -1
- package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +2 -2
- package/src/commons/ActionGroup/__test__/ThreeButtonTemplate.test.js +2 -2
- package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +3 -3
- package/src/commons/ActionGroup/__test__/TimerActionTemplateWithutConfigValue.test.js +2 -2
- package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +14 -14
- package/src/commons/ActionGroup/__test__/index.test.js +41 -41
- package/src/commons/ActionTemplate/OnOffButtonAction.js +6 -4
- package/src/commons/ActionTemplate/OnOffSimpleAction.js +9 -3
- package/src/commons/ActionTemplate/OnOffSmartLockAction.js +12 -10
- package/src/commons/ActionTemplate/__test__/OnOffButtonAction.test.js +3 -3
- package/src/commons/ActionTemplate/__test__/OnOffSimpleAction.test.js +3 -3
- package/src/commons/ActionTemplate/__test__/OneButtonAction.test.js +3 -3
- package/src/commons/ActionTemplate/__test__/ThreeButtonAction.test.js +3 -3
- package/src/commons/ActionTemplate/__test__/index.test.js +6 -6
- package/src/commons/ActionTemplate/index.js +15 -3
- package/src/commons/Alert/__test__/Alert.test.js +2 -2
- package/src/commons/AlertAction/__test__/AlertAction.test.js +2 -2
- package/src/commons/Auth/__test__/AccountItem.test.js +4 -4
- package/src/commons/Auth/__test__/AccountList.test.js +4 -4
- package/src/commons/Auth/__test__/OtpInputList.test.js +20 -16
- package/src/commons/Auth/__test__/SocialButton.test.js +6 -6
- package/src/commons/Automate/__test__/ItemAutomate.test.js +2 -2
- package/src/commons/Automate/__test__/ItemScriptAction.test.js +2 -2
- package/src/commons/BackDefault/__test__/BackDefault.test.js +2 -2
- package/src/commons/Button/__test__/Button.test.js +3 -3
- package/src/commons/ButtonPopup/__test__/ButtonPopup.test.js +2 -2
- package/src/commons/Calendar/__test__/Calendar.test.js +2 -2
- package/src/commons/ChartLoading/__test__/ChartLoading.test.js +2 -2
- package/src/commons/CircleButton/__test__/CircleButton.test.js +2 -2
- package/src/commons/CircleView/__test__/CircleView.test.js +2 -2
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +3 -3
- package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +2 -2
- package/src/commons/DateTimeRangeChange/__test__/DateTimeButton.test.js +4 -4
- package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +5 -5
- package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +2 -2
- package/src/commons/Device/Hanet/ItemHanetDevice.test.js +5 -5
- package/src/commons/Device/HorizontalBarChart.js +2 -6
- package/src/commons/Device/LinearChart/LinearChart.test.js +2 -2
- package/src/commons/Device/RainningSensor/__test__/CurrentRainSensor.test.js +6 -6
- package/src/commons/Device/SonosSpeaker/__test__/SonosSpeaker.test.js +8 -8
- package/src/commons/Device/WindDirection/Compass/Compass.test.js +4 -4
- package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +2 -2
- package/src/commons/Device/WindSpeed/LinearChart/__test__/ValueBalloon.test.js +2 -2
- package/src/commons/Device/WindSpeed/__test__/Anemometer.test.js +4 -4
- package/src/commons/Device/WindSpeed/__test__/ChartInfo.test.js +5 -5
- package/src/commons/Device/__test__/ConnectedViewHeader.test.js +6 -6
- package/src/commons/Device/__test__/DeviceAlertStatus.test.js +6 -6
- package/src/commons/Device/__test__/DisconnectedView.test.js +12 -12
- package/src/commons/Device/__test__/FlatListItems.test.js +2 -2
- package/src/commons/Device/__test__/FooterInfo.test.js +2 -2
- package/src/commons/Device/__test__/SensorConnectedStatus.test.js +2 -2
- package/src/commons/DisplayChecking/__test__/DisplayChecking.test.js +2 -2
- package/src/commons/Explore/SearchBox/__test__/SearchBox.test.js +6 -6
- package/src/commons/Explore/__test__/CityItem.test.js +6 -6
- package/src/commons/Explore/__test__/HeaderExplore.test.js +2 -2
- package/src/commons/Explore/__test__/HeaderLabel.test.js +3 -3
- package/src/commons/Explore/__test__/LocationItem.test.js +3 -3
- package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +4 -4
- package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +2 -2
- package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +1 -1
- package/src/commons/Form/__test__/CurrencyInput.test.js +12 -12
- package/src/commons/Form/__test__/TextInput.test.js +4 -4
- package/src/commons/Form/__test__/TextInputPassword.test.js +5 -5
- package/src/commons/FourButtonFilterHistory/__test__/FourButtonFilterHistory.test.js +1 -1
- package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +12 -10
- package/src/commons/Header/__test__/HeaderCT.test.js +11 -11
- package/src/commons/ImageButton/__test__/ImageButton.test.js +2 -2
- package/src/commons/ImagePicker/__test__/ImagePicker.test.js +8 -8
- package/src/commons/MediaPlayerDetail/__test__/MediaPlayerDetail.test.js +1 -1
- package/src/commons/MediaPlayerDetail/__test__/MediaPlayerFull.test.js +8 -8
- package/src/commons/MenuActionAddnew/__test__/MenuActionAddNew.test.js +3 -3
- package/src/commons/MenuActionList/__test__/MenuActionList.test.js +3 -3
- package/src/commons/MenuActionMore/__test__/MenuActionMore.test.js +2 -2
- package/src/commons/Modal/__test__/ModalBottom.test.js +4 -4
- package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +39 -13
- package/src/commons/OneTapTemplate/OptionsDropdownActionTemplate.js +33 -14
- package/src/commons/OneTapTemplate/StatesGridActionTemplate.js +9 -4
- package/src/commons/OneTapTemplate/__test__/NumberUpDownActionTemplate.test.js +25 -12
- package/src/commons/OneTapTemplate/__test__/OptionsDropdownActionTemplate.test.js +13 -13
- package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +7 -7
- package/src/commons/PreventAccess/__test__/PreventAccess.test.js +7 -5
- package/src/commons/Processing/__test__/Connecting.test.js +61 -25
- package/src/commons/Processing/index.js +21 -7
- package/src/commons/RowItem/__test__/RowItem.test.js +2 -2
- package/src/commons/RowUser/__test__/RowUser.test.js +2 -2
- package/src/commons/SearchLocation/__test__/RowLocation.test.js +4 -4
- package/src/commons/Section/Section.test.js +4 -4
- package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +3 -3
- package/src/commons/SelectSubUnit/index.js +1 -1
- package/src/commons/SelectUnit/__test__/SelectUnit.test.js +3 -3
- package/src/commons/SelectUnit/index.js +3 -4
- package/src/commons/Sharing/__test__/BtnRemoveMember.test.js +3 -3
- package/src/commons/Sharing/__test__/ButtonRemoveMember.test.js +2 -2
- package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +3 -3
- package/src/commons/Sharing/__test__/MemberList.test.js +8 -8
- package/src/commons/Sharing/__test__/RowMember.test.js +4 -4
- package/src/commons/Sharing/__test__/StationDevicePermission.test.js +7 -7
- package/src/commons/Sharing/__test__/WrapHeaderScrollable.test.js +6 -6
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +6 -6
- package/src/commons/SubUnit/__test__/Favorites.test.js +3 -3
- package/src/commons/SubUnit/__test__/Item.test.js +4 -4
- package/src/commons/SubUnit/__test__/ShortDetail.test.js +16 -16
- package/src/commons/SummaryItem/__test__/SummaryItem.test.js +7 -7
- package/src/commons/Tabbar/__test__/index.test.js +1 -1
- package/src/commons/TextButton/__test__/TextButton.test.js +6 -6
- package/src/commons/Today/__test__/Today.test.js +2 -2
- package/src/commons/TouchableScale/__test__/TouchableScale.test.js +5 -5
- package/src/commons/Unit/__test__/HeaderUnit.test.js +3 -3
- package/src/commons/Unit/__test__/SharedUnit.test.js +13 -13
- package/src/commons/UnitSummary/AirQuality/__test__/index.test.js +25 -25
- package/src/commons/UnitSummary/ConfigHistoryChart/__test__/ConfigHistoryChart.test.js +258 -25
- package/src/commons/UnitSummary/ConfigHistoryChart/index.js +90 -1
- package/src/commons/UnitSummary/__test__/TotalPowerBox.test.js +2 -2
- package/src/commons/UnitSummary/__test__/TotalPowerConsumption.test.js +2 -2
- package/src/commons/ViewButtonBottom/__test__/ViewButtonBottom.test.js +3 -3
- package/src/commons/WheelDateTimePicker/__test__/index.test.js +2 -2
- package/src/commons/WrapParallaxScrollView/index.js +2 -1
- package/src/configs/API.js +6 -2
- package/src/configs/AccessibilityLabel.js +5 -0
- package/src/configs/Constants.js +2 -0
- package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +2 -2
- package/src/hooks/Common/__test__/useStatusbar.test.js +4 -4
- package/src/hooks/Common/__test__/useTranslations.test.js +1 -1
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +7 -7
- package/src/hooks/IoT/useRemoteControl.js +0 -1
- package/src/iot/RemoteControl/__test__/Bluetooth.test.js +17 -17
- package/src/iot/RemoteControl/__test__/Internet.test.js +4 -4
- package/src/navigations/AddGatewayStack.js +10 -0
- package/src/screens/AQIGuide/__test__/AQIGuide.test.js +3 -3
- package/src/screens/ActivityLog/__test__/FilterPopup.test.js +2 -2
- package/src/screens/ActivityLog/__test__/ItemLog.test.js +21 -21
- package/src/screens/ActivityLog/hooks/__test__/index.test.js +1 -1
- package/src/screens/AddCommon/SelectUnit.js +1 -1
- package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +4 -4
- package/src/screens/AddCommon/__test__/SelectUnit.test.js +11 -6
- package/src/screens/AddLocationMaps/__test__/index.test.js +6 -6
- package/src/screens/AddNewAction/Device/__test__/index.test.js +3 -3
- package/src/screens/AddNewAction/SelectAction.js +6 -1
- package/src/screens/AddNewAction/SetupSensor.js +6 -0
- package/src/screens/AddNewAction/__test__/SelectAction.test.js +128 -20
- package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +10 -10
- package/src/screens/AddNewAction/__test__/SetupSensor.test.js +8 -8
- package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +2 -2
- package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +8 -8
- package/src/screens/AddNewDevice/__test__/ConnectingDevices.test.js +8 -8
- package/src/screens/AddNewGateway/ConnectingDevice.js +29 -7
- package/src/screens/AddNewGateway/ConnectingModbusDevice.js +0 -1
- package/src/screens/AddNewGateway/ConnectingWifiGuide.js +2 -2
- package/src/screens/AddNewGateway/ConnectingZigbeeDevice.js +3 -2
- package/src/screens/AddNewGateway/PlugAndPlay/ConnectRouterGuide.js +49 -0
- package/src/screens/AddNewGateway/PlugAndPlay/ConnectRouterGuideStyles.js +31 -0
- package/src/screens/AddNewGateway/PlugAndPlay/ZigbeeDeviceConnectGuide.js +51 -0
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +5 -5
- package/src/screens/AddNewGateway/ScanGatewayQR.js +11 -23
- package/src/screens/AddNewGateway/ScanModbusQR.js +75 -11
- package/src/screens/AddNewGateway/ScanWifiDeviceQR.js +19 -9
- package/src/screens/AddNewGateway/SelectDeviceSubUnit.js +26 -7
- package/src/screens/AddNewGateway/SelectDeviceType.js +8 -1
- package/src/screens/AddNewGateway/SelectZigbeeGateway.js +1 -1
- package/src/screens/AddNewGateway/ShareWifiPassword.js +1 -2
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +6 -6
- package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/ConnectingWifiDevice.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/ConnectingWifiGuide.test.js +9 -9
- package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +4 -4
- package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +4 -4
- package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +8 -10
- package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +9 -11
- package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +4 -3
- package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +6 -6
- package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +2 -2
- package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +3 -3
- package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +6 -6
- package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +4 -4
- package/src/screens/AllCamera/__test__/index.test.js +2 -2
- package/src/screens/Automate/__test__/Loading.test.js +2 -2
- package/src/screens/Automate/__test__/MultiUnits.test.js +10 -10
- package/src/screens/Automate/__test__/index.test.js +3 -3
- package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +2 -2
- package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +4 -4
- package/src/screens/Device/__test__/DetailHistoryChart.test.js +2 -2
- package/src/screens/Device/__test__/detail.test.js +14 -14
- package/src/screens/Device/detail.js +10 -3
- package/src/screens/Device/utils/index.test.js +4 -4
- package/src/screens/Drawer/Drawer.test.js +1 -1
- package/src/screens/EditActionsList/__tests__/index.test.js +5 -5
- package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +15 -15
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +19 -19
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +12 -12
- package/src/screens/EmergencySetting/__test__/DropDownItem.test.js +7 -7
- package/src/screens/EmergencySetting/__test__/index.test.js +3 -3
- package/src/screens/EnterPassword/__test__/EnterPassword.test.js +12 -12
- package/src/screens/Explore/__test__/Explore.test.js +3 -3
- package/src/screens/GuestInfo/__test__/index.test.js +3 -3
- package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +2 -2
- package/src/screens/HanetCamera/__test__/Detail.test.js +2 -2
- package/src/screens/HanetCamera/__test__/ManageAccess.test.js +5 -5
- package/src/screens/HanetCamera/__test__/MemberInfo.test.js +5 -5
- package/src/screens/HanetCamera/hooks/__test__/useHanetCheckinData.test.js +6 -6
- package/src/screens/HanetCamera/hooks/__test__/useHanetPlaceMembers.test.js +3 -3
- package/src/screens/ManageAccess/hooks/__test__/useManageAccess.test.js +11 -7
- package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +1 -1
- package/src/screens/Notification/__test__/Notification.test.js +5 -5
- package/src/screens/Notification/__test__/NotificationItem.test.js +41 -41
- package/src/screens/PlayBackCamera/__test__/Timer.test.js +3 -3
- package/src/screens/ScanChipQR/components/InvalidQRCode/index.js +33 -0
- package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +7 -7
- package/src/screens/ScanChipQR/components/QRScan/index.js +7 -5
- package/src/screens/ScriptDetail/__test__/index.test.js +31 -31
- package/src/screens/SetSchedule/__test__/SelectWeekday.test.js +1 -1
- package/src/screens/SetSchedule/__test__/index.test.js +4 -4
- package/src/screens/SharedUnit/__test__/ShareUnit.test.js +2 -2
- package/src/screens/SharedUnit/__test__/TabHeader.test.js +3 -3
- package/src/screens/Sharing/Components/__test__/DeviceItem.test.js +4 -4
- package/src/screens/Sharing/Components/__test__/ItemChangeRole.test.js +4 -4
- package/src/screens/Sharing/Components/__test__/TitleCheckBox.test.js +4 -4
- package/src/screens/Sharing/__test__/MemberList.test.js +1 -1
- package/src/screens/Sharing/__test__/MemberList2.test.js +1 -1
- package/src/screens/Sharing/__test__/SelectPermission.test.js +41 -41
- package/src/screens/Sharing/__test__/SelectUser.test.js +14 -14
- package/src/screens/SideMenuDetail/__test__/index.test.js +25 -4
- package/src/screens/SideMenuDetail/index.js +32 -19
- package/src/screens/SmartAccount/ListDevice/__test__/DeviceItem.test.js +3 -3
- package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +13 -21
- package/src/screens/SmartAccount/ListDevice/index.js +1 -1
- package/src/screens/SmartAccount/SuccessfullyConnected/__test__/DeviceItem.test.js +6 -6
- package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +6 -5
- package/src/screens/SmartAccount/SuccessfullyConnected/index.js +1 -0
- package/src/screens/SmartAccount/__test__/Connecting.test.js +4 -4
- package/src/screens/SmartAccount/__test__/SmartAccount.test.js +17 -17
- package/src/screens/SmartIr/__test__/ButtonsBottom.test.js +2 -2
- package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +12 -12
- package/src/screens/SmartIr/__test__/SelectBrand.test.js +5 -5
- package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +5 -5
- package/src/screens/SmartIr/__test__/SmartIr.test.js +5 -5
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +12 -12
- package/src/screens/SubUnit/__test__/Detail.test.js +6 -6
- package/src/screens/SubUnit/__test__/EditSubUnit.test.js +44 -44
- package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +6 -6
- package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +5 -5
- package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +10 -10
- package/src/screens/TDSGuide/__test__/TDSGuide.test.js +3 -3
- package/src/screens/UVIndexGuide/__test__/UVIndexGuide.test.js +3 -3
- package/src/screens/Unit/ManageUnit.js +4 -45
- package/src/screens/Unit/ManageUnitStyles.js +5 -35
- package/src/screens/Unit/Station/__test__/index.test.js +1 -1
- package/src/screens/Unit/Summaries.js +11 -20
- package/src/screens/Unit/__test__/AddMenu.test.js +8 -8
- package/src/screens/Unit/__test__/CheckSendEmail.test.js +3 -3
- package/src/screens/Unit/__test__/ChooseLocation.test.js +2 -2
- package/src/screens/Unit/__test__/Detail.test.js +17 -17
- package/src/screens/Unit/__test__/ManageUnit.test.js +17 -17
- package/src/screens/Unit/__test__/MyAllUnit.test.js +5 -5
- package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +4 -4
- package/src/screens/Unit/__test__/SelectAddress.test.js +10 -10
- package/src/screens/Unit/__test__/SmartAccount.test.js +4 -4
- package/src/screens/Unit/__test__/SmartAccountItem.test.js +1 -1
- package/src/screens/Unit/__test__/Summaries.test.js +2 -2
- package/src/screens/Unit/components/ButtonWrapper/index.js +60 -0
- package/src/screens/Unit/components/ButtonWrapper/styles.js +37 -0
- package/src/screens/Unit/components/MyAllUnit/__test__/Header.test.js +19 -19
- package/src/screens/Unit/components/MyAllUnit/__test__/MyAllUnit.test.js +3 -3
- package/src/screens/Unit/components/MyAllUnit/__test__/index.test.js +4 -4
- package/src/screens/Unit/components/__test__/Header.test.js +12 -12
- package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +2 -2
- package/src/screens/Unit/components/__test__/SharedUnit.test.js +6 -6
- package/src/screens/UnitSummary/__test__/index.test.js +24 -24
- package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +3 -3
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/ItemPower.test.js +3 -3
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +5 -5
- package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +3 -3
- package/src/screens/UnitSummary/components/Temperature/__test__/ChartAverage.test.js +3 -3
- package/src/screens/UnitSummary/components/Temperature/__test__/ItemAverage.test.js +3 -3
- package/src/screens/UnitSummary/components/UvIndex/__test__/index.test.js +18 -18
- package/src/screens/UnitSummary/components/WaterQuality/__test__/index.test.js +12 -12
- package/src/screens/UnitSummary/components/__test__/TotalPowerBox.test.js +2 -2
- package/src/screens/UnitSummary/components/__test__/TotalPowerConsumption.test.js +2 -2
- package/src/screens/UnitSummary/components/__test__/UnitSummary.test.js +8 -8
- package/src/screens/UnitSummary/components/__test__/index.test.js +5 -5
- package/src/screens/WaterQualityGuide/__test__/index.test.js +12 -12
- package/src/utils/Apis/axios.js +22 -0
- package/src/utils/Converter/__test__/array.test.js +1 -1
- package/src/utils/Converter/__test__/url.test.js +1 -1
- package/src/utils/Functions/__test__/Search.test.js +1 -1
- package/src/utils/Functions/__test__/ShortEmail.test.js +1 -1
- package/src/utils/I18n/translations/en.json +11 -1
- package/src/utils/I18n/translations/vi.json +11 -1
- package/src/utils/Route/index.js +3 -0
- package/src/utils/__test__/InitData.test.js +2 -2
- package/src/utils/__test__/Utils.test.js +2 -2
- package/src/commons/UnitSummary/ConfigHistoryChart.js +0 -105
- package/src/screens/AddNewDevice/hooks/ConnectDevices.js +0 -67
- package/src/screens/AddNewDevice/hooks/useStateAlertRename.js +0 -32
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/__test__/index.test.js +0 -63
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/index.js +0 -53
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { act, create } from 'react-test-renderer';
|
|
3
|
-
import ConfigHistoryChart from '../';
|
|
4
|
-
import { SCProvider } from '../../../../context';
|
|
5
|
-
import { mockSCStore } from '../../../../context/mockStore';
|
|
6
|
-
import HistoryChart from '../../../../commons/Device/HistoryChart';
|
|
7
3
|
import MockAdapter from 'axios-mock-adapter';
|
|
8
|
-
|
|
4
|
+
|
|
5
|
+
import ConfigHistoryChart from '../';
|
|
6
|
+
import HighchartsReactNative from '@eohjsc/highcharts';
|
|
9
7
|
import api from '../../../../utils/Apis/axios';
|
|
8
|
+
import { mockSCStore } from '../../../../context/mockStore';
|
|
9
|
+
import { SCProvider } from '../../../../context';
|
|
10
|
+
import API from '../../../../configs/API';
|
|
11
|
+
import { getPusher } from '../../../../utils/Pusher';
|
|
12
|
+
|
|
13
|
+
jest.mock('react', () => {
|
|
14
|
+
return {
|
|
15
|
+
...jest.requireActual('react'),
|
|
16
|
+
memo: (x) => x,
|
|
17
|
+
};
|
|
18
|
+
});
|
|
10
19
|
|
|
11
20
|
const mock = new MockAdapter(api.axiosInstance);
|
|
12
21
|
|
|
13
|
-
const wrapComponent = (configs = [
|
|
22
|
+
const wrapComponent = (configs = []) => (
|
|
14
23
|
<SCProvider initState={mockSCStore({})}>
|
|
15
24
|
<ConfigHistoryChart configs={configs} />
|
|
16
25
|
</SCProvider>
|
|
@@ -21,36 +30,260 @@ describe('Test HistoryChart', () => {
|
|
|
21
30
|
|
|
22
31
|
beforeAll(() => {
|
|
23
32
|
jest.useFakeTimers();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
beforeEach(() => {
|
|
36
|
+
getPusher().subscribe.mockClear();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const assertChartData = async (data) => {
|
|
40
|
+
const chart = tree.root.findByType(HighchartsReactNative);
|
|
41
|
+
expect(chart.props.options.series[0].data).toEqual(
|
|
42
|
+
data.map((i) => [i.x, i.y])
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
it('Test render null', async () => {
|
|
47
|
+
await act(() => {
|
|
48
|
+
tree = create(wrapComponent());
|
|
49
|
+
});
|
|
50
|
+
const instance = tree.root;
|
|
51
|
+
const HistoryCharts = instance.findAllByType(HighchartsReactNative);
|
|
52
|
+
expect(HistoryCharts).toHaveLength(0);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('Test render chart empty data', async () => {
|
|
56
|
+
const response = {
|
|
57
|
+
data: {
|
|
58
|
+
configs: [
|
|
59
|
+
{
|
|
60
|
+
id: 1,
|
|
61
|
+
head: [],
|
|
62
|
+
tail: [],
|
|
63
|
+
middle: {
|
|
64
|
+
ready: [],
|
|
65
|
+
not_ready: [],
|
|
66
|
+
channel: '',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
mock.onGet(API.CONFIG.DISPLAY_HISTORY()).reply(200, response.data);
|
|
73
|
+
const configs = [{ id: 1 }];
|
|
74
|
+
await act(async () => {
|
|
75
|
+
tree = await create(wrapComponent(configs));
|
|
76
|
+
});
|
|
77
|
+
await assertChartData([]);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('Test render chart empty head data', async () => {
|
|
81
|
+
const response = {
|
|
82
|
+
data: {
|
|
83
|
+
configs: [
|
|
84
|
+
{
|
|
85
|
+
id: 1,
|
|
86
|
+
head: [],
|
|
87
|
+
tail: [{ x: 1, y: 2 }],
|
|
88
|
+
middle: {
|
|
89
|
+
ready: [],
|
|
90
|
+
not_ready: [],
|
|
91
|
+
channel: '',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
mock.onGet(API.CONFIG.DISPLAY_HISTORY()).reply(200, response.data);
|
|
98
|
+
const configs = [{ id: 1 }];
|
|
99
|
+
await act(async () => {
|
|
100
|
+
tree = await create(wrapComponent(configs));
|
|
101
|
+
});
|
|
102
|
+
await assertChartData([{ x: 1, y: 2 }]);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('Test render chart empty tail data', async () => {
|
|
106
|
+
const response = {
|
|
107
|
+
data: {
|
|
108
|
+
configs: [
|
|
28
109
|
{
|
|
29
|
-
|
|
110
|
+
id: 1,
|
|
111
|
+
head: [{ x: 1, y: 2 }],
|
|
112
|
+
tail: [],
|
|
113
|
+
middle: {
|
|
114
|
+
ready: [],
|
|
115
|
+
not_ready: [],
|
|
116
|
+
channel: '',
|
|
117
|
+
},
|
|
30
118
|
},
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
mock.onGet(API.CONFIG.DISPLAY_HISTORY()).reply(200, response.data);
|
|
123
|
+
const configs = [{ id: 1 }];
|
|
124
|
+
await act(async () => {
|
|
125
|
+
tree = await create(wrapComponent(configs));
|
|
126
|
+
});
|
|
127
|
+
await assertChartData([{ x: 1, y: 2 }]);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('Test render chart merge head and tail data', async () => {
|
|
131
|
+
const response = {
|
|
132
|
+
data: {
|
|
133
|
+
configs: [
|
|
31
134
|
{
|
|
32
|
-
|
|
33
|
-
y:
|
|
135
|
+
id: 1,
|
|
136
|
+
head: [{ x: 1, y: 2 }],
|
|
137
|
+
tail: [{ x: 2, y: 3 }],
|
|
138
|
+
middle: {
|
|
139
|
+
ready: [],
|
|
140
|
+
not_ready: [],
|
|
141
|
+
channel: '',
|
|
142
|
+
},
|
|
34
143
|
},
|
|
35
144
|
],
|
|
36
145
|
},
|
|
146
|
+
};
|
|
147
|
+
mock.onGet(API.CONFIG.DISPLAY_HISTORY()).reply(200, response.data);
|
|
148
|
+
const configs = [{ id: 1 }];
|
|
149
|
+
await act(async () => {
|
|
150
|
+
tree = await create(wrapComponent(configs));
|
|
151
|
+
});
|
|
152
|
+
await assertChartData([
|
|
153
|
+
{ x: 1, y: 2 },
|
|
154
|
+
{ x: 2, y: 3 },
|
|
37
155
|
]);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('Test render chart merge fetch ready data', async () => {
|
|
159
|
+
const cacheUrl = 'https://s3.eoh.io/xxx.json';
|
|
160
|
+
const response = {
|
|
161
|
+
data: {
|
|
162
|
+
configs: [
|
|
163
|
+
{
|
|
164
|
+
id: 1,
|
|
165
|
+
head: [{ x: 1, y: 2 }],
|
|
166
|
+
tail: [{ x: 2, y: 3 }],
|
|
167
|
+
middle: {
|
|
168
|
+
ready: [{ date: '2022-03-03', url: cacheUrl }],
|
|
169
|
+
not_ready: [],
|
|
170
|
+
channel: '',
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
],
|
|
44
174
|
},
|
|
175
|
+
};
|
|
176
|
+
mock.onGet(API.CONFIG.DISPLAY_HISTORY()).reply(200, response.data);
|
|
177
|
+
mock.onGet(cacheUrl).reply(200, [{ x: 3, y: 4 }]);
|
|
178
|
+
const configs = [{ id: 1 }];
|
|
179
|
+
await act(async () => {
|
|
180
|
+
tree = await create(wrapComponent(configs));
|
|
181
|
+
});
|
|
182
|
+
await assertChartData([
|
|
183
|
+
{ x: 1, y: 2 },
|
|
184
|
+
{ x: 3, y: 4 },
|
|
185
|
+
{ x: 2, y: 3 },
|
|
45
186
|
]);
|
|
46
187
|
});
|
|
47
188
|
|
|
48
|
-
it('Test render', async () => {
|
|
49
|
-
|
|
50
|
-
|
|
189
|
+
it('Test render chart merge fetch not-ready data', async () => {
|
|
190
|
+
const cacheUrl = 'https://s3.eoh.io/xxx.json';
|
|
191
|
+
const response = {
|
|
192
|
+
data: {
|
|
193
|
+
channel: 'cache-xxx',
|
|
194
|
+
configs: [
|
|
195
|
+
{
|
|
196
|
+
id: 1,
|
|
197
|
+
head: [{ x: 1, y: 2 }],
|
|
198
|
+
tail: [{ x: 2, y: 3 }],
|
|
199
|
+
middle: {
|
|
200
|
+
ready: [],
|
|
201
|
+
not_ready: [{ date: '2022-03-03', url: cacheUrl }],
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
mock.onGet(API.CONFIG.DISPLAY_HISTORY()).reply(200, response.data);
|
|
208
|
+
mock.onGet(cacheUrl).reply(200, [{ x: 3, y: 4 }]);
|
|
209
|
+
const configs = [{ id: 1 }];
|
|
210
|
+
await act(async () => {
|
|
211
|
+
tree = await create(wrapComponent(configs));
|
|
51
212
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
213
|
+
await assertChartData([
|
|
214
|
+
{ x: 1, y: 2 },
|
|
215
|
+
{ x: 2, y: 3 },
|
|
216
|
+
]);
|
|
217
|
+
await act(async () => {
|
|
218
|
+
await getPusher()
|
|
219
|
+
.subscribe('cache-xxx')
|
|
220
|
+
.trigger('caching-value-log-process', {
|
|
221
|
+
success: true,
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
await assertChartData([
|
|
225
|
+
{ x: 1, y: 2 },
|
|
226
|
+
{ x: 3, y: 4 },
|
|
227
|
+
{ x: 2, y: 3 },
|
|
228
|
+
]);
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
it('Test render chart merge fetch both ready and not-ready data', async () => {
|
|
232
|
+
const cacheUrl1 = 'https://s3.eoh.io/xxx1.json';
|
|
233
|
+
const cacheUrl2 = 'https://s3.eoh.io/xxx2.json';
|
|
234
|
+
const cacheUrl3 = 'https://s3.eoh.io/xxx3.json';
|
|
235
|
+
const cacheUrl4 = 'https://s3.eoh.io/xxx4.json';
|
|
236
|
+
const response = {
|
|
237
|
+
data: {
|
|
238
|
+
channel: 'cache-xxx',
|
|
239
|
+
configs: [
|
|
240
|
+
{
|
|
241
|
+
id: 1,
|
|
242
|
+
head: [{ x: 1, y: 2 }],
|
|
243
|
+
tail: [{ x: 2, y: 3 }],
|
|
244
|
+
middle: {
|
|
245
|
+
ready: [
|
|
246
|
+
{ date: '2022-03-02', url: cacheUrl1 },
|
|
247
|
+
{ date: '2022-03-04', url: cacheUrl3 },
|
|
248
|
+
],
|
|
249
|
+
not_ready: [
|
|
250
|
+
{ date: '2022-03-03', url: cacheUrl2 },
|
|
251
|
+
{ date: '2022-03-05', url: cacheUrl4 },
|
|
252
|
+
],
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
],
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
mock.onGet(API.CONFIG.DISPLAY_HISTORY()).reply(200, response.data);
|
|
259
|
+
mock.onGet(cacheUrl1).reply(200, [{ x: 3, y: 4 }]);
|
|
260
|
+
mock.onGet(cacheUrl2).reply(200, [{ x: 4, y: 5 }]);
|
|
261
|
+
mock.onGet(cacheUrl3).reply(200, [{ x: 5, y: 6 }]);
|
|
262
|
+
mock.onGet(cacheUrl4).reply(200, [{ x: 7, y: 8 }]);
|
|
263
|
+
const configs = [{ id: 1 }];
|
|
264
|
+
await act(async () => {
|
|
265
|
+
tree = await create(wrapComponent(configs));
|
|
266
|
+
});
|
|
267
|
+
await assertChartData([
|
|
268
|
+
{ x: 1, y: 2 },
|
|
269
|
+
{ x: 3, y: 4 },
|
|
270
|
+
{ x: 5, y: 6 },
|
|
271
|
+
{ x: 2, y: 3 },
|
|
272
|
+
]);
|
|
273
|
+
await act(async () => {
|
|
274
|
+
await getPusher()
|
|
275
|
+
.subscribe('cache-xxx')
|
|
276
|
+
.trigger('caching-value-log-process', {
|
|
277
|
+
success: true,
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
await assertChartData([
|
|
281
|
+
{ x: 1, y: 2 },
|
|
282
|
+
{ x: 3, y: 4 },
|
|
283
|
+
{ x: 4, y: 5 },
|
|
284
|
+
{ x: 5, y: 6 },
|
|
285
|
+
{ x: 7, y: 8 },
|
|
286
|
+
{ x: 2, y: 3 },
|
|
287
|
+
]);
|
|
55
288
|
});
|
|
56
289
|
});
|
|
@@ -4,7 +4,7 @@ import moment from 'moment';
|
|
|
4
4
|
import { API } from '../../../configs';
|
|
5
5
|
import HistoryChart from '../../../commons/Device/HistoryChart';
|
|
6
6
|
import { axiosGet } from '../../../utils/Apis/axios';
|
|
7
|
-
import {
|
|
7
|
+
import { getPusher } from '../../../utils/Pusher';
|
|
8
8
|
|
|
9
9
|
export const dateTimeType = {
|
|
10
10
|
date: 'date',
|
|
@@ -12,6 +12,95 @@ export const dateTimeType = {
|
|
|
12
12
|
dateTime: 'datetime',
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
+
const fetchDataS3 = async (url) => {
|
|
16
|
+
const { data } = await axiosGet(url, {
|
|
17
|
+
// todo Bang try not to use axiosGet
|
|
18
|
+
transformRequest: (rq, headers) => {
|
|
19
|
+
delete headers.Authorization;
|
|
20
|
+
return rq;
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
return data;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const updateConfigChart = async (
|
|
27
|
+
success,
|
|
28
|
+
data,
|
|
29
|
+
configuration,
|
|
30
|
+
setChartData
|
|
31
|
+
) => {
|
|
32
|
+
if (!success) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const data_by_id = {};
|
|
37
|
+
await Promise.all(
|
|
38
|
+
data.configs.map(async (config) => {
|
|
39
|
+
data_by_id[config.id] = [...config.head, ...config.tail];
|
|
40
|
+
let readyResult = [];
|
|
41
|
+
if (config.middle.ready.length) {
|
|
42
|
+
readyResult = await Promise.all(
|
|
43
|
+
config.middle.ready.map(async (item) => {
|
|
44
|
+
item.data = await fetchDataS3(item.url);
|
|
45
|
+
return item.data;
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
data_by_id[config.id] = [
|
|
50
|
+
...config.head,
|
|
51
|
+
...readyResult.flat(),
|
|
52
|
+
...config.tail,
|
|
53
|
+
];
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
setChartData(
|
|
58
|
+
configuration.map((config) => {
|
|
59
|
+
config.data = data_by_id[config.id];
|
|
60
|
+
return config;
|
|
61
|
+
})
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
if (data.channel) {
|
|
65
|
+
const channel = getPusher().subscribe(data.channel);
|
|
66
|
+
// eslint-disable-next-line no-shadow
|
|
67
|
+
channel.bind('caching-value-log-process', async ({ success }) => {
|
|
68
|
+
await Promise.all(
|
|
69
|
+
data.configs.map(async (config) => {
|
|
70
|
+
if (config.middle.not_ready.length) {
|
|
71
|
+
await Promise.all(
|
|
72
|
+
config.middle.not_ready.map(async (item) => {
|
|
73
|
+
item.data = await fetchDataS3(item.url);
|
|
74
|
+
})
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
const middleDataByDay = [
|
|
78
|
+
...config.middle.not_ready,
|
|
79
|
+
...config.middle.ready,
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
// sort
|
|
83
|
+
middleDataByDay.sort((a, b) => (a.date > b.date ? 1 : -1)); // small to large
|
|
84
|
+
const middleData = middleDataByDay.map((x) => x.data).flat();
|
|
85
|
+
|
|
86
|
+
data_by_id[config.id] = [
|
|
87
|
+
...config.head,
|
|
88
|
+
...middleData,
|
|
89
|
+
...config.tail,
|
|
90
|
+
];
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
setChartData(
|
|
95
|
+
configuration.map((config) => {
|
|
96
|
+
config.data = data_by_id[config.id];
|
|
97
|
+
return config;
|
|
98
|
+
})
|
|
99
|
+
);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
15
104
|
const ConfigHistoryChart = memo(({ configs }) => {
|
|
16
105
|
const [chartData, setChartData] = useState(configs);
|
|
17
106
|
const [startDate, setStartDate] = useState(
|
|
@@ -6,8 +6,8 @@ import { AccessibilityLabel } from '../../../configs/Constants';
|
|
|
6
6
|
describe('Test Total Power Box', () => {
|
|
7
7
|
let tree;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
act(() => {
|
|
9
|
+
it('render Total Power Box', async () => {
|
|
10
|
+
await act(async () => {
|
|
11
11
|
tree = renderer.create(<TotalPowerBox title={'titleTest'} />);
|
|
12
12
|
});
|
|
13
13
|
const instance = tree.root;
|
|
@@ -18,8 +18,8 @@ const wrapComponent = () => (
|
|
|
18
18
|
describe('Test Total Power Consumption', () => {
|
|
19
19
|
let tree;
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
await act(() => {
|
|
21
|
+
it('render Total Power Consumption', async () => {
|
|
22
|
+
await act(async () => {
|
|
23
23
|
tree = renderer.create(wrapComponent());
|
|
24
24
|
});
|
|
25
25
|
const instance = tree.root;
|
|
@@ -6,8 +6,8 @@ import ViewButtonBottom from '../index';
|
|
|
6
6
|
describe('Test TouchableScale', () => {
|
|
7
7
|
let tree;
|
|
8
8
|
const mockFunc = jest.fn();
|
|
9
|
-
|
|
10
|
-
act(() => {
|
|
9
|
+
it('create TouchableScale onPress', async () => {
|
|
10
|
+
await act(async () => {
|
|
11
11
|
tree = renderer.create(
|
|
12
12
|
<ViewButtonBottom
|
|
13
13
|
leftTitle={'leftTitle'}
|
|
@@ -21,7 +21,7 @@ describe('Test TouchableScale', () => {
|
|
|
21
21
|
expect(textInputs.length).toBe(1);
|
|
22
22
|
|
|
23
23
|
const button = instance.findByType(TouchableOpacity);
|
|
24
|
-
act(() => {
|
|
24
|
+
await act(async () => {
|
|
25
25
|
button.props.onPress();
|
|
26
26
|
});
|
|
27
27
|
expect(mockFunc).toHaveBeenCalled();
|
|
@@ -32,7 +32,7 @@ describe('Test WheelDateTimePicker', () => {
|
|
|
32
32
|
};
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
it('test render with mode time', async () => {
|
|
36
36
|
const time = moment().hour(10).minute(30).second(0);
|
|
37
37
|
props.defaultValue = time;
|
|
38
38
|
await act(async () => {
|
|
@@ -53,7 +53,7 @@ describe('Test WheelDateTimePicker', () => {
|
|
|
53
53
|
expect(mockOnPicked).toBeCalledWith(time.hour(9).minute(27).valueOf());
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
it('test render with mode datetime', async () => {
|
|
57
57
|
const date = moment('2021-09-09T10:00:00.000Z')
|
|
58
58
|
.hour(10)
|
|
59
59
|
.minute(30)
|
|
@@ -37,7 +37,7 @@ const WrapParallaxScrollView = ({
|
|
|
37
37
|
hideRightPlus={hideRightPlus}
|
|
38
38
|
idButtonMore={idButtonMore}
|
|
39
39
|
/>
|
|
40
|
-
<Text semibold style={styles.nameUnit}>
|
|
40
|
+
<Text numberOfLines={1} semibold style={styles.nameUnit}>
|
|
41
41
|
{title}
|
|
42
42
|
</Text>
|
|
43
43
|
{contentBackground}
|
|
@@ -120,6 +120,7 @@ const styles = StyleSheet.create({
|
|
|
120
120
|
},
|
|
121
121
|
nameUnit: {
|
|
122
122
|
left: 16,
|
|
123
|
+
width: '90%',
|
|
123
124
|
fontStyle: 'normal',
|
|
124
125
|
fontWeight: '600',
|
|
125
126
|
fontSize: 24,
|
package/src/configs/API.js
CHANGED
|
@@ -44,9 +44,12 @@ const API = {
|
|
|
44
44
|
},
|
|
45
45
|
CHIP: {
|
|
46
46
|
GET_CHIPS_FROM_UNIT: (id) => `/property_manager/get_chips/?unit_id=${id}`,
|
|
47
|
-
SEARCH_DEVICE: (id) => `/chip_manager/chips/${id}/search_device/`,
|
|
48
47
|
SCAN_SENSOR: (id) => `/chip_manager/chips/${id}/scan_sensor/`,
|
|
49
48
|
RENAME_DEVICES: (id) => `/chip_manager/chips/${id}/rename_devices/`,
|
|
49
|
+
ZIGBEE: {
|
|
50
|
+
ACCEPT_NEW_DEVICE: (id) =>
|
|
51
|
+
`/iot/modules/zigbee/chips/${id}/search_device/`,
|
|
52
|
+
},
|
|
50
53
|
},
|
|
51
54
|
DEVICE: {
|
|
52
55
|
SENSOR_DETAIL: (id) => `/property_manager/sensors/${id}/`,
|
|
@@ -60,6 +63,7 @@ const API = {
|
|
|
60
63
|
REMOTE_CONTROL_OPTIONS: (id) =>
|
|
61
64
|
`/property_manager/sensors/${id}/remote_control_options/`,
|
|
62
65
|
TRIGGER_ACTION: (id) => `/property_manager/sensors/${id}/quick_action/`,
|
|
66
|
+
SETUP: (id) => `/property_manager/devices/${id}/setup/`,
|
|
63
67
|
CHECK_CONNECTION: (id) =>
|
|
64
68
|
`/property_manager/sensors/${id}/check_connection/`,
|
|
65
69
|
UPDATE_SENSOR: (unit_id, station_id, id) =>
|
|
@@ -80,7 +84,7 @@ const API = {
|
|
|
80
84
|
ACCESS: (id) => `/property_manager/shared_sensors/${id}/access/`,
|
|
81
85
|
},
|
|
82
86
|
CONFIG: {
|
|
83
|
-
DISPLAY_HISTORY: () => '/
|
|
87
|
+
DISPLAY_HISTORY: () => '/chip_manager/configs/value_history_v3/',
|
|
84
88
|
},
|
|
85
89
|
AUTOMATE: {
|
|
86
90
|
ACTION_ONE_TAP: (id) => `/property_manager/automate/${id}/action_one_tap/`,
|
|
@@ -527,6 +527,9 @@ export default {
|
|
|
527
527
|
// OnOffButtonAction
|
|
528
528
|
ON_OFF_BUTTON_ACTION_TITLE: 'ON_OFF_BUTTON_ACTION_TITLE',
|
|
529
529
|
|
|
530
|
+
// OnOffSimpleAction
|
|
531
|
+
ON_OFF_SIMPLE_ACTION_ON: 'ON_OFF_SIMPLE_ACTION_ON',
|
|
532
|
+
|
|
530
533
|
// Add New Device LG
|
|
531
534
|
ADD_NEW_DEVICE_LG_ADD: 'ADD_NEW_DEVICE_LG_ADD',
|
|
532
535
|
ADD_NEW_DEVICE_LG_THEN_SELECT: 'ADD_NEW_DEVICE_LG_THEN_SELECT',
|
|
@@ -626,4 +629,6 @@ export default {
|
|
|
626
629
|
BUTTON_CANCEL_EDIT_ACTION_LIST: 'BUTTON_CANCEL_EDIT_ACTION_LIST',
|
|
627
630
|
BUTTON_SAVE_EDIT_ACTION_LIST: 'BUTTON_SAVE_EDIT_ACTION_LIST',
|
|
628
631
|
BUTTON_REMOVE_EDIT_ACTION_LIST: 'BUTTON_REMOVE_EDIT_ACTION_LIST',
|
|
632
|
+
//ButtonWrapper
|
|
633
|
+
BUTTON_WRAPPER: 'BUTTON_WRAPPER',
|
|
629
634
|
};
|
package/src/configs/Constants.js
CHANGED
|
@@ -31,7 +31,7 @@ describe('test useAndroidTranslucentStatusBar', () => {
|
|
|
31
31
|
mockAddListener.mockClear();
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
it('test useAndroidTranslucentStatusBar android', async () => {
|
|
35
35
|
Platform.OS = 'android';
|
|
36
36
|
renderHook(
|
|
37
37
|
() => useAndroidTranslucentStatusBar({ background: '#ffffff' }),
|
|
@@ -42,7 +42,7 @@ describe('test useAndroidTranslucentStatusBar', () => {
|
|
|
42
42
|
expect(mockAddListener).not.toBeCalled();
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
it('test useAndroidTranslucentStatusBar ios', async () => {
|
|
46
46
|
Platform.OS = 'ios';
|
|
47
47
|
renderHook(
|
|
48
48
|
() => useAndroidTranslucentStatusBar({ background: '#ffffff' }),
|
|
@@ -6,22 +6,22 @@ describe('test useStatusBarPreview', () => {
|
|
|
6
6
|
Platform = require('react-native').Platform;
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
it('test useStatusBarPreview on android', () => {
|
|
9
|
+
it('test useStatusBarPreview on android', async () => {
|
|
10
10
|
Platform.OS = 'ios';
|
|
11
11
|
useStatusBarPreview();
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
it('test useStatusBarPreview on iOS', () => {
|
|
14
|
+
it('test useStatusBarPreview on iOS', async () => {
|
|
15
15
|
Platform.OS = 'android';
|
|
16
16
|
useStatusBarPreview();
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
it('test useHiddenStatusBar on android', () => {
|
|
19
|
+
it('test useHiddenStatusBar on android', async () => {
|
|
20
20
|
Platform.OS = 'ios';
|
|
21
21
|
useHiddenStatusBar(false);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
it('test useHiddenStatusBar on iOS', () => {
|
|
24
|
+
it('test useHiddenStatusBar on iOS', async () => {
|
|
25
25
|
Platform.OS = 'android';
|
|
26
26
|
useHiddenStatusBar(true);
|
|
27
27
|
});
|
|
@@ -16,7 +16,7 @@ const mockUseContext = jest.fn().mockImplementation(() => ({
|
|
|
16
16
|
React.useContext = mockUseContext;
|
|
17
17
|
|
|
18
18
|
describe('Test useTranslations', () => {
|
|
19
|
-
it('test useTranslations', () => {
|
|
19
|
+
it('test useTranslations', async () => {
|
|
20
20
|
// eslint-disable-next-line no-unused-vars
|
|
21
21
|
const { result } = renderHook(() => useTranslations(), { wrapper });
|
|
22
22
|
});
|
|
@@ -58,7 +58,7 @@ describe('Test useRemoteControl', () => {
|
|
|
58
58
|
const { result: sendRemoteCommand } = renderHook(() => useRemoteControl(), {
|
|
59
59
|
wrapper,
|
|
60
60
|
});
|
|
61
|
-
act(() => {
|
|
61
|
+
await act(async () => {
|
|
62
62
|
sendRemoteCommand.current(sensor, action, data, userId);
|
|
63
63
|
});
|
|
64
64
|
expect(sendCommandOverInternet).not.toBeCalled();
|
|
@@ -73,7 +73,7 @@ describe('Test useRemoteControl', () => {
|
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
sendCommandOverBluetooth.mockImplementation(async () => true);
|
|
76
|
-
act(() => {
|
|
76
|
+
await act(async () => {
|
|
77
77
|
sendRemoteCommand.current(sensor, action, data, userId);
|
|
78
78
|
});
|
|
79
79
|
expect(sendCommandOverBluetooth).toBeCalledWith(
|
|
@@ -96,7 +96,7 @@ describe('Test useRemoteControl', () => {
|
|
|
96
96
|
throw SEND_COMMAND_OVER_BLUETOOTH_FAIL;
|
|
97
97
|
});
|
|
98
98
|
sendCommandOverInternet.mockImplementation(async () => true);
|
|
99
|
-
act(() => {
|
|
99
|
+
await act(async () => {
|
|
100
100
|
sendRemoteCommand.current(sensor, action, data, userId);
|
|
101
101
|
});
|
|
102
102
|
expect(sendCommandOverBluetooth).toBeCalledWith(
|
|
@@ -125,7 +125,7 @@ describe('Test useRemoteControl', () => {
|
|
|
125
125
|
throw 'ANOTHER_ERROR';
|
|
126
126
|
});
|
|
127
127
|
sendCommandOverInternet.mockImplementation(async () => true);
|
|
128
|
-
act(() => {
|
|
128
|
+
await act(async () => {
|
|
129
129
|
sendRemoteCommand.current(sensor, action, data, userId);
|
|
130
130
|
});
|
|
131
131
|
expect(sendCommandOverBluetooth).toBeCalledWith(
|
|
@@ -147,7 +147,7 @@ describe('Test useRemoteControl', () => {
|
|
|
147
147
|
});
|
|
148
148
|
|
|
149
149
|
sendCommandOverInternet.mockImplementation(async () => true);
|
|
150
|
-
act(() => {
|
|
150
|
+
await act(async () => {
|
|
151
151
|
sendRemoteCommand.current(sensor, action, data, userId);
|
|
152
152
|
});
|
|
153
153
|
expect(sendCommandOverInternet).toBeCalledWith(
|
|
@@ -169,7 +169,7 @@ describe('Test useRemoteControl', () => {
|
|
|
169
169
|
});
|
|
170
170
|
|
|
171
171
|
sendCommandOverHomeAssistant.mockImplementation(async () => true);
|
|
172
|
-
act(() => {
|
|
172
|
+
await act(async () => {
|
|
173
173
|
sendRemoteCommand.current(sensor, action, data, userId);
|
|
174
174
|
});
|
|
175
175
|
expect(sendCommandOverHomeAssistant).toBeCalledWith(
|
|
@@ -191,7 +191,7 @@ describe('Test useRemoteControl', () => {
|
|
|
191
191
|
});
|
|
192
192
|
|
|
193
193
|
sendCommandOverLGThinq.mockImplementation(async () => true);
|
|
194
|
-
act(() => {
|
|
194
|
+
await act(async () => {
|
|
195
195
|
sendRemoteCommand.current(sensor, action, data, userId);
|
|
196
196
|
});
|
|
197
197
|
expect(sendCommandOverBluetooth).not.toBeCalled();
|