Skip to content

Commit

Permalink
Fix passing context to table view when rendered in struct view
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Mar 7, 2024
1 parent efac652 commit 28acad6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/views/struct/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 28acad6

Please sign in to comment.