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

339 add alerts for create dataset #354

Merged
merged 3 commits into from
Apr 4, 2024

Conversation

ekraffmiller
Copy link
Contributor

@ekraffmiller ekraffmiller commented Mar 26, 2024

What this PR does / why we need it: Adds Alerts for Dataset Validation Errors, and Create Dataset Success.

Which issue(s) this PR closes:

Special notes for your reviewer:

Sometimes the e2e getTotalDatasetsCount() fails, because of this issue: #294

Suggestions on how to test this

Review Dataset 'Created' Story, Create a Dataset and check for Validation Alerts for missing required fields, and check for Success message on Dataset Page after dataset is created.

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

see mockups in #339

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

Additional documentation:

@ekraffmiller ekraffmiller changed the base branch from develop to feature/316-create-functional-create-dataset-form March 26, 2024 00:51
@ekraffmiller
Copy link
Contributor Author

@MellyGray I added some logic to the submitForm() function to save the "created" state before navigating to the View Dataset page, but I wasn't sure where to use the location hook on that page. I tried adding it to the DatasetFactory or the DatasetProvider, but the logic seemed a little awkward there. Do you have a idea for where logic like this should go?

@coveralls
Copy link

coveralls commented Mar 26, 2024

Coverage Status

coverage: 97.389% (-0.2%) from 97.539%
when pulling ede4738 on 339-add-alerts-for-create-dataset
into 5b2343f on feature/316-create-functional-create-dataset-form.

@MellyGray
Copy link
Contributor

MellyGray commented Mar 26, 2024

@MellyGray I added some logic to the submitForm() function to save the "created" state before navigating to the View Dataset page, but I wasn't sure where to use the location hook on that page. I tried adding it to the DatasetFactory or the DatasetProvider, but the logic seemed a little awkward there. Do you have a idea for where logic like this should go?

@ekraffmiller I would place the logic to read the state from the location hook in the DatasetFactory, simply because it's where we're reading the rest of the navigation parameters. I guess what you mean by 'awkward' is because usually, the Dataset Alerts come from the repository, so we need to pass the state all the way through the repository. That's the part that seems awkward to me. Maybe we can pass the 'created' state to the Dataset.tsx component as a new prop and then use the useAlertContext to add a new Dataset Alert from the Dataset.tsx component instead of from the repository. Alternatively, we could call the useAlertContext in the DatasetFactory component, but then we wouldn't be able to test it individually. I don't have a strong opinion on this

@ekraffmiller ekraffmiller marked this pull request as ready for review March 27, 2024 18:41
@ekraffmiller ekraffmiller added the Size: 3 A percentage of a sprint. 2.1 hours. label Mar 27, 2024
@ekraffmiller
Copy link
Contributor Author

@MellyGray I added some logic to the submitForm() function to save the "created" state before navigating to the View Dataset page, but I wasn't sure where to use the location hook on that page. I tried adding it to the DatasetFactory or the DatasetProvider, but the logic seemed a little awkward there. Do you have a idea for where logic like this should go?

@ekraffmiller I would place the logic to read the state from the location hook in the DatasetFactory, simply because it's where we're reading the rest of the navigation parameters. I guess what you mean by 'awkward' is because usually, the Dataset Alerts come from the repository, so we need to pass the state all the way through the repository. That's the part that seems awkward to me. Maybe we can pass the 'created' state to the Dataset.tsx component as a new prop and then use the useAlertContext to add a new Dataset Alert from the Dataset.tsx component instead of from the repository. Alternatively, we could call the useAlertContext in the DatasetFactory component, but then we wouldn't be able to test it individually. I don't have a strong opinion on this

Thanks @MellyGray, I decided to add a 'created' param to Dataset.tsx, to keep the repository logic simpler

@ekraffmiller ekraffmiller added pm.GREI-d-2.7.1 NIH, yr2, aim7, task1: R&D UI modules for creating datasets and supporting publishing workflows pm.GREI-d-2.7.2 NIH, yr2, aim7, task2: Implement UI modules for creating datasets and publishing workflows SPA: Create Dataset Form labels Mar 27, 2024
Base automatically changed from feature/316-create-functional-create-dataset-form to develop March 28, 2024 10:42
Copy link
Contributor

@MellyGray MellyGray left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

@GPortas GPortas self-assigned this Apr 4, 2024
Copy link
Contributor

@GPortas GPortas 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!

testalerts.mov

@GPortas GPortas merged commit c0f2d0b into develop Apr 4, 2024
14 checks passed
@GPortas GPortas deleted the 339-add-alerts-for-create-dataset branch April 4, 2024 14:21
jayanthkomarraju pushed a commit to jayanthkomarraju/dataverse-frontend that referenced this pull request May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pm.GREI-d-2.7.1 NIH, yr2, aim7, task1: R&D UI modules for creating datasets and supporting publishing workflows pm.GREI-d-2.7.2 NIH, yr2, aim7, task2: Implement UI modules for creating datasets and publishing workflows Size: 3 A percentage of a sprint. 2.1 hours. SPA: Create Dataset Form
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Alerts of the Create Dataset Form
4 participants