feat(api chart): allow customizing api chart with query or body parameters#278
Open
arnaud-moncel wants to merge 2 commits intomainfrom
Open
feat(api chart): allow customizing api chart with query or body parameters#278arnaud-moncel wants to merge 2 commits intomainfrom
arnaud-moncel wants to merge 2 commits intomainfrom
Conversation
4 new issues
|
| end | ||
|
|
||
| def render_chart(caller, name, record_id) | ||
| def render_chart(caller, name, record_id, parameters = {}) |
| attr_reader :composite_record_id, :parameters | ||
|
|
||
| def initialize(collection, caller, record_id) | ||
| def initialize(collection, caller, record_id, parameters = {}) |
| end | ||
|
|
||
| def render_chart(_caller, name, _record_id) | ||
| def render_chart(_caller, name, _record_id, _parameters = {}) |
|
|
||
| def render_chart(caller, name, record_id) | ||
| @child_collection.render_chart(caller, name, record_id) | ||
| def render_chart(caller, name, record_id, parameters = {}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Definition of Done
General
Security
Note
Pass query/body parameters to API chart handlers in collection and datasource routes
QueryStringParser.parse_chart_parametersto extract scalar request params (filtering out nil, Hash, and Array values) as a normalized string hash.render_charton both collection and datasource routes, threading through all decorator and base class signatures.DatasourceChartContextfor datasource-level chart handlers and extendsChartContextwith a frozenparametersattribute, making request params accessible inside chart handler blocks.render_chartsignatures acrossCollection,Datasource,CollectionDecorator,DatasourceDecorator,CompositeDatasource, and their chart decorators now accept an optionalparametershash; existing handlers without aparametersargument are unaffected due to the default value.Macroscope summarized a4b4ebf.