@eohjsc/react-native-smart-city 0.3.29 → 0.3.32
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/package.json +7 -5
- package/src/Images/DevMode/close.png +0 -0
- package/src/Images/DevMode/close@2x.png +0 -0
- package/src/Images/DevMode/close@3x.png +0 -0
- package/src/Images/DevMode/plus.png +0 -0
- package/src/Images/DevMode/plus@2x.png +0 -0
- package/src/Images/DevMode/plus@3x.png +0 -0
- package/src/Images/DevMode/remove_circle.png +0 -0
- package/src/Images/DevMode/remove_circle@2x.png +0 -0
- package/src/Images/DevMode/remove_circle@3x.png +0 -0
- package/src/commons/Action/ItemQuickAction.js +2 -2
- package/src/commons/Action/__test__/ItemQuickAction.test.js +17 -9
- package/src/commons/ActionGroup/ColorPickerTemplate.js +36 -17
- package/src/commons/ActionGroup/CurtainButtonTemplate.js +6 -6
- package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +18 -13
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +5 -2
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +10 -4
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/index.js +4 -4
- package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLock.js +38 -45
- package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLockStyle.js +1 -0
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +12 -6
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/index.js +8 -4
- package/src/commons/ActionGroup/OnOffTemplate/OnOffButtonTemplate.js +9 -10
- package/src/commons/ActionGroup/OnOffTemplate/index.js +2 -2
- package/src/commons/ActionGroup/OneBigButtonTemplate.js +5 -5
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +38 -22
- package/src/commons/ActionGroup/SliderRangeTemplate.js +24 -16
- package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +25 -9
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/ControlPlay.test.js +13 -7
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/RectangleButton.test.js +9 -5
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/SmartTiviActionTemplate.test.js +25 -9
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +16 -6
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +10 -4
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/RectangleButton.js +7 -3
- package/src/commons/ActionGroup/StatesGridActionTemplate.js +2 -2
- package/src/commons/ActionGroup/ThreeButtonTemplate.js +50 -60
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +135 -133
- package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +7 -7
- package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +3 -3
- package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +3 -3
- package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +9 -5
- package/src/commons/ActionGroup/__test__/index.test.js +7 -5
- package/src/commons/ActionGroup/index.js +35 -10
- package/src/commons/AlertAction/index.js +2 -2
- package/src/commons/Auth/AccountItem.js +9 -3
- package/src/commons/Auth/__test__/AccountItem.test.js +6 -3
- package/src/commons/Automate/ItemAutomate.js +13 -3
- package/src/commons/BackDefault/index.js +2 -2
- package/src/commons/BottomButtonView/index.js +4 -4
- package/src/commons/Button/index.js +2 -2
- package/src/commons/ButtonPopup/index.js +3 -3
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +3 -2
- package/src/commons/Dashboard/MyPinnedSharedUnit/index.js +4 -2
- package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +6 -3
- package/src/commons/Dashboard/MyUnit/index.js +5 -3
- package/src/commons/DevMode/CardDevMode.js +42 -0
- package/src/commons/DevMode/EmptyComponent.js +18 -0
- package/src/commons/DevMode/Item.js +21 -0
- package/src/commons/DevMode/Styles/CardStyles.js +40 -0
- package/src/commons/DevMode/Styles/EmptyComponentStyles.js +15 -0
- package/src/commons/DevMode/Styles/ItemStyles.js +27 -0
- package/src/commons/DevMode/Styles/TextWithLabelStyles.js +36 -0
- package/src/commons/DevMode/TextWithLabel.js +30 -0
- package/src/commons/DevMode/index.js +5 -1
- package/src/commons/Device/ConnectedViewHeader.js +2 -2
- package/src/commons/Device/DeviceAlertStatus.js +3 -3
- package/src/commons/Device/DisconnectedView.js +2 -2
- package/src/commons/Device/Emergency/EmergencyButton.js +2 -2
- package/src/commons/Device/Emergency/EmergencyDetail.js +1 -1
- package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +3 -2
- package/src/commons/Device/FlatListItems.js +2 -2
- package/src/commons/Device/ItemAddNew/index.js +10 -11
- package/src/commons/Device/ItemDevice.js +27 -20
- package/src/commons/Device/PMSensor/PMSensorIndicatior.js +1 -1
- package/src/commons/Device/RainningSensor/CurrentRainSensor.js +1 -1
- package/src/commons/Device/SensorConnectedStatus.js +5 -2
- package/src/commons/Device/WindDirection/Compass/index.js +6 -3
- package/src/commons/Device/WindSpeed/Anemometer/index.js +1 -1
- package/src/commons/Device/__test__/DeviceAlertStatus.test.js +8 -4
- package/src/commons/Device/__test__/FlatListItems.test.js +3 -2
- package/src/commons/Device/__test__/SensorConnectedStatus.test.js +4 -2
- package/src/commons/Explore/ActivityIndicator/index.js +5 -2
- package/src/commons/Explore/SearchBox/__test__/SearchBox.test.js +3 -3
- package/src/commons/Explore/SearchBox/index.js +2 -2
- package/src/commons/FieldTemplate/ChooseUserField/ChoosePopup.js +4 -4
- package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +11 -8
- package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
- package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +3 -2
- package/src/commons/FieldTemplate/PasscodeField/index.js +2 -2
- package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +12 -7
- package/src/commons/Form/TextInput.js +2 -2
- package/src/commons/Form/TextInputPassword.js +2 -2
- package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +5 -3
- package/src/commons/GroupCheckBox/index.js +2 -2
- package/src/commons/Header/HeaderCustom.js +8 -2
- package/src/commons/HeaderAni/index.js +2 -3
- package/src/commons/MediaPlayerDetail/index.js +2 -2
- package/src/commons/MenuActionList/index.js +2 -2
- package/src/commons/MenuActionMore/index.js +6 -5
- package/src/commons/NavBar/index.js +4 -4
- package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +11 -5
- package/src/commons/OneTapTemplate/OptionsDropdownActionTemplate.js +7 -3
- package/src/commons/OneTapTemplate/StatesGridActionTemplate.js +4 -2
- package/src/commons/OneTapTemplate/__test__/NumberUpDownActionTemplate.test.js +11 -8
- package/src/commons/OneTapTemplate/__test__/OptionsDropdownActionTemplate.test.js +9 -5
- package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +5 -3
- package/src/commons/Popover/index.js +2 -12
- package/src/commons/PreventAccess/__test__/PreventAccess.test.js +5 -3
- package/src/commons/PreventAccess/index.js +3 -3
- package/src/commons/{Connecting → Processing}/__test__/Connecting.test.js +5 -4
- package/src/commons/Processing/index.js +93 -0
- package/src/commons/{Connecting → Processing}/styles.js +9 -1
- package/src/commons/SelectGateway/index.js +105 -0
- package/src/commons/SelectGateway/styles.js +55 -0
- package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +106 -0
- package/src/commons/SelectSubUnit/index.js +124 -0
- package/src/commons/SelectSubUnit/styles.js +55 -0
- package/src/commons/SelectUnit/__test__/SelectUnit.test.js +120 -0
- package/src/commons/SelectUnit/index.js +106 -0
- package/src/commons/SelectUnit/styles.js +54 -0
- package/src/commons/Sharing/WrapHeaderScrollable.js +6 -4
- package/src/commons/SubUnit/OneTap/ItemOneTap.js +7 -4
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +25 -10
- package/src/commons/SubUnit/OneTap/index.js +9 -4
- package/src/commons/SubUnit/ShortDetail.js +11 -29
- package/src/commons/SubUnit/__test__/ShortDetail.test.js +15 -10
- package/src/commons/SummaryItem/index.js +2 -2
- package/src/commons/Unit/HeaderUnit/index.js +4 -5
- package/src/commons/Unit/SharedUnit.js +10 -8
- package/src/commons/Unit/__test__/HeaderUnit.test.js +13 -5
- package/src/commons/Unit/__test__/SharedUnit.test.js +30 -11
- package/src/commons/UnitSummary/AirQuality/__test__/index.test.js +13 -8
- package/src/commons/UnitSummary/AirQuality/index.js +7 -3
- package/src/commons/UnitSummary/TotalPowerBox.js +2 -2
- package/src/commons/UnitSummary/TotalPowerConsumption/index.js +2 -2
- package/src/commons/UnitSummary/__test__/TotalPowerBox.test.js +3 -2
- package/src/commons/UnitSummary/__test__/TotalPowerConsumption.test.js +4 -2
- package/src/commons/ViewButtonBottom/index.js +4 -4
- package/src/commons/WheelDateTimePicker/index.js +5 -3
- package/src/commons/WrapParallaxScrollView/index.js +2 -1
- package/src/configs/API.js +12 -14
- package/src/configs/AccessibilityLabel.js +608 -0
- package/src/configs/Colors.js +4 -0
- package/src/configs/Constants.js +1 -593
- package/src/configs/Images.js +3 -0
- package/src/context/actionType.ts +19 -3
- package/src/context/mockStore.ts +18 -3
- package/src/context/reducer.ts +66 -9
- package/src/hoc/withRemoteControl.js +1 -0
- package/src/hooks/Common/index.js +2 -2
- package/src/hooks/Common/useDevicesStatus.js +1 -1
- package/src/hooks/Common/{useGGHomeDeviceConnected.js → useHomeAssistantDeviceConnected.js} +3 -3
- package/src/hooks/Common/usePopover.js +6 -1
- package/src/hooks/IoT/__test__/{useGGHomeConnection.test.js → useHomeAssistantConnection.test.js} +18 -18
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +17 -12
- package/src/hooks/IoT/index.js +2 -2
- package/src/hooks/IoT/useHomeAssistantConnection.js +91 -0
- package/src/hooks/IoT/useRemoteControl.js +6 -6
- package/src/hooks/IoT/useValueEvaluation.js +10 -19
- package/src/iot/RemoteControl/{GoogleHome.js → HomeAssistant.js} +27 -23
- package/src/iot/RemoteControl/LG.js +2 -1
- package/src/iot/RemoteControl/__test__/{GoogleHome.test.js → HomeAssistant.test.js} +30 -30
- package/src/navigations/AddDeviceStack.js +0 -14
- package/src/navigations/AddGatewayStack.js +51 -21
- package/src/navigations/Main.js +28 -4
- package/src/navigations/SmartIrStack.js +3 -3
- package/src/navigations/UnitStack.js +5 -8
- package/src/screens/AQIGuide/__test__/AQIGuide.test.js +5 -3
- package/src/screens/AQIGuide/index.js +5 -3
- package/src/screens/ActivityLog/FilterPopup.js +2 -2
- package/src/screens/ActivityLog/__test__/FilterPopup.test.js +2 -2
- package/src/screens/ActivityLog/__test__/index.test.js +3 -2
- package/src/screens/ActivityLog/index.js +3 -3
- package/src/screens/AddCommon/SelectSubUnit.js +44 -191
- package/src/screens/AddCommon/SelectUnit.js +51 -204
- package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +7 -50
- package/src/screens/AddCommon/__test__/SelectUnit.test.js +28 -26
- package/src/screens/AddLocationMaps/__test__/index.test.js +13 -7
- package/src/screens/AddLocationMaps/index.js +3 -3
- package/src/screens/AddNewAction/Device/index.js +5 -1
- package/src/screens/AddNewAction/SelectAction.js +36 -20
- package/src/screens/AddNewAction/SelectSensorDevices.js +3 -3
- package/src/screens/AddNewAction/__test__/SelectAction.test.js +3 -2
- package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +8 -3
- package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +11 -7
- package/src/screens/AddNewAutoSmart/index.js +11 -12
- package/src/screens/AddNewDevice/ConnectingDevices.js +1 -1
- package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +7 -4
- package/src/screens/AddNewDevice/index.js +4 -4
- package/src/screens/AddNewGateway/ConnectingDevice.js +40 -0
- package/src/screens/AddNewGateway/ConnectingModbusDevice.js +61 -0
- package/src/screens/AddNewGateway/ConnectingWifiDevice.js +70 -0
- package/src/screens/AddNewGateway/ConnectingZigbeeDevice.js +60 -0
- package/src/screens/AddNewGateway/PlugAndPlay/FirstWarning.js +21 -8
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +23 -4
- package/src/screens/AddNewGateway/RenameNewDevices.js +141 -0
- package/src/screens/AddNewGateway/RenameNewDevicesStyles.js +75 -0
- package/src/screens/AddNewGateway/ScanGatewayQR.js +57 -0
- package/src/screens/AddNewGateway/ScanModbusQR.js +53 -0
- package/src/screens/AddNewGateway/ScanWifiDeviceQR.js +55 -0
- package/src/screens/AddNewGateway/SelectDeviceSubUnit.js +31 -0
- package/src/screens/AddNewGateway/SelectDeviceType.js +52 -0
- package/src/screens/AddNewGateway/SelectDeviceUnit.js +29 -0
- package/src/screens/AddNewGateway/SelectModbusGateway.js +34 -0
- package/src/screens/AddNewGateway/SelectZigbeeGateway.js +34 -0
- package/src/screens/AddNewGateway/ShareWifiPassword.js +302 -0
- package/src/screens/AddNewGateway/ShareWifiPasswordStyles.js +44 -0
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +7 -4
- package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +63 -0
- package/src/screens/AddNewGateway/__test__/{SelectGateway.test.js → ConnectingWifiDevice.test.js} +15 -10
- package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +62 -0
- package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +191 -0
- package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +73 -0
- package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +75 -0
- package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +73 -0
- package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +47 -0
- package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +89 -0
- package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +48 -0
- package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +77 -0
- package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +77 -0
- package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +294 -0
- package/src/screens/AddNewGateway/hooks/__Tests__/index.test.js +27 -0
- package/src/screens/AddNewGateway/index.js +4 -4
- package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +5 -4
- package/src/screens/AddNewOneTap/index.js +4 -4
- package/src/screens/Automate/__test__/index.test.js +2 -2
- package/src/screens/Automate/index.js +6 -2
- package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +3 -2
- package/src/screens/ConfirmUnitDeletion/index.js +3 -3
- package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +5 -5
- package/src/screens/Device/EditDevice/index.js +3 -3
- package/src/screens/Device/__test__/detail.test.js +38 -22
- package/src/screens/Device/components/DetailHistoryChart.js +7 -5
- package/src/screens/Device/components/SensorConnectStatusViewHeader.js +16 -17
- package/src/screens/Device/components/SensorDisplayItem.js +51 -26
- package/src/screens/Device/detail.js +65 -38
- package/src/screens/Device/hooks/useEvaluateValue.js +0 -2
- package/src/screens/Device/hooks/useFavoriteDevice.js +4 -2
- package/src/screens/DeviceInfo/__test__/index.test.js +8 -4
- package/src/screens/DeviceInfo/index.js +10 -6
- package/src/screens/Drawer/index.js +30 -13
- package/src/screens/EmergencyContacts/EmergencyContactsAddNew.js +11 -7
- package/src/screens/EmergencyContacts/EmergencyContactsList.js +1 -1
- package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +9 -10
- package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +9 -5
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +7 -3
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +7 -3
- package/src/screens/EmergencySetting/__test__/DropDownItem.test.js +3 -2
- package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
- package/src/screens/EnterPassword/__test__/EnterPassword.test.js +6 -3
- package/src/screens/EnterPassword/index.js +5 -3
- package/src/screens/GuestInfo/__test__/index.test.js +18 -12
- package/src/screens/GuestInfo/components/AccessScheduleItem.js +2 -2
- package/src/screens/GuestInfo/components/AccessScheduleSheet.js +3 -3
- package/src/screens/GuestInfo/components/HeaderGuestInfo.js +2 -2
- package/src/screens/GuestInfo/components/RecurringDetail.js +4 -4
- package/src/screens/GuestInfo/components/TemporaryDetail.js +3 -3
- package/src/screens/GuestInfo/index.js +1 -1
- package/src/screens/HanetCamera/Detail.js +10 -4
- package/src/screens/HanetCamera/ManageAccess.js +4 -4
- package/src/screens/HanetCamera/MemberInfo.js +1 -1
- package/src/screens/HanetCamera/__test__/Detail.test.js +5 -3
- package/src/screens/HanetCamera/__test__/ManageAccess.test.js +10 -4
- package/src/screens/HanetCamera/__test__/MemberInfo.test.js +4 -2
- package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
- package/src/screens/ManageAccess/index.js +1 -1
- package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +4 -4
- package/src/screens/MoveToAnotherSubUnit/index.js +2 -2
- package/src/screens/Notification/__test__/NotificationItem.test.js +6 -30
- package/src/screens/Notification/components/NotificationItem.js +3 -19
- package/src/screens/PlayBackCamera/__test__/index.test.js +9 -6
- package/src/screens/PlayBackCamera/index.js +6 -6
- package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +1 -1
- package/src/screens/ScanChipQR/components/QRScan/index.js +10 -3
- package/src/screens/ScriptDetail/__test__/index.test.js +8 -4
- package/src/screens/ScriptDetail/index.js +7 -5
- package/src/screens/SelectUnit/__test__/index.test.js +4 -3
- package/src/screens/SelectUnit/index.js +3 -3
- package/src/screens/SetSchedule/index.js +1 -1
- package/src/screens/Sharing/Components/SensorItem.js +6 -3
- package/src/screens/Sharing/Components/Styles/SensorItemStyles.js +4 -0
- package/src/screens/Sharing/Components/Styles/TitleCheckBoxStyles.js +4 -0
- package/src/screens/Sharing/Components/TitleCheckBox.js +17 -8
- package/src/screens/Sharing/Components/__test__/SensorItem.test.js +4 -2
- package/src/screens/Sharing/InfoMemberUnit.js +7 -6
- package/src/screens/Sharing/MemberList.js +4 -4
- package/src/screens/Sharing/SelectPermission.js +9 -4
- package/src/screens/Sharing/SelectUser.js +9 -5
- package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +3 -2
- package/src/screens/Sharing/__test__/SelectUser.test.js +7 -4
- package/src/screens/SideMenuDetail/__test__/index.test.js +11 -7
- package/src/screens/SideMenuDetail/index.js +2 -2
- package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +4 -2
- package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +5 -5
- package/src/screens/SmartIr/__test__/SmartIr.test.js +14 -6
- package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +4 -2
- package/src/screens/SmartIr/components/{SelectDeviceType.js → SelectIrDeviceType.js} +2 -2
- package/src/screens/SmartIr/index.js +1 -1
- package/src/screens/SubUnit/AddSubUnit.js +7 -3
- package/src/screens/SubUnit/Detail.js +6 -6
- package/src/screens/SubUnit/EditSubUnit.js +10 -6
- package/src/screens/SubUnit/ManageSubUnit.js +2 -2
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +6 -3
- package/src/screens/SubUnit/__test__/Detail.test.js +5 -3
- package/src/screens/SubUnit/__test__/EditSubUnit.test.js +9 -5
- package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +3 -2
- package/src/screens/SyncLGDevice/AddLGDevice.js +4 -4
- package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +7 -4
- package/src/screens/TDSGuide/__test__/TDSGuide.test.js +4 -2
- package/src/screens/TDSGuide/index.js +2 -2
- package/src/screens/Template/EditTemplate.js +152 -0
- package/src/screens/Template/GatewayList.js +51 -0
- package/src/screens/Template/Information.js +41 -0
- package/src/screens/Template/Styles/EditTemplateStyle.js +109 -0
- package/src/screens/Template/Styles/GatewayStyles.js +46 -0
- package/src/screens/Template/Styles/InformationStyles.js +16 -0
- package/src/screens/Template/Styles/detailStyles.js +35 -0
- package/src/screens/Template/Styles/indexStyles.js +2 -33
- package/src/screens/Template/__test__/EditTemplate.test.js +89 -0
- package/src/screens/Template/__test__/GatewayList.test.js +26 -0
- package/src/screens/Template/__test__/Information.test.js +16 -0
- package/src/screens/Template/__test__/detail.test.js +68 -0
- package/src/screens/Template/__test__/index.test.js +26 -1
- package/src/screens/Template/detail.js +154 -0
- package/src/screens/Template/index.js +38 -32
- package/src/screens/UVIndexGuide/__test__/UVIndexGuide.test.js +3 -2
- package/src/screens/UVIndexGuide/index.js +2 -2
- package/src/screens/Unit/AddMenu.js +6 -20
- package/src/screens/Unit/ChooseLocation.js +1 -1
- package/src/screens/Unit/Detail.js +14 -9
- package/src/screens/Unit/ManageUnit.js +21 -15
- package/src/screens/Unit/MyAllUnit/index.js +1 -1
- package/src/screens/Unit/SelectAddToFavorites.js +11 -2
- package/src/screens/Unit/SelectAddress.js +4 -4
- package/src/screens/Unit/SmartAccount.js +1 -1
- package/src/screens/Unit/SmartAccountItem.js +3 -3
- package/src/screens/Unit/Station/__test__/index.test.js +19 -3
- package/src/screens/Unit/Station/index.js +2 -2
- package/src/screens/Unit/Summaries.js +2 -2
- package/src/screens/Unit/__test__/CheckSendEmail.test.js +6 -6
- package/src/screens/Unit/__test__/Detail.test.js +90 -55
- package/src/screens/Unit/__test__/ManageUnit.test.js +40 -18
- package/src/screens/Unit/__test__/SelectAddress.test.js +15 -8
- package/src/screens/Unit/__test__/SmartAccount.test.js +42 -25
- package/src/screens/Unit/__test__/SmartAccountItem.test.js +4 -3
- package/src/screens/Unit/components/AutomateScript/index.js +8 -2
- package/src/screens/Unit/components/ListMyAllUnit/index.js +1 -1
- package/src/screens/Unit/components/MyAllUnit/__test__/Header.test.js +9 -5
- package/src/screens/Unit/components/MyAllUnit/index.js +1 -1
- package/src/screens/Unit/components/MyUnitDevice/index.js +8 -5
- package/src/screens/Unit/components/SharedUnit/index.js +12 -6
- package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +2 -2
- package/src/screens/Unit/components/__test__/SharedUnit.test.js +24 -9
- package/src/screens/Unit/hook/useUnitConnectRemoteDevices.js +25 -11
- package/src/screens/UnitSummary/__test__/index.test.js +4 -2
- package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +4 -2
- package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +2 -2
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +4 -2
- package/src/screens/UnitSummary/components/PowerConsumption/index.js +2 -2
- package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +5 -4
- package/src/screens/UnitSummary/components/RunningDevices/index.js +6 -3
- package/src/screens/UnitSummary/components/TotalPowerBox/index.js +2 -2
- package/src/screens/UnitSummary/components/TotalPowerConsumption/index.js +2 -2
- package/src/screens/UnitSummary/components/__test__/TotalPowerBox.test.js +3 -2
- package/src/screens/UnitSummary/components/__test__/TotalPowerConsumption.test.js +4 -2
- package/src/screens/UnitSummary/index.js +10 -8
- package/src/screens/WaterQualityGuide/__test__/index.test.js +17 -12
- package/src/screens/WaterQualityGuide/index.js +26 -10
- package/src/utils/Apis/axios.js +1 -0
- package/src/utils/I18n/translations/en.json +25 -10
- package/src/utils/I18n/translations/vi.json +22 -9
- package/src/utils/Route/index.js +22 -10
- package/src/commons/Connecting/index.js +0 -67
- package/src/commons/ConnectingProcess/DeviceItem/DeviceItem.js +0 -28
- package/src/commons/ConnectingProcess/DeviceItem/DeviceItemStyles.js +0 -41
- package/src/commons/ConnectingProcess/__test__/Connecting.test.js +0 -163
- package/src/commons/ConnectingProcess/__test__/DeviceItem.test.js +0 -19
- package/src/commons/ConnectingProcess/index.js +0 -213
- package/src/commons/ConnectingProcess/styles.js +0 -69
- package/src/hooks/IoT/useGGHomeConnection.js +0 -91
- package/src/iot/RemoteControl/index.js +0 -55
- package/src/screens/AddNewDevice/ConnectDevices.js +0 -184
- package/src/screens/AddNewDevice/__test__/ConnectDevices.test.js +0 -131
- package/src/screens/AddNewGateway/ConnectedGateway.js +0 -139
- package/src/screens/AddNewGateway/ConnectingGateway.js +0 -137
- package/src/screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning.js +0 -214
- package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +0 -307
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/ConnectWifiWarning.test.js +0 -75
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/GatewayWifiList.test.js +0 -130
- package/src/screens/AddNewGateway/SelectGateway.js +0 -133
- package/src/screens/AddNewGateway/SetupGatewayWifi.js +0 -207
- package/src/screens/AddNewGateway/__test__/ConnectedGateway.test.js +0 -71
- package/src/screens/AddNewGateway/__test__/ConnectingGateway.test.js +0 -96
- package/src/screens/AddNewGateway/__test__/SetupGateway.test.js +0 -120
- package/src/screens/ScanChipQR/__test__/ScanChipQR.test.js +0 -115
- package/src/screens/ScanChipQR/hooks/index.js +0 -120
- package/src/screens/ScanChipQR/index.js +0 -29
- package/src/screens/ScanSensorQR/__test__/ScanSensorQR.test.js +0 -111
- package/src/screens/ScanSensorQR/hooks/index.js +0 -40
- package/src/screens/ScanSensorQR/index.js +0 -39
|
@@ -6,7 +6,7 @@ import { getStatusBarHeight } from 'react-native-iphone-x-helper';
|
|
|
6
6
|
|
|
7
7
|
import Text from '../../commons/Text';
|
|
8
8
|
import { Colors, Constants } from '../../configs';
|
|
9
|
-
import {
|
|
9
|
+
import { AccessibilityLabel } from '../../configs/Constants';
|
|
10
10
|
|
|
11
11
|
const screenHeight = Constants.height;
|
|
12
12
|
const default_height = 44;
|
|
@@ -93,8 +93,7 @@ const HeaderAni = memo(
|
|
|
93
93
|
<TouchableOpacity
|
|
94
94
|
style={styles.btnBack}
|
|
95
95
|
onPress={onPressLeft}
|
|
96
|
-
|
|
97
|
-
accessibilityLabel={TESTID.ICON_BACK}
|
|
96
|
+
accessibilityLabel={AccessibilityLabel.ICON_BACK}
|
|
98
97
|
>
|
|
99
98
|
<Icon name={'left'} size={27} color={Colors.Gray9} />
|
|
100
99
|
</TouchableOpacity>
|
|
@@ -21,7 +21,7 @@ import { Colors, Constants, Images } from '../../configs';
|
|
|
21
21
|
import { colorOpacity } from '../../utils/Converter/color';
|
|
22
22
|
import styles from './Styles/MediaPlayerDetailStyles';
|
|
23
23
|
import FImage from '../../commons/FImage';
|
|
24
|
-
import {
|
|
24
|
+
import { AccessibilityLabel } from '../../configs/Constants';
|
|
25
25
|
import { SCContext, useSCContextSelector } from '../../context';
|
|
26
26
|
import { Action } from '../../context/actionType';
|
|
27
27
|
|
|
@@ -155,7 +155,7 @@ const MediaPlayerDetail = ({
|
|
|
155
155
|
activeOpacity={1}
|
|
156
156
|
style={styles.videoBtn}
|
|
157
157
|
onPress={onTapGoDetail}
|
|
158
|
-
|
|
158
|
+
accessibilityLabel={AccessibilityLabel.SUB_UNIT_GO_DETAIL}
|
|
159
159
|
>
|
|
160
160
|
{paused ? (
|
|
161
161
|
<View style={[styles.player, style]}>
|
|
@@ -4,7 +4,7 @@ import { getBottomSpace } from 'react-native-iphone-x-helper';
|
|
|
4
4
|
|
|
5
5
|
import { Colors } from '../../configs';
|
|
6
6
|
import Text from '../../commons/Text';
|
|
7
|
-
import {
|
|
7
|
+
import { AccessibilityLabel } from '../../configs/Constants';
|
|
8
8
|
import { ModalCustom } from '../Modal';
|
|
9
9
|
|
|
10
10
|
const keyExtractor = (item) => item.id.toString();
|
|
@@ -22,7 +22,7 @@ const MenuActionList = memo(
|
|
|
22
22
|
({ item }) => {
|
|
23
23
|
return (
|
|
24
24
|
<TouchableOpacity
|
|
25
|
-
|
|
25
|
+
accessibilityLabel={AccessibilityLabel.MENU_ACTION_LIST_TOUCHABLE}
|
|
26
26
|
onPress={onPress(item)}
|
|
27
27
|
style={styles.item}
|
|
28
28
|
>
|
|
@@ -4,7 +4,7 @@ import Popover from '../Popover';
|
|
|
4
4
|
|
|
5
5
|
import styles from './MenuActionMoreStyles';
|
|
6
6
|
import Text from '../Text';
|
|
7
|
-
import {
|
|
7
|
+
import { AccessibilityLabel } from '../../configs/Constants';
|
|
8
8
|
import { useStatusBarPreview } from '../../hooks/Common/useStatusBar';
|
|
9
9
|
import { Colors } from '../../configs';
|
|
10
10
|
|
|
@@ -19,7 +19,7 @@ const MenuActionMore = memo(
|
|
|
19
19
|
isTextCenter = true,
|
|
20
20
|
idLabelPopover,
|
|
21
21
|
idLabelScrollView,
|
|
22
|
-
idLabelItem =
|
|
22
|
+
idLabelItem = AccessibilityLabel.SUB_UNIT_NAME,
|
|
23
23
|
}) => {
|
|
24
24
|
const [isDisable, setIsDisable] = useState(false);
|
|
25
25
|
const onPress = useCallback(
|
|
@@ -65,13 +65,14 @@ const MenuActionMore = memo(
|
|
|
65
65
|
]}
|
|
66
66
|
onPress={onPress(item, index)}
|
|
67
67
|
key={index}
|
|
68
|
-
testID={TESTID.TOUCHABLE_ACTION_ADD_MORE}
|
|
69
68
|
accessibilityLabel={`${idLabelItem}-${
|
|
70
|
-
item?.route ? item?.id : item?.station?.id
|
|
69
|
+
(item?.route ? item?.id : item?.station?.id) || index
|
|
71
70
|
}`}
|
|
72
71
|
disabled={isDisable}
|
|
73
72
|
>
|
|
74
|
-
<Text style={styles.modalHeaderText
|
|
73
|
+
<Text style={[styles.modalHeaderText, item?.textStyle]}>
|
|
74
|
+
{item?.text}
|
|
75
|
+
</Text>
|
|
75
76
|
</TouchableOpacity>
|
|
76
77
|
);
|
|
77
78
|
})}
|
|
@@ -5,7 +5,7 @@ import { View, TouchableOpacity } from 'react-native';
|
|
|
5
5
|
import styles from './NavBarStyles';
|
|
6
6
|
import { usePopover } from '../../hooks/Common';
|
|
7
7
|
import { Colors } from '../../configs';
|
|
8
|
-
import {
|
|
8
|
+
import { AccessibilityLabel } from '../../configs/Constants';
|
|
9
9
|
import Station from '../../screens/Unit/Station';
|
|
10
10
|
import MenuActionMore from '../MenuActionMore';
|
|
11
11
|
|
|
@@ -18,6 +18,7 @@ const NavBar = memo(
|
|
|
18
18
|
style,
|
|
19
19
|
idLabelScrollView,
|
|
20
20
|
idLabelItem,
|
|
21
|
+
idLabelIconBars,
|
|
21
22
|
}) => {
|
|
22
23
|
const { childRef, showingPopover, showPopoverWithRef, hidePopover } =
|
|
23
24
|
usePopover();
|
|
@@ -38,8 +39,7 @@ const NavBar = memo(
|
|
|
38
39
|
style={styles.btnBack}
|
|
39
40
|
onPress={handleShowMenuAction}
|
|
40
41
|
ref={refMenuAction}
|
|
41
|
-
|
|
42
|
-
accessibilityLabel={TESTID.NAVBAR_ICON_BARS}
|
|
42
|
+
accessibilityLabel={idLabelIconBars}
|
|
43
43
|
>
|
|
44
44
|
<Icon name={'bars'} size={19} color={Colors.Black} />
|
|
45
45
|
</TouchableOpacity>
|
|
@@ -51,7 +51,7 @@ const NavBar = memo(
|
|
|
51
51
|
childRef={childRef}
|
|
52
52
|
onItemClick={onSnapToItem}
|
|
53
53
|
isTextCenter={false}
|
|
54
|
-
|
|
54
|
+
accessibilityLabel={AccessibilityLabel.NAVBAR_MENU_ACTION_MORE}
|
|
55
55
|
wrapStyle={styles.wrapStyle}
|
|
56
56
|
idLabelScrollView={idLabelScrollView}
|
|
57
57
|
idLabelItem={idLabelItem}
|
|
@@ -8,7 +8,7 @@ import { Colors } from '../../configs';
|
|
|
8
8
|
import SelectActionCard from '../SelectActionCard';
|
|
9
9
|
import Text from '../Text';
|
|
10
10
|
import { useConfigGlobalState } from '../../iot/states';
|
|
11
|
-
import {
|
|
11
|
+
import { AccessibilityLabel } from '../../configs/Constants';
|
|
12
12
|
import { ModalCustom } from '../Modal';
|
|
13
13
|
|
|
14
14
|
const NumberUpDownActionTemplate = memo(({ data, onSelectAction }) => {
|
|
@@ -86,7 +86,9 @@ const NumberUpDownActionTemplate = memo(({ data, onSelectAction }) => {
|
|
|
86
86
|
<View style={styles.modalContent}>
|
|
87
87
|
<TouchableOpacity
|
|
88
88
|
onPress={onPressDown}
|
|
89
|
-
|
|
89
|
+
accessibilityLabel={
|
|
90
|
+
AccessibilityLabel.NUMBER_UP_DOWN_ACTION_DOWN
|
|
91
|
+
}
|
|
90
92
|
>
|
|
91
93
|
<IconOutline name="down" size={32} color={Colors.Primary} />
|
|
92
94
|
</TouchableOpacity>
|
|
@@ -94,13 +96,15 @@ const NumberUpDownActionTemplate = memo(({ data, onSelectAction }) => {
|
|
|
94
96
|
type="H2"
|
|
95
97
|
bold
|
|
96
98
|
style={styles.textTemperature}
|
|
97
|
-
|
|
99
|
+
accessibilityLabel={
|
|
100
|
+
AccessibilityLabel.NUMBER_UP_DOWN_ACTION_TEXT
|
|
101
|
+
}
|
|
98
102
|
>
|
|
99
103
|
{text_format.replace('{number}', value)}
|
|
100
104
|
</Text>
|
|
101
105
|
<TouchableOpacity
|
|
102
106
|
onPress={onPressUp}
|
|
103
|
-
|
|
107
|
+
accessibilityLabel={AccessibilityLabel.NUMBER_UP_DOWN_ACTION_UP}
|
|
104
108
|
>
|
|
105
109
|
<IconOutline name="up" size={32} color={Colors.Primary} />
|
|
106
110
|
</TouchableOpacity>
|
|
@@ -118,7 +122,9 @@ const NumberUpDownActionTemplate = memo(({ data, onSelectAction }) => {
|
|
|
118
122
|
</TouchableOpacity>
|
|
119
123
|
<TouchableOpacity
|
|
120
124
|
onPress={onPressDone}
|
|
121
|
-
|
|
125
|
+
accessibilityLabel={
|
|
126
|
+
AccessibilityLabel.NUMBER_UP_DOWN_ACTION_DONE
|
|
127
|
+
}
|
|
122
128
|
>
|
|
123
129
|
<Text
|
|
124
130
|
type="H4"
|
|
@@ -8,7 +8,7 @@ import styles from './OptionsDropdownActionTemplateStyles';
|
|
|
8
8
|
import { Colors } from '../../configs';
|
|
9
9
|
import SelectActionCard from '../SelectActionCard';
|
|
10
10
|
import Text from '../Text';
|
|
11
|
-
import {
|
|
11
|
+
import { AccessibilityLabel } from '../../configs/Constants';
|
|
12
12
|
|
|
13
13
|
const OptionsDropdownActionTemplate = memo(({ data, onSelectAction }) => {
|
|
14
14
|
const t = useTranslations();
|
|
@@ -66,7 +66,9 @@ const OptionsDropdownActionTemplate = memo(({ data, onSelectAction }) => {
|
|
|
66
66
|
<TouchableOpacity
|
|
67
67
|
style={styles.flexRow}
|
|
68
68
|
onPress={() => handleOnPressItem(item, index)}
|
|
69
|
-
|
|
69
|
+
accessibilityLabel={
|
|
70
|
+
AccessibilityLabel.OPTIONS_DROPDOWN_ACTION_CHOOSING_ITEM
|
|
71
|
+
}
|
|
70
72
|
>
|
|
71
73
|
<RadioCircle active={index === activeAction} />
|
|
72
74
|
<Text type="H4" style={styles.textContent}>
|
|
@@ -90,7 +92,9 @@ const OptionsDropdownActionTemplate = memo(({ data, onSelectAction }) => {
|
|
|
90
92
|
</TouchableOpacity>
|
|
91
93
|
<TouchableOpacity
|
|
92
94
|
onPress={onPressDone}
|
|
93
|
-
|
|
95
|
+
accessibilityLabel={
|
|
96
|
+
AccessibilityLabel.OPTIONS_DROPDOWN_ACTION_DONE
|
|
97
|
+
}
|
|
94
98
|
disabled={activeAction < 0}
|
|
95
99
|
>
|
|
96
100
|
<Text
|
|
@@ -4,7 +4,7 @@ import { View, TouchableOpacity } from 'react-native';
|
|
|
4
4
|
import styles from './StatesGridActionTemplateStyles';
|
|
5
5
|
import SelectActionCard from '../SelectActionCard';
|
|
6
6
|
import Text from '../Text';
|
|
7
|
-
import {
|
|
7
|
+
import { AccessibilityLabel } from '../../configs/Constants';
|
|
8
8
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
9
9
|
import { ModalCustom } from '../Modal';
|
|
10
10
|
|
|
@@ -50,7 +50,9 @@ const StatesGridActionTemplate = memo(({ data, onSelectAction }) => {
|
|
|
50
50
|
<TouchableOpacity
|
|
51
51
|
key={index}
|
|
52
52
|
onPress={() => hanleSelectAction(item)}
|
|
53
|
-
|
|
53
|
+
accessibilityLabel={
|
|
54
|
+
AccessibilityLabel.STATES_GRID_ACTION_GRID_ITEM
|
|
55
|
+
}
|
|
54
56
|
>
|
|
55
57
|
<Text type="H4" style={styles.textwithline}>
|
|
56
58
|
{item.text}
|
|
@@ -6,7 +6,7 @@ import NumberUpDownActionTemplate from '../NumberUpDownActionTemplate';
|
|
|
6
6
|
|
|
7
7
|
import { TouchableOpacity } from 'react-native';
|
|
8
8
|
import Text from '../../Text';
|
|
9
|
-
import {
|
|
9
|
+
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
10
10
|
|
|
11
11
|
jest.mock('react', () => {
|
|
12
12
|
return {
|
|
@@ -47,13 +47,14 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
47
47
|
const instance = tree.root;
|
|
48
48
|
const touchableOpacity = instance.find(
|
|
49
49
|
(item) =>
|
|
50
|
-
item.props.
|
|
50
|
+
item.props.accessibilityLabel ===
|
|
51
|
+
AccessibilityLabel.NUMBER_UP_DOWN_ACTION_DOWN &&
|
|
51
52
|
item.type === TouchableOpacity
|
|
52
53
|
);
|
|
53
54
|
const textElement = instance.find(
|
|
54
55
|
(item) =>
|
|
55
|
-
item.props.
|
|
56
|
-
|
|
56
|
+
item.props.accessibilityLabel ===
|
|
57
|
+
AccessibilityLabel.NUMBER_UP_DOWN_ACTION_TEXT && item.type === Text
|
|
57
58
|
);
|
|
58
59
|
act(() => {
|
|
59
60
|
touchableOpacity.props.onPress();
|
|
@@ -68,13 +69,14 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
68
69
|
const instance = tree.root;
|
|
69
70
|
const touchableOpacity = instance.find(
|
|
70
71
|
(item) =>
|
|
71
|
-
item.props.
|
|
72
|
+
item.props.accessibilityLabel ===
|
|
73
|
+
AccessibilityLabel.NUMBER_UP_DOWN_ACTION_UP &&
|
|
72
74
|
item.type === TouchableOpacity
|
|
73
75
|
);
|
|
74
76
|
const textElement = instance.find(
|
|
75
77
|
(item) =>
|
|
76
|
-
item.props.
|
|
77
|
-
|
|
78
|
+
item.props.accessibilityLabel ===
|
|
79
|
+
AccessibilityLabel.NUMBER_UP_DOWN_ACTION_TEXT && item.type === Text
|
|
78
80
|
);
|
|
79
81
|
act(() => {
|
|
80
82
|
touchableOpacity.props.onPress();
|
|
@@ -89,7 +91,8 @@ describe('Test NumberUpDownActionTemplate', () => {
|
|
|
89
91
|
const instance = tree.root;
|
|
90
92
|
const touchableOpacity = instance.find(
|
|
91
93
|
(item) =>
|
|
92
|
-
item.props.
|
|
94
|
+
item.props.accessibilityLabel ===
|
|
95
|
+
AccessibilityLabel.NUMBER_UP_DOWN_ACTION_DONE &&
|
|
93
96
|
item.type === TouchableOpacity
|
|
94
97
|
);
|
|
95
98
|
act(() => {
|
|
@@ -6,7 +6,7 @@ import OptionsDropdownActionTemplate from '../OptionsDropdownActionTemplate';
|
|
|
6
6
|
import { RadioCircle } from '../..';
|
|
7
7
|
|
|
8
8
|
import { TouchableOpacity } from 'react-native';
|
|
9
|
-
import {
|
|
9
|
+
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
10
10
|
|
|
11
11
|
jest.mock('react', () => {
|
|
12
12
|
return {
|
|
@@ -82,7 +82,8 @@ describe('Test OptionsDropdownActionTemplate', () => {
|
|
|
82
82
|
const instance = tree.root;
|
|
83
83
|
const touchOpacity = instance.findAll(
|
|
84
84
|
(item) =>
|
|
85
|
-
item.props.
|
|
85
|
+
item.props.accessibilityLabel ===
|
|
86
|
+
AccessibilityLabel.OPTIONS_DROPDOWN_ACTION_CHOOSING_ITEM &&
|
|
86
87
|
item.type === TouchableOpacity
|
|
87
88
|
);
|
|
88
89
|
expect(touchOpacity).toHaveLength(7);
|
|
@@ -95,7 +96,8 @@ describe('Test OptionsDropdownActionTemplate', () => {
|
|
|
95
96
|
const instance = tree.root;
|
|
96
97
|
const touchOpacity = instance.findAll(
|
|
97
98
|
(item) =>
|
|
98
|
-
item.props.
|
|
99
|
+
item.props.accessibilityLabel ===
|
|
100
|
+
AccessibilityLabel.OPTIONS_DROPDOWN_ACTION_CHOOSING_ITEM &&
|
|
99
101
|
item.type === TouchableOpacity
|
|
100
102
|
);
|
|
101
103
|
const radioCircle = instance.findAllByType(RadioCircle);
|
|
@@ -113,12 +115,14 @@ describe('Test OptionsDropdownActionTemplate', () => {
|
|
|
113
115
|
const instance = tree.root;
|
|
114
116
|
const selectOptions = instance.findAll(
|
|
115
117
|
(item) =>
|
|
116
|
-
item.props.
|
|
118
|
+
item.props.accessibilityLabel ===
|
|
119
|
+
AccessibilityLabel.OPTIONS_DROPDOWN_ACTION_CHOOSING_ITEM &&
|
|
117
120
|
item.type === TouchableOpacity
|
|
118
121
|
);
|
|
119
122
|
const touchOpacity = instance.find(
|
|
120
123
|
(item) =>
|
|
121
|
-
item.props.
|
|
124
|
+
item.props.accessibilityLabel ===
|
|
125
|
+
AccessibilityLabel.OPTIONS_DROPDOWN_ACTION_DONE &&
|
|
122
126
|
item.type === TouchableOpacity
|
|
123
127
|
);
|
|
124
128
|
|
|
@@ -5,7 +5,7 @@ import { mockSCStore } from '../../../context/mockStore';
|
|
|
5
5
|
import StatesGridActionTemplate from '../StatesGridActionTemplate';
|
|
6
6
|
|
|
7
7
|
import { TouchableOpacity } from 'react-native';
|
|
8
|
-
import {
|
|
8
|
+
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
9
9
|
|
|
10
10
|
jest.mock('react', () => {
|
|
11
11
|
return {
|
|
@@ -71,7 +71,8 @@ describe('Test StatesGridActionTempalte', () => {
|
|
|
71
71
|
const instance = tree.root;
|
|
72
72
|
const touchOpacity = instance.findAll(
|
|
73
73
|
(item) =>
|
|
74
|
-
item.props.
|
|
74
|
+
item.props.accessibilityLabel ===
|
|
75
|
+
AccessibilityLabel.STATES_GRID_ACTION_GRID_ITEM &&
|
|
75
76
|
item.type === TouchableOpacity
|
|
76
77
|
);
|
|
77
78
|
expect(touchOpacity).toHaveLength(4);
|
|
@@ -84,7 +85,8 @@ describe('Test StatesGridActionTempalte', () => {
|
|
|
84
85
|
const instance = tree.root;
|
|
85
86
|
const touchOpacity = instance.findAll(
|
|
86
87
|
(item) =>
|
|
87
|
-
item.props.
|
|
88
|
+
item.props.accessibilityLabel ===
|
|
89
|
+
AccessibilityLabel.STATES_GRID_ACTION_GRID_ITEM &&
|
|
88
90
|
item.type === TouchableOpacity
|
|
89
91
|
);
|
|
90
92
|
expect(touchOpacity).toHaveLength(4);
|
|
@@ -6,21 +6,11 @@ import { Action } from '../../context/actionType';
|
|
|
6
6
|
const PopoverComponent = (props) => {
|
|
7
7
|
const { setAction } = useContext(SCContext);
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
setAction(Action.SET_POPOVER_ANIMATING, true);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const onCloseComplete = () => {
|
|
9
|
+
const _onCloseComplete = () => {
|
|
14
10
|
setAction(Action.SET_POPOVER_ANIMATING, false);
|
|
15
11
|
};
|
|
16
12
|
|
|
17
|
-
return
|
|
18
|
-
<Popover
|
|
19
|
-
onCloseStart={onCloseStart}
|
|
20
|
-
onCloseComplete={onCloseComplete}
|
|
21
|
-
{...props}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
13
|
+
return <Popover onCloseComplete={_onCloseComplete} {...props} />;
|
|
24
14
|
};
|
|
25
15
|
|
|
26
16
|
export default PopoverComponent;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { create } from 'react-test-renderer';
|
|
3
3
|
import { act } from 'react-test-renderer';
|
|
4
4
|
import PreventAccess from '..';
|
|
5
|
-
import {
|
|
5
|
+
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
6
6
|
import { SCProvider } from '../../../context';
|
|
7
7
|
import { mockSCStore } from '../../../context/mockStore';
|
|
8
8
|
import Text from '../../Text';
|
|
@@ -43,10 +43,12 @@ describe('Test PreventAccess.test', () => {
|
|
|
43
43
|
const text = instance.findAllByType(Text);
|
|
44
44
|
expect(text).toHaveLength(5);
|
|
45
45
|
const button1 = instance.find(
|
|
46
|
-
(el) =>
|
|
46
|
+
(el) =>
|
|
47
|
+
el.props.accessibilityLabel === AccessibilityLabel.BUTTON_PREVENT_ACCESS
|
|
47
48
|
);
|
|
48
49
|
const button2 = instance.find(
|
|
49
|
-
(el) =>
|
|
50
|
+
(el) =>
|
|
51
|
+
el.props.accessibilityLabel === AccessibilityLabel.TEXT_PREVENT_ACCESS
|
|
50
52
|
);
|
|
51
53
|
act(() => {
|
|
52
54
|
button1.props.onBackButtonPress();
|
|
@@ -7,7 +7,7 @@ import t from '../../hooks/Common/useTranslations';
|
|
|
7
7
|
import Text from '../Text';
|
|
8
8
|
import { Colors } from '../../configs';
|
|
9
9
|
import { styles } from './styles';
|
|
10
|
-
import {
|
|
10
|
+
import { AccessibilityLabel } from '../../configs/Constants';
|
|
11
11
|
|
|
12
12
|
const PreventAccess = memo(({ headerBodyText, visible, hidePreventAccess }) => {
|
|
13
13
|
const { goBack } = useNavigation();
|
|
@@ -38,7 +38,7 @@ const PreventAccess = memo(({ headerBodyText, visible, hidePreventAccess }) => {
|
|
|
38
38
|
transparent={true}
|
|
39
39
|
onBackButtonPress={handleBackPress}
|
|
40
40
|
style={styles.container}
|
|
41
|
-
|
|
41
|
+
accessibilityLabel={AccessibilityLabel.BUTTON_PREVENT_ACCESS}
|
|
42
42
|
>
|
|
43
43
|
<View style={styles.popoverStyle}>
|
|
44
44
|
<View style={styles.actionTextWrap}>
|
|
@@ -51,7 +51,7 @@ const PreventAccess = memo(({ headerBodyText, visible, hidePreventAccess }) => {
|
|
|
51
51
|
</View>
|
|
52
52
|
<View style={styles.endOfText}>
|
|
53
53
|
<Text
|
|
54
|
-
|
|
54
|
+
accessibilityLabel={AccessibilityLabel.TEXT_PREVENT_ACCESS}
|
|
55
55
|
size={16}
|
|
56
56
|
bold
|
|
57
57
|
color={Colors.Primary}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderer, { act } from 'react-test-renderer';
|
|
3
|
-
import
|
|
3
|
+
import Processing from '../index';
|
|
4
4
|
import Text from '../../Text';
|
|
5
5
|
import { SCProvider } from '../../../context';
|
|
6
6
|
import { mockSCStore } from '../../../context/mockStore';
|
|
7
7
|
|
|
8
8
|
const wrapComponent = (route, isLoading, isConnect, isPercentConnect) => (
|
|
9
9
|
<SCProvider initState={mockSCStore({})}>
|
|
10
|
-
<
|
|
10
|
+
<Processing
|
|
11
11
|
route={route}
|
|
12
12
|
isLoading={isLoading}
|
|
13
13
|
isConnect={isConnect}
|
|
14
14
|
isPercentConnect={isPercentConnect}
|
|
15
|
+
onReady={() => {}}
|
|
15
16
|
/>
|
|
16
17
|
</SCProvider>
|
|
17
18
|
);
|
|
18
|
-
describe('Test
|
|
19
|
+
describe('Test Processing', () => {
|
|
19
20
|
let tree;
|
|
20
21
|
|
|
21
|
-
test('create
|
|
22
|
+
test('create Processing', () => {
|
|
22
23
|
act(() => {
|
|
23
24
|
tree = renderer.create(wrapComponent());
|
|
24
25
|
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import * as Progress from 'react-native-progress';
|
|
4
|
+
import Text from '../Text';
|
|
5
|
+
import { Colors, Constants } from '../../configs';
|
|
6
|
+
import styles from './styles';
|
|
7
|
+
import { HeaderCustom } from '../Header';
|
|
8
|
+
import { getPusher } from '../../utils/Pusher';
|
|
9
|
+
import uuid from 'uuid';
|
|
10
|
+
|
|
11
|
+
const Processing = ({ title, fail, initState, complete, onReady }) => {
|
|
12
|
+
const channelName = useMemo(() => {
|
|
13
|
+
return 'cache-' + uuid.v4();
|
|
14
|
+
}, []);
|
|
15
|
+
|
|
16
|
+
const [state, setState] = useState(initState);
|
|
17
|
+
const [percent, setPercent] = useState(0);
|
|
18
|
+
|
|
19
|
+
const processMessage = useCallback(
|
|
20
|
+
(
|
|
21
|
+
channel,
|
|
22
|
+
{
|
|
23
|
+
percent: newPercent,
|
|
24
|
+
state: newState,
|
|
25
|
+
success: isSuccess,
|
|
26
|
+
fail: isFail,
|
|
27
|
+
data,
|
|
28
|
+
}
|
|
29
|
+
) => {
|
|
30
|
+
if (isSuccess) {
|
|
31
|
+
channel.unbind('progress');
|
|
32
|
+
setPercent(1);
|
|
33
|
+
complete(data);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (isFail) {
|
|
37
|
+
channel.unbind('progress');
|
|
38
|
+
fail(data?.message);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
setPercent(newPercent);
|
|
42
|
+
setState(newState);
|
|
43
|
+
},
|
|
44
|
+
[complete, fail]
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
const channel = getPusher().subscribe(channelName);
|
|
49
|
+
channel.bind('progress', (message) => {
|
|
50
|
+
processMessage(channel, message);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
return () => {
|
|
54
|
+
getPusher().unsubscribe(channelName);
|
|
55
|
+
};
|
|
56
|
+
}, [channelName, complete, fail, processMessage]);
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
onReady(channelName);
|
|
60
|
+
}, [onReady, channelName]);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<View style={styles.wrap}>
|
|
64
|
+
<View style={styles.screen}>
|
|
65
|
+
<HeaderCustom title={title} isShowSeparator />
|
|
66
|
+
<View style={styles.body}>
|
|
67
|
+
<View style={styles.connecting}>
|
|
68
|
+
<Text type="H4" bold>
|
|
69
|
+
{state}
|
|
70
|
+
</Text>
|
|
71
|
+
</View>
|
|
72
|
+
<View style={styles.percentLoad}>
|
|
73
|
+
<Progress.Bar
|
|
74
|
+
progress={percent}
|
|
75
|
+
animated={true}
|
|
76
|
+
color={Colors.Primary}
|
|
77
|
+
indeterminateAnimationDuration={1000}
|
|
78
|
+
height={7}
|
|
79
|
+
width={Constants.width - 80}
|
|
80
|
+
useNativeDriver={true}
|
|
81
|
+
/>
|
|
82
|
+
<Text style={styles.textPercentLoad}>{`${parseInt(
|
|
83
|
+
percent * 100,
|
|
84
|
+
10
|
|
85
|
+
)}%`}</Text>
|
|
86
|
+
</View>
|
|
87
|
+
</View>
|
|
88
|
+
</View>
|
|
89
|
+
</View>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export default Processing;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
-
import { Constants } from '../../configs';
|
|
2
|
+
import { Colors, Constants } from '../../configs';
|
|
3
|
+
import { getStatusBarHeight } from 'react-native-iphone-x-helper';
|
|
3
4
|
|
|
4
5
|
export default StyleSheet.create({
|
|
6
|
+
wrap: {
|
|
7
|
+
paddingTop: getStatusBarHeight(true),
|
|
8
|
+
backgroundColor: Colors.White,
|
|
9
|
+
width: '100%',
|
|
10
|
+
height: '100%',
|
|
11
|
+
justifyContent: 'space-between',
|
|
12
|
+
},
|
|
5
13
|
screen: {
|
|
6
14
|
flex: 1,
|
|
7
15
|
width: '100%',
|