diff --git a/packages/console-app/src/components/AppLink.js b/packages/console-app/src/components/AppLink.js index 0b4eecc..a4eb051 100644 --- a/packages/console-app/src/components/AppLink.js +++ b/packages/console-app/src/components/AppLink.js @@ -31,9 +31,9 @@ const getAppUrl = (config, { wrn }) => { * @param {string} name * @param {string} [text] */ -const AppLink = ({ config, wrn, text }) => { - const fullURL = getAppUrl(config, { wrn }); - return {text || wrn}; +const AppLink = ({ config, crn, text }) => { + const fullURL = getAppUrl(config, { crn }); + return {text || crn}; }; export default AppLink; diff --git a/packages/console-app/src/containers/panels/registry/RegistryLookup.js b/packages/console-app/src/containers/panels/registry/RegistryLookup.js index d467890..3a09dcc 100644 --- a/packages/console-app/src/containers/panels/registry/RegistryLookup.js +++ b/packages/console-app/src/containers/panels/registry/RegistryLookup.js @@ -37,7 +37,7 @@ const useStyles = makeStyles(theme => ({ const types = [ { key: 'authority', label: 'Authority' }, - { key: 'wrn', label: 'WRN' } + { key: 'crn', label: 'CRN' } ]; export const LookupType = ({ scope = types[0].key, onChange }) => { @@ -87,9 +87,9 @@ const RegistryLookup = ({ scope }) => { const getNames = () => { let ret; switch (scope) { - case 'wrn': { + case 'crn': { ret = []; - records.forEach(item => ret.push(...item.names)); + records.forEach(item => ret.push(...(item.names || []))); break; } @@ -98,9 +98,9 @@ const RegistryLookup = ({ scope }) => { // TODO(telackey): Should we be able to query WNS for a list of authorities? const names = new Set(); for (const record of records) { - for (const name of record.names) { - // TODO(telackey): We need a general purpose WRN handling library. - names.add(name.replace('wrn://', '').split('/')[0]); + for (const name of (record.names || [])) { + // TODO(telackey): We need a general purpose CRN handling library. + names.add(name.replace('crn://', '').split('/')[0]); } } ret = Array.from(names.values()); @@ -120,7 +120,7 @@ const RegistryLookup = ({ scope }) => { let result; switch (scope) { - case 'wrn': + case 'crn': result = await registry.lookupNames([newInputValue], true); break; diff --git a/packages/console-app/src/containers/panels/registry/RegistryRecords.js b/packages/console-app/src/containers/panels/registry/RegistryRecords.js index ec4ac09..5596d12 100644 --- a/packages/console-app/src/containers/panels/registry/RegistryRecords.js +++ b/packages/console-app/src/containers/panels/registry/RegistryRecords.js @@ -31,13 +31,13 @@ const useStyles = makeStyles(theme => ({ const types = [ { key: null, label: 'ALL' }, - { key: 'wrn:kube', label: 'Kube' }, - { key: 'wrn:service', label: 'Service' }, - { key: 'wrn:app', label: 'App' }, - { key: 'wrn:bot', label: 'Bot' }, - { key: 'wrn:bot-factory', label: 'Bot Factory' }, - { key: 'wrn:file', label: 'File' }, - { key: 'wrn:type', label: 'Type' } + { key: 'crn:kube', label: 'Kube' }, + { key: 'crn:service', label: 'Service' }, + { key: 'crn:app', label: 'App' }, + { key: 'crn:bot', label: 'Bot' }, + { key: 'crn:bot-factory', label: 'Bot Factory' }, + { key: 'crn:file', label: 'File' }, + { key: 'crn:type', label: 'Type' } ]; export const RecordType = ({ type = types[0].key, onChange }) => { @@ -104,12 +104,12 @@ const RegistryRecords = ({ type }) => { pkgLink = (); } - if (type === 'wrn:app') { + if (type === 'crn:app') { appLinks = ( <> - {names.map(wrn => -
- + {(names || []).map(crn => +
+
)} @@ -120,7 +120,7 @@ const RegistryRecords = ({ type }) => { {type} - {appLinks || names.map(name =>
{name}
)} + {appLinks || (names || []).map(name =>
{name}
)}
{version} diff --git a/packages/console-app/src/hooks/registry.js b/packages/console-app/src/hooks/registry.js index c7a08bd..6d2bd1f 100644 --- a/packages/console-app/src/hooks/registry.js +++ b/packages/console-app/src/hooks/registry.js @@ -2,7 +2,7 @@ // Copyright 2020 DXOS.org // -import { Registry } from '@wirelineio/registry-client'; +import { Registry } from 'laconic-sdk'; import { getServiceUrl } from '../util/config'; diff --git a/packages/console-app/src/resolvers.js b/packages/console-app/src/resolvers.js index 8283482..f915630 100644 --- a/packages/console-app/src/resolvers.js +++ b/packages/console-app/src/resolvers.js @@ -4,7 +4,7 @@ import debug from 'debug'; -import { Registry } from '@wirelineio/registry-client'; +import { Registry } from 'laconic-sdk'; import { getServiceUrl } from './util/config';