diff --git a/src/components/auxiliary/dittoThing/list/info.tsx b/src/components/auxiliary/dittoThing/list/info.tsx index 2e963f7..adfb99c 100644 --- a/src/components/auxiliary/dittoThing/list/info.tsx +++ b/src/components/auxiliary/dittoThing/list/info.tsx @@ -78,16 +78,21 @@ export function InformationThing({ path, thingInfo, meta, isType }: Parameters) const attributeIfExist = (object: any, nameAttribute: string, isImage = false) => { if (defaultIfNoExist(object, nameAttribute, undefined) !== undefined) { - const jsxElement = (!isImage) ?
: - - - return ( -
-
{capitalize(nameAttribute)}
-

{object[nameAttribute]}

- {jsxElement} -
- ) + if(isImage) { + return ( +
+
{capitalize(nameAttribute)}
+ +
+ ) + } else { + return ( +
+
{capitalize(nameAttribute)}
+

{object[nameAttribute]}

+
+ ) + } } else { return
} diff --git a/src/components/auxiliary/dittoThing/list/main.tsx b/src/components/auxiliary/dittoThing/list/main.tsx index fb02dc6..07a048e 100644 --- a/src/components/auxiliary/dittoThing/list/main.tsx +++ b/src/components/auxiliary/dittoThing/list/main.tsx @@ -1,6 +1,6 @@ import React, { useState, useEffect, Fragment, useContext } from 'react'; import { IDittoThing } from 'utils/interfaces/dittoThing'; -import { Card, LinkButton, IconButton, Select, Icon, ConfirmModal, Modal, Spinner, VerticalGroup, InlineSwitch, InlineFieldRow, useTheme2 } from '@grafana/ui' +import { LinkButton, IconButton, Select, Icon, ConfirmModal, Modal, Spinner, VerticalGroup, InlineSwitch, InlineFieldRow, useTheme2 } from '@grafana/ui' import { AppPluginMeta, KeyValue, SelectableValue } from '@grafana/data'; import { defaultIfNoExist, enumNotification, imageIsUndefined } from 'utils/auxFunctions/general'; import { ISelect } from 'utils/interfaces/select'; @@ -160,23 +160,21 @@ export function MainList({ path, meta, isType, funcThings, funcDelete, funcDelet } const getCard = (item: IDittoThing) => { - return - {defaultIfNoExist(item.attributes, "name", item.thingId)} - -
+ return
+ +
+ {defaultIfNoExist(item.attributes, "name", item.thingId).trim()}

{item.thingId}

-

- {defaultIfNoExist(item.attributes, "description", "")} -

+

{defaultIfNoExist(item.attributes, "description", "")}

- - -
- - - handleOnDelete(e, item.thingId)} /> - - +
+ + + + handleOnDelete(e, item.thingId)} /> +
+ +
} const fullCard = (item: IDittoThing) => { @@ -196,8 +194,8 @@ export function MainList({ path, meta, isType, funcThings, funcDelete, funcDelet } const compactCard = (item: IDittoThing) => { - return
-
+ return
+
{getCard(item)}