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 #27

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:

NikolaiMadlener commented 11 months ago

Thanks for giving me the permissions @PSchmiedmayer, that makes everything a lot faster 😊 I'm also happy with the rebase and signatures now. The only thing is that the commit dates look updated here on GitHub (signature timestamps...), but if you check them with e.g. git log you'll still find the original commit dates. So that should be fine 👍 Big thanks again for the support and very excited to talk about the next steps 🚀

codecov[bot] commented 11 months ago

Codecov Report

Merging #27 (a452c89) into main (5937ed6) will not change coverage. The diff coverage is 0.00%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/27/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/27?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) ```diff @@ Coverage Diff @@ ## main #27 +/- ## ===================================== Coverage 0.00% 0.00% ===================================== Files 114 115 +1 Lines 3959 4014 +55 ===================================== - Misses 3959 4014 +55 ``` | [Files](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/27?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/27?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUFjY291bnQvVmlld3MvQWNjb3VudE92ZXJ2aWV3L1Bhc3N3b3JkQ2hhbmdlU2hlZXQuc3dpZnQ=) | `0.00% <ø> (ø)` | | | [Sources/SpeziAccount/Views/AccountSummaryBox.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/27?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUFjY291bnQvVmlld3MvQWNjb3VudFN1bW1hcnlCb3guc3dpZnQ=) | `0.00% <ø> (ø)` | | | [Sources/SpeziAccount/AccountOverview.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/27?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUFjY291bnQvQWNjb3VudE92ZXJ2aWV3LnN3aWZ0) | `0.00% <0.00%> (ø)` | | | [Sources/SpeziAccount/AccountHeader.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/27?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%> (ø)` | | | [...iews/AccountOverview/AccountOverviewSections.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/27?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUFjY291bnQvVmlld3MvQWNjb3VudE92ZXJ2aWV3L0FjY291bnRPdmVydmlld1NlY3Rpb25zLnN3aWZ0) | `0.00% <0.00%> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/27?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/27?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Last update [5937ed6...a452c89](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/27?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).