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

[Question]: Placement of card_template() function. #226

Closed
kartikeyakirar opened this issue Oct 11, 2023 · 6 comments
Closed

[Question]: Placement of card_template() function. #226

kartikeyakirar opened this issue Oct 11, 2023 · 6 comments
Assignees
Labels
core question Further information is requested

Comments

@kartikeyakirar
Copy link
Contributor

kartikeyakirar commented Oct 11, 2023

What is your question?

To include card labels, the add_card_button_srv function allows you to specify the card_fun along with a label parameter for customizing the card's title and content. This feature enables you to utilize the label shiny input and incorporate it into your card_fun to set the title.

When it comes to teal modules, each module has its own structure for the card_fun, but there are common elements shared across all card_function that can be standardized within a card_template function. You can find an example of this in the following code:

Teal Reporter - card_template function

This card_template function can be further encapsulated to suit specific requirements, as demonstrated here:

Teal Goshawk - customized card_template

The challenge lies in deciding where to place the card_template function, as keeping it within teal.reporter adds teal as a dependent package. Here are a few suggestions:

Option 1:
Move the card_template() function to teal as an exported function. Instead of teal.reporter.

Option 2:
Create a separate card_template for each module (e.g., tmc, tmg, tmh) to ensure module-specific customization.

Option 3:
Consider adding teal as a dependency to teal.reporter to retain the card_template function.

@kartikeyakirar kartikeyakirar added question Further information is requested core labels Oct 11, 2023
@kartikeyakirar
Copy link
Contributor Author

@insightsengineering/nest-core-dev Please share your thoughts or questions regarding

@m7pr
Copy link
Contributor

m7pr commented Oct 11, 2023 via email

@kartikeyakirar
Copy link
Contributor Author

Because the card_template function relies on the teal package, it utilizes the TealReportCard R6 class, which has been relocated to the teal package.

@donyunardi donyunardi changed the title [Question]: Placemnet of card_template() function. [Question]: Placement of card_template() function. Oct 12, 2023
@m7pr
Copy link
Contributor

m7pr commented Oct 12, 2023 via email

@m7pr
Copy link
Contributor

m7pr commented Oct 12, 2023

Oh yeah, and as we just spoke, teal.reporter can not import teal, since teal is already importing teal.reporter 📦

kartikeyakirar added a commit to insightsengineering/teal that referenced this issue Oct 13, 2023
#933)

this PR is extension to
insightsengineering/teal.reporter#198

Here I have added card_template() function that generates a report card
with a title,
an optional description, and the option to append the filter state list.
and is been used in
insightsengineering/teal.modules.general#584
insightsengineering/teal.modules.clinical#835
insightsengineering/teal.modules.hermes#336
insightsengineering/teal.osprey#229
insightsengineering/teal.goshawk#241

ref issues and discussion:
insightsengineering/teal.reporter#226

---------

Signed-off-by: kartikeya kirar <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Marcin <[email protected]>
Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
@kartikeyakirar
Copy link
Contributor Author

I've moved the template function to the teal repository. You can find the corresponding pull request at this link: insightsengineering/teal#933.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants