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