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

10476 display on create field option #11224

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Saixel
Copy link
Contributor

@Saixel Saixel commented Feb 6, 2025

What this PR does / why we need it:

This PR introduces the displayOnCreate property to the DataverseFieldTypeInputLevel class, allowing administrators to configure metadata fields to appear during dataset creation, even if they are not required.

Previously, metadata fields selected for a collection would only appear during dataset creation if they were marked as required (or displayOnCreate by default). This change grants collection administrators control over metadata visibility, improving metadata completeness and discoverability.

Which issue(s) this PR closes:

Special notes for your reviewer:

This PR implements the functionality for displayOnCreate, but the UI implementation is not included yet.

If you want to temporarily enable a checkbox for testing, you can manually add the following code snippet at line 384 of dataverse.xhtml. This will render a checkbox in the collection settings UI to toggle the displayOnCreate property:

<td>
    <p:selectBooleanCheckbox id="DisplayOnCreate#{dsft.id}" 
                             value="#{dsft.displayOnCreate}" 
                             widgetVar="DisplayOnCreateOpt#{dsft.id}" 
                             disabled="#{DataversePage.editInputLevel == false}"
                             rendered="#{!dsft.hasParent and (!dsft.required or (dsft.hasParent and !dsft.parentDatasetFieldType.required))}">
        <p:ajax update="@widgetVar(DisplayOnCreateOpt#{dsft.id})" 
                listener="#{DataversePage.updateDisplayOnCreate(mdb.id, dsft.id, dsft.displayOnCreate)}" />
    </p:selectBooleanCheckbox>
</td>

Once the UI implementation is complete, this manual addition will no longer be necessary.

Suggestions on how to test this:

  1. Create or edit a collection.
  2. Navigate to the metadata fields selection section.
  3. Verify that the displayOnCreate checkbox appears next to metadata fields.
  4. Enable displayOnCreate for a field and save the configuration.
  5. Create a new dataset in the collection and confirm that the selected metadata field appears in the dataset creation form.

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

No UI changes in this PR. A separate issue will track the UI implementation.

Additional documentation:

image
image

- Added updateDisplayOnCreate method to DataversePage
- Added displayOnCreate handling in DataverseServiceBean
- Added displayOnCreate checkbox to dataverse.xhtml
- Added displayOnCreate field to DataverseFieldTypeInputLevel
- Remove javadoc comment from updateDisplayOnCreate method in DataversePage.java
- Remove inline comment from displayOnCreate setter in DataverseServiceBean.java
- Remove selector changes from dataverse.xhtml as they will be implemented in a separate task focusing on UI improvements
@Saixel Saixel added NIH CAFE Issues related to and/or funded by the NIH CAFE project FY25 Sprint 16 FY25 Sprint 16 (2025-01-29 - 2025-02-12) labels Feb 6, 2025
@coveralls
Copy link

Coverage Status

coverage: 22.759% (-0.003%) from 22.762%
when pulling 7c77985 on 10476-display-on-create-field-option
into 3aea148 on develop.

Copy link

github-actions bot commented Feb 6, 2025

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:10476-display-on-create-field-option
ghcr.io/gdcc/configbaker:10476-display-on-create-field-option

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 16 FY25 Sprint 16 (2025-01-29 - 2025-02-12) NIH CAFE Issues related to and/or funded by the NIH CAFE project
Projects
Status: Ready for Review ⏩
Development

Successfully merging this pull request may close these issues.

Ensure Visibility of Non-Required Metadata Blocks on Dataset Creation
2 participants