Hello, I wanted to make a small contribution that might be helpful to someone. The connection pages (which we use, for example, when assigning a notification or geofence to a specific device) don't display the already assigned data until they are clicked. In other words, only when clicked, all the values, both assigned and unassigned, are shown. However, before clicking, it appears as if nothing is assigned, when many times it actually is.
I just modified the LinkField.js
file to allow the data to be "previewed" without the need to click anything. The goal is to continue displaying the values when clicked, but also to load them in advance, so that when going to the connection page, one can already see what is already assigned.
Here is the modified part in LinkField.js
(line 15):
const LinkField = ({
label,
endpointAll,
endpointLinked,
baseId,
keyBase,
keyLink,
keyGetter = (item) => item.id,
titleGetter = (item) => item.name,
}) => {
const [active, setActive] = useState(true);
const [open, setOpen] = useState(false);
const [items, setItems] = useState();
const [linked, setLinked] = useState();
useEffectAsync(async () => {
That's all, it's just one line that changes from having a value of 'false' to a value of 'true'.
The previous line was:
const [active, setActive] = useState(true);
And the new one is:
const [active, setActive] = useState(true);
Hello, I wanted to make a small contribution that might be helpful to someone. The connection pages (which we use, for example, when assigning a notification or geofence to a specific device) don't display the already assigned data until they are clicked. In other words, only when clicked, all the values, both assigned and unassigned, are shown. However, before clicking, it appears as if nothing is assigned, when many times it actually is.
I just modified the
LinkField.js
file to allow the data to be "previewed" without the need to click anything. The goal is to continue displaying the values when clicked, but also to load them in advance, so that when going to the connection page, one can already see what is already assigned.Here is the modified part in
LinkField.js
(line 15):/* PREVIOUS CODE */ const LinkField = ({ label, endpointAll, endpointLinked, baseId, keyBase, keyLink, keyGetter = (item) => item.id, titleGetter = (item) => item.name, }) => { const [active, setActive] = useState(true); // THIS LINE HAS BEEN MODIFIED, IT WAS PREVIOUSLY FALSE. const [open, setOpen] = useState(false); const [items, setItems] = useState(); const [linked, setLinked] = useState(); useEffectAsync(async () => { /* REMAINING CODE */
That's all, it's just one line that changes from having a value of 'false' to a value of 'true'.
The previous line was:
const [active, setActive] = useState(true);
And the new one is:
const [active, setActive] = useState(true);