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

Added required to the required fields #216

Merged
merged 23 commits into from May 22, 2023
Merged

Conversation

mehul0810
Copy link
Contributor

Description of the Change

I have added (required) to the podcast meta fields to ensure that it passes the podcast feed while submission.

Closes #63

Alternate Designs

Possible Drawbacks

Verification Process

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Credits

Props @

Copy link
Contributor

@cadic cadic left a comment

Choose a reason for hiding this comment

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

@mehul0810 thank you for this PR.

The current change only adds "(required)" suffix to a few fields. The validation is not performed, so we are still able to save the Podcast with empty "Author", "Summary" and "Cover image" fields.

Could we add validation to both the browser and back-end before saving and provide an error message if any of the required fields are submitted empty?

@jeffpaul jeffpaul added this to the 1.5.0 milestone Jan 30, 2023
@jeffpaul jeffpaul requested a review from cadic February 6, 2023 17:03
Copy link
Contributor

@cadic cadic left a comment

Choose a reason for hiding this comment

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

@mehul0810 thanks for updating this.

Looks like that with all recent changes, we have lot of things broken on the site:

  1. The onboarding workflow fails at step 1 (Could not insert the podcast term) Screenshot 2023-02-13 at 11 18 50
  2. The Quick-add from the podcasts sidebar panel doesn't work (do nothing without any error) image
  3. Most of E2E tests fail (the test suite fails to create the podcast)

So this PR needs to be updated:

  • Fix the onboarding process
  • Fix E2E tests — it should also include all required fields when creating the test podcast
  • Need to decide what to do with the quick-add interface from the sidebar

@roshniahuja roshniahuja self-assigned this Feb 22, 2023
@nateconley
Copy link
Contributor

@cadic I pushed some changes to update the onboarding page with this functionality and use the new validation logic on that page.

I updated the e2e tests. They work locally, but they are failing CI. Beside adding content to the required fields, I have added a media upload (using the 10up util) before each cy.createTerm call.

I did not update the block quick add. As I see it, there are three options:

  1. Remove this functionality and point to the taxonomy admin screen
  2. Add the required fields, media upload, and validation to the block
  3. Allow terms to be created without required fields from this location

@jeffpaul
Copy link
Member

jeffpaul commented Mar 6, 2023

@nateconley I think I would prefer option 2 as that allows an editor to stay within the block editor construct and add a new Podcast without having to leave the post and navigate into the plugin settings

@Spoygg
Copy link

Spoygg commented Mar 8, 2023

@jeffpaul I've added server side validation for onboarding step 1 and it also works on new term form.

@jeffpaul jeffpaul requested review from a team and Sidsector9 and removed request for a team March 20, 2023 13:57
Copy link

@ggutenberg ggutenberg left a comment

Choose a reason for hiding this comment

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

Found a couple of issues, as well as a bunch of tests continuing to fail. I have some time this week to look into these issues.

includes/datatypes.php Show resolved Hide resolved
*
* @return string
*/
function validate_taxonomy_fields( $term, $taxonomy, $args ) {

Choose a reason for hiding this comment

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

On edit-tags.php?taxonomy=podcasting_podcasts&podcasts=true, if this function throws an error, it does not save selections for the following:

  • Cover image
  • Category 1-3

On admin.php?page=simple-podcasting-onboarding&step=1 if it throws a Cover image error, it resets the entire form.

@ggutenberg ggutenberg requested a review from a team as a code owner March 30, 2023 14:01
@jeffpaul jeffpaul removed the request for review from a team April 3, 2023 14:00
@jeffpaul
Copy link
Member

jeffpaul commented Apr 3, 2023

@10up/open-source-practice FYI that this is back up for review, thanks!

Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

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

I've added a few notes inline, unslashing data and the accessibility items are the most important.

I've used 🔢 to indicate the translation changes apply to multiple lines.

includes/admin/onboarding.php Outdated Show resolved Hide resolved
includes/admin/views/onboarding-page-one.php Outdated Show resolved Hide resolved
includes/admin/views/onboarding-page-one.php Outdated Show resolved Hide resolved
includes/admin/views/onboarding-page-one.php Outdated Show resolved Hide resolved
includes/datatypes.php Outdated Show resolved Hide resolved
includes/datatypes.php Outdated Show resolved Hide resolved
includes/datatypes.php Outdated Show resolved Hide resolved
Sidsector9 and others added 3 commits April 14, 2023 15:55
Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
includes/datatypes.php Outdated Show resolved Hide resolved
@jeffpaul
Copy link
Member

jeffpaul commented May 8, 2023

@faisal-alvi some updates here during your OSS time could help get this merged into the next release, thanks!

faisal-alvi and others added 5 commits May 10, 2023 18:30
Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

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

LGTM and tests well.

I pushed a few commits to

  • add a for attribute to the show name and category labels (& related ID on the input)
  • add aria-describedby attributes to each of the fields
  • fix a typo
  • resolve merge conflict with develop.

@jeffpaul jeffpaul merged commit d915c8e into develop May 22, 2023
8 checks passed
@jeffpaul jeffpaul deleted the fix/63-required-fields branch May 22, 2023 14:37
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.

Mark any required fields when adding/editing a podcast feed