Clinical-Genomics / chanjo2

Persistent coverage analysis tool using the d4 format
https://clinical-genomics.github.io/chanjo2/
2 stars 0 forks source link

Changed coverage links on overview page broken #356

Closed Jakob37 closed 1 month ago

Jakob37 commented 1 month ago

Describe the bug

On the overview report page, the "Completeness" links are broken (i.e. "Completeness 30x" in the screenshot below):

incomplete_genes_overview

northwestwitch commented 1 month ago

You mean that the stats are not changing when you click on another threshold or that the link is not there at all?

Jakob37 commented 1 month ago

You mean that the stats are not changing when you click on another threshold or that the link is not there at all?

The link is broken, I get "Not Found":

not_found

northwestwitch commented 1 month ago

I can't reproduce while creating a gene overview from the panels in scout.

Where are these 2 threshold params (10 and 30) you are using coming from, are you sending them in the request or did you set custom thresholds in the chanjo2 settings?

Or both? 🤔

Jakob37 commented 1 month ago

They are added through an environment variable. But I had the same issue with the default values.

I wonder if it is something with our setup again. That we run chanjo2 on a sub-path to Scout. Here is the url: http://mtcmdpgm01.lund.skane.se/chanjo2//overview#

(I'll also try removing the extra /, it works fine for other URLs, so should not be that, but I'll test to make sure)

Edit: Updated the URL to remove the trailing "/". No difference.

Jakob37 commented 1 month ago

Aha, I think I got it. It is the http / https CORS error again :(

cors

There is a tag in Chanjo2 automatically upgrading http -> https requests I think. But this somehow causes CORS errors when differing before / after.

I "solved" it in the other page by removing that line when building our docker container ...

But we actually have ssl certificates set up now I think. So we should be able to solve this properly. I'll look into it!

Jakob37 commented 1 month ago

Aha, no, this is not due to the https issue. I think it is due to our end point being nested below /chanjo2.

We had the same issue on the report page. There it works fine now, using this syntax:

<form name="customizeForm" action="{{url_for('report')}}" method="post">

But for the summary page, the form submit looks like this, hard-coded to /overview:

    {{ super() }}
    <script>
        let theForm = document.getElementById("geneStatsForm");

        function updateOverview(customLevel)
        {
            document.getElementById("defaultLevel").value = customLevel;
            theForm.action = '/overview';
            theForm.submit();
        }

        function getGeneStatsPage(hgncId)
        {
            event.preventDefault();
            var geneInput = document.createElement("input");
            geneInput.setAttribute("type", "hidden");
            geneInput.setAttribute("name", "hgnc_gene_id");
            geneInput.setAttribute("value", hgncId);
            theForm.appendChild(geneInput);
            theForm.submit();
        }
    </script>

Would it be possible to update this?

northwestwitch commented 1 month ago

Ah yes, I remember this issue. Let me check how I fixed for the other report. It should be the same way

northwestwitch commented 1 month ago

Fixed in #360