Full report/panorama rendering in link previews - #582
Conversation
The reference provider (Smart Picker / link preview) previously showed a static card with icon, title and subtitle. Analytics links pasted into rich text (Text documents, Talk, Tables descriptions) now render the actual content: - Reports render as full chart, data table, KPI or combined view using the stored report options, fetched live from the existing data endpoints with ETag/localStorage caching. - Panoramas render their first page as a grid with all report, text and picture widgets, plus a link to the remaining pages. - The chart stack is lazy-loaded on the first rendered analytics reference, so pages without analytics links load no extra scripts. - Failed loads (deleted report, revoked permission, blocked scripts) fall back to the previous static card. Fixes along the way: - resolveReference() now falls back to ShareService, so reports and panoramas shared with the current user no longer resolve as "Report not found". PanoramaService::read() gained the same fallback, restricted to the fields the panorama view needs. - The admin toggle link_preview_enabled is functional again. Signed-off-by: Alexander Askin <lexioj@gmail.com>
|
nice one! thanks! I always had this on my todo list. thank you again |
Bring PR Rello#582 onto current master and adapt its isolated renderer to DataTables 3 and flexible dataset helpers. Signed-off-by: Rello <github@scherello.de> Assisted-by: Codex:GPT-5
|
I am adjusting this PR because the app changed. e.g. the new datatables does not require jquery anymore |
|
testing in progress.... |
Signed-off-by: Rello <github@scherello.de> Assisted-by: Codex:GPT-5
|
Preview asset footprint for the current PR head (
As an example of the variable data cost, local NC34 report #4 returned 36 rows in 2,158 bytes of JSON (738 bytes gzip-equivalent). Table pagination displays ten rows per page but still fetches the full report. Asset files are shared across previews on the same page; cacheable report responses can use ETags on later loads. Assisted-by: Codex:GPT-5 |
Preserve explicit chart and table selections, retain combined content mode, and keep the original picker with scoped heading and keyboard fixes. Add regression coverage and update the changelog. Signed-off-by: Rello <github@scherello.de> Assisted-by: Codex:GPT-5
As announced in #581, this makes Analytics links actually useful when pasted into Text, Talk or Tables: instead of the static card with just icon and title, the link preview now renders the real content.
Tables
Text
Talk
Reports show up as their actual chart / data table / KPI (whatever is configured in the report options), loaded live from the existing data endpoints. Panoramas render their first page as a widget grid with a link to the remaining pages. If loading fails for whatever reason (report deleted, no permission anymore, scripts blocked), it just falls back to the old static card, so nothing breaks.
I made sure the chart bundle is only lazy-loaded when a page actually contains an analytics reference — pages without such links don't pay for this.
While working on this I ran into two bugs that this PR also fixes:
resolveReference()only checked own reports. It now falls back toShareService(same forPanoramaService::read(), limited to the fields the panorama view needs)link_preview_enabledwas ignored, that works againAdded PHPUnit tests for the reference provider and the share fallbacks, plus a few OCP stubs that were needed to test the reference interfaces.
Happy to adjust if you'd prefer a different approach for anything here.