Skip to content

Commit 96d0c44

Browse files
committed
Set default view by default
Signed-off-by: Andrea Lamparelli <[email protected]>
1 parent d2fbf0f commit 96d0c44

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

horreum-web/src/components/LabelFilter/FilterDropDown.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default function FilterDropDown(props: FilterDropDownProps) {
7777
>
7878
<MenuContent>
7979
<MenuList>
80-
{props.options.map((option) => <MenuItem itemId={option}>{option}</MenuItem>)}
80+
{props.options.map((option, idx) => <MenuItem itemId={option} key={option + idx}>{option}</MenuItem>)}
8181
</MenuList>
8282
</MenuContent>
8383
</Menu>

horreum-web/src/components/LabelFilter/LabelFilter.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export default function LabelFilter({selection, onSelect, source, emptyPlacehold
146146
return (
147147

148148
<ToolbarLabelFilter
149+
key={key}
149150
name={key}
150151
options={opts}
151152
filter={selection}

horreum-web/src/components/LabelFilter/LabelFilterOption.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ export default function LabelFilterOption(props: FilterOptionProps) {
8282
const menu = (
8383
<Menu ref={menuRef} id="attribute-search-{props.name}-menu" onSelect={onSelect} selected={props.selection}>
8484
<MenuContent>
85-
<MenuList>
85+
<MenuList key={props.name}>
8686
{
87-
props.options.map((option) => (
88-
<MenuItem isSelected={props.selection === option} itemId={option} key={option}>
87+
props.options.map((option, idx) =>(
88+
<MenuItem isSelected={props.selection === option} itemId={option} key={option + idx}>
8989
{option}
9090
</MenuItem>
9191
))

horreum-web/src/domain/runs/TestDatasets.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ import { teamsSelector, teamToName, tokenSelector } from "../../auth"
2525

2626
import {
2727
CellProps,
28-
UseTableOptions,
29-
UseRowSelectInstanceProps,
30-
UseRowSelectRowProps,
3128
Column,
3229
UseSortByColumnOptions,
3330
SortingRule,
@@ -130,7 +127,11 @@ export default function TestDatasets() {
130127
useEffect(() => {
131128
fetchTest(testIdInt, alerting)
132129
.then(setTest)
133-
.then(() => fetchViews(testIdInt, alerting).then(setViews))
130+
.then(() => fetchViews(testIdInt, alerting).then(res => {
131+
setViewId(res?.find(v => v.name.toLowerCase() === "default")?.id || -1)
132+
return res
133+
}).then(setViews)
134+
)
134135
}, [testIdInt, teams, token])
135136

136137
useEffect(() => {

0 commit comments

Comments
 (0)