Skip to content

Commit 28d82d6

Browse files
docs: add some missing documentation
1 parent 922e230 commit 28d82d6

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

src/lib/components/composites/list/NamedList.svelte

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
showNumberOfListItems?: boolean;
1313
numberOfItems?: number;
1414
emptyHint?: string;
15+
errorHint?: string;
1516
preListContent?: Snippet;
1617
}
1718
@@ -23,7 +24,8 @@
2324
numberOfSkeletons,
2425
showNumberOfListItems = false,
2526
numberOfItems = undefined,
26-
emptyHint = "",
27+
emptyHint = "No items found.",
28+
errorHint,
2729
preListContent = undefined,
2830
}: NamedListProps = $props();
2931
</script>
@@ -90,11 +92,12 @@ This can be e.g. a search bar.
9092
</ul>
9193
{/if}
9294
{:catch error}
95+
{console.error(`Could not load items: ${error}`)}
9396
<h2>{listName}</h2>
9497
{@render preListContent?.()}
9598
<div class="flex flex-row items-center gap-x-2 p-4">
9699
<CircleAlert size={20} class="text-neutral-500" />
97-
<span class="text-error">{error}</span>
100+
<span class="text-error">{errorHint ? errorHint : error}</span>
98101
</div>
99102
{/await}
100103
</div>

src/lib/components/composites/paper-components/paper-view/cards/ReferencesAndCitationsCardContent.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
items={backwardReferencedPapers}
4040
showNumberOfListItems
4141
numberOfSkeletons={3}
42+
emptyHint="No references found."
43+
errorHint="Couldn't load references."
4244
>
4345
{#snippet preListContent()}
4446
<SearchBar onSearch={filterBackwardReferencedPapers} timeoutInMs={0} />
@@ -57,6 +59,8 @@
5759
items={forwardReferencedPapers}
5860
showNumberOfListItems
5961
numberOfSkeletons={3}
62+
emptyHint="No citations found."
63+
errorHint="Couldn't load citations."
6064
>
6165
{#snippet preListContent()}
6266
<SearchBar onSearch={filterForwardReferencedPapers} timeoutInMs={0} />

src/lib/components/composites/search-bar/SearchBar.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ and the search method is triggered with an empty string,
5454
so if no further handling exist, all elements are retrieved
5555
by the search.
5656
57+
To limit the amount of calls (if used with backend calls), the search only starts after a
58+
specified timout in which no other events occur. The default for this is 500 ms.
59+
5760
Usage:
5861
```svelte
59-
<SearchBar placeholderText={yourText} onSearch={yourCallback} />
62+
<SearchBar placeholderText={yourText} onSearch={yourCallback} timeoutInMs={500} />
6063
```
6164
-->
6265
<div class="relative w-full">

src/lib/model/general.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ interface ProjectListEntryInterface {
1919
statistics: Project_Statistics;
2020
}
2121

22+
/**
23+
* Interface for the paper list entries.
24+
*
25+
* It either takes a Paper or a Project_Paper object.
26+
* According to this the projectId is either undefined or a string
27+
* and the showReviewStatus is either false or a boolean value.
28+
*/
2229
type PaperListEntryInterface =
2330
| {
2431
projectId: undefined;

0 commit comments

Comments
 (0)