Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix select components #5394

Merged
merged 4 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- 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)
- 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)
- 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)
- Fixed broken search functionality in select components. [#5394](https://github.com/scalableminds/webknossos/pull/5394)

### Removed
-
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/dataset/dataset_components.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function DatastoreFormItem({
<Select
showSearch
placeholder="Select a Datastore"
optionFilterProp="children"
optionFilterProp="label"
philippotto marked this conversation as resolved.
Show resolved Hide resolved
style={{ width: "100%" }}
options={datastores.map((datastore: APIDataStore) => ({
label: datastore.name,
Expand Down
4 changes: 2 additions & 2 deletions frontend/javascripts/admin/project/project_create_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function ProjectCreateView({ projectName }: PropsWithRouter) {
<Select
showSearch
placeholder="Select a Team"
optionFilterProp="children"
optionFilterProp="label"
style={fullWidth}
disabled={isEditMode}
notFoundContent={isFetchingData ? <Spin size="small" /> : "No Data"}
Expand All @@ -117,7 +117,7 @@ function ProjectCreateView({ projectName }: PropsWithRouter) {
<Select
showSearch
placeholder="Select a User"
optionFilterProp="children"
optionFilterProp="label"
style={fullWidth}
disabled={isEditMode}
notFoundContent={isFetchingData ? <Spin size="small" /> : "No Data"}
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/scripts/script_create_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function ScriptCreateView({ scriptId, activeUser, history }: PropsWithRouter) {
<Select
showSearch
placeholder="Select a User"
optionFilterProp="children"
optionFilterProp="label"
style={{ width: "100%" }}
notFoundContent={isFetchingData ? <Spin size="small" /> : "No Data"}
options={users.map((user: APIUser) => ({
Expand Down
8 changes: 4 additions & 4 deletions frontend/javascripts/admin/task/task_create_form_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class TaskCreateFormView extends React.PureComponent<Props, State> {
? "The dataset is inferred from the base annotation."
: "Select a Dataset"
}
optionFilterProp="children"
optionFilterProp="label"
style={fullWidth}
disabled={
isEditingMode || this.state.specificationType === SpecificationEnum.BaseAnnotation
Expand Down Expand Up @@ -469,7 +469,7 @@ class TaskCreateFormView extends React.PureComponent<Props, State> {
<Select
showSearch
placeholder="Select a TaskType"
optionFilterProp="children"
optionFilterProp="label"
style={fullWidth}
disabled={isEditingMode}
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}
Expand Down Expand Up @@ -522,7 +522,7 @@ class TaskCreateFormView extends React.PureComponent<Props, State> {
<Select
showSearch
placeholder="Select a Project"
optionFilterProp="children"
optionFilterProp="label"
style={fullWidth}
disabled={isEditingMode}
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}
Expand All @@ -537,7 +537,7 @@ class TaskCreateFormView extends React.PureComponent<Props, State> {
<Select
showSearch
placeholder="Select a Script"
optionFilterProp="children"
optionFilterProp="label"
style={fullWidth}
disabled={isEditingMode}
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/task/task_list_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class TaskListView extends React.PureComponent<Props, State> {
<h3>Tasks</h3>
<div className="clearfix" style={{ margin: "20px 0px" }} />

<Card title="Search for Tasks">
<Card title="Search for TaskSearchForm">
philippotto marked this conversation as resolved.
Show resolved Hide resolved
<TaskSearchForm
onChange={queryObject => this.fetchData(queryObject)}
initialFieldValues={this.props.initialFieldValues}
Expand Down
6 changes: 3 additions & 3 deletions frontend/javascripts/admin/task/task_search_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class TaskSearchForm extends React.Component<Props, State> {
showSearch
allowClear
placeholder="Select a Task Type"
optionFilterProp="children"
optionFilterProp="label"
style={{ width: "100%" }}
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}
options={this.state.taskTypes.map((taskType: APITaskType) => ({
Expand All @@ -222,7 +222,7 @@ class TaskSearchForm extends React.Component<Props, State> {
allowClear
showSearch
placeholder="Select a Project"
optionFilterProp="children"
optionFilterProp="label"
style={{ width: "100%" }}
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}
options={this.state.projects.map((project: APIProject) => ({
Expand All @@ -238,7 +238,7 @@ class TaskSearchForm extends React.Component<Props, State> {
allowClear
showSearch
placeholder="Select a User"
optionFilterProp="children"
optionFilterProp="label"
style={{ width: "100%" }}
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}
options={this.state.users
Expand Down
6 changes: 3 additions & 3 deletions frontend/javascripts/admin/tasktype/task_type_create_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class TaskTypeCreateView extends React.PureComponent<Props, State> {
allowClear
showSearch
placeholder="Select a Team"
optionFilterProp="children"
optionFilterProp="label"
style={{ width: "100%" }}
notFoundContent={this.state.isFetchingData ? <Spin size="small" /> : "No Data"}
options={this.state.teams.map((team: APITeam) => ({
Expand Down Expand Up @@ -260,7 +260,7 @@ class TaskTypeCreateView extends React.PureComponent<Props, State> {
mode="multiple"
allowClear
placeholder="Select all Allowed Modes"
optionFilterProp="children"
optionFilterProp="label"
style={{ width: "100%" }}
options={[
{ value: "orthogonal", label: "Orthogonal" },
Expand All @@ -273,7 +273,7 @@ class TaskTypeCreateView extends React.PureComponent<Props, State> {
<FormItem name={["settings", "preferredMode"]} label="Preferred Mode" hasFeedback>
<Select
allowClear
optionFilterProp="children"
optionFilterProp="label"
style={{ width: "100%" }}
options={[
{ value: null, label: "Any" },
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/time/time_line_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class TimeLineView extends React.PureComponent<Props, State> {
allowClear
showSearch
placeholder="Select a User"
optionFilterProp="children"
optionFilterProp="label"
style={{ width: "100%" }}
onChange={this.handleUserChange}
notFoundContent={this.state.isFetchingUsers ? <Spin size="small" /> : "No Data"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class UserSelectionComponent extends React.PureComponent<Props, State> {
placeholder="Select a New User"
value={this.state.currentUserIdValue}
onChange={this.handleSelectChange}
optionFilterProp="children"
optionFilterProp="label"
style={{ width: "100%" }}
filterOption={(input, option) =>
option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
Expand Down