Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaned up preview tab on file pg [ref #6437] #6438

Merged
merged 2 commits into from
Dec 9, 2019

Conversation

mheppler
Copy link
Contributor

@mheppler mheppler commented Dec 5, 2019

What this PR does / why we need it:

The new preview tab on the file pg needed some UI clean up.

Which issue(s) this PR closes:

Closes #6437 File Preview - UI clean up

Special notes for your reviewer:

Thank you for reviewing.

Suggestions on how to test this:

Single tool, multiple tools, with and without guestbook/terms of access

Does this PR introduce a user interface change?:

Sure does.

Is there a release notes update needed for this change?:

No.

Additional documentation:

N/A

@coveralls
Copy link

coveralls commented Dec 5, 2019

Coverage Status

Coverage remained the same at 19.541% when pulling 0dacda6 on 6437-file-pg-preview-tab-ui into 4f1bfea on develop.

@sekmiller sekmiller self-assigned this Dec 6, 2019
@sekmiller sekmiller removed their assignment Dec 6, 2019
@kcondon kcondon self-assigned this Dec 9, 2019
@mheppler mheppler assigned mheppler and kcondon and unassigned kcondon Dec 9, 2019
@mheppler
Copy link
Contributor Author

mheppler commented Dec 9, 2019

@qqmyers I was hoping you can help clarify a problem with the Preview tab render logic on the file pg in this branch, as well as develop. @kcondon was testing this PR and found that your changes to the render logic were not behaving as expected in my branch.

In your PR #6420 which was merged into develop on 12/2, you changed the render logic of the tab on file.xhtml to:

... and FilePage.fileMetadata.datasetVersion == FilePage.fileMetadata.datasetVersion.dataset.getLatestVersionForCopy()

But, in another commit on 12/2 37906d3, directly to the develop branch (I'd scold you but I did the same thing last week), you changed it again to:

... and FilePage.fileMetadata.datasetVersion.isPublished()

That latest commit seems to have revert the bug fix of your PR. Can you provide some guidance here on what that latest commit does? Was it an unintended commit? Thanks.

@qqmyers
Copy link
Member

qqmyers commented Dec 9, 2019

@mheppler - I don't think I have privs to commit to dev - these should have been from 2 PRs. I did try to fix a merge issue and ended up making a null PR, but I then added a corecting commit.

FOr the two PRs: The first one corrected an issue where the previewers would not show if there was a draft version since the current version (i.e. a published v 2.0) would not equal the latest version, but would equal the latestversionforcopy (basically the latest published/public one).
The second issue/PR was that, even with this fix, one could not preview files in earlier versions (e.g. a file only in the published v1 version). The second commit is to replace the comparison between the current version and the latest/latestforcopy with a simple test to see if the current version is public. Since this PR changes the same line as the other one, it led to a merge conflict (which I then bungled before correcting).

After both are in, I think the FilePage.fileMetadata.datasetVersion.isPublished() should fix both issues.

@mheppler
Copy link
Contributor Author

mheppler commented Dec 9, 2019

Ahh, my apologies. I didn't notice there were two PRs (#6420, #6422) to the same line of code, on the same day, from the same developer.

I'll tell you what I am seeing in develop/my branch, and you can tell me if it's behaving as expected.

@kcondon
Copy link
Contributor

kcondon commented Dec 9, 2019

@qqmyers Jim, have seen a couple issues that were not addressed by your fixes. Not sure whether you would have included them if known: 1. If file is restricted or request for access is specified. 2. if tou specified, 3. if gb specified. In any of these cases, preview tab will not appear.

@qqmyers
Copy link
Member

qqmyers commented Dec 9, 2019

@mheppler - I'm surprised if you don't get a preview for v1 or v2 when there's no draft, unless it is due to one of the issues @kcondon brings up. For those issues, my understanding is that those limitations were 'by design' at this point - awaiting thinking about how to display the terms/ask for gb info, etc. when the file isn't public. (These should still be viewable through the external preview button which has a way to popup terms, etc. - it's just the in page display). So I took them as out of scope at present and just tried to fix issues where I saw valid public datasets not getting preview displays.

@kcondon kcondon merged commit 751ca19 into develop Dec 9, 2019
@kcondon kcondon deleted the 6437-file-pg-preview-tab-ui branch December 9, 2019 22:14
@mheppler
Copy link
Contributor Author

@qqmyers my apoloogies, @kcondon helped me diagnose what I was seeing, which was the expected behavior because those files were in datasets that had terms or guestbooks.

Someday this we will build out File Page needs a Term Tab to define terms at the file level #4391 and all this preview tab render logic will be a lot easier to determine per file.

@djbrooke djbrooke added this to the 4.19 milestone Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File Preview - UI clean up
6 participants