-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Datatables #863
Add Datatables #863
Conversation
Bonus: Fixes #806 - "Neighbourhood view not displaying names for parent objects" Added Datatables - Added 'ajax-datatables-rails' gem - Added 'datatables.net-bs4' yarn package - Added datatable css to application.css - Added datatable js to packs/application.js - Added datatable code to admin_index.js component - Changed neighbourhoods controller to allow datatables JSON response as well as HTML - Added datatables/neighbourhood_datatable.rb - Changed Neighbourhoods index so it renders it's own (data) table rather than admin_index component table. This was done to fix the "edit" column not really being supported by datatables
Closing test fail & need to make sure neighbourhood admins can see datatables |
This works as is, can either merge or do some tidyup first? Key gotchas:
|
I think we should change columns to reflect the database structure too as it's kinda confusing as is |
Remove "Add new neighbourhood" button (and functionality?) |
…bourhoods edit page
Everything done, new ticked added for out of scope stuff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a quick look. This looks great. Few tiny comments... but super excited to get this in. Is very well organised!
dataTable = $('#datatable').DataTable({ | ||
"processing": true, | ||
"serverSide": true, | ||
"pageLength": 15, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a little dropdown on the datatable to pick the number per page if that counts :) but yes it could be set per-page if we need? what do you mean by configurable?
title: "Neighbourhoods", | ||
model: :neighbourhoods, | ||
columns: %i[id name unit_name unit_code_key unit_code_value], | ||
data: @neighbourhoods.limit(15), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again wondering if we want this to be configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you said on the other one... if there's a dropdown so the user can configure and this is just our default starting point, then all good. I could not tell if it was a fixed value.
</div> | ||
</div> | ||
</div> | ||
<p class="alert alert-danger" role="alert">Warning: neighbourhoods should not be created here and this page is only left as a placeholder!</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to remove it? What breaks if we do not have a placeholder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm I did consider this but I think it's good to resolve the usual default Rails routes? The main usecase for it going forwards is for when we have custom geographies but that's a way off?
<h2>Geography</h2> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<h3>Is a part of…</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great new headings!
Partial/WIP #821 & #821
Bonus: Fixes #806 - "Neighbourhood view not displaying names for parent objects"
Progress
Aster
Kim
TODO