Skip to content

Commit 5c762e5

Browse files
Merge branch 'BV-BRC:master' into main
2 parents 597eabb + da27a29 commit 5c762e5

21 files changed

+358
-141
lines changed

app.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ app.use(favicon(path.join(__dirname, '/public/favicon.ico')));
3636
app.use(logger('dev'));
3737
app.use(cookieParser(config.get('cookieSecret')));
3838

39+
const proxyConfig = config.get('proxyConfig');
40+
if (proxyConfig) {
41+
const proxy = require("express-http-proxy");
42+
var prox;
43+
44+
for (const prox of proxyConfig) {
45+
console.log(prox);
46+
app.use(prox.local, proxy(prox.site, {
47+
proxyReqPathResolver: req => req.originalUrl.replace(prox.local, ""),
48+
https: true
49+
}));
50+
}
51+
}
52+
3953
app.use(function (req, res, next) {
4054
// console.log("Config.production: ", config.production);
4155
// console.log("Session Data: ", req.session);
@@ -52,6 +66,7 @@ app.use(function (req, res, next) {
5266
probModelSeedServiceURL: config.get('probModelSeedServiceURL'), // for dashboard
5367
shockServiceURL: config.get('shockServiceURL'), // for dashboard
5468
workspaceServiceURL: config.get('workspaceServiceURL'),
69+
workspaceDownloadServiceURL: config.get('workspaceDownloadServiceURL'),
5570
appBaseURL: config.get('appBaseURL'),
5671
appServiceURL: config.get('appServiceURL'),
5772
dataServiceURL: config.get('dataServiceURL'),

bin/p3-web

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/usr/bin/env node
2+
3+
const https = require('https');
4+
const fs = require('fs');
5+
26
var debug = require('debug')('p3-web');
37
var app = require('../app');
48
var conf = require('../config');
@@ -7,6 +11,21 @@ debug('Launching p3-www...');
711

812
app.set('port', conf.get('http_port') || 3000);
913

10-
var server = app.listen(app.get('port'), function () {
11-
debug('Express server listening on port ' + server.address().port);
12-
});
14+
const sslConfig = conf.get('sslConfig');
15+
var server;
16+
17+
if (sslConfig) {
18+
// Read SSL cert and key
19+
const sslOptions = {
20+
key: fs.readFileSync(sslConfig.ssl_key),
21+
cert: fs.readFileSync(sslConfig.ssl_cert)
22+
};
23+
server = https.createServer(sslOptions, app).listen(app.get('port'), function () {
24+
debug('Express server listening on SSL port ' + server.address().port);
25+
});
26+
}
27+
else {
28+
server = app.listen(app.get('port'), function () {
29+
debug('Express server listening on port ' + server.address().port);
30+
});
31+
}

package-lock.json

Lines changed: 32 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "p3-web",
3-
"version": "3.49.1",
3+
"version": "3.50.5",
44
"private": true,
55
"scripts": {
66
"start": "node ./bin/p3-web",
@@ -29,6 +29,7 @@
2929
"ejs": "^3.1.10",
3030
"express": "^4.19.2",
3131
"express-formidable": "^1.2.0",
32+
"express-http-proxy": "^2.1.1",
3233
"feedparser": "^2.2.10",
3334
"flag-icons": "^7.2.1",
3435
"formidable": "^2.1.2",

public/js/p3/resources/DataItemFormatter.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343

4444
.DataItemValue {
4545
vertical-align: top;
46+
word-wrap: break-word;
47+
overflow-wrap: break-word;
48+
white-space: normal;
4649
}
4750

4851
.DataItemSectionNotFound {

public/js/p3/widget/AdvancedSearchFields.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ define([], function () {
10761076
field: 'host_capture_status', type: 'str', facet: true, facet_hidden: true, search: true
10771077
},
10781078
{
1079-
field: 'host_health', type: 'str', facet: false, facet_hidden: true, search: true
1079+
field: 'host_health', type: 'str', facet: true, facet_hidden: true, search: true
10801080
},
10811081
{
10821082
field: 'exposure', type: 'str', facet: false, facet_hidden: true, search: true

public/js/p3/widget/ColumnsGenome.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,12 @@ define(['./formatter'], function (formatter) {
506506
hidden: false,
507507
group: 'Host Info'
508508
},
509+
host_scientific_name: {
510+
label: 'Host Scientific Name',
511+
field: 'host_scientific_name',
512+
hidden: true,
513+
group: 'Host Info'
514+
},
509515
host_gender: {
510516
label: 'Host Sex',
511517
field: 'host_gender',

public/js/p3/widget/DataItemFormatter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ define([
149149

150150
var mini = options && options.mini || false;
151151

152-
var table = domConstruct.create('table', {}, parent);
152+
var table = domConstruct.create('table', { 'style': 'table-layout: fixed;' }, parent);
153153
var tbody = domConstruct.create('tbody', {}, table);
154154

155155
sections.forEach(function (section) {

public/js/p3/widget/FilterContainerActionBar.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ define([
763763

764764
on(_row, 'remove', (evt) => {
765765
this._Searches[evt.idx].destroyRecursive()
766+
delete this._Searches[evt.idx];
766767
})
767768
on(_row, 'create', lang.hitch(this, 'createAdvancedSearchRow'))
768769
this._Searches[this._SearchesIdx] = _row
@@ -804,12 +805,13 @@ define([
804805
// TODO: implement this and trigger when context has changed
805806
},
806807
buildFilterQueryFromAdvancedSearch: function () {
808+
this._filter = {};
807809
Object.keys(this._Searches).map((idx) => {
808810
const col = this._Searches[idx]
809811
const condition = col.getValues()
810812
let q;
811813
if (condition.type === 'str') {
812-
q = `${condition.op === 'NOT' ? 'ne' : 'eq'}(${condition.column},${condition.value})`
814+
q = `${condition.op === 'NOT' ? 'ne' : 'eq'}(${condition.column},${encodeURIComponent(condition.value)})`;
813815
} else if (condition.type === 'date') {
814816
const encode = (date) => {
815817
if (!date) {
@@ -862,7 +864,9 @@ define([
862864
}
863865
}
864866
if (this._filter.hasOwnProperty(condition.column)) {
865-
this._filter[condition.column].push(q)
867+
if (!this._filter[condition.column].includes(q)) {
868+
this._filter[condition.column].push(q);
869+
}
866870
} else {
867871
this._filter[condition.column] = [q]
868872
}

0 commit comments

Comments
 (0)