Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow specifying a path to a custom js function #267

Merged
merged 2 commits into from
Nov 17, 2022

Conversation

fxwiegand
Copy link
Collaborator

This PR allows the user to write their custom js function in a separate file instead of inside the config.yaml. This cleans up the config when having long custom functions as well as making it possible for the user to have full IDE support when writing the actual javascript.

@fxwiegand fxwiegand added the feature New feature or request label Nov 16, 2022
@fxwiegand fxwiegand self-assigned this Nov 16, 2022
README.md Outdated
|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|---------------------------|
| link-to-url | Renders a link to the given url with {value} replace by the value of the table. Other values of the same row can be accessed by their column header (e.g. {age} for a column named age). | | |
| custom | Applies the given js function to render column content. The parameters of the function are similar to the ones defined [here](https://bootstrap-table.com/docs/api/column-options/#formatter) | | |
| custom-path | Allows to specify a path to a file that contains a js function similar to custom. | | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should say something about the naming of the function and in general the allowed contents of the file here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the function shouldn't matter (added that to the docs) and also pointed to the example of our example report.

@johanneskoester johanneskoester merged commit 1eb1453 into main Nov 17, 2022
@johanneskoester johanneskoester deleted the custom-path branch November 17, 2022 12:58
johanneskoester pushed a commit that referenced this pull request Nov 17, 2022
🤖 I have created a release \*beep\* \*boop\*
---
##
[2.9.0](https://www.github.com/datavzrd/datavzrd/compare/v2.8.1...v2.9.0)
(2022-11-17)


### Features

* Allow specifying a path to a custom js function
([#267](https://www.github.com/datavzrd/datavzrd/issues/267))
([1eb1453](https://www.github.com/datavzrd/datavzrd/commit/1eb145338b551285926ff8449ebd90664688f2d3))


### Bug Fixes

* Fix error when rendering empty multi header files
([#268](https://www.github.com/datavzrd/datavzrd/issues/268))
([9c2b464](https://www.github.com/datavzrd/datavzrd/commit/9c2b4649cc6ab170a048d7a7154625b28f5be309))
---


This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants