Skip to content

Commit

Permalink
Merge pull request #929 from BV-BRC/beta
Browse files Browse the repository at this point in the history
1/31/2025 release
  • Loading branch information
olsonanl authored Feb 3, 2025
2 parents 7088c93 + 5071d66 commit 18336f2
Show file tree
Hide file tree
Showing 18 changed files with 520 additions and 138 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "p3-web",
"version": "3.45.4",
"version": "3.46.3",
"private": true,
"scripts": {
"start": "node ./bin/p3-web",
Expand Down
2 changes: 1 addition & 1 deletion public/js/p3/resources/assembly.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.appTemplate {
width: 750px;
max-width: 750px;
margin: auto;
}

Expand Down
31 changes: 22 additions & 9 deletions public/js/p3/widget/DownloadTooltipDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,27 @@ define([
domConstruct.create('div', { 'class': 'wsActionTooltip', rel: 'csv', innerHTML: 'CSV' }, tData);
// domConstruct.create("div", {"class": "wsActionTooltip", rel: "excel", innerHTML: "Excel"}, tData);

tr = domConstruct.create('tr', {}, table);
var td = domConstruct.create('td', { colspan: 3, style: 'text-align:right' }, tr);
this.advancedDownloadButton = domConstruct.create('span', {
'class': 'wsActionTooltip',
style: 'padding:4px;',
rel: 'advancedDownload',
innerHTML: 'More Options'
}, td);
if (this.isGenomeOverview) {
const conf = this.downloadableConfig[this.containerType] || this.downloadableConfig['default'];
if (conf && conf.otherData) {
conf.otherData.forEach(function (type) {
domConstruct.create('div', {
'class': 'wsActionTooltip',
rel: type,
innerHTML: this.downloadableDataTypes[type]
}, this.otherDownloadNode);
}, this);
}
} else {
tr = domConstruct.create('tr', {}, table);
var td = domConstruct.create('td', {colspan: 3, style: 'text-align:right'}, tr);
this.advancedDownloadButton = domConstruct.create('span', {
'class': 'wsActionTooltip',
style: 'padding:4px;',
rel: 'advancedDownload',
innerHTML: 'More Options'
}, td);
}

this.set('content', dstContent);

Expand All @@ -250,7 +263,7 @@ define([
_setLabelAttr: function (val) {
this.label = val;
if (this._started) {
this.labelNode.innerHTML = 'Download selected ' + val + ' (' + (this.selection ? this.selection.length : '0') + ') as...';
this.labelNode.innerHTML = this.isGenomeOverview ? 'Download options' : 'Download selected ' + val + ' (' + (this.selection ? this.selection.length : '0') + ') as...';
}
},

Expand Down
18 changes: 12 additions & 6 deletions public/js/p3/widget/GenomeOverview.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ define([
'dojo/dom-class', 'dojo/query', 'dojo/dom-style', 'dojo/text!./templates/GenomeOverview.html', 'dojo/dom-construct',
'dijit/_WidgetBase', 'dijit/_TemplatedMixin', 'dijit/_WidgetsInTemplateMixin', 'dijit/Dialog',
'../util/PathJoin', './SelectionToGroup', './GenomeFeatureSummary', './DataItemFormatter',
'./ExternalItemFormatter', './AdvancedDownload', 'dijit/form/TextBox', 'dijit/form/Form', './Confirmation',
'./ExternalItemFormatter', './DownloadTooltipDialog', 'dijit/form/TextBox', 'dijit/form/Form', './Confirmation',
'./InputList', 'dijit/form/SimpleTextarea', 'dijit/form/DateTextBox', './MetaEditor',
'../DataAPI', './PermissionEditor', './ServicesTooltipDialog', 'dijit/popup'
], function (
declare, lang, on, xhr, Topic,
domClass, domQuery, domStyle, Template, domConstruct,
WidgetBase, Templated, _WidgetsInTemplateMixin, Dialog,
PathJoin, SelectionToGroup, GenomeFeatureSummary, DataItemFormatter,
ExternalItemFormatter, AdvancedDownload, TextBox, Form, Confirmation,
ExternalItemFormatter, DownloadTooltipDialog, TextBox, Form, Confirmation,
InputList, TextArea, DateTextBox, MetaEditor,
DataAPI, PermissionEditor, ServicesTooltipDialog, popup
) {
Expand Down Expand Up @@ -249,10 +249,16 @@ define([
},

onDownload: function () {
var dialog = new Dialog({ title: 'Download' });
var advDn = new AdvancedDownload({ selection: [this.genome], containerType: 'genome_data' });
domConstruct.place(advDn.domNode, dialog.containerNode);
dialog.show();
popup.open({
popup: new DownloadTooltipDialog({
selection: [this.genome],
containerType: 'genome_data',
isGenomeOverview: true
}),
parent: this,
around: this.genomeDownloadButton,
orient: ['below']
});
},

onClickUserGuide: function () {
Expand Down
3 changes: 2 additions & 1 deletion public/js/p3/widget/RerunUtility.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ define([], function () {
'HASubtypeNumberingConversion': 'HASubtypeNumberingConversion',
'TaxonomicClassification': 'TaxonomicClassification',
'TnSeq': 'Tnseq',
'Variation': 'Variation'
'Variation': 'Variation',
'ViralAssembly': 'ViralAssembly'
};

// TODO: addin modal parameter
Expand Down
16 changes: 16 additions & 0 deletions public/js/p3/widget/WorkspaceBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,22 @@ define([
}
}, false);

this.browserHeader.addAction('ViewViralAssemblyReport', 'fa icon-eye fa-2x', {
label: 'Report',
multiple: false,
validTypes: ['ViralAssembly'],
tooltip: 'View Viral Assembly Report'
}, function (selection) {
const path = selection[0].autoMeta.output_files.find(meta_file_data =>
meta_file_data[0].includes('AssemblyReport.html')
);
if (path && path[0]) {
Topic.publish('/navigate', { href: '/workspace' + encodePath(path[0]) });
} else {
console.log('Error: could not find AssemblyReport.html output file');
}
}, false);

this.browserHeader.addAction('ViewHASubtypeNumberingReport', 'fa icon-eye fa-2x', {
label: 'Report',
multiple: false,
Expand Down
91 changes: 51 additions & 40 deletions public/js/p3/widget/app/Docking.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,34 +85,36 @@ define([
},

onInputChange: function (evt) {
// protein radio buttons
if (this.protein_databank_selection.checked) {
// set display logic
dojo.style(this.block_pdb_list, "display", "block");
dojo.style(this.block_pdb_upload, "display", "none");
}
else if (this.user_pdb_file.checked) {
dojo.style(this.block_pdb_list, "display", "none");
dojo.style(this.block_pdb_upload, "display", "block");
}
// ligand radio buttons
if (this.input_sequence.checked)
{
dojo.style(this.block_smiles_text, 'display', 'block');
dojo.style(this.block_smiles_ws, 'display', 'none');
dojo.style(this.block_smiles_dropdown, 'display', 'none');
}
else if (this.ws_file.checked)
{
dojo.style(this.block_smiles_text, 'display', 'none');
dojo.style(this.block_smiles_ws, 'display', 'block');
dojo.style(this.block_smiles_dropdown, 'display', 'none');
}
else if (this.ligand_named_library.checked)
if (typeof this.protein_databank_selection != "undefined"){
// protein radio buttons
if (this.protein_databank_selection.checked) {
// set display logic
dojo.style(this.block_pdb_list, "display", "block");
dojo.style(this.block_pdb_upload, "display", "none");
}
else if (this.user_pdb_file.checked) {
dojo.style(this.block_pdb_list, "display", "none");
dojo.style(this.block_pdb_upload, "display", "block");
}
// ligand radio buttons
if (this.input_sequence.checked)
{
dojo.style(this.block_smiles_text, 'display', 'block');
dojo.style(this.block_smiles_ws, 'display', 'none');
dojo.style(this.block_smiles_dropdown, 'display', 'none');
}
else if (this.ws_file.checked)
{
dojo.style(this.block_smiles_text, 'display', 'none');
dojo.style(this.block_smiles_ws, 'display', 'none');
dojo.style(this.block_smiles_dropdown, 'display', 'block');
dojo.style(this.block_smiles_text, 'display', 'none');
dojo.style(this.block_smiles_ws, 'display', 'block');
dojo.style(this.block_smiles_dropdown, 'display', 'none');
}
else if (this.ligand_named_library.checked)
{
dojo.style(this.block_smiles_text, 'display', 'none');
dojo.style(this.block_smiles_ws, 'display', 'none');
dojo.style(this.block_smiles_dropdown, 'display', 'block');
}
}
},

Expand All @@ -130,7 +132,7 @@ define([
"pdb_preview": "",
"input": "smiles_list",
"smiles_text": "asdfasdf",
"smiles_ws_file": "",
"ligand_ws_file": "",
"output_path": "/olson@patricbrc.org/home/test/test1/test2",
"output_file": "abc"
} */
Expand Down Expand Up @@ -179,7 +181,7 @@ define([
}
else if (values.input === 'ws_file')
{
submit_values.ligand_ws_file = values.smiles_ws_file;
submit_values.ligand_ws_file = values.ligand_ws_file;
}
else if (values.input === 'named_library')
{
Expand All @@ -201,7 +203,7 @@ define([
}
}
},

onOutputPathChange: function (val) {
this.inherited(arguments);
this.checkParameterRequiredFields();
Expand All @@ -213,13 +215,25 @@ define([
},

addRerunFields: function (job_params) {
var ligand_library_type = job_params['ligand_library_type'];
// Protein Input
if (job_params.protein_input_type === 'user_pdb_file'){
this.protein_databank_selection.set('checked', false);
this.user_pdb.set('value', job_params["user_pdb_file"])
this.user_pdb_file.set('checked', true);
}
else if (job_params.protein_input_type === 'input_pdb'){
this.pdb_list.set('value', job_params["input_pdb"]);
}
else {
console.log( 'Invalid protein input');
}
// ligand library is not working just yet
var ligand_library_type = job_params['ligand_library_type'];
if (ligand_library_type === "ws_file"){
this.ws_file.checked
this.ws_file.set('value', ligand_library_type);
this.smiles_ws_file.set('value', job_params['ligand_ws_file']);

}
this.ligand_ws_file.set('value', job_params['ligand_ws_file']);
}
else if (ligand_library_type === "smiles_list"){
this.input_sequence.checked;
this.input_sequence.set('value', ligand_library_type);
Expand All @@ -234,15 +248,13 @@ define([
else if (ligand_library_type === "named_library"){
this.ligand_named_library.checked;
this.ligand_named_library.set('value', ligand_library_type);
this.smiles_dropdown.set('value', job_params['ligand_named_library'])
this.ligand_named_library.set('value', job_params['ligand_named_library']);
this.smiles_dropdown_attach_point.set('value', job_params['ligand_named_library']);
}
else{
else {
console.log("Improper ligand library type passed.")
}
this.pdb_list.set('value', job_params["input_pdb"]);
this.output_path.set('value', job_params['output_path']);
},
},

intakeRerunForm: function () {
// assuming only one key
Expand All @@ -269,4 +281,3 @@ define([
}
});
});

Loading

0 comments on commit 18336f2

Please sign in to comment.