Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
#### 🐛 Fixed
- Fix relation having changed `data` but missing from `AuthoringState` when the source or target entity becomes deleted then restored back.
- Fix grouped relation (`RelationGroup` item) does not updating its `data` when changed by `EditorController`.
- Fix `ConnectionsMenu` displaying no links when there is only a single incoming/outgoing relation type. (by @cristianvasquez)
- Exclude collapsed `DropdownMenu` and `UnifiedSearch` content from Tab-navigation.
- Exclude canvas elements from Tab-navigation unless the element is only one selected.
- Block canvas interacton (including Tab-navigation) when displaying a blocking modal overlay i.e. an overlay task or viewport-centered dialog.
Expand Down
11 changes: 6 additions & 5 deletions src/widgets/connectionsMenu/connectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export function ConnectionsList(props: {

allRelatedLink: LinkTypeModel;
onExpandLink: (chunk: LinkDataChunk) => void;
onMoveToFilter: ((chunk: LinkDataChunk) => void) | undefined;
onMoveToFilter?: (chunk: LinkDataChunk) => void;

scrolledListRef: React.RefObject<HTMLUListElement | null>;
scrolledListRef?: React.RefObject<HTMLUListElement | null>;
}) {
const {
data, filterKey, sortMode, suggestions,
Expand Down Expand Up @@ -77,9 +77,10 @@ export function ConnectionsList(props: {
count: inexact && totalCount > 0 ? 'some' : totalCount,
});
entries.push({type: 'separator'});
for (const entry of regularEntries) {
entries.push(entry);
}
}

for (const entry of regularEntries) {
entries.push(entry);
}

if (probableEntries.length > 0) {
Expand Down
39 changes: 39 additions & 0 deletions test/widgets/connectionsList.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import * as React from 'react';
import { describe, expect, it } from 'vitest';
import { render } from 'vitest-browser-react';

import type { LinkTypeModel } from '../../src/data/model';
import { ConnectionsList } from '../../src/widgets/connectionsMenu/connectionList';
import { WorkspaceProvider, createWorkspace } from '../../src/workspace/workspaceProvider';
import { blockingDefaultLayout } from '../../src/layout-sync';

describe('ConnectionsList', () => {
it('renders the only connection link', async () => {
const link: LinkTypeModel = {id: 'urn:test:single-link', label: []};
const workspace = createWorkspace({
defaultLayout: blockingDefaultLayout,
});

await render(
<WorkspaceProvider workspace={workspace}>
<ConnectionsList
data={{
links: [link],
counts: new Map([
[link.id, {inCount: 1, outCount: 0, inexact: false}]
]),
}}
filterKey=''
sortMode='alphabet'
suggestions={{filterKey: null, scores: new Map()}}
allRelatedLink={{id: 'all', label: []}}
onExpandLink={() => undefined}
/>
</WorkspaceProvider>
);

expect(document.body.querySelector(
'[data-linktypeid="urn:test:single-link"]'
)).toBeTruthy();
});
});
Loading