Skip to content

Commit

Permalink
Merge branch 'ui-v2' of https://github.com/IGS/gEAR into ui-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
adkinsrs committed Jan 10, 2024
2 parents a909cec + f497d22 commit 0d0f721
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ <h3>Genes</h3>
</select>
</div>
<div class="control">
<button class="button">
<button class="button is-primary">
<span class="icon is-small">
<i class="mdi mdi-magnify"></i>
</span>
Expand Down
25 changes: 25 additions & 0 deletions www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let selected_genes = [];

document.addEventListener('DOMContentLoaded', () => {
fetchGeneCartData();
fetchDatasetCollections();

// Add event listeners to the gene list category selectors
const categorySelectors = document.querySelectorAll('#dropdown-content-gene-list-category .ul-li');
Expand Down Expand Up @@ -145,7 +146,31 @@ document.addEventListener('DOMContentLoaded', () => {
});
});

const fetchDatasetCollections = async () => {
console.log("Fetching dataset collections");
try {
const data = await apiCallsMixin.fetchDatasetCollections();
console.log(data);
return;

const template = document.querySelector('#tmpl-dataset-collection');
const container = document.querySelector('#dataset-collection-container');

for (const collection of data) {
const row = template.content.cloneNode(true);
row.querySelector('.dataset-collection-label').textContent = collection.label;
row.querySelector('.dataset-collection-description').textContent = collection.description;
row.querySelector('.dataset-collection-link').setAttribute('href', collection.url);

container.appendChild(row);
}
} catch (error) {
console.error(error);
}
}

const fetchGeneCartData = async () => {
console.log("Fetching gene cart data");
try {
gene_cart_data = await apiCallsMixin.fetchGeneCarts('unweighted-list');
document.querySelector('#dropdown-gene-lists').classList.remove('is-loading');
Expand Down

0 comments on commit 0d0f721

Please sign in to comment.