Skip to content

Commit 1213b70

Browse files
Fix select components (#5394)
* pass correct filter prop to select component * update changelog * Update frontend/javascripts/admin/task/task_list_view.js Co-authored-by: Daniel <[email protected]> Co-authored-by: Daniel <[email protected]>
1 parent 933ac20 commit 1213b70

9 files changed

+17
-16
lines changed

CHANGELOG.unreleased.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
2323
- Fixed a bug where some values in the project list were displayed incorrectly after pausing/unpausing the project. [#5339](https://github.com/scalableminds/webknossos/pull/5339)
2424
- Fixed that editing a task type would always re-add the default values to the recommended configuration (if enabled). [#5341](https://github.com/scalableminds/webknossos/pull/5341)
2525
- Fixed a bug where tasks created from existing volume annotations that did not have a specified bounding box were broken. [#5362](https://github.com/scalableminds/webknossos/pull/5361)
26+
- Fixed broken search functionality in select components. [#5394](https://github.com/scalableminds/webknossos/pull/5394)
2627
- Fixed a bug which could cause corrupted trees when CTRL+Rightclick was used in an empty tree. [#5385](https://github.com/scalableminds/webknossos/pull/5385)
2728
- Fixed a bug in Safari which could cause an error message (which is safe to ignore). [#5373](https://github.com/scalableminds/webknossos/pull/5373)
2829
- Fixed artifacts in screenshots near the dataset border. [#5324](https://github.com/scalableminds/webknossos/pull/5324)

frontend/javascripts/admin/dataset/dataset_components.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function DatastoreFormItem({
8282
<Select
8383
showSearch
8484
placeholder="Select a Datastore"
85-
optionFilterProp="children"
85+
optionFilterProp="label"
8686
style={{ width: "100%" }}
8787
options={datastores.map((datastore: APIDataStore) => ({
8888
label: datastore.name,

frontend/javascripts/admin/project/project_create_view.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function ProjectCreateView({ projectName }: PropsWithRouter) {
102102
<Select
103103
showSearch
104104
placeholder="Select a Team"
105-
optionFilterProp="children"
105+
optionFilterProp="label"
106106
style={fullWidth}
107107
disabled={isEditMode}
108108
notFoundContent={isFetchingData ? <Spin size="small" /> : "No Data"}
@@ -117,7 +117,7 @@ function ProjectCreateView({ projectName }: PropsWithRouter) {
117117
<Select
118118
showSearch
119119
placeholder="Select a User"
120-
optionFilterProp="children"
120+
optionFilterProp="label"
121121
style={fullWidth}
122122
disabled={isEditMode}
123123
notFoundContent={isFetchingData ? <Spin size="small" /> : "No Data"}

frontend/javascripts/admin/scripts/script_create_view.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function ScriptCreateView({ scriptId, activeUser, history }: PropsWithRouter) {
9292
<Select
9393
showSearch
9494
placeholder="Select a User"
95-
optionFilterProp="children"
95+
optionFilterProp="label"
9696
style={{ width: "100%" }}
9797
notFoundContent={isFetchingData ? <Spin size="small" /> : "No Data"}
9898
options={users.map((user: APIUser) => ({

frontend/javascripts/admin/task/task_create_form_view.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ class TaskCreateFormView extends React.PureComponent<Props, State> {
415415
? "The dataset is inferred from the base annotation."
416416
: "Select a Dataset"
417417
}
418-
optionFilterProp="children"
418+
optionFilterProp="label"
419419
style={fullWidth}
420420
disabled={
421421
isEditingMode || this.state.specificationType === SpecificationEnum.BaseAnnotation
@@ -469,7 +469,7 @@ class TaskCreateFormView extends React.PureComponent<Props, State> {
469469
<Select
470470
showSearch
471471
placeholder="Select a TaskType"
472-
optionFilterProp="children"
472+
optionFilterProp="label"
473473
style={fullWidth}
474474
disabled={isEditingMode}
475475
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}
@@ -522,7 +522,7 @@ class TaskCreateFormView extends React.PureComponent<Props, State> {
522522
<Select
523523
showSearch
524524
placeholder="Select a Project"
525-
optionFilterProp="children"
525+
optionFilterProp="label"
526526
style={fullWidth}
527527
disabled={isEditingMode}
528528
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}
@@ -537,7 +537,7 @@ class TaskCreateFormView extends React.PureComponent<Props, State> {
537537
<Select
538538
showSearch
539539
placeholder="Select a Script"
540-
optionFilterProp="children"
540+
optionFilterProp="label"
541541
style={fullWidth}
542542
disabled={isEditingMode}
543543
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}

frontend/javascripts/admin/task/task_search_form.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class TaskSearchForm extends React.Component<Props, State> {
204204
showSearch
205205
allowClear
206206
placeholder="Select a Task Type"
207-
optionFilterProp="children"
207+
optionFilterProp="label"
208208
style={{ width: "100%" }}
209209
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}
210210
options={this.state.taskTypes.map((taskType: APITaskType) => ({
@@ -222,7 +222,7 @@ class TaskSearchForm extends React.Component<Props, State> {
222222
allowClear
223223
showSearch
224224
placeholder="Select a Project"
225-
optionFilterProp="children"
225+
optionFilterProp="label"
226226
style={{ width: "100%" }}
227227
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}
228228
options={this.state.projects.map((project: APIProject) => ({
@@ -238,7 +238,7 @@ class TaskSearchForm extends React.Component<Props, State> {
238238
allowClear
239239
showSearch
240240
placeholder="Select a User"
241-
optionFilterProp="children"
241+
optionFilterProp="label"
242242
style={{ width: "100%" }}
243243
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}
244244
options={this.state.users

frontend/javascripts/admin/tasktype/task_type_create_view.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class TaskTypeCreateView extends React.PureComponent<Props, State> {
205205
allowClear
206206
showSearch
207207
placeholder="Select a Team"
208-
optionFilterProp="children"
208+
optionFilterProp="label"
209209
style={{ width: "100%" }}
210210
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}
211211
options={this.state.teams.map((team: APITeam) => ({
@@ -260,7 +260,7 @@ class TaskTypeCreateView extends React.PureComponent<Props, State> {
260260
mode="multiple"
261261
allowClear
262262
placeholder="Select all Allowed Modes"
263-
optionFilterProp="children"
263+
optionFilterProp="label"
264264
style={{ width: "100%" }}
265265
options={[
266266
{ value: "orthogonal", label: "Orthogonal" },
@@ -273,7 +273,7 @@ class TaskTypeCreateView extends React.PureComponent<Props, State> {
273273
<FormItem name={["settings", "preferredMode"]} label="Preferred Mode" hasFeedback>
274274
<Select
275275
allowClear
276-
optionFilterProp="children"
276+
optionFilterProp="label"
277277
style={{ width: "100%" }}
278278
options={[
279279
{ value: null, label: "Any" },

frontend/javascripts/admin/time/time_line_view.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ class TimeLineView extends React.PureComponent<Props, State> {
275275
allowClear
276276
showSearch
277277
placeholder="Select a User"
278-
optionFilterProp="children"
278+
optionFilterProp="label"
279279
style={{ width: "100%" }}
280280
onChange={this.handleUserChange}
281281
notFoundContent={this.state.isFetchingUsers ? <Spin size="small" /> : "No Data"}

frontend/javascripts/admin/user/user_selection_component.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class UserSelectionComponent extends React.PureComponent<Props, State> {
6161
placeholder="Select a New User"
6262
value={this.state.currentUserIdValue}
6363
onChange={this.handleSelectChange}
64-
optionFilterProp="children"
64+
optionFilterProp="label"
6565
style={{ width: "100%" }}
6666
filterOption={(input, option) =>
6767
option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0

0 commit comments

Comments
 (0)