Feature #2300
openLoad form tables dynamically
Added by Alexander Watzinger over 1 year ago. Updated about 1 month ago.
Description
- Load form tables only on demand (when clicking on the corresponding input field)
- Maybe even load only the relevant page and reload on demand (e.g. clicking next page, or sort, or filter)
Beside better performance this would also help with situations e.g. at person when adding a place dynamically for birth and than also being able to use it immediately for residence.
All these changes would require support from the frontend team, the second one would require support from the API so most likely we won't start this before autumn.
Sorry for changing these approaches so often over the last months and a big thank you to Christoph for latest input.
Branch: features/table_api
Files
| clipboard-202510271531-tsgnv.png (174 KB) clipboard-202510271531-tsgnv.png | Katharina Wünsche, 2025-10-27 15:31 |
Updated by Bernhard Koschiček-Krombholz over 1 year ago
- Status changed from Acknowledged to Assigned
- Assignee set to Bernhard Koschiček-Krombholz
I will look into this issue, at least from a managing point of view.
So, we use currently Datatables. I will look into other possibilities for better server-side support:I will look into these, but if anybody has other solution, which will integrate better, please let me know.
Updated by Bernhard Koschiček-Krombholz over 1 year ago
- Related to Feature #998: Filter for Entity Overviews added
Updated by Bernhard Koschiček-Krombholz over 1 year ago
Since OpenAtlas Discovery uses Tanstack, we will use the same library in the backend UI.
Updated by Bernhard Koschiček-Krombholz about 1 year ago
- Target version changed from 8.8.0 to 8.9.0
Updated by Bernhard Koschiček-Krombholz about 1 year ago
Discovered that Tanstack doesn't really support vanilla JS like advertised: https://github.com/TanStack/table/discussions/4928
Here are user examples which work, but aren't great:
https://stackblitz.com/edit/vitejs-vite-mcxo6f?file=src%2Fmain.ts
https://stackblitz.com/edit/vitejs-vite-zbmszd?file=src%2Fmain.ts
Updated by Alexander Watzinger about 1 year ago
- Target version changed from 8.9.0 to 8.10.0
Updated by Alexander Watzinger about 1 year ago
- Precedes Feature #2438: Text annotation: also provide unlinked entities added
Updated by Bernhard Koschiček-Krombholz 11 months ago
- Target version changed from 8.10.0 to 8.15.0
Updated by Bernhard Koschiček-Krombholz 11 months ago
- Status changed from Assigned to Acknowledged
- Assignee deleted (
Bernhard Koschiček-Krombholz)
Updated by Alexander Watzinger 11 months ago
- Precedes Feature #2476: Re-filling of tables after adding an entity added
Updated by Bernhard Koschiček-Krombholz 10 months ago
- Related to Feature #2490: Dynamic entity add for multiple table select added
Updated by Bernhard Koschiček-Krombholz 10 months ago
- Related to deleted (Feature #2490: Dynamic entity add for multiple table select)
Updated by Bernhard Koschiček-Krombholz 10 months ago
- Precedes Feature #2490: Dynamic entity add for multiple table select added
Updated by Alexander Watzinger 10 months ago
- Related to deleted (Feature #998: Filter for Entity Overviews)
Updated by Alexander Watzinger 10 months ago
- Precedes Feature #998: Filter for Entity Overviews added
Updated by Bernhard Koschiček-Krombholz 9 months ago
- Related to Feature #2495: API: Simple search endpoint added
Updated by Alexander Watzinger 6 months ago
- Status changed from Acknowledged to Assigned
- Assignee set to Katharina Wünsche
Updated by Alexander Watzinger 3 months ago
- Start date changed from 2024-06-04 to 2025-01-27
- Follows Feature #2464: OpenAtlas major version 9.0.0 added
Updated by Alexander Watzinger 3 months ago
Moving to next version because of dependencies.
Updated by Alexander Watzinger 3 months ago
- Target version changed from 8.15.0 to 9.2.0
Updated by Katharina Wünsche 2 months ago
For filling the table dynamically, i.e. through the API, I'd suggest the following workflow:
For that, we would need an API endpoint that accepts an array of system classes and an array of column names as well as parameters for limit and pageNr. It should return the filled in rows as an Array of Arrays of strings, similar to what the entity_table() function currently does. A sample request could look like this:
Request : /get_table_rows?system_classes=['person']&columns=['name', 'description', 'begin', 'end']&limit=20&page=1
Response :
[
{
name: "Hugo",
description: "Our first test entry",
begin: 1900,
end: 1990
},
{
name: "Sieglinde",
description: "Our second test entry",
begin: null,
end: 2003
},
...
]
Updated by Katharina Wünsche 2 months ago
- Status changed from Assigned to In Progress
Updated by Bernhard Koschiček-Krombholz about 2 months ago
- Description updated (diff)
Great. The new endpoint is named /table_rows and gives you back an array of array with strings or Null.
You can select which columns you want with table_columns=.
Additionally, this endpoint shares a lot with the /query endpoint currently. So you can already choose between entities, system_classes, view_classes, linked_entities and use search, filter by type_id, etc.
OpenApi3 file should also be up-to-date with the version 0.4.11.
I will now test it, if every table_colums works as expected.
Available under: features/table_api
As a little bonus, now each Entity Endpoint features the format=table_row.
I don't know if everything stays the same, due to performance considerations, but currently this is the way to go.
PS: it currently only works if you are logged in and send the request from the browser you are logged in due to user settings. This can be easily overwritten, but we keep it for now the way it is.
File "/home/bkoschicek/www/openatlas/openatlas/display/table.py", line 282, in format_name_and_aliases
if not entity.aliases or not current_user.settings['table_show_aliases']:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'AnonymousUserMixin' object has no attribute 'settings'
Updated by Bernhard Koschiček-Krombholz about 2 months ago
Here is an update, which table_columns work right now:
| table_columns | Notes / Errors |
|---|---|
| 'activity' | AttributeError: 'Entity' object has no attribute 'property' |
| 'begin' | |
| 'checkbox' | Gives the correct input form, but "checked" will not be selected |
| 'class' | |
| 'created' | |
| 'creator' | |
| 'content' / 'description' | |
| 'count' | Works, but currently 0 because e.count is not filled |
| 'default_precision' | |
| 'end' | |
| 'example_id' | AttributeError: 'Entity' object has no attribute 'example_id' |
| 'extension' | |
| 'external_reference_match' | AttributeError: 'NoneType' object has no attribute 'resolver_url' (No origin) |
| 'first' | AttributeError: 'NoneType' object has no attribute 'dates' (need links) |
| 'icon' | |
| 'involvement' / 'function' / 'relation' | AttributeError: 'Entity' object has no attribute 'type' (needs links) |
| 'last' | AttributeError: 'NoneType' object has no attribute 'dates' (need links) |
| 'license holder' | |
| 'main image' | 'NoneType' object has no attribute 'image_id' (needs origin) |
| 'name' | |
| 'page' | needs a link |
| 'precision' | needs a link |
| 'profile' | needs a link |
| 'overlay' | needs origin_id |
| 'public' | |
| 'remove' | AttributeError: 'NoneType' object has no attribute 'root' |
| 'set logo' | returns the link but naturally with a wrong id |
| 'size' | |
| 'type' / 'license' | |
| 'update' | need a link |
| 'resolver_url' / 'website_url' | Reference systems need to be initialized with more data |
| 'value' | need link |
For the basic overview tables, everything should work.
Updated by Bernhard Koschiček-Krombholz about 1 month ago
- Related to Feature #2681: API: Additional columns for sorting added
Updated by Bernhard Koschiček-Krombholz about 1 month ago
A small request, it would be cool to have a loading circle, not only for the load of the table, but also for the sort/filter.
Updated by Bernhard Koschiček-Krombholz about 1 month ago
- Related to Feature #2478: API: Format for tables added