mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
parent
d87f232ad4
commit
4bd657ccb4
@ -172,6 +172,7 @@ const Actions = () => {
|
||||
.filter(Boolean)
|
||||
.join(' - ')
|
||||
},
|
||||
dataCy: 'modal-clone',
|
||||
},
|
||||
form: (rows) => {
|
||||
const names = rows?.map(({ original }) => original?.NAME)
|
||||
@ -199,6 +200,7 @@ const Actions = () => {
|
||||
icon: Group,
|
||||
selected: true,
|
||||
color: 'secondary',
|
||||
dataCy: 'template-ownership',
|
||||
options: [
|
||||
{
|
||||
accessor: VM_TEMPLATE_ACTIONS.CHANGE_OWNER,
|
||||
@ -243,6 +245,7 @@ const Actions = () => {
|
||||
isConfirmDialog: true,
|
||||
dialogProps: {
|
||||
title: T.Share,
|
||||
dataCy: `modal-${VM_TEMPLATE_ACTIONS.SHARE}`,
|
||||
children: (rows) =>
|
||||
MessageToConfirmAction(rows, T.ShareVmTemplateDescription),
|
||||
},
|
||||
@ -258,6 +261,7 @@ const Actions = () => {
|
||||
isConfirmDialog: true,
|
||||
dialogProps: {
|
||||
title: T.Unshare,
|
||||
dataCy: `modal-${VM_TEMPLATE_ACTIONS.UNSHARE}`,
|
||||
children: (rows) =>
|
||||
MessageToConfirmAction(
|
||||
rows,
|
||||
@ -277,6 +281,7 @@ const Actions = () => {
|
||||
icon: Lock,
|
||||
selected: true,
|
||||
color: 'secondary',
|
||||
dataCy: 'template-lock',
|
||||
options: [
|
||||
{
|
||||
accessor: VM_TEMPLATE_ACTIONS.LOCK,
|
||||
@ -284,6 +289,7 @@ const Actions = () => {
|
||||
isConfirmDialog: true,
|
||||
dialogProps: {
|
||||
title: T.Lock,
|
||||
dataCy: `modal-${VM_TEMPLATE_ACTIONS.LOCK}`,
|
||||
children: MessageToConfirmAction,
|
||||
},
|
||||
onSubmit: (rows) => async () => {
|
||||
@ -297,6 +303,7 @@ const Actions = () => {
|
||||
isConfirmDialog: true,
|
||||
dialogProps: {
|
||||
title: T.Unlock,
|
||||
dataCy: `modal-${VM_TEMPLATE_ACTIONS.UNLOCK}`,
|
||||
children: MessageToConfirmAction,
|
||||
},
|
||||
onSubmit: (rows) => async () => {
|
||||
@ -315,6 +322,7 @@ const Actions = () => {
|
||||
options: [
|
||||
{
|
||||
dialogProps: {
|
||||
dataCy: `modal-${VM_TEMPLATE_ACTIONS.DELETE}`,
|
||||
title: (rows) => {
|
||||
const isMultiple = rows?.length > 1
|
||||
const { ID, NAME } = rows?.[0]?.original ?? {}
|
||||
|
@ -108,7 +108,7 @@ const InfoTabs = memo(({ template, gotoPage, unselect }) => {
|
||||
/>
|
||||
)}
|
||||
<Typography color="text.primary" noWrap>
|
||||
{`#${template?.ID} | ${template?.NAME}`}
|
||||
{`#${template?.ID || ''} | ${template?.NAME || ''}`}
|
||||
</Typography>
|
||||
</Stack>
|
||||
<VmTemplateTabs id={template?.ID} />
|
||||
|
@ -445,8 +445,9 @@ export const intersperse = (arr, sep) => {
|
||||
* @param {string[]|object} knownAttributes - Attributes to check
|
||||
* @returns {object} Returns object with unknown properties
|
||||
*/
|
||||
export const getUnknownAttributes = (obj, knownAttributes) => {
|
||||
export const getUnknownAttributes = (obj = {}, knownAttributes) => {
|
||||
const unknown = {}
|
||||
|
||||
const entries = Object.entries(obj)
|
||||
|
||||
const attributes = Array.isArray(knownAttributes)
|
||||
|
Loading…
x
Reference in New Issue
Block a user