From 28acad67070b9537f26d59e1a1ab147afb05e95b Mon Sep 17 00:00:00 2001 From: Roman Dvornov Date: Thu, 7 Mar 2024 01:57:52 +0100 Subject: [PATCH] Fix passing context to `table` view when rendered in `struct` view --- CHANGELOG.md | 1 + src/views/struct/index.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf37cef2..edf6702c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Modified the badge view to enable passing all options via config, in addition to data - Fixed the highlighting of Jora assertions - Fixed displaying supported syntaxes in view's showcase for `source` view +- Fixed passing context to `table` view when rendered in `struct` view - Exposed used CodeMirror for extension purposes via a static property `CodeMirror` of `QueryEditor` and `ViewEditor`, e.g. `discovery.view.QueryEditor.CodeMirror.defineMode('my-mode', ...)` ## 1.0.0-beta.80 (21-01-2024) diff --git a/src/views/struct/index.js b/src/views/struct/index.js index c3bb8813..51762ba5 100644 --- a/src/views/struct/index.js +++ b/src/views/struct/index.js @@ -238,13 +238,14 @@ export default function(host) { } function renderTable(el) { + const options = elementOptions.get(el); let data = elementData.get(el); if (!isArray(data) && !isSet(data)) { data = Object.entries(data).map(([key, value]) => ({ '[key]': key, '[value]': value })); } - host.view.render(el, 'table', data, {}); + host.view.render(el, 'table', data, options.context); el.append(el.lastChild.previousSibling); }