diff --git a/packages/console-app/src/components/AppLink.js b/packages/console-app/src/components/AppLink.js index 301b431..4ea92be 100644 --- a/packages/console-app/src/components/AppLink.js +++ b/packages/console-app/src/components/AppLink.js @@ -35,7 +35,7 @@ const getAppUrl = (config, { name, version, text }) => { * @param {string} [version] */ const AppLink = ({ config, name, version, text }) => { - const fullURL = getAppUrl(config, {name, version}); + const fullURL = getAppUrl(config, { name, version }); return {text || name}; }; diff --git a/packages/console-app/src/components/PackageLink.js b/packages/console-app/src/components/PackageLink.js index 82a1c27..6ac9759 100644 --- a/packages/console-app/src/components/PackageLink.js +++ b/packages/console-app/src/components/PackageLink.js @@ -4,8 +4,6 @@ import React from 'react'; import Link from '@material-ui/core/Link'; -import Menu from '@material-ui/core/Menu'; -import MenuItem from '@material-ui/core/MenuItem'; import { getServiceUrl } from '../util/config'; diff --git a/packages/console-app/src/components/QueryLink.js b/packages/console-app/src/components/QueryLink.js index 7e1fcd6..46e3199 100644 --- a/packages/console-app/src/components/QueryLink.js +++ b/packages/console-app/src/components/QueryLink.js @@ -22,15 +22,17 @@ const QUERY = `{ * @param {string} name * @param {string} [text] */ -const QueryLink = ({ config, name, text, icon = false}) => { +const QueryLink = ({ config, name, text, icon = false }) => { const baseURL = getServiceUrl(config, 'wns.webui'); const query = QUERY.replace('%NAME%', name); - const fullURL= encodeURI(`${baseURL}?query=${query}`); + const fullURL = encodeURI(`${baseURL}?query=${query}`); if (icon) { - return - - + return ( + + + + ); } return {text || name}; }; diff --git a/packages/console-app/src/containers/panels/apps/AppRecords.js b/packages/console-app/src/containers/panels/apps/AppRecords.js index 995ea40..0b5e5c1 100644 --- a/packages/console-app/src/containers/panels/apps/AppRecords.js +++ b/packages/console-app/src/containers/panels/apps/AppRecords.js @@ -6,7 +6,6 @@ import React, { useContext } from 'react'; import moment from 'moment'; import { useQuery } from '@apollo/react-hooks'; -import Link from '@material-ui/core/Link'; import TableHead from '@material-ui/core/TableHead'; import TableRow from '@material-ui/core/TableRow'; import TableBody from '@material-ui/core/TableBody'; @@ -19,8 +18,7 @@ import { ConsoleContext, useQueryStatusReducer, useSorter } from '../../../hooks import { BooleanIcon } from '../../../components/BooleanIcon'; import Table from '../../../components/Table'; import TableCell from '../../../components/TableCell'; -import { getServiceUrl } from '../../../util/config'; -import AppLink from "../../../components/AppLink"; +import AppLink from '../../../components/AppLink'; const AppRecords = () => { const { config } = useContext(ConsoleContext); diff --git a/packages/console-app/src/containers/panels/wns/WNSRecords.js b/packages/console-app/src/containers/panels/wns/WNSRecords.js index ce8bb81..a62b832 100644 --- a/packages/console-app/src/containers/panels/wns/WNSRecords.js +++ b/packages/console-app/src/containers/panels/wns/WNSRecords.js @@ -11,7 +11,6 @@ import Button from '@material-ui/core/Button'; import TableHead from '@material-ui/core/TableHead'; import TableRow from '@material-ui/core/TableRow'; import TableBody from '@material-ui/core/TableBody'; -import Tooltip from '@material-ui/core/Tooltip'; import WNS_RECORDS from '../../../gql/wns_records.graphql'; @@ -21,8 +20,8 @@ import Table from '../../../components/Table'; import TableCell from '../../../components/TableCell'; import PackageLink from '../../../components/PackageLink'; -import QueryLink from "../../../components/QueryLink"; -import AppLink from "../../../components/AppLink"; +import QueryLink from '../../../components/QueryLink'; +import AppLink from '../../../components/AppLink'; const types = [ { key: null, label: 'ALL' }, @@ -95,40 +94,41 @@ const WNSRecords = ({ type }) => { {records.sort(sorter) .map((record) => { - const { id, type, name, version, createTime, attributes: { displayName, description, service, package: pkg } } = record; + const { id, type, name, version, createTime, attributes: { displayName, description, service, package: pkg } } = record; - let pkgLink = undefined; - let appLink = undefined; - let verLink = undefined; + let pkgLink; + let appLink; + let verLink; - if (pkg) { - pkgLink = (); - } - - if (type === 'wrn:app') { - appLink = (); - verLink = (); - } - - return ( - {type} - - {appLink && appLink || name} - - - - - {displayName || service || description} - - {verLink && verLink || version} - - {moment.utc(createTime).fromNow()} - - {pkgLink} - - - ); + if (pkg) { + pkgLink = (); } + + if (type === 'wrn:app') { + appLink = (); + verLink = (); + } + + return ( + + {type} + + {appLink || name} + + + + + {displayName || service || description} + + {verLink || version} + + {moment.utc(createTime).fromNow()} + + {pkgLink} + + + ); + } )}