Skip to content

Do not show counters and filters when there isn't any election#12055

Merged
alecslupu merged 7 commits intodevelopfrom
fix/elections-no-results
Dec 17, 2023
Merged

Do not show counters and filters when there isn't any election#12055
alecslupu merged 7 commits intodevelopfrom
fix/elections-no-results

Conversation

@andreslucena
Copy link
Copy Markdown
Member

🎩 What? Why?

Related to #11875, on elections we're showing a message but we're also showing it with the counter and sorting controls. This PR changes it to not showing these controls to be consistent with the rest of modules.

📌 Related Issues

Testing

  1. Create a new process
  2. Create a elections component
  3. Click in the "Preview" icon in the admin's component page

📷 Screenshots

Before

Screenshot of the elections index page empty

After

Screenshot of the elections index page empty

♥️ Thank you!

@andreslucena andreslucena added module: elections type: fix PRs that implement a fix for a bug no-backport Pull Requests that should not be backported labels Nov 22, 2023
@andreslucena
Copy link
Copy Markdown
Member Author

Adding the no-backport label, as the elections module is unfinished, so we don't offer support for v0.27

github-actions[bot]
github-actions bot previously approved these changes Nov 22, 2023
@andreslucena andreslucena marked this pull request as ready for review November 22, 2023 14:45
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

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

There is a small issue with this PR:
Elections do have a warning callout but the others do not. Could we fix this ?

image

Budgets:
image
Debates
image

Comment thread decidim-elections/app/views/decidim/elections/elections/_elections.html.erb Outdated
Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
github-actions[bot]
github-actions bot previously approved these changes Nov 27, 2023
Comment thread decidim-elections/app/views/decidim/elections/elections/_elections.html.erb Outdated
github-actions[bot]
github-actions bot previously approved these changes Nov 27, 2023
@andreslucena
Copy link
Copy Markdown
Member Author

Elections do have a warning callout but the others do not. Could we fix this ?

That's already solved. Can you check this out again @alecslupu ?

Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

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

Hey @andreslucena it seems this is actually more buggy than expected...

In my backend i have this:
image

In my frontend i have this:
image

When the component is barely published, the message is :
image

Maybe is something wrong with my dataset, but the list of finished meetings are appearing only if there is at least one upcomming meeting available.

Comment thread decidim-elections/app/views/decidim/elections/elections/_elections.html.erb Outdated
@alecslupu
Copy link
Copy Markdown
Contributor

@andreslucena It seems there are more issues on the elections page, and i am willing to merge this once we clarify how those 2 announcements should look like.

@andreslucena andreslucena removed the no-backport Pull Requests that should not be backported label Dec 11, 2023
Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
github-actions[bot]
github-actions bot previously approved these changes Dec 11, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 11, 2023
We already have it in the mother key:

- decidim.elections.warnings.no_scheduled_elections_warning

Do we really need that extra warning?
@andreslucena andreslucena marked this pull request as ready for review December 12, 2023 06:47
@andreslucena
Copy link
Copy Markdown
Member Author

@andreslucena It seems there are more issues on the elections page, and i am willing to merge this once we clarify how those 2 announcements should look like.

You were right as usual 😄

Now it should be fixed, I added specs for each of the different announcements:

  1. When there isn't any election all all: There is not any election scheduled.
  2. When the elections are all in the past, we hide the date sidebar and show the past elections (as in meetings): Currently, there are no scheduled elections, but here you can find all the past elections listed.
  3. When there's a filter without any election: There are no elections with this criteria.

@andreslucena andreslucena dismissed alecslupu’s stale review December 12, 2023 06:50

Ready for another round

Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

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

👍

image
image

@alecslupu alecslupu merged commit 6d94209 into develop Dec 17, 2023
@alecslupu alecslupu deleted the fix/elections-no-results branch December 17, 2023 07:52
@andreslucena andreslucena added the no-backport Pull Requests that should not be backported label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: elections no-backport Pull Requests that should not be backported type: fix PRs that implement a fix for a bug

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants