-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Upgrade for compatibility with new Datasette 1.0 JSON format #19
Comments
I also got this error:
|
I think I need a Playwright test for this, since it's a bug in the JavaScript. I'll borrow from https://github.com/datasette/datasette-comments/blob/a0f637f6a3d6927a00c678166d7e66363df1a7b5/tests/test_ui.py#L2 |
Here's the code that's failing: datasette-search-all/datasette_search_all/templates/search_all.html Lines 121 to 126 in 3ecd8e6
I don't think I've exposed all of that stuff as |
Actually I have: https://latest.datasette.io/fixtures/searchable.json?__search=dog&_extra=count&_extra=table&_extra=database&_extra=columns {
"ok": true,
"next": null,
"columns": [
"pk",
"text1",
"text2",
"name with . and spaces"
],
"database": "fixtures",
"count": 2,
"table": "searchable",
"rows": [
{
"pk": "pk",
"text1": "text1",
"text2": "text2",
"name with . and spaces": "name with . and spaces"
},
{
"pk": "pk",
"text1": "text1",
"text2": "text2",
"name with . and spaces": "name with . and spaces"
}
],
"truncated": false
} |
Found a Datasette 1.0 bug: the {
"ok": true,
"next": "2,2",
"columns": [
"pk",
"name"
],
"rows": [
{
"pk": "pk",
"name": "name"
}
],
"truncated": false
} Should return this: {
"ok": true,
"next": "2,2",
"columns": [
"pk",
"name"
],
"rows": [
{
"pk": 2,
"name": "Paranormal"
}
],
"truncated": false
} |
That bug is a bit of a blocker on this task. For the moment I'll use the keys from the first returned row. |
Got that working - the tests are a bit ugly in terms of Playwright boilerplate: datasette-search-all/tests/test_playwright.py Lines 7 to 24 in 502ac1e
Playwright includes I was getting "This event loop is already running" errors when I tried to use that, but it looks like the solution is to add |
Much neater: datasette-search-all/tests/test_playwright.py Lines 13 to 23 in e79f19a
|
Tested this on Datasette Cloud as well. |
Running datasette, version 1.0a2 this plugin seems broken.
When the search runs, it always gets
undefined
for the row count fromdata.filtered_table_rows_count
.datasette-search-all/datasette_search_all/templates/search_all.html
Line 127 in 5b5f192
I changed this to
data.count
and the plugin works as it used to.The text was updated successfully, but these errors were encountered: