Skip to content

Commit

Permalink
Merge branch 'main' into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Almighty committed Oct 1, 2023
2 parents 7965aa7 + 8be6ec8 commit 4631ea9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
19 changes: 17 additions & 2 deletions assets/app_component_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,17 @@ const datasetView = () =>
c.dirs_from_path[c.dirs_from_path.length - 1]
.toLowerCase()
.indexOf(this.search_text.toLowerCase()) >= 0 ||
// || (c.authors.some(e => e.givenName.toLowerCase().indexOf(this.search_text.toLowerCase()) >= 0))
c.authors.some(
(f) =>
f.name.toLowerCase().indexOf(this.search_text.toLowerCase()) >= 0
f.givenName && f.givenName.toLowerCase().indexOf(this.search_text.toLowerCase()) >= 0
) ||
c.authors.some(
(f) =>
f.familyName && f.familyName.toLowerCase().indexOf(this.search_text.toLowerCase()) >= 0
) ||
c.authors.some(
(f) =>
f.name && f.name.toLowerCase().indexOf(this.search_text.toLowerCase()) >= 0
)
);
});
Expand Down Expand Up @@ -326,6 +333,9 @@ const datasetView = () =>
dataset_version: objVersion,
},
}
// before navigation, clear filtering options
this.clearFilters()
// now navigate
if (newBrowserTab) {
const routeData = router.resolve(route_info);
window.open(routeData.href, '_blank');
Expand All @@ -338,6 +348,11 @@ const datasetView = () =>
this.$root.$emit("bv::show::modal", "modal-3", "#btnShow");
}
},
clearFilters() {
this.search_text = ""
this.search_tags = []
this.clearSearchTagText()
},
selectDescription(desc) {
if (desc.content.startsWith("path:")) {
this.description_ready = false;
Expand Down
3 changes: 3 additions & 0 deletions assets/app_component_item.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ Vue.component('tree-item', function (resolve, reject) {
dataset_version: objVersion,
},
}
// before navigation, clear filter options
this.$emit('clear-filters')
// now navigate
if (newBrowserTab) {
const routeData = router.resolve(route_info);
window.open(routeData.href, '_blank');
Expand Down
11 changes: 8 additions & 3 deletions templates/dataset-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ <h3>Cite dataset</h3>
<span v-else>
<span v-if="!subdatasets || !subdatasets.length"><em>There are no subdatasets listed for the current dataset</em></span>
<span v-else>
<b-form>
<b-form v-if="subdatasets.length > 3">
<b-row>
<b-col md="7">
<b-input-group>
Expand Down Expand Up @@ -246,7 +246,12 @@ <h5><a @click="selectDataset($event, ds)" class="newlink">{{ds.dirs_from_path.at
</b-col>
<b-col md="4">
<b-card-text>
<span v-for="keyword in ds.keywords"><b-button pill size="sm" class="p-1" variant="outline-dark" @click="addSearchTag(keyword)">{{keyword}}</b-button>&nbsp;</span>
<span v-if="subdatasets.length > 3">
<span v-for="keyword in ds.keywords"><b-button pill size="sm" class="p-1" variant="outline-dark" @click="addSearchTag(keyword)">{{keyword}}</b-button>&nbsp;</span>
</span>
<span v-else>
<span v-for="keyword in ds.keywords"><b-button pill size="sm" class="p-1" variant="outline-secondary">{{keyword}}</b-button>&nbsp;</span>
</span>
</b-card-text>
</b-col>
</b-row>
Expand All @@ -265,7 +270,7 @@ <h5><a @click="selectDataset($event, ds)" class="newlink">{{ds.dirs_from_path.at
<span v-else>
<b-card no-body class="p-2">
<ul>
<tree-item class="item" v-for="item in selectedDataset.tree" :item="item"></tree-item>
<tree-item class="item" v-for="item in selectedDataset.tree" :item="item" @clear-filters="clearFilters"></tree-item>
</ul>
</b-card>
</span>
Expand Down
2 changes: 1 addition & 1 deletion templates/item-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
</div>
<!-- Children of an open folder -->
<ul v-show="isOpen" v-if="isFolder">
<tree-item class="item" v-for="(child, index) in item.children" :key="index" :index="index" :item="child"></tree-item>
<tree-item class="item" v-for="(child, index) in item.children" :key="index" :index="index" :item="child" v-on="$listeners"></tree-item>
</ul>
</li>

0 comments on commit 4631ea9

Please sign in to comment.