StanfordSpezi / SpeziOnboarding

Spezi Onboarding module to inform a user or retrieve consent for a study participation
https://swiftpackageindex.com/StanfordSpezi/SpeziOnboarding/documentation/
MIT License
11 stars 5 forks source link

Enable async action closure in ConsentView #9

Closed philippzagar closed 1 year ago

philippzagar commented 1 year ago

Async action within OnboardingActionsView

:recycle: Current situation & Problem

The ConsentView takes an action closure that is synchronous in nature. This closure is passed to the OnboardingActionsView which also takes an asynchronous function.

:bulb: Proposed solution

Enable passing an asynchronous function to the ConsentView. This enables the following code block:

ConsentView(
    header: ...,
    asyncMarkdown: ...,
    action: {
        await testFunction()
    }
)

:gear: Release Notes

:heavy_plus_sign: Additional Information

--

Related PRs

SpeziTemplateApplication PR

Testing

--

Reviewer Nudging

Very minor code changes

Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

codecov[bot] commented 1 year ago

Codecov Report

Merging #9 (7c9df16) into main (4ca13f2) will increase coverage by 73.98%. The diff coverage is 50.00%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/StanfordSpezi/SpeziOnboarding/pull/9/graphs/tree.svg?width=650&height=150&src=pr&token=tVwIFVPdJG&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi)](https://app.codecov.io/gh/StanfordSpezi/SpeziOnboarding/pull/9?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) ```diff @@ Coverage Diff @@ ## main #9 +/- ## ========================================== + Coverage 0.00% 73.98% +73.98% ========================================== Files 7 7 Lines 511 511 ========================================== + Hits 0 378 +378 + Misses 511 133 -378 ``` | [Impacted Files](https://app.codecov.io/gh/StanfordSpezi/SpeziOnboarding/pull/9?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) | Coverage Δ | | |---|---|---| | [Sources/SpeziOnboarding/ConsentView.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziOnboarding/pull/9?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aU9uYm9hcmRpbmcvQ29uc2VudFZpZXcuc3dpZnQ=) | `86.93% <50.00%> (+86.93%)` | :arrow_up: | ... and [6 files with indirect coverage changes](https://app.codecov.io/gh/StanfordSpezi/SpeziOnboarding/pull/9/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/StanfordSpezi/SpeziOnboarding/pull/9?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/StanfordSpezi/SpeziOnboarding/pull/9?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Last update [4ca13f2...7c9df16](https://app.codecov.io/gh/StanfordSpezi/SpeziOnboarding/pull/9?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi).
philippzagar commented 1 year ago

@PSchmiedmayer Thanks for the feedback, the branch is now ready to merge, all lints and tests in the pipeline finish successfully. However, some checks are staying on "Wating for status to be reported" (the same also happenes in another repo), even though the actual job (e.g. linting) ran through. Retriggering the CI didn't help. Any hints?

image
PSchmiedmayer commented 1 year ago

@philippzagar Sorry about that; I need to update the CI requirements as we did some changes under the hood. Will do that and merge the PR in a second 👍