Skip to content

Commit

Permalink
Feature Search : GUI feedback when no result
Browse files Browse the repository at this point in the history
part of #444 (as was previous commit aac5b89)
goto-feature-list.js : matchAliasesChanged() : set .matchAliases = value, which is now target.checked not event.
manage-genotype.js : vcfGenotypeReceiveResult() : resultCounts : log createdFeatures.length
blast-results-view.js : showTable() : after promise is resolved, don't continue loop waiting for result.

goto-feature-list.hbs :
 <input checkbox matchAliases : pass value='target.checked' to matchAliasesChanged (default arg wasxo event)
 instead of displaying .blocksOfFeatures.length when non-zero, display it when not .loading, and also display .aliases.length
  • Loading branch information
Don-Isdale committed Dec 6, 2024
1 parent aac5b89 commit fb97d70
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
1 change: 1 addition & 0 deletions frontend/app/components/goto-feature-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default Component.extend({

matchAliasesChanged(value) {
dLog('matchAliasesChanged', value, this.matchAliases);
this.matchAliases = value;
},


Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/panel/manage-genotype.js
Original file line number Diff line number Diff line change
Expand Up @@ -2721,6 +2721,7 @@ export default class PanelManageGenotypeComponent extends Component {
if (resultCounts) {
resultCounts.blocks++;
resultCounts.features += added.createdFeatures.length;
dLog(fnName, resultCounts, 'createdFeatures.length', added.createdFeatures.length);
}

const showOtherBlocks = true;
Expand Down
7 changes: 6 additions & 1 deletion frontend/app/components/panel/upload/blast-results-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,12 @@ export default Component.extend({
p && p.then(() => {
dLog('showTable then', this.get('data')?.length);
// alternative : dataForTableEffect() could do this if ! table.
this.shownBsTab(); });
const resolved = (p.state() === "resolved") || (p.readyState == 4);
if (! resolved || this.data.length || p.responseJSON?.features?.length) {
this.shownBsTab();
}
// else don't show table if resolved and ! data.length
});
} else
// Ensure table is created when tab is shown
if (! (table = this.get('table')) ||
Expand Down
21 changes: 16 additions & 5 deletions frontend/app/templates/components/goto-feature-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
type="checkbox"
name="matchAliases"
checked={{this.matchAliases}}
oninput={{action this.matchAliasesChanged preventDefault=false}}
oninput={{action this.matchAliasesChanged value='target.checked' preventDefault=false}}
id="checkbox-matchAliases"
/>
<label for="checkbox-matchAliases">Match aliases</label>
Expand Down Expand Up @@ -75,10 +75,21 @@
{{!-- → &#8594; &rarr; RIGHTWARDS ARROW --}}

<div style="clear:both; margin-top : 4ex;">
{{#if this.blocksOfFeatures.length}}
<span class="badge">
{{this.blocksOfFeatures.length}}
</span>
{{#if this.taskGet.lastPerformed}}
{{#unless this.loading }}
<label>Received :</label>
<ul style="list-style-type: none;">
<li>{{this.blocksOfFeatures.length}} Features</li>
{{!-- if this.matchAliases the result shape is Features [],
otherwise { aliases: [...], features: [...] }
Using this.matchAliases in this if expression does not currently update,
but will probably work after converting this component from
Ember Component to a native class which extends glimmer Component --}}
{{#if this.taskGet.lastPerformed.value.aliases }}
<li>{{this.aliases.length}} Aliases</li>
{{/if}}
</ul>
{{/unless}}
{{/if}}
</div>
</div>
Expand Down

0 comments on commit fb97d70

Please sign in to comment.