@eohjsc/react-native-smart-city 0.5.9 → 0.6.0-rc2
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 +8 -10
- package/package.json +52 -69
- 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__/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 +3 -3
- 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 +3 -4
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +2 -2
- 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 +1 -8
- package/src/commons/ActionGroup/__test__/TimerActionTemplateWithutConfigValue.test.js +1 -8
- package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +2 -9
- package/src/commons/ActionGroup/__test__/index.test.js +14 -21
- 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/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +1 -12
- 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/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/HorizontalBarChart.js +1 -1
- package/src/commons/Device/ItemAddNew/index.js +2 -2
- package/src/commons/Device/ItemDevice.js +2 -2
- package/src/commons/Device/PowerConsumptionChart.js +154 -0
- 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 +2 -2
- package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
- package/src/commons/Form/CurrencyInput.js +1 -15
- package/src/commons/Header/HeaderCustom.js +3 -3
- package/src/commons/HeaderAni/index.js +2 -2
- package/src/commons/IconComponent/index.js +3 -3
- 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 +2 -2
- 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__/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 +2 -2
- 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/Tabbar/__test__/index.test.js +0 -11
- package/src/commons/Unit/HeaderUnit/index.js +4 -4
- package/src/commons/Unit/SharedUnit.js +5 -5
- package/src/commons/Unit/__test__/HeaderUnit.test.js +3 -15
- package/src/commons/Unit/__test__/SharedUnit.test.js +94 -105
- package/src/commons/UnitSummary/AirQuality/SegmentedRoundDisplay/index.js +11 -30
- package/src/commons/UnitSummary/ConfigHistoryChart/index.js +6 -61
- package/src/commons/Widgets/IFrame/IFrame.js +54 -0
- package/src/commons/Widgets/IFrame/IFrameStyles.js +35 -0
- package/src/commons/Widgets/IFrame/__tests__/IFrame.test.js +74 -0
- package/src/commons/Widgets/IFrame/index.js +0 -0
- package/src/commons/Widgets/IFrameWithConfig/IFrameWithConfig.js +163 -0
- package/src/commons/Widgets/IFrameWithConfig/IFrameWithConfigStyles.js +9 -0
- package/src/commons/Widgets/IFrameWithConfig/__tests__/IFrameWithConfig.test.js +284 -0
- package/src/commons/Widgets/IFrameWithConfig/index.js +0 -0
- package/src/commons/Widgets/Widget.js +0 -0
- package/src/commons/Widgets/index.js +0 -0
- package/src/configs/Constants.js +5 -0
- package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +4 -15
- package/src/hooks/Common/useDevicesStatus.js +23 -23
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +1 -1
- package/src/hooks/IoT/__test__/useWatchConfigs.test.js +0 -7
- 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 +2 -2
- package/src/navigations/UnitStack.js +2 -2
- 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 +4 -4
- 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/AddNewGateway/hooks/__Tests__/index.test.js +1 -10
- 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 +5 -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 +5 -5
- 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 +0 -12
- 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 +3 -15
- package/src/screens/Device/components/SensorDisplayItem.js +23 -5
- package/src/screens/Device/components/__test__/VisualChart.test.js +2 -9
- package/src/screens/Device/detail.js +11 -10
- 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 +2 -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 +5 -5
- package/src/screens/Notification/__test__/NotificationItem.test.js +9 -19
- package/src/screens/Notification/index.js +3 -3
- package/src/screens/PlayBackCamera/Styles/index.js +2 -4
- package/src/screens/PlayBackCamera/Timer.js +65 -47
- package/src/screens/PlayBackCamera/__test__/index.test.js +32 -33
- package/src/screens/PlayBackCamera/index.js +115 -112
- 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 +1 -21
- 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/UnitMemberList.js +2 -2
- 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 +7 -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 +3 -3
- 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 +4 -5
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +9 -31
- package/src/screens/SubUnit/__test__/Detail.test.js +4 -28
- 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 +2 -13
- package/src/screens/Template/__test__/GatewayList.test.js +0 -9
- package/src/screens/Template/__test__/detail.test.js +4 -4
- package/src/screens/Template/__test__/index.test.js +1 -12
- package/src/screens/Template/detail.js +2 -2
- package/src/screens/Unit/SelectAddToFavorites.js +2 -2
- package/src/screens/Unit/SelectAddress.js +4 -4
- package/src/screens/Unit/SmartAccountItem.js +2 -2
- package/src/screens/Unit/Summaries.js +3 -2
- 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 +5 -5
- 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 +3 -3
- 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 +0 -12
- package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +10 -23
- package/src/screens/UnitSummary/components/AirQuality/__test__/index.test.js +1 -7
- package/src/screens/UnitSummary/components/AirQuality/index.js +3 -3
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +38 -14
- package/src/screens/UnitSummary/components/PowerConsumption/index.js +21 -30
- 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 +2 -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/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 +4 -4
- package/src/utils/Storage.js +1 -1
- package/src/commons/Device/HistoryChart.js +0 -225
- package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +0 -48
- package/src/commons/Device/WindSpeed/LinearChart/index.js +0 -155
- package/src/commons/UnitSummary/ConfigHistoryChart/__test__/ConfigHistoryChart.test.js +0 -289
- package/src/screens/Device/__test__/DetailHistoryChart.test.js +0 -69
- package/src/screens/Device/components/DetailHistoryChart.js +0 -118
- 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
|
@@ -6,7 +6,7 @@ import React, {
|
|
|
6
6
|
useState,
|
|
7
7
|
} from 'react';
|
|
8
8
|
import { FlatList, Image, TouchableOpacity, View } from 'react-native';
|
|
9
|
-
import
|
|
9
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
10
10
|
import {
|
|
11
11
|
useIsFocused,
|
|
12
12
|
useNavigation,
|
|
@@ -197,7 +197,7 @@ const Automate = () => {
|
|
|
197
197
|
/* istanbul ignore next */
|
|
198
198
|
headerRight: () => (
|
|
199
199
|
<TouchableOpacity style={styles.buttonAdd}>
|
|
200
|
-
<
|
|
200
|
+
<AntDesign name={'plus-circle'} size={28} color={Colors.Orange} />
|
|
201
201
|
</TouchableOpacity>
|
|
202
202
|
),
|
|
203
203
|
});
|
|
@@ -13,20 +13,8 @@ import { ToastBottomHelper } from '../../../utils/Utils';
|
|
|
13
13
|
import BottomButtonView from '../../../commons/BottomButtonView';
|
|
14
14
|
|
|
15
15
|
const mock = new MockAdapter(api.axiosInstance);
|
|
16
|
-
const mockGoBack = jest.fn();
|
|
17
16
|
const mockSetDisplay = jest.fn();
|
|
18
17
|
|
|
19
|
-
jest.mock('@react-navigation/native', () => {
|
|
20
|
-
return {
|
|
21
|
-
...jest.requireActual('@react-navigation/native'),
|
|
22
|
-
useRoute: jest.fn(),
|
|
23
|
-
|
|
24
|
-
useNavigation: () => ({
|
|
25
|
-
goBack: mockGoBack,
|
|
26
|
-
}),
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
|
|
30
18
|
const wrapComponent = ({ ...rest }) => (
|
|
31
19
|
<SCProvider initState={mockSCStore({})}>
|
|
32
20
|
<ChangePosition {...rest} />
|
|
@@ -38,7 +26,6 @@ describe('Test ChangePosition', () => {
|
|
|
38
26
|
|
|
39
27
|
beforeEach(() => {
|
|
40
28
|
useRoute.mockClear();
|
|
41
|
-
mockGoBack.mockClear();
|
|
42
29
|
});
|
|
43
30
|
|
|
44
31
|
it('render ChangePosition', async () => {
|
|
@@ -70,7 +57,7 @@ describe('Test ChangePosition', () => {
|
|
|
70
57
|
await act(async () => {
|
|
71
58
|
bottomButtonView[0].props.onPressMain();
|
|
72
59
|
});
|
|
73
|
-
expect(
|
|
60
|
+
expect(global.mockedGoBack).toHaveBeenCalled();
|
|
74
61
|
expect(mockFetchData).toHaveBeenCalled();
|
|
75
62
|
expect(mockSetDisplay).toHaveBeenCalled();
|
|
76
63
|
expect(spyToastSuccess).toBeCalledWith('Updated widget successfully');
|
|
@@ -18,18 +18,6 @@ const wrapComponent = (route, navigation) => (
|
|
|
18
18
|
</SCProvider>
|
|
19
19
|
);
|
|
20
20
|
|
|
21
|
-
const mockNavigate = jest.fn();
|
|
22
|
-
const mockGoBack = jest.fn();
|
|
23
|
-
jest.mock('@react-navigation/native', () => {
|
|
24
|
-
return {
|
|
25
|
-
...jest.requireActual('@react-navigation/native'),
|
|
26
|
-
useNavigation: () => ({
|
|
27
|
-
navigate: mockNavigate,
|
|
28
|
-
goBack: mockGoBack,
|
|
29
|
-
}),
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
|
|
33
21
|
const mockSetState = jest.fn();
|
|
34
22
|
jest.mock('react', () => {
|
|
35
23
|
return {
|
|
@@ -23,17 +23,7 @@ const wrapComponent = (route) => (
|
|
|
23
23
|
|
|
24
24
|
const mock = new MockAdapter(api.axiosInstance);
|
|
25
25
|
|
|
26
|
-
const mockPop = jest.fn();
|
|
27
26
|
const mockSetSensorDetail = jest.fn();
|
|
28
|
-
jest.mock('@react-navigation/native', () => {
|
|
29
|
-
return {
|
|
30
|
-
...jest.requireActual('@react-navigation/native'),
|
|
31
|
-
useRoute: jest.fn(),
|
|
32
|
-
useNavigation: () => ({
|
|
33
|
-
pop: mockPop,
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
27
|
|
|
38
28
|
describe('Test EditDevice', () => {
|
|
39
29
|
let tree;
|
|
@@ -135,7 +125,7 @@ describe('Test EditDevice', () => {
|
|
|
135
125
|
await alertAction.props.rightButtonClick();
|
|
136
126
|
});
|
|
137
127
|
expect(alertAction.props.visible).toBeFalsy();
|
|
138
|
-
expect(
|
|
128
|
+
expect(global.mockedPop).toHaveBeenCalled();
|
|
139
129
|
});
|
|
140
130
|
|
|
141
131
|
it('test delete EditDevice failure', async () => {
|
|
@@ -2,7 +2,7 @@ import React, { memo, useState, useCallback } from 'react';
|
|
|
2
2
|
import { View, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
4
4
|
import { HeaderCustom } from '../../../commons/Header';
|
|
5
|
-
import
|
|
5
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
6
6
|
import { Colors } from '../../../configs';
|
|
7
7
|
import Text from '../../../commons/Text';
|
|
8
8
|
import { useRoute } from '@react-navigation/native';
|
|
@@ -92,7 +92,7 @@ const EditDevice = memo(() => {
|
|
|
92
92
|
<Text type="Body" Reugular color={Colors.Grey7}>
|
|
93
93
|
{sensorName}
|
|
94
94
|
</Text>
|
|
95
|
-
<
|
|
95
|
+
<AntDesign
|
|
96
96
|
name="right"
|
|
97
97
|
size={18}
|
|
98
98
|
color={Colors.Gray7}
|
|
@@ -11,7 +11,7 @@ import { AlertSent } from '../../../commons/EmergencyButton/AlertSent';
|
|
|
11
11
|
import { AlertAction, ButtonPopup, MenuActionMore } from '../../../commons';
|
|
12
12
|
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
13
13
|
import Text from '../../../commons/Text';
|
|
14
|
-
import
|
|
14
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
15
15
|
import CurrentRainSensor from '../../../commons/Device/RainningSensor/CurrentRainSensor';
|
|
16
16
|
import { getTranslate } from '../../../utils/I18n';
|
|
17
17
|
import { SCProvider } from '../../../context';
|
|
@@ -115,7 +115,7 @@ describe('test DeviceDetail', () => {
|
|
|
115
115
|
command_prefer_over_googlehome: false,
|
|
116
116
|
command_prefer_over_internet: true,
|
|
117
117
|
googlehome_actions: [],
|
|
118
|
-
icon: '
|
|
118
|
+
icon: 'caretup',
|
|
119
119
|
id: 9,
|
|
120
120
|
key: '2b949045-8e03-4c07-a855-7794ade2e69c',
|
|
121
121
|
},
|
|
@@ -137,13 +137,13 @@ describe('test DeviceDetail', () => {
|
|
|
137
137
|
command_prefer_over_googlehome: false,
|
|
138
138
|
command_prefer_over_internet: true,
|
|
139
139
|
googlehome_actions: [],
|
|
140
|
-
icon: '
|
|
140
|
+
icon: 'caretdown',
|
|
141
141
|
id: 10,
|
|
142
142
|
key: 'a492e08c-8cb1-44ee-8ea0-46aaca4e5141',
|
|
143
143
|
},
|
|
144
|
-
icon1: '
|
|
144
|
+
icon1: 'caretup',
|
|
145
145
|
icon2: 'stop',
|
|
146
|
-
icon3: '
|
|
146
|
+
icon3: 'caretdown',
|
|
147
147
|
text1: 'UP',
|
|
148
148
|
text2: 'STOP/UNLOCK',
|
|
149
149
|
text3: 'DOWN',
|
|
@@ -352,7 +352,7 @@ describe('test DeviceDetail', () => {
|
|
|
352
352
|
const buttonPopupIcon = instance.find(
|
|
353
353
|
(el) =>
|
|
354
354
|
el.props.accessibilityLabel ===
|
|
355
|
-
AccessibilityLabel.BUTTON_POPUP_RESOLVED_ICON && el.type ===
|
|
355
|
+
AccessibilityLabel.BUTTON_POPUP_RESOLVED_ICON && el.type === AntDesign
|
|
356
356
|
);
|
|
357
357
|
expect(buttonPopupTitle.props.children).toEqual([
|
|
358
358
|
'Unit name',
|
|
@@ -403,16 +403,16 @@ describe('test DeviceDetail', () => {
|
|
|
403
403
|
action1: 'a',
|
|
404
404
|
action2: 'b',
|
|
405
405
|
action3: 'b',
|
|
406
|
-
icon1: '
|
|
406
|
+
icon1: 'caretup',
|
|
407
407
|
icon2: 'stop',
|
|
408
|
-
icon3: '
|
|
408
|
+
icon3: 'caretdown',
|
|
409
409
|
text1: 'A',
|
|
410
410
|
text2: 'B',
|
|
411
411
|
text3: 'C',
|
|
412
412
|
action1_data: {
|
|
413
413
|
id: 9,
|
|
414
414
|
key: 'a',
|
|
415
|
-
icon: '
|
|
415
|
+
icon: 'caretup',
|
|
416
416
|
color: '#00979D',
|
|
417
417
|
googlehome_actions: [],
|
|
418
418
|
command_prefer_over_internet: false,
|
|
@@ -432,7 +432,7 @@ describe('test DeviceDetail', () => {
|
|
|
432
432
|
action3_data: {
|
|
433
433
|
id: 10,
|
|
434
434
|
key: 'b',
|
|
435
|
-
icon: '
|
|
435
|
+
icon: 'caretdown',
|
|
436
436
|
color: '#00979D',
|
|
437
437
|
googlehome_actions: [],
|
|
438
438
|
command_prefer_over_internet: false,
|
|
@@ -728,7 +728,7 @@ describe('test DeviceDetail', () => {
|
|
|
728
728
|
await act(async () => {
|
|
729
729
|
await menu.props.onItemClick(gotoActivityLog);
|
|
730
730
|
});
|
|
731
|
-
expect(mockedNavigate).toHaveBeenCalledWith(Routes.ActivityLog, {
|
|
731
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.ActivityLog, {
|
|
732
732
|
id: route.params.sensorData.id,
|
|
733
733
|
type: 'action',
|
|
734
734
|
share: route.params.unitData,
|
|
@@ -31,21 +31,9 @@ const wrapComponent = ({ ...rest }) => (
|
|
|
31
31
|
</SCProvider>
|
|
32
32
|
);
|
|
33
33
|
|
|
34
|
-
const mockNavigate = jest.fn();
|
|
35
|
-
jest.mock('@react-navigation/native', () => {
|
|
36
|
-
return {
|
|
37
|
-
...jest.requireActual('@react-navigation/native'),
|
|
38
|
-
useRoute: jest.fn(),
|
|
39
|
-
useNavigation: () => ({
|
|
40
|
-
navigate: mockNavigate,
|
|
41
|
-
}),
|
|
42
|
-
useFocusEffect: (func) => func(),
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
|
|
46
34
|
describe('Test SensorDisplayItem', () => {
|
|
47
35
|
let tree;
|
|
48
|
-
it('render
|
|
36
|
+
it('render visualChart', async () => {
|
|
49
37
|
const item = {
|
|
50
38
|
id: 10452,
|
|
51
39
|
order: 0,
|
|
@@ -74,8 +62,8 @@ describe('Test SensorDisplayItem', () => {
|
|
|
74
62
|
tree = await renderer.create(wrapComponent({ item, sensor }));
|
|
75
63
|
});
|
|
76
64
|
const instance = tree.root;
|
|
77
|
-
const
|
|
78
|
-
expect(
|
|
65
|
+
const visualChart = instance.findAllByType(VisualChart);
|
|
66
|
+
expect(visualChart).toHaveLength(1);
|
|
79
67
|
});
|
|
80
68
|
|
|
81
69
|
it('render ActionGroup', async () => {
|
|
@@ -13,18 +13,19 @@ import ListQualityIndicator from '../../../commons/Device/WaterQualitySensor/Lis
|
|
|
13
13
|
import Compass from '../../../commons/Device/WindDirection/Compass';
|
|
14
14
|
import Anemometer from '../../../commons/Device/WindSpeed/Anemometer';
|
|
15
15
|
import MediaPlayerDetail from '../../../commons/MediaPlayerDetail';
|
|
16
|
-
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
16
|
+
import { AccessibilityLabel, WIDGET_TYPE } from '../../../configs/Constants';
|
|
17
17
|
import { useSCContextSelector } from '../../../context';
|
|
18
18
|
import { useRemoteControl } from '../../../hooks/IoT';
|
|
19
19
|
import { useConfigGlobalState } from '../../../iot/states';
|
|
20
20
|
import SmartIr from '../../../screens/SmartIr';
|
|
21
21
|
import { useEvaluateValue } from '../hooks/useEvaluateValue';
|
|
22
22
|
import styles from '../styles';
|
|
23
|
-
import { DetailHistoryChart } from './DetailHistoryChart';
|
|
24
23
|
import VisualChart from './VisualChart';
|
|
25
24
|
import { standardizeCameraScreenSize } from '../../../utils/Utils';
|
|
26
25
|
import { Device } from '../../../configs';
|
|
27
26
|
import DonutCharts from './DonutChart';
|
|
27
|
+
import IFrame from '../../../commons/Widgets/IFrame/IFrame';
|
|
28
|
+
import IFrameWithConfig from '../../../commons/Widgets/IFrameWithConfig/IFrameWithConfig';
|
|
28
29
|
|
|
29
30
|
const { standardizeWidth, standardizeHeight } = standardizeCameraScreenSize(
|
|
30
31
|
Device.screenWidth - 32
|
|
@@ -176,10 +177,27 @@ export const SensorDisplayItem = ({
|
|
|
176
177
|
isWidgetOrder={isWidgetOrder}
|
|
177
178
|
/>
|
|
178
179
|
);
|
|
180
|
+
case WIDGET_TYPE.iframe:
|
|
181
|
+
return (
|
|
182
|
+
<IFrame
|
|
183
|
+
doAction={doAction}
|
|
184
|
+
sensor={sensor}
|
|
185
|
+
id={idTemplate}
|
|
186
|
+
item={item}
|
|
187
|
+
isWidgetOrder={isWidgetOrder}
|
|
188
|
+
/>
|
|
189
|
+
);
|
|
190
|
+
case WIDGET_TYPE.iframeWithConfig:
|
|
191
|
+
return (
|
|
192
|
+
<IFrameWithConfig
|
|
193
|
+
doAction={doAction}
|
|
194
|
+
sensor={sensor}
|
|
195
|
+
id={idTemplate}
|
|
196
|
+
item={item}
|
|
197
|
+
isWidgetOrder={isWidgetOrder}
|
|
198
|
+
/>
|
|
199
|
+
);
|
|
179
200
|
case 'history':
|
|
180
|
-
if (configuration?.config === 'power_consumption') {
|
|
181
|
-
return <DetailHistoryChart item={item} sensor={sensor} />;
|
|
182
|
-
}
|
|
183
201
|
return (
|
|
184
202
|
<VisualChart
|
|
185
203
|
item={item}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import MockAdapter from 'axios-mock-adapter';
|
|
3
3
|
import moment from 'moment';
|
|
4
|
-
import { act
|
|
4
|
+
import { act } from 'react-test-renderer';
|
|
5
5
|
|
|
6
6
|
import VisualChart from '../VisualChart';
|
|
7
7
|
import { API } from '../../../../configs';
|
|
@@ -11,14 +11,7 @@ import api from '../../../../utils/Apis/axios';
|
|
|
11
11
|
import ChartAggregationOption from '../../../../commons/ChartAggregationOption';
|
|
12
12
|
import DateTimeRangeChange from '../../../../commons/DateTimeRangeChange';
|
|
13
13
|
import Highcharts from '../../../../commons/Highcharts';
|
|
14
|
-
|
|
15
|
-
const render = async (component) => {
|
|
16
|
-
let tree;
|
|
17
|
-
await act(async () => {
|
|
18
|
-
tree = await create(component);
|
|
19
|
-
});
|
|
20
|
-
return tree;
|
|
21
|
-
};
|
|
14
|
+
import { render } from '../../../../../jest/render';
|
|
22
15
|
|
|
23
16
|
const mockAxios = new MockAdapter(api.axiosInstance);
|
|
24
17
|
|
|
@@ -8,8 +8,7 @@ import React, {
|
|
|
8
8
|
} from 'react';
|
|
9
9
|
import { View, TouchableOpacity, Platform } from 'react-native';
|
|
10
10
|
import { useNavigation, useFocusEffect } from '@react-navigation/native';
|
|
11
|
-
import
|
|
12
|
-
import { Icon } from '@ant-design/react-native';
|
|
11
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
13
12
|
import moment from 'moment';
|
|
14
13
|
|
|
15
14
|
import { SCContext } from '../../context';
|
|
@@ -215,7 +214,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
215
214
|
|
|
216
215
|
useEffect(() => {
|
|
217
216
|
if (
|
|
218
|
-
unit
|
|
217
|
+
unit?.remote_control_options &&
|
|
219
218
|
unit.remote_control_options.googlehome?.length &&
|
|
220
219
|
isNetworkConnected
|
|
221
220
|
) {
|
|
@@ -685,9 +684,9 @@ const DeviceDetail = ({ route }) => {
|
|
|
685
684
|
>
|
|
686
685
|
<View style={styles.buttonStar}>
|
|
687
686
|
{isFavorite ? (
|
|
688
|
-
<
|
|
687
|
+
<AntDesign name="star" size={25} color={Colors.Yellow6} />
|
|
689
688
|
) : (
|
|
690
|
-
<
|
|
689
|
+
<AntDesign name="star" size={25} />
|
|
691
690
|
)}
|
|
692
691
|
</View>
|
|
693
692
|
</TouchableOpacity>
|
|
@@ -695,7 +694,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
695
694
|
{isShowSetupEmergencyContact && (
|
|
696
695
|
<TouchableOpacity onPress={onPressSetting}>
|
|
697
696
|
<View style={styles.button}>
|
|
698
|
-
<
|
|
697
|
+
<AntDesign name="setting" size={25} color={Colors.Black} />
|
|
699
698
|
</View>
|
|
700
699
|
</TouchableOpacity>
|
|
701
700
|
)}
|
|
@@ -706,7 +705,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
706
705
|
ref={refMenuAction}
|
|
707
706
|
accessibilityLabel={AccessibilityLabel.HEADER_DEVICE_BUTTON_MORE}
|
|
708
707
|
>
|
|
709
|
-
<
|
|
708
|
+
<AntDesign name={'more'} size={27} color={Colors.Black} />
|
|
710
709
|
</TouchableOpacity>
|
|
711
710
|
</View>
|
|
712
711
|
),
|
|
@@ -791,7 +790,9 @@ const DeviceDetail = ({ route }) => {
|
|
|
791
790
|
canManageSubUnit && (
|
|
792
791
|
<BottomButtonView
|
|
793
792
|
style={styles.bottomButtonEmergencyContact}
|
|
794
|
-
mainIcon={
|
|
793
|
+
mainIcon={
|
|
794
|
+
<AntDesign name="plus" size={16} color={Colors.Primary} />
|
|
795
|
+
}
|
|
795
796
|
mainTitle={t('setup_my_emergency_contact')}
|
|
796
797
|
onPressMain={onSetupContacts}
|
|
797
798
|
typeMain="primaryBorder"
|
|
@@ -825,7 +826,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
825
826
|
{isShowEmergencyResolve && !isEmergencyPopupScreen && (
|
|
826
827
|
<BottomButtonView
|
|
827
828
|
style={styles.bottomButtonEmergencyResolve}
|
|
828
|
-
mainIcon={<
|
|
829
|
+
mainIcon={<AntDesign name="tool" size={15} color={Colors.Gray6} />}
|
|
829
830
|
mainTitle={t('resolve_situation')}
|
|
830
831
|
onPressMain={onPressResolveSituationConfirm}
|
|
831
832
|
topComponent={
|
|
@@ -865,7 +866,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
865
866
|
>
|
|
866
867
|
{unit?.name} - {sensor?.station?.name}
|
|
867
868
|
</Text>
|
|
868
|
-
<
|
|
869
|
+
<AntDesign
|
|
869
870
|
accessibilityLabel={AccessibilityLabel.BUTTON_POPUP_RESOLVED_ICON}
|
|
870
871
|
name="check-circle"
|
|
871
872
|
size={42}
|
|
@@ -4,16 +4,7 @@ import AccessibilityLabel from '../../configs/AccessibilityLabel';
|
|
|
4
4
|
import { SCProvider } from '../../context';
|
|
5
5
|
import { mockSCStore } from '../../context/mockStore';
|
|
6
6
|
import Drawer, { Row } from './index';
|
|
7
|
-
|
|
8
|
-
const mockDispatch = jest.fn();
|
|
9
|
-
jest.mock('@react-navigation/native', () => {
|
|
10
|
-
return {
|
|
11
|
-
...jest.requireActual('@react-navigation/native'),
|
|
12
|
-
useNavigation: () => ({
|
|
13
|
-
dispatch: mockDispatch,
|
|
14
|
-
}),
|
|
15
|
-
};
|
|
16
|
-
});
|
|
7
|
+
import { useNavigation } from '@react-navigation/native';
|
|
17
8
|
|
|
18
9
|
const wrapComponent = (initState = mockSCStore({})) => (
|
|
19
10
|
<SCProvider initState={initState}>
|
|
@@ -24,6 +15,7 @@ const wrapComponent = (initState = mockSCStore({})) => (
|
|
|
24
15
|
describe('Drawer', () => {
|
|
25
16
|
let tree;
|
|
26
17
|
it('test render with user', async () => {
|
|
18
|
+
const { dispatch } = useNavigation();
|
|
27
19
|
await act(async () => {
|
|
28
20
|
tree = await renderer.create(wrapComponent());
|
|
29
21
|
});
|
|
@@ -43,7 +35,7 @@ describe('Drawer', () => {
|
|
|
43
35
|
await act(async () => {
|
|
44
36
|
await rows[2].props.onPress();
|
|
45
37
|
});
|
|
46
|
-
expect(
|
|
38
|
+
expect(dispatch).toBeCalledWith({
|
|
47
39
|
payload: { index: 0, routes: [{ name: 'Main' }] },
|
|
48
40
|
type: 'RESET',
|
|
49
41
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Icon } from '@ant-design/react-native';
|
|
1
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
3
2
|
import React, { useCallback, useContext } from 'react';
|
|
4
3
|
import {
|
|
5
4
|
Image,
|
|
@@ -60,7 +59,7 @@ const DrawerContainer = () => {
|
|
|
60
59
|
style={styles.avatar}
|
|
61
60
|
accessibilityLabel={AccessibilityLabel.SIDE_MENU_AVATAR_USER}
|
|
62
61
|
>
|
|
63
|
-
<
|
|
62
|
+
<AntDesign name={'user'} size={27} />
|
|
64
63
|
</View>
|
|
65
64
|
)}
|
|
66
65
|
<View style={styles.textContainer}>
|
|
@@ -117,7 +116,7 @@ export const Row = ({
|
|
|
117
116
|
]}
|
|
118
117
|
accessibilityLabel={accessibilityLabel}
|
|
119
118
|
>
|
|
120
|
-
<
|
|
119
|
+
<AntDesign name={image} size={24} />
|
|
121
120
|
|
|
122
121
|
<View style={styles.wrapText}>
|
|
123
122
|
<Text style={[styles.text]}>{name}</Text>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from 'react';
|
|
2
2
|
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
import { useIsFocused, useNavigation } from '@react-navigation/native';
|
|
5
5
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
6
6
|
import { AlertAction, MenuActionList, Section } from '../../commons';
|
|
@@ -99,7 +99,7 @@ export const EmergencyContactsList = ({ route }) => {
|
|
|
99
99
|
: 'disable'
|
|
100
100
|
}
|
|
101
101
|
leftIcon={
|
|
102
|
-
<
|
|
102
|
+
<AntDesign name={'plus'} size={20} color={Colors.White} />
|
|
103
103
|
}
|
|
104
104
|
text={t('add_new')}
|
|
105
105
|
subtext={t('emergency_max_contacts', {
|
|
@@ -113,7 +113,7 @@ export const EmergencyContactsList = ({ route }) => {
|
|
|
113
113
|
key={contact.id}
|
|
114
114
|
index={index}
|
|
115
115
|
leftIcon={
|
|
116
|
-
<
|
|
116
|
+
<AntDesign name={'user'} size={20} color={Colors.White} />
|
|
117
117
|
}
|
|
118
118
|
text={contact.name}
|
|
119
119
|
subtext={contact.phone_number}
|
|
@@ -122,11 +122,7 @@ export const EmergencyContactsList = ({ route }) => {
|
|
|
122
122
|
style={styles.buttonRemove}
|
|
123
123
|
onPress={onPressRemoveContact(contact)}
|
|
124
124
|
>
|
|
125
|
-
<
|
|
126
|
-
name={'minus'}
|
|
127
|
-
size={20}
|
|
128
|
-
color={Colors.Gray8}
|
|
129
|
-
/>
|
|
125
|
+
<AntDesign name={'minus'} size={20} color={Colors.Gray8} />
|
|
130
126
|
</TouchableOpacity>
|
|
131
127
|
}
|
|
132
128
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
import { useNavigation } from '@react-navigation/native';
|
|
5
5
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
6
6
|
import { Section, ViewButtonBottom } from '../../commons';
|
|
@@ -81,7 +81,7 @@ export const EmergencyContactsSelectContacts = ({ route }) => {
|
|
|
81
81
|
}
|
|
82
82
|
index={index}
|
|
83
83
|
leftIcon={
|
|
84
|
-
<
|
|
84
|
+
<AntDesign name={'user'} size={20} color={Colors.White} />
|
|
85
85
|
}
|
|
86
86
|
text={contact.name}
|
|
87
87
|
subtext={contact.phone_number}
|
|
@@ -91,7 +91,7 @@ export const EmergencyContactsSelectContacts = ({ route }) => {
|
|
|
91
91
|
{currentContacts.some(
|
|
92
92
|
(item) => item?.name === contact?.name
|
|
93
93
|
) && (
|
|
94
|
-
<
|
|
94
|
+
<AntDesign
|
|
95
95
|
name={'check-circle'}
|
|
96
96
|
size={20}
|
|
97
97
|
color={Colors.Primary}
|
|
@@ -20,19 +20,8 @@ const wrapComponent = (route) => (
|
|
|
20
20
|
|
|
21
21
|
jest.mock('react-native-toast-message');
|
|
22
22
|
|
|
23
|
-
const mockedGoBack = jest.fn();
|
|
24
|
-
|
|
25
23
|
const mock = new MockAdapter(api.axiosInstance);
|
|
26
24
|
|
|
27
|
-
jest.mock('@react-navigation/native', () => {
|
|
28
|
-
return {
|
|
29
|
-
...jest.requireActual('@react-navigation/native'),
|
|
30
|
-
useNavigation: () => ({
|
|
31
|
-
goBack: mockedGoBack,
|
|
32
|
-
}),
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
|
|
36
25
|
describe('test EmergencyContactAddNew', () => {
|
|
37
26
|
let route;
|
|
38
27
|
beforeEach(() => {
|
|
@@ -44,9 +33,7 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
44
33
|
},
|
|
45
34
|
},
|
|
46
35
|
};
|
|
47
|
-
mockedGoBack.mockClear();
|
|
48
|
-
});
|
|
49
|
-
afterEach(() => {
|
|
36
|
+
global.mockedGoBack.mockClear();
|
|
50
37
|
Toast.show.mockClear();
|
|
51
38
|
});
|
|
52
39
|
|
|
@@ -105,7 +92,7 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
105
92
|
viewButtonBottom.props.onLeftClick();
|
|
106
93
|
});
|
|
107
94
|
|
|
108
|
-
expect(mockedGoBack).toHaveBeenCalledTimes(1);
|
|
95
|
+
expect(global.mockedGoBack).toHaveBeenCalledTimes(1);
|
|
109
96
|
});
|
|
110
97
|
|
|
111
98
|
it('onSave success', async () => {
|
|
@@ -129,7 +116,7 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
129
116
|
await viewButtonBottom.props.onRightClick();
|
|
130
117
|
});
|
|
131
118
|
|
|
132
|
-
expect(mockedGoBack).toHaveBeenCalledTimes(1);
|
|
119
|
+
expect(global.mockedGoBack).toHaveBeenCalledTimes(1);
|
|
133
120
|
});
|
|
134
121
|
|
|
135
122
|
it('onSave failed', async () => {
|
|
@@ -159,7 +146,7 @@ describe('test EmergencyContactAddNew', () => {
|
|
|
159
146
|
text1: getTranslate('en', 'create_contact_failed'),
|
|
160
147
|
visibilityTime: 1000,
|
|
161
148
|
});
|
|
162
|
-
expect(mockedGoBack).not.toHaveBeenCalled();
|
|
149
|
+
expect(global.mockedGoBack).not.toHaveBeenCalled();
|
|
163
150
|
});
|
|
164
151
|
|
|
165
152
|
it('invalid phone number', async () => {
|
|
@@ -13,6 +13,7 @@ import { SCProvider } from '../../../context';
|
|
|
13
13
|
import { mockSCStore } from '../../../context/mockStore';
|
|
14
14
|
import api from '../../../utils/Apis/axios';
|
|
15
15
|
import { RowUser } from '../../../commons/RowUser';
|
|
16
|
+
import { useNavigation } from '@react-navigation/native';
|
|
16
17
|
|
|
17
18
|
const mock = new MockAdapter(api.axiosInstance);
|
|
18
19
|
|
|
@@ -22,18 +23,6 @@ const wrapComponent = (route) => (
|
|
|
22
23
|
</SCProvider>
|
|
23
24
|
);
|
|
24
25
|
|
|
25
|
-
const mockedNavigate = jest.fn();
|
|
26
|
-
|
|
27
|
-
jest.mock('@react-navigation/native', () => {
|
|
28
|
-
return {
|
|
29
|
-
...jest.requireActual('@react-navigation/native'),
|
|
30
|
-
useNavigation: () => ({
|
|
31
|
-
navigate: mockedNavigate,
|
|
32
|
-
}),
|
|
33
|
-
useIsFocused: () => true,
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
|
|
37
26
|
describe('test EmergencyContactList', () => {
|
|
38
27
|
let route;
|
|
39
28
|
|
|
@@ -44,7 +33,6 @@ describe('test EmergencyContactList', () => {
|
|
|
44
33
|
group: 1,
|
|
45
34
|
},
|
|
46
35
|
};
|
|
47
|
-
mockedNavigate.mockClear();
|
|
48
36
|
mock.reset();
|
|
49
37
|
});
|
|
50
38
|
let tree;
|
|
@@ -137,6 +125,7 @@ describe('test EmergencyContactList', () => {
|
|
|
137
125
|
});
|
|
138
126
|
|
|
139
127
|
it('onItemAddClick select unit members', async () => {
|
|
128
|
+
const { navigate } = useNavigation();
|
|
140
129
|
await act(async () => {
|
|
141
130
|
tree = await create(wrapComponent(route));
|
|
142
131
|
});
|
|
@@ -159,7 +148,7 @@ describe('test EmergencyContactList', () => {
|
|
|
159
148
|
buttonsMenuActionList[1].props.onPress();
|
|
160
149
|
});
|
|
161
150
|
|
|
162
|
-
expect(
|
|
151
|
+
expect(navigate).toHaveBeenCalledWith(
|
|
163
152
|
Routes.EmergencyContactsSelectContacts,
|
|
164
153
|
{
|
|
165
154
|
unitId: route.params.unitId,
|
|
@@ -14,16 +14,6 @@ import { getTranslate } from '../../../utils/I18n';
|
|
|
14
14
|
|
|
15
15
|
const mock = new MockAdapter(api.axiosInstance);
|
|
16
16
|
|
|
17
|
-
const mockedNavigate = jest.fn();
|
|
18
|
-
jest.mock('@react-navigation/native', () => {
|
|
19
|
-
return {
|
|
20
|
-
...jest.requireActual('@react-navigation/native'),
|
|
21
|
-
useNavigation: () => ({
|
|
22
|
-
navigate: mockedNavigate,
|
|
23
|
-
}),
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
|
|
27
17
|
const wrapComponent = (route) => (
|
|
28
18
|
<SCProvider initState={mockSCStore({})}>
|
|
29
19
|
<EmergencyContactsSelectContacts route={route} />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useState } from 'react';
|
|
2
2
|
import { View, TouchableOpacity } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
4
|
|
|
5
5
|
import Text from '../../../commons/Text';
|
|
6
6
|
import styles from '../styles/DropDownItem';
|
|
@@ -29,7 +29,7 @@ const DropDownItem = ({ label, data, onSelectItem, isOpen, onOpen, index }) => {
|
|
|
29
29
|
<View style={styles.dropDownContainer}>
|
|
30
30
|
<TouchableOpacity style={styles.dropDownStyle} onPress={handleOnOpen}>
|
|
31
31
|
<Text>{selecteValue?.label}</Text>
|
|
32
|
-
<
|
|
32
|
+
<AntDesign name="caretdown" size={18} color={Colors.Gray8} />
|
|
33
33
|
</TouchableOpacity>
|
|
34
34
|
|
|
35
35
|
{isOpen && (
|