Skip to content

Conversation

@JacobBriggsAckama
Copy link
Contributor

@JacobBriggsAckama JacobBriggsAckama commented Sep 2, 2025

CCSD-4987: change topic and private folders sign pages to have paging…

feat: CCSD-4987 change topic and private folders sign pages to have paging.

The customer would like the topic and private folders sign pages to have paging and sorting, much like the current "Public Signs" page does. Happily, the code in the existing Public Signs functionality in the PublicSignsController and PublicSignsService Objects could easily be used as a template for the other two types of Signs, so much so that there is a lot of duplicated code.

Here is the existing "Public Signs" page:

Screenshot from 2025-08-21 14-02-11

Here is the changed Topics page with the added "Sort By" etc:

Screenshot from 2025-08-21 14-03-22

Here is the changed Private page with the added "Sort By" etc:

Screenshot from 2025-08-21 14-04-41

Note: there is a "See More" button at the bottom of each page which is not shown

The existing code for public signs in lib/sql/status.rb explicitly only shows 'published' signs, so I had to replicate the query but without the where clause WHERE signs.status = 'published' - I am not sure how to DRY this up.

There is a link on the topics page that shows all sign that do not have topics. This used to be done by making a Topic instance on the fly and not saving it to the database, so that the UI would still render properly, then doing the search using the Sign scope uncategorised, in the uncategorised method in app/controllers/topics_controller.rb

Since we need to Sort and Page these "no topic" Signs, I've kept the unsaved Topic instance, and moved the uncategorised scope to the TopicSignService.

The way the query in lib/sql/status.rb works is it gets all the IDs that could be displayed, alongside their ranks and activity, and orders them by that order, and returns them. The *SignService objects get all the signs it wants to show then orders/prunes them by the IDs the query in lib/sql/status.rb returns.

…#757)

feat: CCSD-4987 change topic and private folders sign pages to have
paging.

The customer would like the topic and private folders sign pages to have
paging and sorting, much like the current "Public Signs" page does.
Happily, the code in the existing Public Signs functionality in the
`PublicSignsController` and `PublicSignsService` Objects could easily be
used as a template for the other two types of Signs, so much so that
there is a lot of duplicated code.
 
Here is the existing "Public Signs" page:

<img width="1281" height="1004" alt="Screenshot from 2025-08-21
14-02-11"
src="https://github.com/user-attachments/assets/d881691f-4572-4374-b168-0b295782f42f"
/>

Here is the changed Topics page with the added "Sort By" etc:

<img width="1281" height="1004" alt="Screenshot from 2025-08-21
14-03-22"
src="https://github.com/user-attachments/assets/1e56a263-fba0-4dc9-9093-383968f5cee8"
/>

Here is the changed Private page with the added "Sort By" etc:

<img width="1281" height="1004" alt="Screenshot from 2025-08-21
14-04-41"
src="https://github.com/user-attachments/assets/06d6f814-89d3-4a8e-8af1-dff6ad9a30de"
/>

Note: there is a "See More" button at the bottom of each page which is
not shown

The existing code for public signs in `lib/sql/status.rb` explicitly
only shows 'published' signs, so I had to replicate the query but
without the where clause `WHERE signs.status = 'published'` - I am not
sure how to DRY this up.

There is a link on the topics page that shows all sign that do not have
topics. This used to be done by making a `Topic` instance on the fly and
not saving it to the database, so that the UI would still render
properly, then doing the search using the Sign scope `uncategorised`, in
the `uncategorised` method in `app/controllers/topics_controller.rb`

Since we need to Sort and Page these "no topic" Signs, I've kept the
unsaved `Topic` instance, and moved the `uncategorised` scope to the
`TopicSignService`.

The way the query in `lib/sql/status.rb` works is it gets all the IDs
that could be displayed, alongside their ranks and activity, and orders
them by that order, and returns them. The *SignService objects get all
the signs it wants to show then orders/prunes them by the IDs the query
in `lib/sql/status.rb` returns.
@JacobBriggsAckama JacobBriggsAckama merged commit bf1887e into production Sep 3, 2025
32 of 34 checks passed
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.

3 participants