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

Feat/406 add edit dataset metadata form #422

Merged
merged 51 commits into from
Jul 15, 2024

Conversation

g-saracca
Copy link
Contributor

@g-saracca g-saracca commented Jun 26, 2024

What this PR does / why we need it:

Adds the Edit Dataset Metadata section/page.
A reusable form component is created for the creation of a dataset, as well as for editing the metadata of a dataset.

Which issue(s) this PR closes:

Closes #406

Special notes for your reviewer:

Some external issues were encountered during the development of this feature:

  1. There is a field validation bug from JS-Dataverse related to Date fields that accept YYYY or YYYY-MM format that will be address in this just created issue.
  2. When trying to update a dataset metadata with 6 metadatablocks, API is throwing 500 Internal Server Error. I have created an issue for investigate this.
  3. Another issue related to how metadata block info is retrieve for coverage.RedShiftValue, as a parent field of a composed field should be type NONE but is saved in DB as type FLOAT. @GPortas is aware of this and will ask this on dv-tech

I have added extra functionalities such as:

  • Disabled submit button if no form field was modified.
  • Logic to create dependent validations of other fields, this case occurs when a composed parent field ( multiple or not ) is not required, but one of its child fields is, this last mentioned will only become required if any of its sibling fields is populated. A helper text message is shown for this occasions.
  • On edit mode, the form component shows two times the submit and cancel button, at the top of the form and below. The top buttons location differs from the JSF version for reusability of the form component purposes.

Suggestions on how to test this:

Step 1: Run the Development Environment

  1. Execute npm i.
  2. Navigate with cd packages/design-system && npm run build.
  3. Return with cd ../../.
  4. Ensure you have a .env file similar to .env.example, with the variable VITE_DATAVERSE_BACKEND_URL=http://localhost:8000.
  5. Navigate with cd dev-env.
  6. Start the environment using ./run-env.sh unstable.
  7. To verify the environment, visit http://localhost:8000 and check your local Dataverse installation.

Step 2: Test the Create Dataset Form

  • Log in, click the create dataset button.
  • Try submitting the form without touching any field, submit button should be disabled.
  • Submit the form without filling required fields, those required field should show te required error feedback, and the form should focus and scroll to the first input with an error.
  • Fill a date field with the wrong format, respective feedback error should be visible.
  • Fill an integer field with the wrong format (e.g.: 23.5), respective feedback error should be visible.
  • Fill a float field with the wrong format (e.g.: 'hi'), respective feedback error should be visible.
  • Fill an email field with a wrong format (e.g.: 'test@'), respective feedback error should be visible.
  • Fill an URL field with a worng format (e.g.: 'bad://something'), espective feedback error should be visible.
  • Submit the form filling al required fields with the correct format, a new dataset should be created.

Step 3: Test the Edit Dataset Metadata section

  • You can follow the same steps from Step 2.
  • Also in citation metadata block there is the Producer composed field that has a field (Name) that may become required, you can test that functionality by filling a sibling field and notice that Name field becomes required (required symbol appears), if you try to submit the form, you will see a field validation error below this field.
    You then can clear any of the sibling fields that was filled and you will notice that the Name field is no longer required.
  • After submiting the form you should be redirected to the Dataset Page and see the alert that the metadata has been updated.

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?:

Additional documentation:

@coveralls
Copy link

Coverage Status

coverage: 97.737% (+0.2%) from 97.581%
when pulling 2bba5bb on feat/406-add-edit-dataset-metadata-form
into 107aaca on develop.

@g-saracca g-saracca added UI Tasks related to the user interface (UI) or frontend development integration Tasks involving the connection and interaction of UI features with the Dataverse API SPA: Edit Dataset Page GREI Re-arch GREI re-architecture-related Size: 3 A percentage of a sprint. 2.1 hours. Waiting labels Jun 26, 2024
@g-saracca g-saracca marked this pull request as ready for review June 26, 2024 14:45
@coveralls
Copy link

Coverage Status

coverage: 97.737% (+0.2%) from 97.581%
when pulling ae79aac on feat/406-add-edit-dataset-metadata-form
into 107aaca on develop.

@coveralls
Copy link

Coverage Status

coverage: 97.737% (+0.2%) from 97.581%
when pulling ae79aac on feat/406-add-edit-dataset-metadata-form
into 107aaca on develop.

@coveralls
Copy link

Coverage Status

coverage: 97.737% (+0.2%) from 97.581%
when pulling 6dc38f9 on feat/406-add-edit-dataset-metadata-form
into 107aaca on develop.

@coveralls
Copy link

Coverage Status

coverage: 97.737% (+0.2%) from 97.581%
when pulling 6dc38f9 on feat/406-add-edit-dataset-metadata-form
into 107aaca on develop.

@g-saracca g-saracca removed the Waiting label Jul 2, 2024
@ekraffmiller ekraffmiller self-assigned this Jul 8, 2024
Copy link
Contributor

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just one issue with bounding box validation, which will be tracked in a separate issue.

@ekraffmiller ekraffmiller merged commit 91b2db6 into develop Jul 15, 2024
17 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GREI Re-arch GREI re-architecture-related integration Tasks involving the connection and interaction of UI features with the Dataverse API Size: 3 A percentage of a sprint. 2.1 hours. SPA: Edit Dataset Page UI Tasks related to the user interface (UI) or frontend development
Projects
Status: Done 🧹
Development

Successfully merging this pull request may close these issues.

Add edit dataset metadata form
3 participants