@eohjsc/react-native-smart-city 0.2.86 → 0.2.87

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.
Files changed (74) hide show
  1. package/assets/images/brightnessBlack.svg +12 -0
  2. package/index.js +4 -0
  3. package/package.json +1 -1
  4. package/src/Images/SmartIr/AC.svg +14 -0
  5. package/src/Images/SmartIr/DIY.svg +3 -0
  6. package/src/Images/SmartIr/Fan.svg +10 -0
  7. package/src/Images/SmartIr/Fridge.svg +5 -0
  8. package/src/Images/SmartIr/TV.svg +10 -0
  9. package/src/Images/SmartIr/WM.svg +11 -0
  10. package/src/Images/SmartIr/index.js +7 -0
  11. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/AutoLockStyles.js +40 -0
  12. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +65 -0
  13. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapperStyles.js +43 -0
  14. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +48 -0
  15. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/index.js +57 -0
  16. package/src/commons/ActionGroup/{OnOffSmartLock.js → OnOffSmartLock/OnOffSmartLock.js} +5 -5
  17. package/src/commons/ActionGroup/{OnOffSmartLockStyle.js → OnOffSmartLock/OnOffSmartLockStyle.js} +1 -1
  18. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode.js +48 -0
  19. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscodeStyles.js +42 -0
  20. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/PasscodeListStyles.js +49 -0
  21. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +66 -0
  22. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +96 -0
  23. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/SetupGeneratePasscodeStyles.js +98 -0
  24. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +62 -0
  25. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/index.js +249 -0
  26. package/src/commons/ActionGroup/OnOffTemplate/index.js +4 -2
  27. package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +2 -1
  28. package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +188 -186
  29. package/src/commons/ActionGroup/StatesGridActionTemplate.js +2 -1
  30. package/src/commons/ActionGroup/index.js +1 -1
  31. package/src/commons/Device/DisconnectedView.js +7 -1
  32. package/src/commons/Device/LinearChart.js +3 -40
  33. package/src/commons/Device/__test__/DisconnectedView.test.js +13 -2
  34. package/src/commons/RowItem/index.js +12 -7
  35. package/src/commons/WheelDateTimePicker/index.js +18 -4
  36. package/src/configs/API.js +1 -1
  37. package/src/configs/Colors.js +1 -0
  38. package/src/configs/Constants.js +11 -0
  39. package/src/context/mockStore.ts +1 -0
  40. package/src/iot/RemoteControl/Bluetooth.js +3 -3
  41. package/src/navigations/SmartIrStack.js +31 -0
  42. package/src/navigations/SmartLockStack.js +51 -0
  43. package/src/navigations/UnitStack.js +12 -3
  44. package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +1 -1
  45. package/src/screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning.js +77 -55
  46. package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +141 -27
  47. package/src/screens/AddNewGateway/PlugAndPlay/__test__/ConnectWifiWarning.test.js +58 -0
  48. package/src/screens/AddNewGateway/PlugAndPlay/__test__/GatewayWifiList.test.js +26 -2
  49. package/src/screens/Device/components/SensorConnectStatusViewHeader.js +13 -2
  50. package/src/screens/Device/detail.js +49 -10
  51. package/src/screens/Device/hooks/useDisconnectedDevice.js +21 -5
  52. package/src/screens/GuestInfo/components/AccessScheduleItem.js +9 -2
  53. package/src/screens/GuestInfo/components/RecurringDetail.js +3 -2
  54. package/src/screens/GuestInfo/components/TemporaryDetail.js +3 -2
  55. package/src/screens/GuestInfo/styles/AccessScheduleItemStyles.js +3 -0
  56. package/src/screens/Notification/__test__/NotificationItem.test.js +1 -0
  57. package/src/screens/Notification/components/NotificationItem.js +16 -0
  58. package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +54 -0
  59. package/src/screens/SmartIr/__test__/SelectBrand.test.js +74 -0
  60. package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +64 -0
  61. package/src/screens/SmartIr/__test__/SmartIr.test.js +1 -0
  62. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +86 -0
  63. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByTypeStyles.js +76 -0
  64. package/src/screens/SmartIr/components/SelectBrand.js +61 -0
  65. package/src/screens/SmartIr/components/SelectBrandStyles.js +14 -0
  66. package/src/screens/SmartIr/components/SelectDeviceType.js +96 -0
  67. package/src/screens/SmartIr/components/SelectDeviceTypeStyles.js +30 -0
  68. package/src/screens/SmartIr/index.js +8 -3
  69. package/src/screens/Unit/Detail.js +7 -3
  70. package/src/screens/Unit/components/MyUnitDevice/index.js +2 -4
  71. package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +38 -9
  72. package/src/utils/I18n/translations/en.json +24 -1
  73. package/src/utils/I18n/translations/vi.json +24 -1
  74. package/src/utils/Route/index.js +9 -1
@@ -22,193 +22,195 @@ import {
22
22
  Netflix,
23
23
  } from './component/Icon';
24
24
 
25
- const SmartTiviActionTemplate = memo(({ actionGroup, doAction }) => {
26
- const t = useTranslations();
27
- const FakeDataChannel = [
28
- {
29
- id: 1,
30
- icon: 'disney',
31
- link: '...',
32
- },
33
- {
34
- id: 2,
35
- icon: 'youtube',
36
- link: '...',
37
- },
38
- {
39
- id: 3,
40
- icon: 'netflix',
41
- link: '...',
42
- },
43
- {
44
- id: 4,
45
- icon: 'spotify',
46
- link: '...',
47
- },
48
- ];
49
- const onPressOnOff = useCallback(() => {
50
- return Alert.alert(t('feature_under_development'));
51
- }, [t]);
52
- const onPressExit = useCallback(() => {
53
- return Alert.alert(t('feature_under_development'));
54
- }, [t]);
55
- const onPressVolumeUp = useCallback(() => {
56
- return Alert.alert(t('feature_under_development'));
57
- }, [t]);
58
- const onPressVolumeDown = useCallback(() => {
59
- return Alert.alert(t('feature_under_development'));
60
- }, [t]);
61
- const onPressChUp = useCallback(() => {
62
- return Alert.alert(t('feature_under_development'));
63
- }, [t]);
64
- const onPressChDown = useCallback(() => {
65
- return Alert.alert(t('feature_under_development'));
66
- }, [t]);
67
- const onPressUp = useCallback(() => {
68
- return Alert.alert(t('feature_under_development'));
69
- }, [t]);
70
- const onPressDown = useCallback(() => {
71
- return Alert.alert(t('feature_under_development'));
72
- }, [t]);
73
- const onPressLeft = useCallback(() => {
74
- return Alert.alert(t('feature_under_development'));
75
- }, [t]);
76
- const onPressRight = useCallback(() => {
77
- return Alert.alert(t('feature_under_development'));
78
- }, [t]);
79
- const onPressOk = useCallback(() => {
80
- return Alert.alert(t('feature_under_development'));
81
- }, [t]);
82
- const onPressPrev = useCallback(() => {
83
- return Alert.alert(t('feature_under_development'));
84
- }, [t]);
85
- const onPressStop = useCallback(() => {
86
- return Alert.alert(t('feature_under_development'));
87
- }, [t]);
88
- const onPressNext = useCallback(() => {
89
- return Alert.alert(t('feature_under_development'));
90
- }, [t]);
91
- const onPressHome = useCallback(() => {
92
- return Alert.alert(t('feature_under_development'));
93
- }, [t]);
94
- const onPressBack = useCallback(() => {
95
- return Alert.alert(t('feature_under_development'));
96
- }, [t]);
97
- const onPressChannel = useCallback(
98
- (item) => {
99
- return Alert.alert(t('feature_under_development'));
100
- },
101
- [t]
102
- );
103
- const iconChannels = useCallback((item) => {
104
- switch (item.icon) {
105
- case 'disney':
106
- return <Disney style={styles.iconChannel} />;
107
- case 'youtube':
108
- return <Youtube style={styles.iconChannel} />;
109
- case 'netflix':
110
- return <Netflix style={styles.iconChannel} />;
111
- case 'spotify':
112
- return <Spotify style={styles.iconChannel} />;
113
- default:
114
- return <></>;
115
- }
116
- }, []);
117
- return (
118
- <>
119
- <ScrollView>
120
- <View style={styles.wrap}>
121
- <View style={styles.rowOnOff}>
122
- <CircleButton
123
- type="small"
124
- icon={
125
- <IconOutline
126
- name="poweroff"
127
- size={20}
128
- color={Colors.Gray6}
129
- style={styles.iconButton}
130
- />
131
- }
132
- onPress={onPressOnOff}
133
- testID={TESTID.SMART_TIVI_TEMPLATE.ONOFF_BUTTON}
134
- />
135
- <CircleButton
136
- type="small"
137
- icon={<SvgInput size={20} style={styles.iconButtonExit} />}
138
- onPress={onPressExit}
139
- testID={TESTID.SMART_TIVI_TEMPLATE.EXIT_BUTTON}
140
- />
141
- </View>
142
- <View style={styles.controlDevice}>
143
- <RectangleButton
144
- type="column"
145
- icon={<VolumeUp width={20} height={20} />}
146
- onPressUp={onPressVolumeUp}
147
- onPressDown={onPressVolumeDown}
148
- testID={TESTID.SMART_TIVI_TEMPLATE.VOLUME_BUTTON}
149
- />
150
- <CircleButton
151
- type="big"
152
- wrapStyle={styles.circleBigButton}
153
- onPressUp={onPressUp}
154
- onPressDown={onPressDown}
155
- onPressLeft={onPressLeft}
156
- onPressRight={onPressRight}
157
- onPressOk={onPressOk}
158
- testID={TESTID.SMART_TIVI_TEMPLATE.BIG_BUTTON}
159
- />
160
- <RectangleButton
161
- type="column"
162
- icon={
163
- <Text type="H4" color={Colors.Gray9} bold>
164
- CH
165
- </Text>
166
- }
167
- onPressUp={onPressChUp}
168
- onPressDown={onPressChDown}
169
- testID={TESTID.SMART_TIVI_TEMPLATE.CH_BUTTON}
170
- />
171
- </View>
172
- <View style={styles.controlPlay}>
173
- <ControlPlay
174
- onPressPrev={onPressPrev}
175
- onPressStop={onPressStop}
176
- onPressNext={onPressNext}
177
- testID={TESTID.SMART_TIVI_TEMPLATE.CONTROL_BUTTON}
178
- />
179
- </View>
180
- <View style={styles.controlHome}>
181
- <RectangleButton
182
- type="row"
183
- onPress={onPressHome}
184
- icon={<Home />}
185
- testID={TESTID.SMART_TIVI_TEMPLATE.HOME_BUTTON}
186
- />
187
- <RectangleButton
188
- type="row"
189
- onPress={onPressBack}
190
- icon={<KeyboardReturn />}
191
- testID={TESTID.SMART_TIVI_TEMPLATE.BACK_BUTTON}
192
- />
193
- </View>
194
- <View style={styles.channelTV}>
195
- {!!FakeDataChannel &&
196
- FakeDataChannel.map((item, index) => {
197
- return (
198
- <RectangleButton
199
- type="row"
200
- onPress={() => onPressChannel(item)}
201
- icon={iconChannels(item)}
202
- wrapStyle={styles.buttonChannel}
203
- index={index}
25
+ const SmartTiviActionTemplate = memo(
26
+ ({ actionGroup, doAction, scrollEnabled = true }) => {
27
+ const t = useTranslations();
28
+ const FakeDataChannel = [
29
+ {
30
+ id: 1,
31
+ icon: 'disney',
32
+ link: '...',
33
+ },
34
+ {
35
+ id: 2,
36
+ icon: 'youtube',
37
+ link: '...',
38
+ },
39
+ {
40
+ id: 3,
41
+ icon: 'netflix',
42
+ link: '...',
43
+ },
44
+ {
45
+ id: 4,
46
+ icon: 'spotify',
47
+ link: '...',
48
+ },
49
+ ];
50
+ const onPressOnOff = useCallback(() => {
51
+ return Alert.alert(t('feature_under_development'));
52
+ }, [t]);
53
+ const onPressExit = useCallback(() => {
54
+ return Alert.alert(t('feature_under_development'));
55
+ }, [t]);
56
+ const onPressVolumeUp = useCallback(() => {
57
+ return Alert.alert(t('feature_under_development'));
58
+ }, [t]);
59
+ const onPressVolumeDown = useCallback(() => {
60
+ return Alert.alert(t('feature_under_development'));
61
+ }, [t]);
62
+ const onPressChUp = useCallback(() => {
63
+ return Alert.alert(t('feature_under_development'));
64
+ }, [t]);
65
+ const onPressChDown = useCallback(() => {
66
+ return Alert.alert(t('feature_under_development'));
67
+ }, [t]);
68
+ const onPressUp = useCallback(() => {
69
+ return Alert.alert(t('feature_under_development'));
70
+ }, [t]);
71
+ const onPressDown = useCallback(() => {
72
+ return Alert.alert(t('feature_under_development'));
73
+ }, [t]);
74
+ const onPressLeft = useCallback(() => {
75
+ return Alert.alert(t('feature_under_development'));
76
+ }, [t]);
77
+ const onPressRight = useCallback(() => {
78
+ return Alert.alert(t('feature_under_development'));
79
+ }, [t]);
80
+ const onPressOk = useCallback(() => {
81
+ return Alert.alert(t('feature_under_development'));
82
+ }, [t]);
83
+ const onPressPrev = useCallback(() => {
84
+ return Alert.alert(t('feature_under_development'));
85
+ }, [t]);
86
+ const onPressStop = useCallback(() => {
87
+ return Alert.alert(t('feature_under_development'));
88
+ }, [t]);
89
+ const onPressNext = useCallback(() => {
90
+ return Alert.alert(t('feature_under_development'));
91
+ }, [t]);
92
+ const onPressHome = useCallback(() => {
93
+ return Alert.alert(t('feature_under_development'));
94
+ }, [t]);
95
+ const onPressBack = useCallback(() => {
96
+ return Alert.alert(t('feature_under_development'));
97
+ }, [t]);
98
+ const onPressChannel = useCallback(
99
+ (item) => {
100
+ return Alert.alert(t('feature_under_development'));
101
+ },
102
+ [t]
103
+ );
104
+ const iconChannels = useCallback((item) => {
105
+ switch (item.icon) {
106
+ case 'disney':
107
+ return <Disney style={styles.iconChannel} />;
108
+ case 'youtube':
109
+ return <Youtube style={styles.iconChannel} />;
110
+ case 'netflix':
111
+ return <Netflix style={styles.iconChannel} />;
112
+ case 'spotify':
113
+ return <Spotify style={styles.iconChannel} />;
114
+ default:
115
+ return <></>;
116
+ }
117
+ }, []);
118
+ return (
119
+ <>
120
+ <ScrollView scrollEnabled={scrollEnabled}>
121
+ <View style={styles.wrap}>
122
+ <View style={styles.rowOnOff}>
123
+ <CircleButton
124
+ type="small"
125
+ icon={
126
+ <IconOutline
127
+ name="poweroff"
128
+ size={20}
129
+ color={Colors.Gray6}
130
+ style={styles.iconButton}
204
131
  />
205
- );
206
- })}
132
+ }
133
+ onPress={onPressOnOff}
134
+ testID={TESTID.SMART_TIVI_TEMPLATE.ONOFF_BUTTON}
135
+ />
136
+ <CircleButton
137
+ type="small"
138
+ icon={<SvgInput size={20} style={styles.iconButtonExit} />}
139
+ onPress={onPressExit}
140
+ testID={TESTID.SMART_TIVI_TEMPLATE.EXIT_BUTTON}
141
+ />
142
+ </View>
143
+ <View style={styles.controlDevice}>
144
+ <RectangleButton
145
+ type="column"
146
+ icon={<VolumeUp width={20} height={20} />}
147
+ onPressUp={onPressVolumeUp}
148
+ onPressDown={onPressVolumeDown}
149
+ testID={TESTID.SMART_TIVI_TEMPLATE.VOLUME_BUTTON}
150
+ />
151
+ <CircleButton
152
+ type="big"
153
+ wrapStyle={styles.circleBigButton}
154
+ onPressUp={onPressUp}
155
+ onPressDown={onPressDown}
156
+ onPressLeft={onPressLeft}
157
+ onPressRight={onPressRight}
158
+ onPressOk={onPressOk}
159
+ testID={TESTID.SMART_TIVI_TEMPLATE.BIG_BUTTON}
160
+ />
161
+ <RectangleButton
162
+ type="column"
163
+ icon={
164
+ <Text type="H4" color={Colors.Gray9} bold>
165
+ CH
166
+ </Text>
167
+ }
168
+ onPressUp={onPressChUp}
169
+ onPressDown={onPressChDown}
170
+ testID={TESTID.SMART_TIVI_TEMPLATE.CH_BUTTON}
171
+ />
172
+ </View>
173
+ <View style={styles.controlPlay}>
174
+ <ControlPlay
175
+ onPressPrev={onPressPrev}
176
+ onPressStop={onPressStop}
177
+ onPressNext={onPressNext}
178
+ testID={TESTID.SMART_TIVI_TEMPLATE.CONTROL_BUTTON}
179
+ />
180
+ </View>
181
+ <View style={styles.controlHome}>
182
+ <RectangleButton
183
+ type="row"
184
+ onPress={onPressHome}
185
+ icon={<Home />}
186
+ testID={TESTID.SMART_TIVI_TEMPLATE.HOME_BUTTON}
187
+ />
188
+ <RectangleButton
189
+ type="row"
190
+ onPress={onPressBack}
191
+ icon={<KeyboardReturn />}
192
+ testID={TESTID.SMART_TIVI_TEMPLATE.BACK_BUTTON}
193
+ />
194
+ </View>
195
+ <View style={styles.channelTV}>
196
+ {!!FakeDataChannel &&
197
+ FakeDataChannel.map((item, index) => {
198
+ return (
199
+ <RectangleButton
200
+ type="row"
201
+ onPress={() => onPressChannel(item)}
202
+ icon={iconChannels(item)}
203
+ wrapStyle={styles.buttonChannel}
204
+ index={index}
205
+ />
206
+ );
207
+ })}
208
+ </View>
207
209
  </View>
208
- </View>
209
- </ScrollView>
210
- </>
211
- );
212
- });
210
+ </ScrollView>
211
+ </>
212
+ );
213
+ }
214
+ );
213
215
 
214
216
  export default SmartTiviActionTemplate;
@@ -49,9 +49,10 @@ const GridItem = ({ item, index, length, doAction, sensor, title }) => {
49
49
 
50
50
  const doActionAndWatchConfig = useCallback(
51
51
  (actionData) => {
52
- const actionName = `${
52
+ let actionName = `${
53
53
  sensor?.name
54
54
  } ${title?.toLowerCase()} ${text?.toLowerCase()}`;
55
+ actionName = actionName.replace(/\s+/g, ' ').trim();
55
56
  doAction(actionData, null, actionName);
56
57
  if (sensor?.is_managed_by_backend) {
57
58
  config && watchMultiConfigs([config]);
@@ -11,7 +11,7 @@ import TimerActionTemplate from './TimerActionTemplate';
11
11
  import CurtainButtonTemplate from './CurtainButtonTemplate';
12
12
  import SmartTiviActionTemplate from './SmartTiviActionTemplate/SmartTiviActionTemplate';
13
13
  import LightActionTemplate from './LightActionTemplate';
14
- import OnOffSmartLock from './OnOffSmartLock';
14
+ import OnOffSmartLock from './OnOffSmartLock/OnOffSmartLock';
15
15
 
16
16
  export const getActionComponent = (template) => {
17
17
  switch (template) {
@@ -42,7 +42,7 @@ const DisplayTextDisconnected = memo(({ type }) => {
42
42
  return <Text style={styles.redStatus}>{text}</Text>;
43
43
  });
44
44
 
45
- const DisconnectedView = memo(({ sensor, type }) => {
45
+ const DisconnectedView = memo(({ sensor, type, isDeviceHasBle }) => {
46
46
  const t = useTranslations();
47
47
  return (
48
48
  <View style={styles.statusContainer}>
@@ -74,6 +74,12 @@ const DisconnectedView = memo(({ sensor, type }) => {
74
74
  <CircleView size={6} backgroundColor={Colors.Gray8} />
75
75
  <Text style={styles.noticeText}>{t('check_the_wifi')}</Text>
76
76
  </View>
77
+ {isDeviceHasBle && (
78
+ <View style={styles.infoRow}>
79
+ <CircleView size={6} backgroundColor={Colors.Gray8} />
80
+ <Text style={styles.noticeText}>{t('check_the_ble')}</Text>
81
+ </View>
82
+ )}
77
83
  </View>
78
84
  </View>
79
85
  );
@@ -47,46 +47,9 @@ const chartOptions = {
47
47
  text: '',
48
48
  },
49
49
  labels: {
50
- formatter: function (value) {
51
- const time = new Date(this.value || value);
52
- let date = ('0' + time.getDate()).slice(-2);
53
- let month = ('0' + (time.getMonth() + 1)).slice(-2);
54
- return `${date}.${month}`;
55
- },
56
- },
57
- minRange: 3600 * 24 * 1000,
58
- tickInterval: 24 * 3600 * 1000,
59
- },
60
- plotOptions: {
61
- series: {
62
- events: {
63
- legendItemClick: function () {
64
- const { index, visible, chart } = this;
65
- const { series } = chart;
66
- series.forEach((serie, i) => {
67
- if (i !== index) {
68
- serie.visible ? serie.show() : serie.hide();
69
- }
70
- });
71
- const isHiding = (serie, i) => {
72
- if (i === index) {
73
- return visible;
74
- }
75
- return !serie.visible;
76
- };
77
- if (this.chart.series.every(isHiding)) {
78
- this.chart.yAxis[0].update({
79
- min: 0,
80
- max: 100,
81
- });
82
- } else {
83
- this.chart.yAxis[0].update({
84
- min: undefined,
85
- max: undefined,
86
- });
87
- }
88
- },
89
- },
50
+ align: 'center',
51
+ padding: 70,
52
+ format: '{value:%d.%m %H:%M}',
90
53
  },
91
54
  },
92
55
  };
@@ -5,9 +5,9 @@ import renderer, { act } from 'react-test-renderer';
5
5
  import { SCProvider } from '../../../context';
6
6
  import { mockSCStore } from '../../../context/mockStore';
7
7
 
8
- const wrapComponent = (sensor) => (
8
+ const wrapComponent = (sensor, isDeviceHasBle) => (
9
9
  <SCProvider initState={mockSCStore({})}>
10
- <DisconnectedView sensor={sensor} />
10
+ <DisconnectedView sensor={sensor} isDeviceHasBle={isDeviceHasBle} />
11
11
  </SCProvider>
12
12
  );
13
13
 
@@ -63,4 +63,15 @@ describe('Test DisconnectedView', () => {
63
63
  const Views = instance.findAllByType(View);
64
64
  expect(Views).toHaveLength(15);
65
65
  });
66
+
67
+ test('render DisconnectedView text check bluetooth', () => {
68
+ const isDeviceHasBle = true;
69
+ const sensor = { icon: 'test' };
70
+ act(() => {
71
+ tree = renderer.create(wrapComponent(sensor, isDeviceHasBle));
72
+ });
73
+ const instance = tree.root;
74
+ const Views = instance.findAllByType(View);
75
+ expect(Views).toHaveLength(17);
76
+ });
66
77
  });
@@ -21,7 +21,8 @@ export const RowItem = memo(
21
21
  type, //primary | disable | undefined
22
22
  leftIcon,
23
23
  text,
24
- subtext,
24
+ isShowSubText = true,
25
+ subtext = '',
25
26
  subtextColor = Colors.Gray6,
26
27
  rightComponent,
27
28
  onPress,
@@ -40,14 +41,18 @@ export const RowItem = memo(
40
41
  <View style={styles.wrapItem}>
41
42
  <TouchableOpacity onPress={onPress} disabled={type === 'disable'}>
42
43
  <View style={styles.Border}>
43
- <View style={styles.paddingLeft16}>
44
- <CircleView size={40} backgroundColor={circleColor} center>
45
- {leftIcon}
46
- </CircleView>
47
- </View>
44
+ {!!leftIcon && (
45
+ <View style={styles.paddingLeft16}>
46
+ <CircleView size={40} backgroundColor={circleColor} center>
47
+ {leftIcon}
48
+ </CircleView>
49
+ </View>
50
+ )}
48
51
  <View style={styles.columeFlex}>
49
52
  <Text style={styles.titleName}> {text}</Text>
50
- <Text style={styles.status}> {subtext}</Text>
53
+ {!!isShowSubText && (
54
+ <Text style={styles.status}> {subtext}</Text>
55
+ )}
51
56
  </View>
52
57
  {!!rightComponent && (
53
58
  <View style={styles.endFlex}>{rightComponent}</View>
@@ -92,10 +92,14 @@ const WheelDateTimePicker = ({
92
92
  }, [dateSelected, hourSelected, minuteSelected, onCancel, onPicked]);
93
93
 
94
94
  const title = useMemo(() => {
95
- if (mode === 'time') {
96
- return t('set_time');
95
+ switch (mode) {
96
+ case 'time':
97
+ return t('set_time');
98
+ case 'datetime':
99
+ return t('set_date_time');
100
+ default:
101
+ return t('minutes');
97
102
  }
98
- return t('set_date_time');
99
103
  }, [t, mode]);
100
104
 
101
105
  return (
@@ -125,7 +129,7 @@ const WheelDateTimePicker = ({
125
129
  style={styles.picker}
126
130
  />
127
131
  </View>
128
- ) : (
132
+ ) : mode === 'datetime' ? (
129
133
  <View style={styles.container}>
130
134
  <Picker
131
135
  dataSource={dateData}
@@ -153,6 +157,16 @@ const WheelDateTimePicker = ({
153
157
  style={styles.picker}
154
158
  />
155
159
  </View>
160
+ ) : (
161
+ <View style={styles.container}>
162
+ <Picker
163
+ dataSource={minuteData}
164
+ selectedIndex={indexInitialMinute}
165
+ onValueChange={onValueMinuteChange}
166
+ keyPrefix="minute"
167
+ style={styles.picker}
168
+ />
169
+ </View>
156
170
  )}
157
171
  <ViewButtonBottom
158
172
  leftTitle={t('cancel')}
@@ -184,7 +184,7 @@ const API = {
184
184
  VCONNEX: {
185
185
  AUTHORIZE: (client_id, redirect_uri, user_id, unit_id, station_id) =>
186
186
  // eslint-disable-next-line max-len
187
- `https://partner-api-stg.vconnex.vn/oauth/authorize?client_id=${client_id}&redirect_uri=${redirect_uri}&response_type=code&scope=SYNCH&scope=CONTROL&scope=QUERY&state=${user_id}@${unit_id}@${station_id}`,
187
+ `https://partner-api.vconnex.vn/oauth/authorize?client_id=${client_id}&redirect_uri=${redirect_uri}&response_type=code&scope=SYNCH&scope=CONTROL&scope=QUERY&state=${user_id}@${unit_id}@${station_id}`,
188
188
  },
189
189
  },
190
190
  NOTIFICATION: {
@@ -110,6 +110,7 @@ export const Colors = {
110
110
  Blue10: '#1890FF',
111
111
  Blue11: '#096DD9',
112
112
  Blue12: '#0050B3',
113
+ Blue13: '#E2F0F8',
113
114
 
114
115
  //Range Volcano:
115
116
  Volcano3: '#FFBB96',
@@ -636,6 +636,16 @@ export const TESTID = {
636
636
 
637
637
  // MoveToAnotherSubUnit
638
638
  ROW_SUB_UNIT: 'ROW_SUB_UNIT',
639
+
640
+ //SetupGeneratePasscode
641
+ GENERATE_PASSCODE_CHOOSE_USER: 'GENERATE_PASSCODE_CHOOSE_USER',
642
+ GENERATE_PASSCODE_SET_TIME: 'GENERATE_PASSCODE_SET_TIME',
643
+ GENERATE_PASSCODE_SET_DURATION: 'GENERATE_PASSCODE_SET_DURATION',
644
+
645
+ //AutoLock
646
+ AUTO_LOCK_BUTTON_ENABLE: 'AUTO_LOCK_BUTTON_ENABLE',
647
+ AUTO_LOCK_BUTTON_INSTANT: 'AUTO_LOCK_BUTTON_INSTANT',
648
+ AUTO_LOCK_BUTTON_RELOCK_TIMING: 'AUTO_LOCK_BUTTON_RELOCK_TIMING',
639
649
  };
640
650
 
641
651
  export const NOTIFICATION_TYPES = {
@@ -682,4 +692,5 @@ export const SENSOR_TYPE = {
682
692
  SMOKE: 'smoke',
683
693
  FIRE: 'fire',
684
694
  SOS: 'sos',
695
+ FILTER_WATER: 'filter_water',
685
696
  };
@@ -49,6 +49,7 @@ export const mockSCStore = (data: ContextData): ContextData => {
49
49
  listAction: [...mockDataStore.listAction, ...(data?.listAction || [])],
50
50
  app: {
51
51
  isFirstOpenCamera: true,
52
+ isConnectWifiGateway: false,
52
53
  },
53
54
  };
54
55
  };
@@ -185,9 +185,9 @@ export const sendDataOverBluetooth = async (
185
185
  return result;
186
186
  }
187
187
 
188
- // eslint-disable-next-line no-shadow
189
- setTimeout(async (device) => {
190
- await device.cancelConnection();
188
+ const timeout = setTimeout(() => {
189
+ device.cancelConnection();
190
+ clearTimeout(timeout);
191
191
  }, responseTime);
192
192
  return result;
193
193
  };