Skip to content

Commit 00a038c

Browse files
authored
Merge pull request #731 from tadast/tt/search-header-plugin
Simplify webpack config and allow adding a header above search form
2 parents 9aabe65 + f4ad042 commit 00a038c

8 files changed

Lines changed: 30 additions & 13 deletions

File tree

bin/sequenceserver

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ begin
398398
end
399399

400400
if import?
401-
xml_file = fetch_option(:import).value
402-
params = {:xml => xml_file}
401+
xml_file_path = fetch_option(:import).value
402+
params = {:xml => xml_file_path}
403403
job = SequenceServer::BLAST::Job.new(params)
404404
puts job.id
405405
exit

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ module.exports = {
4444
'report_plugins': '<rootDir>/public/js/null_plugins/report_plugins.js',
4545
'download_links': '<rootDir>/public/js/null_plugins/download_links.js',
4646
'hit_buttons': '<rootDir>/public/js/null_plugins/hit_buttons.js',
47+
'search_header_plugin': '<rootDir>/public/js/null_plugins/search_header_plugin.js',
4748
},
4849
watchPlugins: [
4950
'jest-watch-typeahead/filename',

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
},
1111
"scripts": {
1212
"watch": "webpack --watch",
13-
"watch-cloud": "webpack --watch --env=reportPluginsPath='../sequence_server_js_extensions/report_plugins.js' --env=downloadLinks='../sequence_server_js_extensions/conserved_domains/download_links.js' --env=hitButtons='../sequence_server_js_extensions/hit_buttons.js' --env=targetEnv='cloud'",
13+
"watch-cloud": "webpack --watch --env=pluginsPath='../sequence_server_js_extensions' --env=targetEnv='cloud'",
1414
"test": "jest",
1515
"minify:css": "cleancss public/css/sequenceserver.css > public/css/sequenceserver.min.css",
1616
"build": "webpack && npm run minify:css",
17-
"build-cloud": "webpack --env=reportPluginsPath='../sequence_server_js_extensions/report_plugins.js' --env=downloadLinks='../sequence_server_js_extensions/conserved_domains/download_links.js' --env=hitButtons='../sequence_server_js_extensions/hit_buttons.js' --env=targetEnv='cloud' && npm run minify:css"
17+
"build-cloud": "webpack --env=pluginsPath='../sequence_server_js_extensions' --env=targetEnv='cloud' && npm run minify:css"
1818
},
1919
"dependencies": {
2020
"babel-plugin-transform-export-extensions": "^6.22.0",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const SearchHeaderPlugin = () => {
2+
return '';
3+
};
4+

public/js/search.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React, { Component } from "react";
33
import { createRoot } from "react-dom/client";
44
import { DnD } from "./dnd";
55
import { Form } from "./form";
6+
import { SearchHeaderPlugin } from "search_header_plugin";
67

78
/**
89
* Clear sessionStorage on reload.
@@ -19,6 +20,7 @@ class Page extends Component {
1920
render() {
2021
return (
2122
<div>
23+
<SearchHeaderPlugin />
2224
<DnD ref="dnd" />
2325
<Form ref="form" />
2426
</div>

public/sequenceserver-search.min.js

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/search.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<%= erb :blastp_options %>
3838
</div>
3939
</div>
40-
40+
4141
<div
4242
class="modal-footer">
4343
<button
@@ -49,4 +49,4 @@
4949
</div>
5050
</div>
5151
</div>
52-
</div>
52+
</div>

webpack.config.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ const path = require('path');
33
const webpack = require('webpack');
44

55
module.exports = (env, argv) => {
6-
const reportPluginsPath = env.reportPluginsPath || './public/js/null_plugins/report_plugins.js';
7-
const downloadLinks = env.downloadLinks || './public/js/null_plugins/download_links.js';
8-
const hitButtons = env.hitButtons || './public/js/null_plugins/hit_buttons.js';
6+
const pluginsPath = env.pluginsPath || './public/js/null_plugins';
97

108
return {
119
entry: {
@@ -45,9 +43,10 @@ module.exports = (env, argv) => {
4543
resolve: {
4644
modules: [path.resolve(__dirname, 'public', 'js'), path.resolve(__dirname, 'node_modules')],
4745
alias: {
48-
'report_plugins': path.resolve(__dirname, reportPluginsPath),
49-
'download_links': path.resolve(__dirname, downloadLinks),
50-
'hit_buttons': path.resolve(__dirname, hitButtons),
46+
'report_plugins': path.resolve(__dirname, pluginsPath, 'report_plugins.js'),
47+
'download_links': path.resolve(__dirname, pluginsPath, 'download_links.js'),
48+
'hit_buttons': path.resolve(__dirname, pluginsPath, 'hit_buttons.js'),
49+
'search_header_plugin': path.resolve(__dirname, pluginsPath, 'search_header_plugin.js'),
5150
}
5251
}
5352
};

0 commit comments

Comments
 (0)