mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-11-02 19:27:45 +00:00
Merge pull request #146 from stephb9959/main
[WIFI-11936] Devices table links now using real links with href
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.8.0(38)",
|
"version": "2.8.0(39)",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.8.0(38)",
|
"version": "2.8.0(39)",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chakra-ui/icons": "^2.0.11",
|
"@chakra-ui/icons": "^2.0.11",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.8.0(38)",
|
"version": "2.8.0(39)",
|
||||||
"description": "",
|
"description": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "index.tsx",
|
"main": "index.tsx",
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
Center,
|
Center,
|
||||||
Flex,
|
Flex,
|
||||||
IconButton,
|
IconButton,
|
||||||
|
Link,
|
||||||
Popover,
|
Popover,
|
||||||
PopoverArrow,
|
PopoverArrow,
|
||||||
PopoverBody,
|
PopoverBody,
|
||||||
@@ -18,7 +19,6 @@ import {
|
|||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useNavigate } from 'react-router-dom';
|
|
||||||
import DeviceActionDropdown from 'components/Buttons/DeviceActionDropdown';
|
import DeviceActionDropdown from 'components/Buttons/DeviceActionDropdown';
|
||||||
import { DeviceWithStatus, useDeleteDevice } from 'hooks/Network/Devices';
|
import { DeviceWithStatus, useDeleteDevice } from 'hooks/Network/Devices';
|
||||||
import { GatewayDevice } from 'models/Device';
|
import { GatewayDevice } from 'models/Device';
|
||||||
@@ -49,13 +49,11 @@ const Actions: React.FC<Props> = ({
|
|||||||
onOpenScriptModal,
|
onOpenScriptModal,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const navigate = useNavigate();
|
|
||||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||||
const { mutateAsync: deleteDevice, isLoading: isDeleting } = useDeleteDevice({
|
const { mutateAsync: deleteDevice, isLoading: isDeleting } = useDeleteDevice({
|
||||||
serialNumber: device.serialNumber,
|
serialNumber: device.serialNumber,
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleViewDetailsClick = () => navigate(`/devices/${device.serialNumber}`);
|
|
||||||
const handleDeleteClick = () =>
|
const handleDeleteClick = () =>
|
||||||
deleteDevice(device.serialNumber, {
|
deleteDevice(device.serialNumber, {
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
@@ -106,14 +104,15 @@ const Actions: React.FC<Props> = ({
|
|||||||
onOpenScriptModal={onOpenScriptModal}
|
onOpenScriptModal={onOpenScriptModal}
|
||||||
/>
|
/>
|
||||||
<Tooltip hasArrow label={t('common.view_details')} placement="top">
|
<Tooltip hasArrow label={t('common.view_details')} placement="top">
|
||||||
<IconButton
|
<Link href={`#/devices/${device.serialNumber}`}>
|
||||||
aria-label={t('common.view_details')}
|
<IconButton
|
||||||
ml={2}
|
aria-label={t('common.view_details')}
|
||||||
colorScheme="blue"
|
ml={2}
|
||||||
icon={<MagnifyingGlass size={20} />}
|
colorScheme="blue"
|
||||||
size="sm"
|
icon={<MagnifyingGlass size={20} />}
|
||||||
onClick={handleViewDetailsClick}
|
size="sm"
|
||||||
/>
|
/>
|
||||||
|
</Link>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user