diff --git a/CHANGELOG.md b/CHANGELOG.md index 55defc6a0..a2f4141f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ By far most changes relate to `atomic-server`, so if not specified, assume the c **Changes to JS assets (including the front-end and JS libraries) are not shown here**, but in [`/browser/CHANGELOG`](/browser/CHANGELOG.md). See [STATUS.md](server/STATUS.md) to learn more about which features will remain stable. +## UNRELEASED + +- CLI should use Agent in requests - get #986 +- Search endpoint throws error for websocket requests #1047 +- Fix search in CLI / atomic_lib #958 + ## [v0.40.2] - fix property sort order when importing + add tests #980 diff --git a/Cargo.lock b/Cargo.lock index 1ede40ce3..f285cf475 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -595,7 +595,6 @@ dependencies = [ "opentelemetry-jaeger", "percent-encoding", "rand 0.8.5", - "ravif", "rcgen", "regex", "rio_api", @@ -2412,7 +2411,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" dependencies = [ "cfg-if", - "rayon", ] [[package]] @@ -2515,15 +2513,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e94e1e6445d314f972ff7395df2de295fe51b71821694f0b0e1e79c4f12c8577" -[[package]] -name = "nasm-rs" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4d98d0065f4b1daf164b3eafb11974c94662e5e2396cf03f32d0bb5c17da51" -dependencies = [ - "rayon", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -3324,7 +3313,6 @@ dependencies = [ "av1-grain", "bitstream-io", "built", - "cc", "cfg-if", "interpolate_name", "itertools 0.12.1", @@ -3332,7 +3320,6 @@ dependencies = [ "libfuzzer-sys", "log", "maybe-rayon", - "nasm-rs", "new_debug_unreachable", "noop_proc_macro", "num-derive", @@ -3360,7 +3347,6 @@ dependencies = [ "loop9", "quick-error", "rav1e", - "rayon", "rgb", ] diff --git a/browser/cli/src/generateIndex.ts b/browser/cli/src/generateIndex.ts index d23c12cd0..fbded0490 100644 --- a/browser/cli/src/generateIndex.ts +++ b/browser/cli/src/generateIndex.ts @@ -33,6 +33,10 @@ export const generateIndex = ( const names = ontologies.map(x => { const res = store.getResourceLoading(x); + if (res.error) { + throw new Error('error getting ontology'); + } + return camelCaseify(res.title); }); @@ -43,10 +47,8 @@ export const generateIndex = ( const importLines = names.map(createImportLine).join('\n'); const registerArgs = names.join(', '); - const content = TEMPLATE.replaceAll( - Inserts.MODULE_ALIAS, - atomicConfig.moduleAlias ?? '@tomic/lib', - ) + const moduleAlias = atomicConfig.moduleAlias ?? '@tomic/lib'; + const content = TEMPLATE.replaceAll(Inserts.MODULE_ALIAS, moduleAlias) .replace(Inserts.IMPORTS, importLines) .replace(Inserts.REGISTER_ARGS, registerArgs); diff --git a/browser/cli/src/utils.ts b/browser/cli/src/utils.ts index 57bd781d3..6e838087e 100644 --- a/browser/cli/src/utils.ts +++ b/browser/cli/src/utils.ts @@ -9,7 +9,14 @@ export const dedupe = (array: T[]): T[] => { return Array.from(new Set(array)); }; -export const getExtension = () => - getTsconfig()?.config.compilerOptions?.moduleResolution === 'Bundler' - ? '' - : '.js'; +export const getExtension = () => { + try { + return getTsconfig()?.config.compilerOptions?.moduleResolution === 'Bundler' + ? '' + : '.js'; + } catch (e) { + console.warn('Something went wrong getting TS Config / file extension', e); + + return '.js'; + } +}; diff --git a/browser/create-template/src/postprocess.ts b/browser/create-template/src/postprocess.ts index 9596078ee..b919ff59a 100644 --- a/browser/create-template/src/postprocess.ts +++ b/browser/create-template/src/postprocess.ts @@ -35,7 +35,7 @@ export async function postProcess(context: PostProcessContext) { switch (ontology.error.type) { case ErrorType.NotFound: console.error( - `\nThe ${baseTemplate.name} template does not exist on your drive. To get the template go to the Create Resource page and select the ${baseTemplate.name} template`, + `\nThe '${baseTemplate.name}' template does not exist on your drive on '${ontologySubject}'. To get the template go to the Create Resource page and select the ${baseTemplate.name} template.`, ); break; case ErrorType.Unauthorized: diff --git a/browser/data-browser/src/components/Button.tsx b/browser/data-browser/src/components/Button.tsx index 9eb7ff001..3ca411d73 100644 --- a/browser/data-browser/src/components/Button.tsx +++ b/browser/data-browser/src/components/Button.tsx @@ -153,7 +153,7 @@ export const ButtonBar = styled(ButtonClean)` } padding-left: ${p => (p.leftPadding ? '1.2rem' : '')}; - padding-right: ${p => (p.rightPadding ? '1.2rem' : '')}; + padding-right: ${p => (p.rightPadding ? '1rem' : '')}; `; /** Button with some optional margins around it */ diff --git a/browser/data-browser/src/components/NavBarSpacer.tsx b/browser/data-browser/src/components/NavBarSpacer.tsx index 38273a3ac..ffd863800 100644 --- a/browser/data-browser/src/components/NavBarSpacer.tsx +++ b/browser/data-browser/src/components/NavBarSpacer.tsx @@ -2,8 +2,8 @@ import { styled } from 'styled-components'; import { useSettings } from '../helpers/AppSettings'; import type { JSX } from 'react'; +import { NAVBAR_HEIGHT } from './Navigation'; -const NAVBAR_HEIGHT = '2rem'; const NAVBAR_CALC_PART = ` + ${NAVBAR_HEIGHT}`; export interface NavBarSpacerProps { diff --git a/browser/data-browser/src/components/Navigation.tsx b/browser/data-browser/src/components/Navigation.tsx index 9be4d92bd..8ff570436 100644 --- a/browser/data-browser/src/components/Navigation.tsx +++ b/browser/data-browser/src/components/Navigation.tsx @@ -15,6 +15,8 @@ import { useMediaQuery } from '../hooks/useMediaQuery'; import { useBackForward } from '../hooks/useNavigateWithTransition'; import { NAVBAR_TRANSITION_TAG } from '../helpers/transitionName'; +export const NAVBAR_HEIGHT = '2.5rem'; + interface NavWrapperProps { children: React.ReactNode; } @@ -96,6 +98,7 @@ function NavBar(): JSX.Element { <> setSideBarLocked(!sideBarLocked)} title={`Show / hide sidebar (${shortcuts.sidebarToggle})`} @@ -135,7 +138,7 @@ const NavBarBase = styled.div` /* transition: all 0.2s; */ position: fixed; z-index: ${p => p.theme.zIndex.sidebar}; - height: 2.5rem; + height: ${NAVBAR_HEIGHT}; display: flex; border: solid 1px ${props => props.theme.colors.bg2}; background-color: ${props => props.theme.colors.bg}; @@ -191,7 +194,6 @@ const VerticalDivider = styled.div` width: 1px; background-color: ${props => props.theme.colors.bg2}; height: 100%; - margin-left: ${p => p.theme.size(2)}; `; const SideBarWrapper = styled('div')` display: flex; diff --git a/browser/data-browser/src/components/Template/ApplyTemplateDialog.tsx b/browser/data-browser/src/components/Template/ApplyTemplateDialog.tsx index 28ffca7cc..0c74c2f1a 100644 --- a/browser/data-browser/src/components/Template/ApplyTemplateDialog.tsx +++ b/browser/data-browser/src/components/Template/ApplyTemplateDialog.tsx @@ -10,7 +10,6 @@ import { useDialog, } from '../Dialog'; import { Column } from '../Row'; -import type { Template } from './template'; import { useEffect, useMemo, useState } from 'react'; import Markdown from '../datatypes/Markdown'; import { dataBrowser, useResource, useResources, useStore } from '@tomic/react'; @@ -19,6 +18,7 @@ import { InlineErrMessage } from '../forms/InputStyles'; import { useSettings } from '../../helpers/AppSettings'; import { useNavigateWithTransition } from '../../hooks/useNavigateWithTransition'; import { constructOpenURL } from '../../helpers/navigation'; +import type { Template } from './template'; interface ApplyTemplateDialogProps { template?: Template; @@ -95,9 +95,7 @@ export function ApplyTemplateDialog({ - +
diff --git a/browser/data-browser/src/components/Template/TemplateList.tsx b/browser/data-browser/src/components/Template/TemplateList.tsx index 5bd720576..365c6b4cf 100644 --- a/browser/data-browser/src/components/Template/TemplateList.tsx +++ b/browser/data-browser/src/components/Template/TemplateList.tsx @@ -1,32 +1,50 @@ import { TemplateListItem } from './TemplateListItem'; import { styled } from 'styled-components'; import { website } from './templates/website'; -import type { Template } from './template'; +import type { Template, TemplateFn } from './template'; import { useState } from 'react'; import { ApplyTemplateDialog } from './ApplyTemplateDialog'; +import { useSettings } from '../../helpers/AppSettings'; -const templates: Template[] = [website]; +const templates: TemplateFn[] = [website]; export function TemplateList(): React.JSX.Element { const [dialogOpen, setDialogOpen] = useState(false); const [selectedTemplate, setSelectedTemplate] = useState