staging -> production #758
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
PublicSignsControllerandPublicSignsServiceObjects 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:
Here is the changed Topics page with the added "Sort By" etc:
Here is the changed Private page with the added "Sort By" etc:
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.rbexplicitly only shows 'published' signs, so I had to replicate the query but without the where clauseWHERE 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
Topicinstance 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 scopeuncategorised, in theuncategorisedmethod inapp/controllers/topics_controller.rbSince we need to Sort and Page these "no topic" Signs, I've kept the unsaved
Topicinstance, and moved theuncategorisedscope to theTopicSignService.The way the query in
lib/sql/status.rbworks 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 inlib/sql/status.rbreturns.