Skip to content

Commit

Permalink
[Fix] Fix broken term definition link - ensure a text quote selector …
Browse files Browse the repository at this point in the history
…is used when available

Remove unused VocabularyFileDetail.tsx file, update caniuse
  • Loading branch information
ledsoft committed Feb 13, 2025
1 parent d12b056 commit dca1f58
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 41 deletions.
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/component/annotator/AnnotatorTermsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ const AnnotatorTermsSelector: React.FC<AnnotatorTermsSelectorProps> = ({

React.useEffect(() => {
if (autoFocus) {
setTimeout(() => treeSelect.current.focus(), 100);
setTimeout(() => {
if (treeSelect.current !== null) {
treeSelect.current.focus();
}
}, 100);
}
}, [autoFocus, treeSelect]);

Expand Down
2 changes: 1 addition & 1 deletion src/component/file/FileContentDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class FileContentDetail extends React.Component<
}

private onUpdate = (newFileContent: string) => {
trackPromise(
return trackPromise(
this.props.saveFileContent(
{
fragment: this.props.iri.fragment,
Expand Down
6 changes: 4 additions & 2 deletions src/component/term/TermDefinitionSourceLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ export const TermDefinitionSourceLink: React.FC<
if (!file || !file.owner) {
return;
}
// assert target.selectors.length === 1
const selector = Utils.sanitizeArray(target.selectors).find((s) =>
Utils.sanitizeArray(s.types).includes(VocabularyUtils.TEXT_QUOTE_SELECTOR)
);
dispatch(
pushRoutingPayload(Routes.annotateFile, {
selector: Utils.sanitizeArray(target.selectors)[0],
selector,
})
);
const ownerIri = VocabularyUtils.create(file.owner.iri!);
Expand Down
30 changes: 0 additions & 30 deletions src/component/vocabulary/VocabularyFileDetail.tsx

This file was deleted.

0 comments on commit dca1f58

Please sign in to comment.