1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

L #-: lint fix vntemplate tab (#2898)

Signed-off-by: Jorge Lobo <jlobo@opennebula.io>
(cherry picked from commit 07c279292a7e2b77abbd06593f91ddc1ddf9e4e7)
This commit is contained in:
Jorge Miguel Lobo Escalona 2024-01-17 17:03:58 +01:00 committed by Tino Vázquez
parent f790e4cb81
commit f1a796dc4e
No known key found for this signature in database
GPG Key ID: 14201E424D02047E
2 changed files with 10 additions and 7 deletions

View File

@ -37,11 +37,9 @@ const ClustersContent = ({ oneConfig, adminGroup }) => {
const { setValue } = useFormContext()
const clusters = useWatch({ name: TAB_PATH })
const selectedRowIds =
Array.isArray(clusters) ?
clusters?.reduce((res, id) => ({ ...res, [id]: true }), {})
:
{[clusters]: true}
const selectedRowIds = Array.isArray(clusters)
? clusters?.reduce((res, id) => ({ ...res, [id]: true }), {})
: { [clusters]: true }
const handleSelectedRows = (rows) => {
const newValue = rows?.map((row) => row.original.ID) || []

View File

@ -16,7 +16,11 @@
import { List } from 'client/components/Tabs/Common'
import { T, VN_TEMPLATE_ACTIONS, VNetworkTemplate } from 'client/constants'
import { useRenameVNTemplateMutation } from 'client/features/OneApi/networkTemplate'
import { booleanToString, levelLockToString, stringToBoolean } from 'client/models/Helper'
import {
booleanToString,
levelLockToString,
stringToBoolean,
} from 'client/models/Helper'
import PropTypes from 'prop-types'
import { ReactElement } from 'react'
@ -30,7 +34,8 @@ import { ReactElement } from 'react'
*/
const InformationPanel = ({ vnetTemplate = {}, actions }) => {
const [rename] = useRenameVNTemplateMutation()
const { ID, NAME, VLAN_ID_AUTOMATIC, OUTER_VLAN_ID_AUTOMATIC, LOCK } = vnetTemplate
const { ID, NAME, VLAN_ID_AUTOMATIC, OUTER_VLAN_ID_AUTOMATIC, LOCK } =
vnetTemplate
const handleRename = async (_, newName) => {
await rename({ id: ID, name: newName })