Skip to content

Commit

Permalink
fix(editor): allow embed items to display backlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
thesophiaxu committed Feb 16, 2022
1 parent 019c3a5 commit c8403a2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export function AutoDynamicView({

if (object?.constructor.name !== 'UnigraphObject') object = new UnigraphObject(object);

const shouldGetBacklinks = !excludableTypes.includes(object?.type?.['unigraph.id']) && !inline;
const shouldGetBacklinks =
finalOptions.shouldGetBacklinks || (!excludableTypes.includes(object?.type?.['unigraph.id']) && !inline);

const dataContext = React.useContext(DataContext);
const tabContext = React.useContext(TabContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,13 @@ export function DetailedEmbedBlock({
attributes={{
isHeading: !(isChildren || callbacks.isEmbed),
}}
options={{ inline: true, noDrag: true, noDrop: true, noClickthrough: true }}
options={{
inline: true,
noDrag: true,
noDrop: true,
noClickthrough: true,
shouldGetBacklinks: true,
}}
callbacks={{
'get-semantic-properties': () => data,
isEmbed: true,
Expand Down
2 changes: 2 additions & 0 deletions packages/unigraph-dev-explorer/src/types/ObjectView.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export type DynamicViewOptions = {
customBoundingBox?: boolean;
/** If set to true, AutoDynamicView will consider the object with children already displayed when considering recursion, etc, WIP */
expandedChildren?: boolean;
/** If set to true, AutoDynamicView will always get backlinks for this object. */
shouldGetBacklinks?: boolean;
};

export type DynamicViewRendererProps = {
Expand Down

0 comments on commit c8403a2

Please sign in to comment.