Skip to content

Fix initiative creation missing form fields#10006

Merged
alecslupu merged 15 commits intodecidim:developfrom
webema:fix/initiative_missing_create_form_fields
Apr 18, 2023
Merged

Fix initiative creation missing form fields#10006
alecslupu merged 15 commits intodecidim:developfrom
webema:fix/initiative_missing_create_form_fields

Conversation

@heisam
Copy link
Copy Markdown
Contributor

@heisam heisam commented Oct 27, 2022

🎩 What? Why?

This PR fixes an issue that the form for initiative creation and update do not display the same fields.

  • Added the field hashtag to creation form
  • Added condition in update-form to only display signature_type-dropdown when more than one option exists (same as creation-form)
  • Renamed CreateInitiativeHelper to SignatureTypeOptionsHelper

📌 Related Issues

Link your PR to an issue

Testing

Describe the best way to test or validate your PR.

  • create new initiative then edit it
  • Forms should have the same fields
  • Repeat test with one/multiple signature_type-options

@heisam heisam marked this pull request as ready for review October 28, 2022 10:21
@heisam
Copy link
Copy Markdown
Contributor Author

heisam commented Nov 3, 2022

@andreslucena could you please have a look? Not sure how your processes work for First-Time-Contributors...

@andreslucena
Copy link
Copy Markdown
Member

@andreslucena could you please have a look? Not sure how your processes work for First-Time-Contributors...

Yes, sure, sorry for the delay. You've caught us with too much PRs on our plate, as we were in the middle of backporting old bugfixes. Now we have a bit more time, I'll give it an eye. Thanks for the PR!

@andreslucena andreslucena added module: initiatives type: fix PRs that implement a fix for a bug labels Nov 9, 2022
@andreslucena
Copy link
Copy Markdown
Member

I could check this one out with @carolromero. Here's some feedback:

First of all, thanks again for working on this one. It's something that I remember the last time I saw these initiatives form but didn't have time to tackle 😄

Just as a reference, this is how the forms are right now (current state of this PR):

New

Selection_407

Edit

Selection_408

There are still some minor inconsistencies, that we think we should handle:

  • Initiative type field should be editable in New form
  • Initiative type field should be the first field in Edit form
  • Status should be the last field on Edit form (just before Committee members)
  • As its something specific to this field that doesn't happen on other places, we should add a message in the Author field explaining: "It's not possible to change an initiative authorship"

As a final check-up, this is how both forms should be:

New

  1. Type
  2. Title
  3. Description
  4. Hashtag
  5. Scope
  6. Author

Edit

  1. Type
  2. Title
  3. Description
  4. Hashtag
  5. Scope
  6. State
  7. Committee members

The only specific fields are the ones that make sense for that form (you can't change authors on Edit, as that can mess up the Committee members; seeing the Status on New doesn't make much sense; you can't invite Committee members until its created.


Let me know if there's something missing, but I think these changes shouldn't take too much time (hopefully).

@heisam
Copy link
Copy Markdown
Contributor Author

heisam commented Nov 15, 2022

Thanks for your feedback! Adding a Initiative type-Select in New Form is easily done, but then we would have to make the form more dynamic, e.g. clear/show fields depending on selected type (signature_end_date, areas_select, attachment) and reload options for other select fields (scope, signature_type). In Edit Form at least options for signature_type are updated on change of type (but only, if the field exists - if previous type had only one option it won't be displayed and updated). I would vote to leave this (fix dynamic form field display) for some time after the redesign though.

Add form_field for initiative_type to create form
Move form_field for state to the end on edit form
add help text to author-select
fix specs
@andreslucena
Copy link
Copy Markdown
Member

but then we would have to make the form more dynamic, e.g. clear/show fields depending on selected type

You're absolutely right, we forgot about this little detail 😄

I would vote to leave this (fix dynamic form field display) for some time after the redesign though.

+1, let's leave it out for now as it's tricky

@alecslupu
Copy link
Copy Markdown
Contributor

@heisam , can you fix the issue reported in #10063 as part of this PR ?

cc @andreslucena

@heisam
Copy link
Copy Markdown
Contributor Author

heisam commented Nov 16, 2022

@alecslupu I'd rather take care of that in a separate PR, can you assign #10063 to me?

@andreslucena @carolromero I think the forms should now be as suggested in your review. Plz let me know, if there are further issues:

  • Initiative type field should be editable in New form (Select dropdown is shown unless there is only one initiative type)
  • Initiative type field should be the first field in Edit form (Select dropdown is shown unless there is only one initiative type)
  • Status should be the last field on Edit form (just before Committee members)
  • As its something specific to this field that doesn't happen on other places, we should add a message in the Author field explaining: "It's not possible to change an initiative authorship"

@alecslupu
Copy link
Copy Markdown
Contributor

@heisam I cannot assign you. I cannot find you in the list.

@andreslucena
Copy link
Copy Markdown
Member

@heisam I cannot assign you. I cannot find you in the list.

If the person isn't a member of the organization, you only can assign someone if that person has commented on that issue. I think it's a measure to stop spamming people or something like that. This is why we need to approve the GitHub Actions workflow on each new commit.

As @heisam is already tackling multiple issues with great code and communication and we actually met in the last Decidim Fest, I already sent you the invite to the @decidim/developers team. Congratulations and welcome to the team 😄

@PierreMesure
Copy link
Copy Markdown
Contributor

Be careful when you tag @decidim/developers, @andreslucena. We all get a notification. 😁

But welcome anyway, @heisam!

Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

With the Product hat I like how its now, great job! 👌🏽
I just have a couple suggestions and we're good to go at least on my side.

heisam and others added 4 commits November 21, 2022 09:56
Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
…_initiative_controller.rb

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
@heisam
Copy link
Copy Markdown
Contributor Author

heisam commented Nov 21, 2022

Thanks for your suggestions @andreslucena - it should now be all done

@heisam heisam requested a review from andreslucena December 4, 2022 20:04
@andreslucena
Copy link
Copy Markdown
Member

@heisam it seems like there are some failing specs, can you check them out please? Thanks

@heisam
Copy link
Copy Markdown
Contributor Author

heisam commented Dec 5, 2022

@andreslucena on my machine spec/system/admin/admin_manages_initiatives_spec.rb is all green. Could these be some flaky specs? Not sure what I can do to fix it.
Update: When running all system tests locally I can definitely see some specs randomly failing, but when retrying them individually they are all green. Plz let me know how to go forward with this so I can move on to the next issue (#9923)

@eliegaboriau
Copy link
Copy Markdown
Contributor

Hello, I noticed a little error when backporting this on one of our app : the hashtag field is not saved when creating an initiative.
You probably need to add it to the command.

We also have a question : why does the state field is displayed whereas it appears to never be updatable ?

@heisam
Copy link
Copy Markdown
Contributor Author

heisam commented Feb 6, 2023

Thank you @eliegaboriau! Yes, the "hashtag"-attribute was indeed missing in the creation-command. Regarding the state field I'm not sure...

@andreslucena
Copy link
Copy Markdown
Member

Sorry for the delay on reviewing this one, I'll assign this to @alecslupu as I don't have availability for moving this forward.

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

Labels

module: initiatives type: fix PRs that implement a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initiative edit form fields are different from creation form

5 participants