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

Issue/608 #645

Merged
merged 3 commits into from
Jul 20, 2023
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
5 changes: 3 additions & 2 deletions public/js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,17 @@ export class Form extends Component {
}

handleAlgoChanged(algo) {
if (this.state.preDefinedOpts.hasOwnProperty(algo)) {
if (algo in this.state.preDefinedOpts) {
var preDefinedOpts = this.state.preDefinedOpts[algo];
this.refs.opts.setState({
method: algo,
preOpts: preDefinedOpts,
value: (preDefinedOpts['last search'] ||
preDefinedOpts['default']).join(' ')
});
}
else {
this.refs.opts.setState({ preOpts: {}, value: '' });
this.refs.opts.setState({ preOpts: {}, value: '', method: '' });
}
}

Expand Down
18 changes: 14 additions & 4 deletions public/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import React, { Component } from 'react';
export class Options extends Component {
constructor(props) {
super(props);
this.state = { preOpts: {}, value: '' };
this.state = { preOpts: {}, value: '', method: '' };
this.updateBox = this.updateBox.bind(this);
this.optionsJSX = this.optionsJSX.bind(this);
this.showAdvancedOptions = this.showAdvancedOptions.bind(this);
}

updateBox(value) {
Expand Down Expand Up @@ -37,7 +38,14 @@ export class Options extends Component {
</ul>
</span>;
}

showAdvancedOptions(e) {
const ids = ['blastn', 'tblastn', 'blastp', 'blastx', 'tblastx'];
const method = this.state.method.toLowerCase();
// hide options for other algorithms and only show for selected algorithm
for (const id of ids) {
$(`#${id}`)[id === method ? 'show' : 'hide']();
}
}
render() {
var classNames = 'form-control';
if (this.state.value.trim()) {
Expand All @@ -50,12 +58,14 @@ export class Options extends Component {
<div className="input-group">
<label className="control-label" htmlFor="advanced">
Advanced parameters:
<sup style={{ marginLeft: '2px' }}>
{/* only show link to advanced parameters if blast method is known */}
{this.state.method && <sup style={{ marginLeft: '2px' }}>
<a href=''
onClick={this.showAdvancedOptions}
data-toggle="modal" data-target="#help">
<i className="fa fa-question-circle"></i>
</a>
</sup>
</sup>}
</label>
<input type="text" className={classNames}
onChange={e => this.updateBox(e.target.value)}
Expand Down
4 changes: 2 additions & 2 deletions public/sequenceserver-search.min.js

Large diffs are not rendered by default.

156 changes: 0 additions & 156 deletions views/_options.erb

This file was deleted.

Loading