Skip to content

Add order in not highlighted assemblies by weight#7444

Merged
mrcasals merged 1 commit intodecidim:developfrom
CodiTramuntana:feature/assembly_and_process_order
Feb 25, 2021
Merged

Add order in not highlighted assemblies by weight#7444
mrcasals merged 1 commit intodecidim:developfrom
CodiTramuntana:feature/assembly_and_process_order

Conversation

@laurajaime
Copy link
Copy Markdown
Contributor

🎩 What? Why?

In the related PR, I forgot to order by weight also the assemblies that are not highlighted.

📌 Related Issues

Link your PR to an issue

Testing

Describe the best way to test or validate your PR.

📋 Checklist

🚨 Please review the guidelines for contributing to this repository.

  • CONSIDER adding a unit test if your PR resolves an issue.
  • ✔️ DO check open PR's to avoid duplicates.
  • ✔️ DO keep pull requests small so they can be easily reviewed.
  • ✔️ DO build locally before pushing.
  • ✔️ DO make sure tests pass.
  • ✔️ DO make sure any new changes are documented in docs/.
  • ✔️ DO add and modify seeds if necessary.
  • ✔️ DO add CHANGELOG upgrade notes if required.
  • ✔️ DO add to GraphQL API if there are new public fields.
  • ✔️ DO add link to MetaDecidim if it's a new feature.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

📷 Screenshots

Please add screenshots of the changes you're proposing
Description

♥️ Thank you!


def parent_assemblies
search.results.parent_assemblies.order(promoted: :desc)
search.results.parent_assemblies.order(weight: :asc)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should fallback to the promoted, IMO

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do you propose this?

search.results.parent_assemblies.order(promoted: :desc, weight: :asc)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This would work, yes! Or the other way around, order(weight: :asc, promoted: :desc). Not sure what were the requirements or what's @decidim/product thoughts on this, you might need to ask.

You might need to modify code from the previous PR to keep the same feature, sorry about that!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think product gave the OK to first order them by weight and then as they were normally ordered if they have no weight.

What do you mean about modify code from the previous PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What do you mean about modify code from the previous PR?

I mean that probably the same issue happens with the Participatory Processes!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Participatory processes are different because in this section we show participatory processes and participatory processes group.
These processes groups have no weight so it could not be applied.

@laurajaime laurajaime force-pushed the feature/assembly_and_process_order branch from dec5864 to 93c734a Compare February 24, 2021 15:37
@mrcasals mrcasals merged commit 7acb33f into decidim:develop Feb 25, 2021
entantoencuanto added a commit that referenced this pull request Feb 25, 2021
* develop: (232 commits)
  Add Votings to Open Data export (#7388)
  Add order in not highlighted assemblies by weight (#7444)
  Resort Menus (#7460)
  Polling Officer Zone (#7439)
  Fix session timeout when using multiple windows or tabs (#7459)
  Fix display of debates with multiple dates (#7393)
  chore: split election tests (#7451)
  style: make selected values primary labels with delete button (#7448)
  Fix and tests to avoid registered users being invited again (#7392)
  Migrate Admin menus to Menu Registry (#7368)
  New Crowdin updates (#7338)
  Bump to carrierwave 2.2.0 (#7441)
  Voting: show callout when Polling Stations miss Polling Officers (#7417)
  Further default orders for the API (#7436)
  Fix random order inconsistencies (#7437)
  Ensure Rails is locked to 5.2.4.x series (#7430)
  Add default order by ID to API list queries (#7424)
  Update dependencies (#7422)
  Ignore warning on CI when no artifacts to upload (#7420)
  Filter and search polling officers (#7411)
  ...
@tramuntanal tramuntanal deleted the feature/assembly_and_process_order branch February 26, 2021 07:15
entantoencuanto added a commit that referenced this pull request Mar 2, 2021
* develop: (25 commits)
  Add css selectors to emails to improve design customization (#7493)
  Only share tokens if component exists (#7499)
  Fix record encryptor hash values JSON parsing for legacy unencrypted hash values (#7494)
  Fix NULL error with weight field in assemblies & processes (#7486)
  Fix proposals to budget import (#7449)
  Fix cost display on proposals (#7450)
  Fix #7487 - Invalid signature on message decryption (#7488)
  New Crowdin updates (#7482)
  Move specs file to correct folder (#7476)
  Improve changelog generator (#7475)
  New Crowdin updates (#7472)
  Prepare 0.25-dev version (#7473)
  New Crowdin updates (#7470)
  New Crowdin updates (#7468)
  Feature proposal infinite edit time (#7406)
  New Crowdin updates (#7457)
  Trigger docs build on folder changes (#7360)
  Add changelog generator based on PR data (#7461)
  Add Votings to Open Data export (#7388)
  Add order in not highlighted assemblies by weight (#7444)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants