Skip to content

Harmonizes the design of initiatives search in FO#6090

Merged
jesusdb merged 10 commits intodecidim:developfrom
aspgems:feature/initiatives_search_fo_new_design
May 27, 2020
Merged

Harmonizes the design of initiatives search in FO#6090
jesusdb merged 10 commits intodecidim:developfrom
aspgems:feature/initiatives_search_fo_new_design

Conversation

@ace
Copy link
Copy Markdown
Contributor

@ace ace commented May 12, 2020

🎩 What? Why?

Adapt initiatives search filters to the recent design used in proposals.

📌 Related Issues

📋 Subtasks

  • Add CHANGELOG entry
  • Add tests

📷 Screenshots (optional)

New filters section

@virgile-dev
Copy link
Copy Markdown
Contributor

@carolromero you can check this out on https://osp-decidim.dev.aspgems.com/initiatives

@carolromero
Copy link
Copy Markdown
Member

@virgile-dev I'm not so sure about this one. I understand that there are different "levels" or categories of status:

  • The top level: open or closed initiatives.
  • A second level: If it has been accepted, rejected or is in validation, because you can have accepted initiatives, whether they are open or not, right?
  • Finally, the fact that they have been answered or not belongs to a different "level" from the two previous ones.

So it seems to me that this change in the filters can be confusing. I don't have a clear solution, a priori I think it's better to leave only the upper level (as it is now), although maybe we can think of some alternative. Thoughts? cc @decidim/product

@virgile-dev
Copy link
Copy Markdown
Contributor

Hello @carolromero
Thanks for your feedback !

  • Open = end date for signature collection period hasn't passed yet
  • Closed = end date for signature collection period has passed (signature collection date cannot be changed once an initiative accepted or rejected)
  • Only initiatives which end date for signature collection period has passed can be either accepted or rejected. So it makes sense it's a sub-filter of closed.
  • Initiatives can receive answers at any time regardless of its signature collection period dates. That's I figured it could be first level too.

@carolromero
Copy link
Copy Markdown
Member

@virgile-dev sorry I'm late! Thank you for clarifying, sometimes I mess myself up with so many options 😬
I guess what I find a little confusing is the name of the Accepted and Rejected labels if it actually refers to the number of signatures collected, although that was before this PR. We have discussed it with product and we thought that this way it would be more understandable:

  • Open
  • Closed
    • Enough signatures
    • Not enough signatures
  • Answered

@virgile-dev @ace what do you say? Do you think we can make that change? 🙏

@virgile-dev
Copy link
Copy Markdown
Contributor

@carolromero sure we can change the translations.

Just to be clear you want us to change accepted and rejected to the ones you suggest everywhere not juste in the filtering box right ?
This means on cards, on the page etc.

@carolromero
Copy link
Copy Markdown
Member

carolromero commented May 20, 2020

Just to be clear you want us to change accepted and rejected to the ones you suggest everywhere not juste in the filtering box right ?

@virgile-dev that's right, to be consistent, yes. thanks!

@virgile-dev
Copy link
Copy Markdown
Contributor

@ace could you apply the changes in locales that carol requested ? Thanks in advance !

@ace
Copy link
Copy Markdown
Contributor Author

ace commented May 21, 2020

Changed both texts in filters, lists and cards.

BO states

FO states

@ace
Copy link
Copy Markdown
Contributor Author

ace commented May 21, 2020

@carolromero @virgile-dev The changes are on https://osp-decidim.dev.aspgems.com if you want to check them.

@jesusdb jesusdb self-requested a review May 21, 2020 13:25
@jesusdb
Copy link
Copy Markdown
Contributor

jesusdb commented May 21, 2020

Hi @ace, could you please check the remaining failing test?

@ace
Copy link
Copy Markdown
Contributor Author

ace commented May 21, 2020

Hi @jesusdb. I think I need some guidance here. I saw that test, but it shouldn't be failing. It's complaining about unused l18n keys that are if fact used.
Both the keys and the usage were added in the same commit, c833bfa (the badge_name ones).
You can see two of them in the last screenshot above, the '(not) enough signatures' labels in the initiatives card.
Any idea how that can be solved? Is there any way to make the test find those keys usages?

@microstudi
Copy link
Copy Markdown
Contributor

Any idea how that can be solved? Is there any way to make the test find those keys usages?

Let me chime in here, this is a problem that comes back from time to time. You can force the identification of i18n keys by creating a comment somewhere in the code.

For instance:

 # i18n-tasks-use t('decidim.admin.exports.formats.JSON')

There's also the possibility to edit the config/i18n-tasks.yml file, but I found the comment method a little bit more clear.

@ace
Copy link
Copy Markdown
Contributor Author

ace commented May 21, 2020

Thanks @microstudi, those comments fixed the missing keys issue. Now it's complaining about a non-normalized locale file in the proposals module, should that be fixed here?

@microstudi
Copy link
Copy Markdown
Contributor

Thanks @microstudi, those comments fixed the missing keys issue. Now it's complaining about a non-normalized locale file in the proposals module, should that be fixed here?

Just do what the test says and it will fix it:
bundle exec i18n-tasks normalize --locales en

@ace
Copy link
Copy Markdown
Contributor Author

ace commented May 21, 2020

Yeah, I did that but found out the offending file doesn't belong to this PR (not even the initiatives module, it's from proposals), that's why I'm not sure about fixing it here.

@microstudi
Copy link
Copy Markdown
Contributor

Maybe it is related with the fact that some keys used in initiatives where moved to proposals recently (because they were used un both). Can you check what is changed by the i18n task?

@ace
Copy link
Copy Markdown
Contributor Author

ace commented May 21, 2020

I'll recheck when I can get back to this branch, dealing with that nil in the other one :)
But it makes a lot of sense, normalize was removing two keys from the proposals for accepted and rejected states, I've changed that here to use explicit keys so maybe initiatives was using some kind of generic proposals keys.

@microstudi
Copy link
Copy Markdown
Contributor

Actually, I made the PR with the change, check this: #6013

@virgile-dev
Copy link
Copy Markdown
Contributor

@jesusdb could you check if can merge this now ? Thanks !

@jesusdb
Copy link
Copy Markdown
Contributor

jesusdb commented May 26, 2020

Could you check the changelog conflict, please?

We're currently looking on a way to automate and fix the changelog conflicts to avoid these situations

@ace
Copy link
Copy Markdown
Contributor Author

ace commented May 26, 2020

Done. That automation would be great, I can't remember how many times I've had this conflict in the last days :)

@microstudi
Copy link
Copy Markdown
Contributor

Yes, it's a pain... This will change at the next version. PR won't have to deal with changelog anymore

@ace
Copy link
Copy Markdown
Contributor Author

ace commented May 26, 2020

It seems coverage upload timed out, can you re-run?

@ace ace mentioned this pull request May 26, 2020
2 tasks
Copy link
Copy Markdown
Contributor

@jesusdb jesusdb left a comment

Choose a reason for hiding this comment

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

Nicely done!

@jesusdb jesusdb merged commit 517b25d into decidim:develop May 27, 2020
@ace ace deleted the feature/initiatives_search_fo_new_design branch May 27, 2020 09:06
ace pushed a commit to aspgems/decidim that referenced this pull request May 28, 2020
* feature/add_areas_to_initiatives: (30 commits)
  Adds areas to FO filters
  Fix lint issue
  Fixes rubocop issues
  Updates changelog
  Adds areas to initiatives
  Send notification when signature threshold reached (decidim#6098)
  Adds filter by initiative type to admin panel (decidim#6093)
  Require confirmation on exiting a survey mid-answering (decidim#6118)
  Information message when there isn't any Proposal (decidim#6063)
  Set email asset host dynamically (decidim#5888)
  Harmonizes the design of initiatives search in FO (decidim#6090)
  Include year in meetings card (decidim#6102)
  Add attachment enabled option to initiative types and initiatives (decidim#6036)
  Fix a flaky test in group profile conversations (decidim#6123)
  Add attachments to Initiatives (decidim#5844)
  Add initiatives export (decidim#6070)
  Improvements to conversations with more than one participant (decidim#6094)
  Elections module and election administration (decidim#6065)
  Separate forms in steps (decidim#6108)
  Add sorting by publishing date to initiatives (decidim#6016)
  ...

# Conflicts:
#	decidim-initiatives/app/cells/decidim/initiatives/initiative_m_cell.rb
#	decidim-initiatives/app/commands/decidim/initiatives/admin/update_initiative.rb
#	decidim-initiatives/app/controllers/decidim/initiatives/initiatives_controller.rb
#	decidim-initiatives/app/forms/decidim/initiatives/admin/initiative_form.rb
#	decidim-initiatives/app/helpers/decidim/initiatives/application_helper.rb
#	decidim-initiatives/app/models/decidim/initiative.rb
#	decidim-initiatives/app/services/decidim/initiatives/initiative_search.rb
#	decidim-initiatives/app/views/decidim/initiatives/create_initiative/fill_data.html.erb
#	decidim-initiatives/app/views/decidim/initiatives/initiatives/_filters.html.erb
#	decidim-initiatives/app/views/decidim/initiatives/initiatives/_tags.html.erb
#	decidim-initiatives/config/locales/en.yml
#	decidim-initiatives/db/migrate/20200514085422_add_area_to_initiatives.rb
#	decidim-initiatives/db/migrate/20200514102631_add_area_enabled_option_to_initiatives.rb
#	decidim-initiatives/spec/forms/initiative_form_spec.rb
#	decidim-initiatives/spec/services/decidim/initiatives/initiative_search_spec.rb
#	decidim-initiatives/spec/shared/update_initiative_type_example.rb
#	decidim-initiatives/spec/system/admin/admin_manages_initiatives_spec.rb
#	decidim-initiatives/spec/system/admin/initiative_types_controller_spec.rb
#	decidim-initiatives/spec/system/filter_initiatives_spec.rb
ace pushed a commit to aspgems/decidim that referenced this pull request May 29, 2020
* develop:
  Send notification when signature threshold reached (decidim#6098)
  Adds filter by initiative type to admin panel (decidim#6093)
  Require confirmation on exiting a survey mid-answering (decidim#6118)
  Information message when there isn't any Proposal (decidim#6063)
  Set email asset host dynamically (decidim#5888)
  Harmonizes the design of initiatives search in FO (decidim#6090)
anaghavl pushed a commit to codegram/decidim that referenced this pull request Jun 3, 2020
* Harmonizes the design of initiatives search in FO

* Updates changelog

* Removes unused i18n keys

* Changes 'accepted/rejected' state texts to 'enough/not enough sigantures'

* Fixes specs for label changes

* Adds I18n keys in comment to avoid being detected as unused

* Removes unused I18n keys
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.

6 participants