Rename crn to lrn
This commit is contained in:
parent
b9fd355a0e
commit
ab75670aca
@ -31,7 +31,7 @@
|
||||
"@apollo/react-components": "^4.0.0",
|
||||
"@apollo/react-hooks": "^4.0.0",
|
||||
"@babel/runtime": "^7.21.0",
|
||||
"@cerc-io/laconic-sdk": "^0.1.15",
|
||||
"@cerc-io/registry-sdk": "^0.1.15",
|
||||
"@lirewine/debug": "1.0.0-beta.78",
|
||||
"@lirewine/gem-core": "1.0.0-beta.28",
|
||||
"@lirewine/react-ux": "1.1.0-beta.1",
|
||||
|
@ -31,9 +31,9 @@ const getAppUrl = (config, { wrn }) => {
|
||||
* @param {string} name
|
||||
* @param {string} [text]
|
||||
*/
|
||||
const AppLink = ({ config, crn, text }) => {
|
||||
const fullURL = getAppUrl(config, { crn });
|
||||
return <Link href={fullURL} target={crn}>{text || crn}</Link>;
|
||||
const AppLink = ({ config, lrn, text }) => {
|
||||
const fullURL = getAppUrl(config, { lrn });
|
||||
return <Link href={fullURL} target={lrn}>{text || lrn}</Link>;
|
||||
};
|
||||
|
||||
export default AppLink;
|
||||
|
@ -37,7 +37,7 @@ const useStyles = makeStyles(theme => ({
|
||||
|
||||
const types = [
|
||||
{ key: 'authority', label: 'Authority' },
|
||||
{ key: 'crn', label: 'CRN' }
|
||||
{ key: 'lrn', label: 'LRN' }
|
||||
];
|
||||
|
||||
export const LookupType = ({ scope = types[0].key, onChange }) => {
|
||||
@ -87,7 +87,7 @@ const RegistryLookup = ({ scope }) => {
|
||||
const getNames = () => {
|
||||
let ret;
|
||||
switch (scope) {
|
||||
case 'crn': {
|
||||
case 'lrn': {
|
||||
ret = [];
|
||||
records.forEach(item => ret.push(...(item.names || [])));
|
||||
break;
|
||||
@ -99,8 +99,8 @@ const RegistryLookup = ({ scope }) => {
|
||||
const names = new Set();
|
||||
for (const record of records) {
|
||||
for (const name of (record.names || [])) {
|
||||
// TODO(telackey): We need a general purpose CRN handling library.
|
||||
names.add(name.replace('crn://', '').split('/')[0]);
|
||||
// TODO(telackey): We need a general purpose LRN handling library.
|
||||
names.add(name.replace('lrn://', '').split('/')[0]);
|
||||
}
|
||||
}
|
||||
ret = Array.from(names.values());
|
||||
@ -120,7 +120,7 @@ const RegistryLookup = ({ scope }) => {
|
||||
|
||||
let result;
|
||||
switch (scope) {
|
||||
case 'crn':
|
||||
case 'lrn':
|
||||
result = await registry.lookupNames([newInputValue], true);
|
||||
break;
|
||||
|
||||
|
@ -31,13 +31,13 @@ const useStyles = makeStyles(theme => ({
|
||||
|
||||
const types = [
|
||||
{ key: null, label: 'ALL' },
|
||||
{ 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' }
|
||||
{ key: 'lrn:kube', label: 'Kube' },
|
||||
{ key: 'lrn:service', label: 'Service' },
|
||||
{ key: 'lrn:app', label: 'App' },
|
||||
{ key: 'lrn:bot', label: 'Bot' },
|
||||
{ key: 'lrn:bot-factory', label: 'Bot Factory' },
|
||||
{ key: 'lrn:file', label: 'File' },
|
||||
{ key: 'lrn:type', label: 'Type' }
|
||||
];
|
||||
|
||||
export const RecordType = ({ type = types[0].key, onChange }) => {
|
||||
@ -104,12 +104,12 @@ const RegistryRecords = ({ type }) => {
|
||||
pkgLink = (<PackageLink config={config} type={type} pkg={pkg} />);
|
||||
}
|
||||
|
||||
if (type === 'crn:app') {
|
||||
if (type === 'lrn:app') {
|
||||
appLinks = (
|
||||
<>
|
||||
{(names || []).map(crn =>
|
||||
<div key={crn}>
|
||||
<AppLink config={config} crn={crn} />
|
||||
{(names || []).map(lrn =>
|
||||
<div key={lrn}>
|
||||
<AppLink config={config} lrn={lrn} />
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Copyright 2020 DXOS.org
|
||||
//
|
||||
|
||||
import { Registry } from '@cerc-io/laconic-sdk';
|
||||
import { Registry } from '@cerc-io/registry-sdk';
|
||||
|
||||
import { getServiceUrl } from '../util/config';
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
import debug from 'debug';
|
||||
|
||||
import { Registry } from '@cerc-io/laconic-sdk';
|
||||
import { Registry } from '@cerc-io/registry-sdk';
|
||||
|
||||
import { getServiceUrl } from './util/config';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user