StanfordSpezi / SpeziAccount

The Spezi Account module to enable login and signup functionality
https://swiftpackageindex.com/StanfordSpezi/SpeziAccount/documentation/
MIT License
5 stars 5 forks source link

Add Customizable Area to AccountOverview #26

Closed NikolaiMadlener closed 11 months ago

NikolaiMadlener commented 11 months ago

Add Customizable Area to AccountOverview

:recycle: Current situation & Problem

Like described in issue #25, some applications like the Spezi Template application could display some additional information such as licensing information or other settings at the bottom of the Account Overview. Furthermore, some developers might want to do it the other way around and link to account information within a settings page.

:bulb: Proposed Solution

Add footer components to AccountOverview, as suggested by @PSchmiedmayer Implement an additional "AccountHeader" that looks something like the one in the Apple Settings app, as suggested by @Supereg

:gear: Release Notes

This PR adds two major things.

  1. A customizable content section ViewBuilder to the AccountOverview. Simply pass any view as a trailing closure of AccountOverview and it will be rendered as a Section right between the other AccountOverview information and the log out button. Here is an example:

    AccountOverview() {
    NavigationLink {
        // ...
    } label: {
        Text("General Settings")
    }
    NavigationLink {
        // ...
    } label: {
        Text("License Information")
    }
    }
    Screenshot 2023-09-27 at 17 30 04
  2. A AccountHeader, similar to the one of the iOS Settings App, that could be used as a button that brings a user to the AccountOverview. Here is an example:

    Section {
    NavigationLink {
        AccountOverview()
    } label: {
        AccountHeader(details: details)
    }
    }
    Screenshot 2023-09-27 at 17 29 33

:books: Documentation

in progress

:white_check_mark: Testing

UI tests for the customizable content section have been written.

:pencil: 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 11 months ago

Codecov Report

Merging #26 (00a4972) into main (5937ed6) will increase coverage by 75.17%. The diff coverage is 42.70%.

:exclamation: Current head 00a4972 differs from pull request most recent head 0379c04. Consider uploading reports for the commit 0379c04 to get more accurate results

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/26/graphs/tree.svg?width=650&height=150&src=pr&token=AudNwGU7tR&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi)](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/26?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) ```diff @@ Coverage Diff @@ ## main #26 +/- ## ========================================== + Coverage 0.00% 75.17% +75.17% ========================================== Files 114 115 +1 Lines 3959 4014 +55 ========================================== + Hits 0 3017 +3017 + Misses 3959 997 -2962 ``` | [Files](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/26?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) | Coverage Δ | | |---|---|---| | [...nt/Views/AccountOverview/PasswordChangeSheet.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/26?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUFjY291bnQvVmlld3MvQWNjb3VudE92ZXJ2aWV3L1Bhc3N3b3JkQ2hhbmdlU2hlZXQuc3dpZnQ=) | `88.35% <ø> (+88.35%)` | :arrow_up: | | [Sources/SpeziAccount/Views/AccountSummaryBox.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/26?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUFjY291bnQvVmlld3MvQWNjb3VudFN1bW1hcnlCb3guc3dpZnQ=) | `73.34% <ø> (+73.34%)` | :arrow_up: | | [Sources/SpeziAccount/AccountOverview.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/26?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUFjY291bnQvQWNjb3VudE92ZXJ2aWV3LnN3aWZ0) | `56.37% <25.00%> (+56.37%)` | :arrow_up: | | [...iews/AccountOverview/AccountOverviewSections.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/26?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUFjY291bnQvVmlld3MvQWNjb3VudE92ZXJ2aWV3L0FjY291bnRPdmVydmlld1NlY3Rpb25zLnN3aWZ0) | `88.32% <68.75%> (+88.32%)` | :arrow_up: | | [Sources/SpeziAccount/AccountHeader.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/26?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUFjY291bnQvQWNjb3VudEhlYWRlci5zd2lmdA==) | `0.00% <0.00%> (ø)` | | ... and [101 files with indirect coverage changes](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/26/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/SpeziAccount/pull/26?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/SpeziAccount/pull/26?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Last update [5937ed6...0379c04](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/26?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).
NikolaiMadlener commented 11 months ago

Again, thanks for your feedback @PSchmiedmayer! Will incorporate the suggestions as soon as possible :)

PSchmiedmayer commented 11 months ago

Sounds great, thank you @NikolaiMadlener 👍

NikolaiMadlener commented 11 months ago

@Supereg could you run the workflow for me ☺️🙏

NikolaiMadlener commented 11 months ago

The two tests seem to be failing due to some github runner issues, I suspect? Maybe you've had such a problem before and know a fix? @PSchmiedmayer @Supereg

NikolaiMadlener commented 11 months ago

Seems like I closed this PR by accident 🙈 In order to merge the PR, I tried to sign the commits retrospectively by rebasing. Tried to use --committer-date-is-author-date in the rebase but to my suprise the commit timestamps also got updated :/ Sorry for the circumstances @PSchmiedmayer, was the first time I tried signing a bunch of commits afterwards. Thinking about how to resolve this now.

PSchmiedmayer commented 11 months ago

@NikolaiMadlener No worries. I think the best would be to delete the branch, recreate it from main, and then push your changes onto it and create a new PR.

I also gave you the permission to write to this repo so you can directly create it in this repo and we don't have to approve the CI runs 👍

Once you have the new PR in place I can approve it and we can merge it once all builds are passing. Thank you for the great contribution and free free to reach out about the next steps once we have the feature merged in the Template App 🚀