Skip to content

Fix activity search function#53

Merged
jeancochrane merged 3 commits intomasterfrom
jfc/activity-search
Apr 17, 2020
Merged

Fix activity search function#53
jeancochrane merged 3 commits intomasterfrom
jfc/activity-search

Conversation

@jeancochrane
Copy link
Copy Markdown
Contributor

Overview

Update the DataTables configuration on search views to allow searching on username and content type fields.

Handles #52.

Testing Instructions

  • Make sure you have some edits that will show up in the activity search views
    • If you don't, just edit any document and save it without adjusting any fields
  • Visit the global activity search view at http://localhost:8000/activity/ and confirm you can run searches
  • Navigate to the detail view for a document that has changed (you can do this by following the link in the global activity search view), scroll down to the activity table at the bottom of the page, and confirm that you can run searches

@jeancochrane jeancochrane requested a review from derekeder April 13, 2020 20:16
Copy link
Copy Markdown
Collaborator

@derekeder derekeder left a comment

Choose a reason for hiding this comment

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

Sorting works as expected!

I did notice a formatting issue for the time. Perhaps its just missing the leading zero for the minutes:

Screen Shot 2020-04-13 at 5 06 24 PM

This affects both the main activity page, as well as the activity detail on each document.

Question: this seems to work well for a small number of edits. what happens when the list of actions on the main activity page grows to 1000+? Will the page try and load them all?

@jeancochrane
Copy link
Copy Markdown
Contributor Author

I did notice a formatting issue for the time. Perhaps its just missing the leading zero for the minutes:

Great catch! I switched the minutes directive from %-M to %M in c1f16b5 to ensure that minutes are 0-padded in timestamps.

Question: this seems to work well for a small number of edits. what happens when the list of actions on the main activity page grows to 1000+? Will the page try and load them all?

We're loading search results from the backend using django-datatables-view, so queries should be performant even at large volumes. DataTables' Show X entries dropdown will control the number of results returned for any given query, so we can always expect queries to be paginated.

@jeancochrane jeancochrane requested a review from derekeder April 14, 2020 14:45
Copy link
Copy Markdown
Collaborator

@derekeder derekeder left a comment

Choose a reason for hiding this comment

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

Looks like this updated the individual document formatting, but still seeing the missing zero on the top level activity page:

Screen Shot 2020-04-14 at 11 17 38 AM

@jeancochrane
Copy link
Copy Markdown
Contributor Author

Totally forgot that I had to define those two pages with separate views. I adjusted the other view and confirmed they both looked good to me in 7aca334, let me know how it looks to you!

@jeancochrane jeancochrane requested a review from derekeder April 15, 2020 15:07
Copy link
Copy Markdown
Collaborator

@derekeder derekeder left a comment

Choose a reason for hiding this comment

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

Looks good! Aprroved

@jeancochrane jeancochrane merged commit 5f6b524 into master Apr 17, 2020
@jeancochrane jeancochrane deleted the jfc/activity-search branch April 17, 2020 15:19
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.

2 participants