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:
parent
f790e4cb81
commit
f1a796dc4e
@ -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) || []
|
||||
|
@ -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 })
|
||||
|
Loading…
x
Reference in New Issue
Block a user