Skip to content

Upcoming and past meetings order #8589

@paulinebessoles

Description

@paulinebessoles

Describe the bug
As a user, when visiting a meeting component index or the meeting directory:

  • I see upcoming meetings sorted by descending start date
  • I see past meetings sorted by descending start date, as for upcoming meetings.

IMO, it would be more logical to display upcoming meetings in an ascending order and the past meetings in a descending order, to see the nearest meetings first for each index.

To Reproduce

  1. Go to 'https://www.decidim.barcelona/assemblies/comissio-permanent-CEMB/f/4054/'
  2. See that the first meeting is the furthest meeting

Expected behavior
As a user, when seeing upcoming meetings, I expect them to be displayed from the nearest to the furthest in time.
As a user, when seeing past meetings, I expect them to be displayed from the most recent to the oldest meeting.
This should be applied in meetings_controller.rb and directory/meetings_controller.rb

Additional context
May be the solution could look like this:

        def meetings
          @meetings ||= paginate(search.results.order(start_time: params.dig("filter", "date")&.include?("past") ? :desc : :asc))
        end

instead of this:

      def meetings
        @meetings ||= paginate(search.results.order(start_time: :desc))
      end

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions