Closed rastogi-bhavya closed 3 years ago
For https://dev.gudmap.org/chaise/viewer/#2/Gene_Expression:Image/id=16-2GJM, when you go to z index 1 -> 2 -> 1, the resize event no more fires when the size of the page is reduced, causing the UI to break. The resize event fire only when the page size is increased beyond the point, after it, stopped working. To reproduce this, go to a z index having annotations, then go to one not having annotations and then to the first one.
I tried using window.addeventlistener('resize',...)
and window.resize()
they also do not work after the above mentioned scenario.
@rastogi-bhavya
Please stop saying "Update
Regarding your questions,
- What all error messages need to be shown?
Since we decided to mask the inputs and disallow non-integer inputs, the only error that I can think of is the one that we couldn't find the actual zindex. I added the skeleton for it in chaise, update the message based on what you think is good. And then we can review.
- How should I decide the min-width of the z plane list?
We should try some heuristic and then later see if our users agree or not. But I think making sure that you can fit at least 2 images should be a good starting point.
- For handling the case when a z index is searched and the page size is also increased at the same time, I have to make it look like first the z index was searched and then the page size was changed, right?
I'm not entirely sure what you mean. As soon as we're sending a request to chaise (either by user initiation or just width change), all the buttons should be disabled and the spinner should show up. So in this case, user clicks on the button, the input and buttons will be disabled. Changing the width of the page shouldn't change what you're showing (everything should be disabled and spinner is visible). But you would have to send another request with the same input and different pageSize.
Disabling all the button would allow us to make sure that users are doing a single action. So the request that we're sending to chaise is always either page change or finding z-index. And because of this, we can have a single function that talks to chaise. You just have to remember what was the previous user action, so you can send the proper request to chaise. To better explain this, let's go over some different scenarios:
Scenario 1:
Scenario 2:
Scenario 3:
So it really doesn't matter if there's a pending request or not. Whenever you need to update the page, you just have to remember user's previous action and send an updated request. The requestID
should prevent from showing stale data.
Also, we have to change the logic that you have to optimize the page size shrinkage case (the one that you're not sending any extra request and are just hiding the extra images).To properly fix it,
Just to summarize what's left:
I made some changes to this PR,
parseInt
to handle any values for us.I also added new cases to regression test for this feature.
Features Added
Jump to a particular z index. UI has been added which allows the user to jump to a particular Z Index. This z index should be an integer greater than equal to 0. If the Z index entered by the user is not found in the database, the closest Z index would be shown along with an alert showing the user that the desired Z index was not found.
Things Pending
hasNext
when the size of the page is decreased when on the last page. Eg last page = 150 - 160. Now the page size is decreased so that the page is 150-155. This means that now more data can be fetched and thereforehasNext
should be updated.