@eohjsc/react-native-smart-city 0.2.85 → 0.2.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/images/Device/button-lock.svg +3 -0
- package/assets/images/Device/button-unlock.svg +3 -0
- package/package.json +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock.js +48 -0
- package/src/commons/ActionGroup/OnOffSmartLockStyle.js +51 -0
- package/src/commons/ActionGroup/index.js +3 -0
- package/src/commons/ConnectingProcess/index.js +5 -2
- package/src/commons/Device/ItemDevice.js +8 -3
- package/src/commons/MediaPlayer/__test__/index.test.js +45 -0
- package/src/commons/SubUnit/ShortDetail.js +10 -22
- package/src/commons/SubUnit/__test__/ShortDetail.test.js +57 -48
- package/src/configs/API.js +2 -2
- package/src/configs/Constants.js +13 -0
- package/src/screens/ActivityLog/hooks/index.js +18 -4
- package/src/screens/ActivityLog/index.js +3 -0
- package/src/screens/AddCommon/SelectSubUnit.js +1 -0
- package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +1 -1
- package/src/screens/AddNewAction/SelectSensorDevices.js +4 -2
- package/src/screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning.js +10 -2
- package/src/screens/AddNewGateway/PlugAndPlay/FirstWarning.js +4 -2
- package/src/screens/AddNewOneTap/index.js +32 -17
- package/src/screens/Automate/index.js +2 -2
- package/src/screens/Device/EditDevice/index.js +5 -3
- package/src/screens/Device/components/SensorDisplayItem.js +3 -0
- package/src/screens/Device/detail.js +1 -0
- package/src/screens/Notification/__test__/NotificationItem.test.js +15 -3
- package/src/screens/Notification/components/NotificationItem.js +52 -8
- package/src/screens/ScanChipQR/__test__/ScanChipQR.test.js +1 -0
- package/src/screens/ScanChipQR/hooks/index.js +90 -44
- package/src/screens/ScriptDetail/index.js +1 -6
- package/src/screens/SelectUnit/index.js +1 -0
- package/src/screens/SharedUnit/index.js +1 -1
- package/src/screens/SmartIr/__test__/SmartIr.test.js +61 -0
- package/src/screens/SmartIr/index.js +23 -0
- package/src/screens/SmartIr/styles.js +14 -0
- package/src/screens/Unit/AddMenu.js +4 -1
- package/src/screens/Unit/Detail.js +1 -1
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/__test__/index.test.js +32 -1
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/index.js +1 -1
- package/src/utils/I18n/translations/en.json +9 -2
- package/src/utils/I18n/translations/vi.json +9 -2
- package/src/utils/Route/index.js +1 -0
|
@@ -4,6 +4,17 @@ import ConfigHistoryChart from '../';
|
|
|
4
4
|
import { SCProvider } from '../../../../../context';
|
|
5
5
|
import { mockSCStore } from '../../../../../context/mockStore';
|
|
6
6
|
import HistoryChart from '../../../../../commons/Device/HistoryChart';
|
|
7
|
+
import axios from 'axios';
|
|
8
|
+
import moment from 'moment';
|
|
9
|
+
|
|
10
|
+
jest.mock('react', () => {
|
|
11
|
+
return {
|
|
12
|
+
...jest.requireActual('react'),
|
|
13
|
+
memo: (x) => x,
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
jest.mock('axios');
|
|
7
18
|
|
|
8
19
|
const wrapComponent = (configs = []) => (
|
|
9
20
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -18,7 +29,7 @@ describe('Test HistoryChart', () => {
|
|
|
18
29
|
jest.useFakeTimers();
|
|
19
30
|
});
|
|
20
31
|
|
|
21
|
-
it('Test render', async () => {
|
|
32
|
+
it('Test render null', async () => {
|
|
22
33
|
await act(() => {
|
|
23
34
|
tree = create(wrapComponent());
|
|
24
35
|
});
|
|
@@ -26,4 +37,24 @@ describe('Test HistoryChart', () => {
|
|
|
26
37
|
const HistoryCharts = instance.findAllByType(HistoryChart);
|
|
27
38
|
expect(HistoryCharts).toHaveLength(0);
|
|
28
39
|
});
|
|
40
|
+
|
|
41
|
+
it('Test render chart', async () => {
|
|
42
|
+
const response = {
|
|
43
|
+
status: 200,
|
|
44
|
+
data: [
|
|
45
|
+
{
|
|
46
|
+
config: 1,
|
|
47
|
+
data: [{ x: moment(), y: 10 }],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
axios.get.mockImplementation(async () => response);
|
|
52
|
+
const configs = [{ id: 1 }];
|
|
53
|
+
await act(async () => {
|
|
54
|
+
tree = await create(wrapComponent(configs));
|
|
55
|
+
});
|
|
56
|
+
const instance = tree.root;
|
|
57
|
+
const HistoryCharts = instance.findAllByType(HistoryChart);
|
|
58
|
+
expect(HistoryCharts).toHaveLength(1);
|
|
59
|
+
});
|
|
29
60
|
});
|
|
@@ -311,6 +311,7 @@
|
|
|
311
311
|
"your_location": "Your location",
|
|
312
312
|
"choose_on_map": "Choose on map",
|
|
313
313
|
"plan_and_zoom_to_adjust": "Plan and zoom to adjust",
|
|
314
|
+
"add_remote_control": "Add remote control",
|
|
314
315
|
"manage_sub_unit": "Manage sub-unit",
|
|
315
316
|
"remove_sub_unit": "Remove sub-unit",
|
|
316
317
|
"text_ble_is_powered_on": "Bluetooth is powered on",
|
|
@@ -680,6 +681,7 @@
|
|
|
680
681
|
"text_notification_content_turbility_high": "The Turbility at **%{unit_name}** is **%{status}**. Water is not safe to drink.",
|
|
681
682
|
"text_notification_content_smoke": "Smoke appears in **%{unit_name}**. Please check your home and call the rescue team if there is a fire.",
|
|
682
683
|
"text_notification_content_fire": "There is a fire at **%{unit_name}**, Please move out of the house immediately and call the rescue team.",
|
|
684
|
+
"text_notification_content_active_sos": "SOS button is activating at **%{unit_name}**, Please check it NOW.",
|
|
683
685
|
"text_notification_content_remove_unit_to_owner": "Unit **%{unit_name}** has been removed successfully.",
|
|
684
686
|
"text_notification_content_remove_unit_to_member": "Unit **%{unit_name}** has been removed by **%{unit_owner_name}**. You cannot access to this unit anymore.",
|
|
685
687
|
"text_notification_content_remove_member": "You were remove from **%{unit_name}** by **%{unit_owner_name}**. You cannot access to this unit anymore.",
|
|
@@ -687,6 +689,8 @@
|
|
|
687
689
|
"text_notification_content_rename_unit": "Unit **%{old_unit_name}** has been renamed to **%{new_unit_name}** by **%{owner_name}**.",
|
|
688
690
|
"text_notification_content_divice_disconnect": "**%{device_name}** at **%{unit_name}**: **%{sub_unit_name}** has been disconnected. Please check and reconnect.",
|
|
689
691
|
"text_notification_content_rename_sub_unit": "Sub-unit **%{old_sub_unit_name}**: **%{unit_name}** has been renamed to **%{new_sub_unit_name}** by **%{unti_owner_name}**.",
|
|
692
|
+
"text_notification_content_remove_sub_unit": "Sub-unit **%{sub_unit_name}** has been removed from **%{unit_name}** by **%{unit_owner_name}**.",
|
|
693
|
+
"text_notification_content_remove_device": "Device **%{device_name}** has been removed from **%{unit_name}** by **%{unit_owner_name}**.",
|
|
690
694
|
"text_notification_content_update_address": "New address of **%{unit_name}** has been updated by **%{unit_owner_name}** to **%{unit_address}**.",
|
|
691
695
|
"this_spot_does_not_exsit": "This spot does not exist",
|
|
692
696
|
"please_scan_again_or_contact_the_parking_manager": "Please scan again or contact the parking manager",
|
|
@@ -895,7 +899,6 @@
|
|
|
895
899
|
"connecting_gateway_warning_1": "By continuing, EoH needs to connect to the device's wifi.",
|
|
896
900
|
"connecting_gateway_warning_2": "A message will appear asking you to connect.",
|
|
897
901
|
"remove_account": "Remove Account",
|
|
898
|
-
"text_sub_unit_not_have_device": "You don't have sub-unit with a device to control",
|
|
899
902
|
"brightness": "Brightness",
|
|
900
903
|
"tap_to_add_new_schedule": "Tap + to add new schedule",
|
|
901
904
|
"confirmation": "Confirmation",
|
|
@@ -915,5 +918,9 @@
|
|
|
915
918
|
"error_share_permission": "{text} {data} does not exist!",
|
|
916
919
|
"text_phone_share_permission": "The phone",
|
|
917
920
|
"text_email_share_permission": "Email",
|
|
918
|
-
"icon_unit": "Icon unit"
|
|
921
|
+
"icon_unit": "Icon unit",
|
|
922
|
+
"lock": "LOCK",
|
|
923
|
+
"unlock": "UNLOCK",
|
|
924
|
+
"door_is_open": "Door is open | unlocked",
|
|
925
|
+
"door_is_close": "Door is close | locked"
|
|
919
926
|
}
|
|
@@ -346,6 +346,7 @@
|
|
|
346
346
|
"your_location": "Vị trí của bạn",
|
|
347
347
|
"choose_on_map": "Chọn trên bản đồ",
|
|
348
348
|
"plan_and_zoom_to_adjust": "Di chuyển và phóng to để điều chỉnh",
|
|
349
|
+
"add_remote_control": "Thêm điều khiển từ xa",
|
|
349
350
|
"manage_sub_unit": "Quản lý khu vực",
|
|
350
351
|
"remove_sub_unit": "Xóa khu vực",
|
|
351
352
|
"text_ble_is_powered_on": "Bluetooth đã được mở",
|
|
@@ -688,6 +689,7 @@
|
|
|
688
689
|
"text_notification_content_turbility_high": "Độ đục của nước tại **%{unit_name}** đang ở mức **%{status}**. Nước không đảm bảo an toàn để uống.",
|
|
689
690
|
"text_notification_content_smoke": "Xuất hiện khói tại **%{unit_name}**. Vui lòng kiểm tra nhà của bạn và gọi cho đội cứu hộ nếu xảy ra hỏa hoạn.",
|
|
690
691
|
"text_notification_content_fire": "Có đám cháy tại **%{unit_name}**, Vui lòng di chuyển ra khỏi nhà ngay lập tức và gọi cho đội cứu hộ.",
|
|
692
|
+
"text_notification_content_active_sos": "Nút SOS đang kích hoạt tại **%{unit_name}**. Vui lòng kiểm tra nó NGAY BÂY GIỜ.",
|
|
691
693
|
"text_notification_content_remove_unit_to_owner": "Địa điểm **%{unit_name}** vừa được xoá thành công.",
|
|
692
694
|
"text_notification_content_remove_unit_to_member": "Địa điểm **%{unit_name}** vừa được xoá bởi **%{unit_owner_name}**. Bạn không thể truy cập vào địa điểm này được nữa.",
|
|
693
695
|
"text_notification_content_remove_member": "Bạn vừa được xoá khỏi **%{unit_name}** bởi **%{unit_owner_name}**. Bạn không thể truy cập vào địa điểm này được nữa.",
|
|
@@ -695,6 +697,8 @@
|
|
|
695
697
|
"text_notification_content_rename_unit": "Địa điểm **%{old_unit_name}** vừa được đổi tên thành **%{new_unit_name}** bởi **%{owner_name}**.",
|
|
696
698
|
"text_notification_content_divice_disconnect": "**%{device_name}** tại **%{unit_name}**: **%{sub_unit_name}** vừa bị mất kết nối. Vui lòng kiểm tra và kết nối lại.",
|
|
697
699
|
"text_notification_content_rename_sub_unit": "Khu vực **%{old_sub_unit_name}**: **%{unit_name}** vừa được đổi tên thành **%{new_sub_unit_name}** bởi **%{unti_owner_name}**.",
|
|
700
|
+
"text_notification_content_remove_sub_unit": "Khu vực **%{sub_unit_name}** vừa được xoá khỏi **%{unit_name}** bởi **%{unit_owner_name}**.",
|
|
701
|
+
"text_notification_content_remove_device": "Thiết bị **%{device_name}** vừa được xoá khỏi **%{unit_name}** bởi **%{unit_owner_name}**.",
|
|
698
702
|
"text_notification_content_update_address": "Địa chỉ mới của **%{unit_name}** vừa được cập nhật bởi **%{unit_owner_name}** thành **%{unit_address}**.",
|
|
699
703
|
"this_spot_does_not_exsit": "Vị trí đỗ này không tồn tại",
|
|
700
704
|
"please_scan_again_or_contact_the_parking_manager": "Vui lòng quét lại hoặc liên hệ với người quản lý bãi đậu xe",
|
|
@@ -705,7 +709,6 @@
|
|
|
705
709
|
"command_send_fail_googlehome": "Lệnh gởi thất bại đến google home",
|
|
706
710
|
"command_googlehome_ready": "Google Home kết nối thành công",
|
|
707
711
|
"command_googlehome_lost": "Google Home bị mất kết nối. Đang kết nối lại...",
|
|
708
|
-
"text_sub_unit_not_have_device": "Khu vực không có thiết bị để điều khiển",
|
|
709
712
|
"confirm": "Xác nhận",
|
|
710
713
|
"car_validate_warning": "Vui lòng nhập đúng định dạng biển số xe \nVD: %{example}",
|
|
711
714
|
"are_you_sure_this_resolved": "Bạn có chắc tình huống khẩn cấp này đã được xử lý xong? Các thành viên thuộc địa điểm này cũng sẽ nhận được thông báo.",
|
|
@@ -917,5 +920,9 @@
|
|
|
917
920
|
"error_share_permission": "{text} {data} không tồn tại!",
|
|
918
921
|
"text_phone_share_permission": "Số điện thoại",
|
|
919
922
|
"text_email_share_permission": "Email",
|
|
920
|
-
"icon_unit": "Ảnh đại diện địa điểm"
|
|
923
|
+
"icon_unit": "Ảnh đại diện địa điểm",
|
|
924
|
+
"lock": "KHÓA",
|
|
925
|
+
"unlock": "MỞ KHÓA",
|
|
926
|
+
"door_is_open": "Cửa mở | mở khóa",
|
|
927
|
+
"door_is_close": "Cửa đóng | bị khóa"
|
|
921
928
|
}
|
package/src/utils/Route/index.js
CHANGED