Skip to content

Commit

Permalink
Merge branch 'ui-v2' of github.com:IGS/gEAR into ui-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
jorvis committed Jan 10, 2024
2 parents 03a6893 + 0ef733b commit f497d22
Show file tree
Hide file tree
Showing 23 changed files with 3,794 additions and 10,714 deletions.
16 changes: 14 additions & 2 deletions tests/test/gene_collection_manager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ const mockSaveNewGeneCollection = async (page) => {
})
}

const mockSaveGeneCollectionChanges = async (page) => {
await page.route(`${gearBase}/cgi/save_genecart_changes.cgi`, async route => {
const json = {
"gene_cart": "{\"id\": 334, \"user_id\": 1, \"gctype\": \"unweighted-list\", \"label\": \"updated test\", \"organism_id\": 1, \"ldesc\": \"This is the unweighted description\", \"share_id\": \"06c1cdd3\", \"is_public\": 1, \"is_domain\": null, \"date_added\": \"2023-11-01 17:10:36\", \"genes\": [\"0610040J01Rik\", \"Zkscan1\", \"1500011K16Rik\", \"1700025G04Rik\", \"Zfp60\", \"1810037I17Rik\", \"2010111I01Rik\", \"2300009A05Rik\", \"Zfp24\", \"Zdhhc2\", \"4931406P16Rik\", \"Ypel2\", \"5031439G07Rik\", \"Wwp1\", \"Wsb2\", \"Wls\", \"Wasf1\", \"Vwc2\", \"Vwa1\", \"Aatk\", \"Vps36\", \"Vps37b\", \"Abca8a\", \"Vldlr\", \"Abhd4\", \"Vcl\", \"Utrn\", \"Acsbg1\", \"Usp1\", \"Adam10\", \"Adam17\", \"Adam23\", \"Adamts17\", \"Adamts5\", \"Ung\", \"Unc119\", \"Adgrg6\", \"Ucp2\", \"Ado\", \"Ado\", \"Uchl1\", \"Adra2c\", \"Afap1l2\", \"Ubl3\", \"Ube2e2\", \"Ube2c\", \"Ahr\", \"Ak3\", \"Ak6\", \"Tyms\", \"Akr1b8\", \"Twf1\", \"Alcam\", \"Alad\", \"Tubg1\", \"Ttyh1\", \"Ttyh2\", \"Tst\", \"Tspo\", \"Angpt2\", \"Ank3\", \"Tspan18\", \"Tspan13\", \"Tspan15\", \"Tspan17\", \"Tsc22d4\", \"Anxa2\", \"Trim2\", \"Trim13\", \"Arfip1\", \"Trappc2\", \"Arhgap19\", \"Arhgap24\", \"Arhgap32\", \"Arhgap39\", \"Arhgef10\", \"Arhgef28\", \"Tpst1\", \"Tppp3\", \"Tpp1\", \"Arid5b\", \"Tpd52\", \"Tox\", \"Arl8a\", \"Arnt2\", \"Top2a\", \"Arrdc3\", \"Art3\", \"Arvcf\", \"Arvcf\", \"Arxes2\", \"Tns3\", \"Asb8\", \"Aspa\", \"Asrgl1\", \"Atad2\", \"Asxl3\", \"Tnik\", \"Atad2\", \"Tnfrsf21\", \"Atg3\", \"Tnfaip6\", \"Tmpo\", \"Atp1b1\", \"Tmod2\", \"Tmem9b\", \"Tmem63b\", \"Atp8a1\", \"Aurkb\", \"Tmem245\", \"B4galt6\", \"Bach1\", \"Bambi\", \"Tmem117\", \"Tm7sf3\", \"Bcas1\", \"Tk1\", \"Tjp1\", \"Bcl7a\", \"Thtpa\", \"Bicd1\", \"Bin3\", \"Birc5\", \"Tgfbr3\", \"Borcs5\", \"Bpnt1\", \"Tex30\", \"Tdrkh\", \"Tead1\", \"Bzw2\", \"Tcp11l1\", \"Tcf19\", \"Tbx2\", \"Cab39l\", \"Cadm1\", \"Cadm4\", \"Camk2d\", \"Tbc1d10a\", \"Tax1bp3\", \"Capg\", \"Tanc2\", \"Capn5\", \"Taldo1\", \"Tagln2\", \"Taf13\", \"Tacc1\", \"Syt11\", \"Syngr1\", \"Cbx6\", \"Svip\", \"Ccdc13\", \"Ccdc28b\", \"Stx7\", \"Strbp\", \"Ccna2\", \"Ccnd1\", \"Ccnb2\", \"Stmn2\", \"Ccser2\"], \"folder_id\": null, \"folder_parent_id\": null, \"folder_label\": null, \"user_name\": \"Test Armstrong\", \"gene_count\": 159, \"organism\": \"Mus musculus\", \"is_owner\": false}",
"success": 1
};
await route.fulfill({ json });
});
}

/**
* Mocks the delete gene collection functionality.
* @param {Page} page - The page object.
Expand Down Expand Up @@ -281,7 +291,6 @@ const mockDownloadUnweightedGeneCollectionMembers = async (page) => {

describe('Gene Collection Manager', function () {
this.retries(3);

this.timeout(10000); // default is 2000

let browserIndex = 0;
Expand Down Expand Up @@ -498,7 +507,7 @@ describe('Gene Collection Manager', function () {

// Selecting should deselect "All"
await groupAffiliatedOption.click();
// ! This class seems to not be detected
// TODO: detecting the class seems to be flaky when all tests are run
await expect(groupAffiliatedOption).toHaveClass(/js-selected/);
await expect(yourCollectionsOption).toHaveClass(/js-selected/);
await expect(allFacet).not.toHaveClass(/js-selected/);
Expand Down Expand Up @@ -628,6 +637,9 @@ describe('Gene Collection Manager', function () {
it("should update gene collection when save button is clicked", async () => {
await page.locator("css=#result_gc_id_334 .js-edit-gc").click();
await page.locator("css=#result_gc_id_334_editable_title").fill("updated test");

await mockSaveGeneCollectionChanges(page);

await page.locator("css=#result_gc_id_334 .js-edit-gc-save").click();
await expect(page.locator("css=#result_gc_id_334_editable_title")).not.toBeVisible();
// Check that the search results were updated
Expand Down
2 changes: 1 addition & 1 deletion tests/test/multigene_curator.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env mocha

/*
Unit tests for dataset_curator.js
Unit tests for multigene_curator.js
*/

// Some setup help by https://publishing-project.rivendellweb.net/testing-front-end-with-mocha-and-playwright-2/
Expand Down
4 changes: 2 additions & 2 deletions www/compare_datasets.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<script>document.write('<link rel="stylesheet" href="css/common.v2.' + (new Date()).getTime() + '.css" />');</script>

<!--Page-specific CSS here -->
<script>document.write('<link rel="stylesheet" href="css/compare_datasets.v2.' + (new Date()).getTime() + '.css" />');</script>
<script>document.write('<link rel="stylesheet" href="css/compare_datasets.' + (new Date()).getTime() + '.css" />');</script>
</head>


Expand Down Expand Up @@ -493,7 +493,7 @@ <h5 class="title is-5">
<script>document.write('<script src="js/common.v2.' + (new Date()).getTime() + '.js"><\/script>');</script>

<!-- Page-specific JS file here -->
<script>document.write('<script src="js/compare_datasets.v2.' + (new Date()).getTime() + '.js"><\/script>');</script>
<script>document.write('<script src="js/compare_datasets.' + (new Date()).getTime() + '.js"><\/script>');</script>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59916932-1"></script>
Expand Down
129 changes: 44 additions & 85 deletions www/css/compare_datasets.css
Original file line number Diff line number Diff line change
@@ -1,103 +1,62 @@
dd {
margin-bottom: 25px;
}
dd div {
margin-bottom: 10px;
}
div#chart_settings h3 {
margin-top: 20px;
margin-bottom: 0px;
}
div#chart_settings label {
font-size: 90%;
}
div#chart_settings ul {
list-style: none;
font-size: 90%;
margin: 20px 0 0 10px;
padding: 0;
}
div.code {
font-size: 90%;
font-family: courier;
letter-spacing: 1px;
}
div#error_loading_c {
display: none;
}
div#create_gene_cart_dialog {
display: none;
margin: 15px 0 15px 0;
/* Keep at a reasonable length */
input[type=number] {
width: 6em;
}

div.loading_indicator {
display: none;
}
div.loading_indicator img {
width: 100px;
}
div#result_table_c {
margin-top: 30px;
}
div#saved_gene_cart_info_c {
display: none;
}
div#saved_gene_cart_info_c h3 {
margin-bottom: 5px;
/* reflecting gEAR "select" form CSS to "nice-select" elements */
.select .nice-select {
background-color: #EFEDF7;
border-color: #544A8E;
border-radius: 5px;
color: #363636;
}
div#selected_label {
display: none;
margin-bottom: 10px;
}
div#sidebar {
padding: 20px 0 0 10px;
}
div#stat_action_options_c {
margin-top: 10px;
padding-left: 5px;

.is-fullwidth .nice-select{
width:100%;
}
div#viewport {
min-height: 500px;

.nice-select::after {
content: unset; /* remove their version of dropdown arrow (behind the Bulma select arrow) */
}
div.svg-container {
max-width: 100%;

.nice-select-dropdown {
width: 100%; /* Override auto-width setting by nice-select */
}
p#saved_gene_cart_info {
font-size: 80%;

.nice-select .list {
overflow-y: scroll; /* Make it apparent that there are more options */
overflow-x: hidden;
}

#gene_list_c {
display: none;
/* match nice-select disabled state style with select style from common.css */
.select .nice-select.disabled {
border-color: grey;
background-color: lightgrey;
}

table#tbl_selected_genes {
border-collapse: collapse;

.nice-select .list::-webkit-scrollbar-thumb {
background: #888;
}
table#tbl_selected_genes td {
padding: 3px;
font-size: 90%;
border: 1px solid rgb(200,200,200);

.nice-select .list::-webkit-scrollbar-thumb:hover {
background: #555;
}
table#tbl_selected_genes th {
border: 1px solid rgb(200,200,200);
padding: 3px;

.nice-select .list::-webkit-scrollbar {
width: 10px; /* overwrite nice-select default of 0 */
}

/* Overwritting bootstrap default */
.nav-tabs .nav-link.active {
text-decoration-line: underline;
/* Track */
.nice-select .list::-webkit-scrollbar-track {
background: #f1f1f1;
}

.btn-outline-purple {
color: #562a6f;
background-color: transparent;
background-image: none;
border-color: #562a6f;
#post_plot_content_c {
height:92vh;
}

.btn-outline-purple:hover {
color: white;
background-color: #401362;
background-image: none;
border-color: #401362;
}
/* override loader from the themed CSS */
.button.is-loading::after, .loader, .select.is-loading::after, .control.is-loading::after {
border-color: black;
}
62 changes: 0 additions & 62 deletions www/css/compare_datasets.v2.css

This file was deleted.

Loading

0 comments on commit f497d22

Please sign in to comment.