Skip to content

Commit

Permalink
blast-result-view : make transient dataset and block ids unique by pa…
Browse files Browse the repository at this point in the history
…rent

 ... to address issue of subsequent results not displaying features/triangles.
dnaSequenceSearch.bash : pass datasetId to dev_blastResult, so that multiple results can be simulated in development.

blast-results-view.js : viewFeatures() :
append parentName to datasetName for transient datasets, to make them distinct by parent.
add featuresU : prepend dataset.id to features[*].blockId

transient.js : pushBlockArgs() : blockId : prefix datasetId, so that results for different parents are distinct.
  • Loading branch information
Don-Isdale committed Jul 5, 2021
1 parent 13c2c28 commit 8f08e60
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/scripts/dnaSequenceSearch.bash
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ if [ -d ../../pretzel.A1 ]
then
# sleep 10
# FJ039903.1, DQ146423.1
dev_blastResult | \
dev_blastResult "$datasetId" | \
( [ "$addDataset" = true ] && convertSearchResults2Json || cat) | \
( [ -n "$resultRows" ] && head -n $resultRows || cat)
status=$?
Expand Down
8 changes: 6 additions & 2 deletions frontend/app/components/panel/upload/blast-results-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,9 @@ export default Component.extend({
}
let
transient = this.get('transient'),
datasetName = this.get('newDatasetName') || 'blastResults',
parentName = this.get('search.parent'),
/** append parentName to make transient datasets distinct by parent */
datasetName = this.get('newDatasetName') || ('blastResults_' + parentName),
namespace = this.get('namespace'),
dataset = transient.pushDatasetArgs(
datasetName,
Expand All @@ -426,6 +428,8 @@ export default Component.extend({
this.get('blockNames'),
namespace
);
/** change features[].blockId to match blocks[], which has dataset.id prefixed to make them distinct. */
let featuresU = features.map((f) => { let {blockId, ...rest} = f; rest.blockId = dataset.id + '-' + blockId; return rest; });
/** When changing between 2 blast-results tabs, this function will be
* called for both.
*
Expand All @@ -445,7 +449,7 @@ export default Component.extend({
active,
/* when switching tabs got : this.isDestroyed===true, this.viewRow and this.get('viewRow') undefined
* but this.search.viewRow OK */
() => transient.showFeatures(dataset, blocks, features, active, this.get('viewRow') || this.search.viewRow));
() => transient.showFeatures(dataset, blocks, featuresU, active, this.get('viewRow') || this.search.viewRow));
}
},

Expand Down
3 changes: 2 additions & 1 deletion frontend/app/services/data/transient.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ export default Service.extend({

pushBlockArgs(datasetId, name, namespace) {
let
/** may need to pass search ID also; depends on whether distinct blocks should be used for each search result. */
/** prefix _id with datasetId to make it unique enough. May use UUID. */
data = {_id : /*datasetId + '-' +*/ name, scope : name, name, namespace, datasetId},
data = {_id : datasetId + '-' + name, scope : name, name, namespace, datasetId},
store = this.get('store'),
record = this.pushData(store, 'block', data);
return record;
Expand Down

0 comments on commit 8f08e60

Please sign in to comment.