@iotready/nextjs-components-library 1.0.0-preview8 → 1.0.0-preview9
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.
@@ -76,15 +76,7 @@ const lineOptions = {
|
|
76
76
|
drawOnChartArea: false,
|
77
77
|
}
|
78
78
|
},
|
79
|
-
y: {
|
80
|
-
ticks: {
|
81
|
-
callback: function (value) {
|
82
|
-
if (Math.floor(value) === value) {
|
83
|
-
return value;
|
84
|
-
}
|
85
|
-
}
|
86
|
-
}
|
87
|
-
},
|
79
|
+
y: {},
|
88
80
|
},
|
89
81
|
};
|
90
82
|
const chartConfigByPeriod = {
|
@@ -321,9 +313,9 @@ const TrendChart = ({ deviceId, measures, enableExportData, enableDatePicker, ha
|
|
321
313
|
let paddedMin = null;
|
322
314
|
let paddedMax = null;
|
323
315
|
if (min !== null && max !== null) {
|
324
|
-
const diff =
|
325
|
-
paddedMin = min - diff;
|
326
|
-
paddedMax = max + diff;
|
316
|
+
const diff = ((max - min) * 0.2) < 0.1 ? 0.1 : (max - min) * 0.2;
|
317
|
+
paddedMin = Math.floor((min - diff) * 10) / 10;
|
318
|
+
paddedMax = Math.ceil((max + diff) * 10) / 10;
|
327
319
|
}
|
328
320
|
setDataMeasures([...datasets]);
|
329
321
|
setTimeStartPicker(minTime || timeStart);
|
@@ -28,7 +28,7 @@ const GroupsDevices = ({ userInfo, handleGetUsersList, handleAddUserToGroup, han
|
|
28
28
|
const [selectedGroup, setSelectedGroup] = useState(group);
|
29
29
|
const [groups, setGroups] = useState(null);
|
30
30
|
const [usersList, setUsersList] = useState([]);
|
31
|
-
const [usersGroup, setUsersGroup] = useState(
|
31
|
+
const [usersGroup, setUsersGroup] = useState(null);
|
32
32
|
const [groupInfo, setGroupInfo] = useState(null);
|
33
33
|
const [openAdd, setOpenAdd] = useState(false);
|
34
34
|
const [groupName, setGroupName] = useState('');
|
@@ -132,7 +132,9 @@ const GroupsDevices = ({ userInfo, handleGetUsersList, handleAddUserToGroup, han
|
|
132
132
|
if (currentGroup && !checkboxSelection) {
|
133
133
|
setSelectedGroup(currentGroup);
|
134
134
|
setGroupInfo(groups && groups.find((g) => g.id === currentGroup));
|
135
|
-
|
135
|
+
if (currentGroup !== 'all') {
|
136
|
+
getUsersGroup(currentGroup);
|
137
|
+
}
|
136
138
|
fetchDevices(currentGroup, currentGroup);
|
137
139
|
}
|
138
140
|
}, [currentGroup]);
|