Skip to content

fix jsf guestbook response cancel button - #12220

Merged
qqmyers merged 7 commits into
developfrom
12205-guestbook-response-jsf-popup-cancel-button
Sep 25, 2026
Merged

qqmyers merged 7 commits into
developfrom
12205-guestbook-response-jsf-popup-cancel-button

Conversation

@stevenwinship

@stevenwinship stevenwinship commented Mar 16, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it: Pressing 'Cancel' button on JSF Guestbook Response screen (preview, download, or request access) does not cancel the dialog

Which issue(s) this PR closes:#12205

Special notes for your reviewer: lines prior to 291 are just reformatted because the spacing was off. No code changes were made. The new code comes after line 291

Suggestions on how to test this: Make a dataset require a guestbook response. Try to preview the file. Try to download the file. Also with dataverse.files.guestbook-at-request=true try to request access to a restricted file. Old version - cancel does nothing. This version - Cancel closes the tab/dialog and returns you to the files tab.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

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

Additional documentation:

@stevenwinship stevenwinship self-assigned this Mar 16, 2026
@github-actions github-actions Bot added Size: 10 A percentage of a sprint. 7 hours. Type: Bug a defect labels Mar 16, 2026
@stevenwinship stevenwinship moved this to In Progress 💻 in IQSS Dataverse Project Mar 16, 2026
@stevenwinship stevenwinship moved this from In Progress 💻 to Ready for Review ⏩ in IQSS Dataverse Project Mar 17, 2026
@stevenwinship stevenwinship removed their assignment Mar 17, 2026
@stevenwinship stevenwinship added this to the 6.11 milestone Mar 19, 2026
@coveralls

coveralls commented Mar 19, 2026 •

Copy link
Copy Markdown

Coverage Status

Coverage is 25.409% — 12205-guestbook-response-jsf-popup-cancel-button into develop. No base build found for develop.

@cmbz cmbz added the FY26 Sprint 20 FY26 Sprint 20 (2026-03-26 - 2026-04-08) label Mar 27, 2026
@stevenwinship
stevenwinship force-pushed the 12205-guestbook-response-jsf-popup-cancel-button branch 3 times, most recently from f30e3dc to 1a99b0f Compare April 6, 2026 19:34
@cmbz cmbz added the FY26 Sprint 21 FY26 Sprint 21 (2026-04-08 - 2026-04-22) label Apr 8, 2026
@stevenwinship
stevenwinship force-pushed the 12205-guestbook-response-jsf-popup-cancel-button branch 3 times, most recently from 2ff633a to 70a5914 Compare April 15, 2026 18:41
@stevenwinship
stevenwinship force-pushed the 12205-guestbook-response-jsf-popup-cancel-button branch 3 times, most recently from 2cc838e to 90106cd Compare April 21, 2026 15:19
@cmbz cmbz added the FY26 Sprint 22 FY26 Sprint 22 (2026-04-22 - 2026-05-06) label Apr 22, 2026
@sekmiller sekmiller self-assigned this Apr 23, 2026
@sekmiller sekmiller moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Apr 23, 2026
@github-project-automation github-project-automation Bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Apr 23, 2026
@sekmiller sekmiller removed their assignment Apr 23, 2026
@stevenwinship
stevenwinship force-pushed the 12205-guestbook-response-jsf-popup-cancel-button branch from 90106cd to 61899b0 Compare April 23, 2026 16:12
@cmbz cmbz added the FY26 Sprint 23 FY26 Sprint 23 (2026-05-06 - 2026-05-20) label May 6, 2026
@stevenwinship
stevenwinship force-pushed the 12205-guestbook-response-jsf-popup-cancel-button branch 2 times, most recently from 13629da to a2b8ea3 Compare May 11, 2026 13:12
@stevenwinship
stevenwinship force-pushed the 12205-guestbook-response-jsf-popup-cancel-button branch from d484196 to e2fe762 Compare August 12, 2026 14:47
@pdurbin

pdurbin commented Aug 12, 2026

Copy link
Copy Markdown
Member

/push-image

@cmbz cmbz added the FY27 Sprint 4 FY27 Sprint 4 (2026-08-12 - 2026-08-26) label Aug 12, 2026
@github-actions

Copy link
Copy Markdown

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:12205-guestbook-response-jsf-popup-cancel-button
ghcr.io/gdcc/configbaker:12205-guestbook-response-jsf-popup-cancel-button

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@youseihuayu-wonderful youseihuayu-wonderful left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-posted the Terms of Access suggestion on current HEAD. 257febc undid e2fe762 and put the regression back; the JSF Select All failure is a separate issue.

Comment thread src/main/webapp/guestbook-terms-popup-fragment.xhtml Outdated
@youseihuayu-wonderful

youseihuayu-wonderful commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Update: Steven applied the two-line restoration directly in bf019c4 and then merged the latest develop into the branch (ad315c1).

The current official checks pass:

The earlier trace showed no filesTable toggleSelect request and no JSF/EL/bundle error. That fixture also does not render this Terms of Access block. With the restoration now present on #12220 and its current CI passing, #12608 is superseded.

@pdurbin

pdurbin commented Aug 13, 2026

Copy link
Copy Markdown
Member

@stevenwinship can you please decide if you'd like to merge this PR by @youseihuayu-wonderful ...

... into this one (#12220)?

@stevenwinship

Copy link
Copy Markdown
Contributor Author

merged the latest suggested code

@cmbz cmbz added the FY27 Sprint 5 FY27 Sprint 5 (2026-08-26 - 2026-09-09) label Aug 26, 2026
<p:commandButton styleClass="btn btn-default" value="#{bundle.cancel}"
rendered="#{popupContext == 'previewTab'}"
onclick="history.back();"
update="fileForm:tabView">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the onclick method, this doesn't appear to have any effect.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this code there is no cancel button. Only an "accept" button. To cancel you must click the browser's back button.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the cancel button

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW: The comment was on line 316 where the code is trying to make a call to he server to update the tab view while your onclick was sending people to another page.

<!--PREVIEW TAB CANCEL BUTTON-->
<p:commandButton styleClass="btn btn-default" value="#{bundle.cancel}"
rendered="#{popupContext == 'previewTab'}"
onclick="history.back();"

@qqmyers qqmyers Aug 28, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I navigate to the datafile page, and then click cancel, I end up back on the dataset page, which seems counter-intuitive as I wouldn't expect to get pushed back to the dataset page (I have to accept or just ignore the dialog and switch to another pane to stay on the file page).

Same concern if I start from a search page - clicking cancel pushes me back to the search result page.

Going back to the dataset page makes some sense if I just click the preview button, since I started on the dataset page in that case, but I think it might be better to just stay on the datafile page and switch to the metadata tab. This onclick would do that: onclick="var metadataTab = $('a[href$=&quot;metadataMapTab&quot;]'); if (metadataTab.length) { metadataTab.click(); } else { history.back(); } " I suspect the check that the tab exists and the option to still use history.back() if not isn't really needed (if you have a previewTab so this button is rendered, the metadataTab has to be there too.).

The one minor weirdness in doing this is that the large thumbnail on the metadata pane is also labelled "Preview" so it appears that when you to cancel while trying to see the preview, you see it anyway (you don't - it's a 400px thumbnail for types that have one). I'd suggest just changing that label on the metadata tab to "Thumbnail" to address this. It's the file.metadata.preview entry in the Bundle.properties

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of this cancel button was to send you back to the place you started (Dataset Page Files Tab). Since that's not what you want I will remove the button so the user can choose to go back with the back button or select the metadata tab.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this PR is to fix the "cancel" buttons that don't work and this "cancel" button was never there it will be restored to the original functionality

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point in my comment is that people are not always starting from the same place - could even be an external site. It's worse if I go to the file page manually and then click the cancel (history.back) button, I'm sent away from the page I navigated to, possibly back to some other site, rather than being able to see the rest of the data file info on the page. My suggestion was to redirect people to the metadata tab instead, which avoids leaving them on a non-working preview tab.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. My point is that clicking a button that does nothing is a bug. If the button never existed there is no need to fix it

#{bundle.cancel}
</button>
<!--PREVIEW TAB CANCEL BUTTON-->
<p:commandButton styleClass="btn btn-default" value="#{bundle.cancel}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all three p:CommandButtons added in this PR: they need a type="button" attribute. Without that, they make an extra ajax call to the server (as they act as a submit button by default). I confirmed this in QA (and also noted that one can achieve ~the same thing by having the onclick javascript have a return false; at the end, but using the type attribute is cleaner.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added type="button"

@@ -0,0 +1 @@
This release fixes a bug which, in the JSF UI, the 'Cancel' button on the Guestbook Response dialog/preview tab does not close the dialog/tab. With this fix the dialog will close or, when in the preview tab, the tab will go back to the 'Files' tab.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would change with the suggested updates - ... when on the file page, clicking cancel on the preview tab will shift the view to the metadata tab.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the button

@qqmyers qqmyers moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Aug 28, 2026
@pdurbin pdurbin added this to the 6.13 milestone Sep 2, 2026
@stevenwinship
stevenwinship force-pushed the 12205-guestbook-response-jsf-popup-cancel-button branch from ad315c1 to f0f900b Compare September 22, 2026 19:09
@stevenwinship stevenwinship removed their assignment Sep 22, 2026
@cmbz cmbz added the FY27 Sprint 6 FY27 Sprint 6 (2026-09-09 - 2026-09-23) label Sep 23, 2026

@qqmyers qqmyers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the revisions, this PR now makes the minimal change to suppress the cancel button when the guestbookAndTermsPopup is shown on the file preview tab (FWIW: the reason it didn't close before is that the widgetVar guestbookAndTermsPopup is not defined in the file.xhtml page, so the call to hide() it in the guestbook-terms-popup-fragment fails. This widgetVar is defined where the fragment is used in the dataset page.)

Not allowing a cancel on the file preview pane is a good solution - actually making the cancel button work would cause the form to disappear and not allow changing your mind without reloading the whole page. (Both options discussed earlier have this problem. The dataset page use is different since a popup is used - one can just hit download/request access again.)

The minimalist fix here would have been to just add jsf:rendered="#{popupContext != 'previewTab'}" to the one copy of the button used on the file page. That said, the other changes made in the PR are ~neutral (changing to p:commandButton) or cleanup (removing PF('blockDatasetForm').hide(); - that looks like it was cut/pasted from other dialogs but I and AI confirm it isn't ever shown when this fragment is used, so there's no need to hide it.).

In QA, I confirmed that the cancel button is gone in the preview pane, one can still navigate to/from the preview pane and click accept later. I also checked the request-at-download and request-at-access-request uses on the dataset page - clicking cancel still works. I also verified that the p:commandButtons with type="button" don't make an unnecessary call to the server (as they do w/o that type).

So - good to go - merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 20 FY26 Sprint 20 (2026-03-26 - 2026-04-08) FY26 Sprint 21 FY26 Sprint 21 (2026-04-08 - 2026-04-22) FY26 Sprint 22 FY26 Sprint 22 (2026-04-22 - 2026-05-06) FY26 Sprint 23 FY26 Sprint 23 (2026-05-06 - 2026-05-20) FY26 Sprint 24 FY26 Sprint 24 (2026-05-20 - 2026-06-03) FY26 Sprint 25 FY26 Sprint 25 (2026-06-03 - 2026-06-17) FY26 Sprint 26 FY26 Sprint 26 (2026-06-17 - 2026-07-01) FY27 Sprint 1 FY27 Sprint 1 (2026-07-01 - 2026-07-15) FY27 Sprint 2 FY27 Sprint 2 (2026-07-15 - 2026-07-29) FY27 Sprint 3 FY27 Sprint 3 (2026-07-29 - 2026-08-12) FY27 Sprint 4 FY27 Sprint 4 (2026-08-12 - 2026-08-26) FY27 Sprint 5 FY27 Sprint 5 (2026-08-26 - 2026-09-09) FY27 Sprint 6 FY27 Sprint 6 (2026-09-09 - 2026-09-23) FY27 Sprint 7 FY27 Sprint 7 (2026-09-23 - 2026-10-07) Size: 10 A percentage of a sprint. 7 hours. Type: Bug a defect

Projects

Status: Merged 🚀

Development

Successfully merging this pull request may close these issues.

Guestbook Response JSF popup Cancel button not working

7 participants