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

Task/initial app permissions #150

Merged
merged 4 commits into from
Dec 9, 2024
Merged

Conversation

eldcn
Copy link
Contributor

@eldcn eldcn commented Dec 8, 2024

Initial app permissions

♻️ Current situation & Problem

  • We already have an issue to improve bluetooth/home viewmodel as it is growing and we should extract some logic into smaller components. As part of this PR I just did the renaming from BluetoothViewModel to HomeViewModel
  • We are now requesting also notification permissions in home right after login
  • Since bluetooth permissions are also needed to display the devices header in home, those are also kept and requested right after notification permission.
  • Requested permissions are cleared after their result is received, so that the next permission can be requested
  • Introduced BuildInfo and NotificationPermissions component and unit tested.
  • Adapted PermissionChecker component to return also granted status

⚙️ Release Notes

Add a bullet point list summary of the feature and possible migration guides if this is a breaking change so this section can be added to the release notes.
Include code snippets that provide examples of the feature implemented or links to the documentation if it appends or changes the public interface.

📚 Documentation

Please ensure that you properly document any additions in conformance to Spezi Documentation Guide.
You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.

✅ Testing

Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested.
This section describes important information about the tests and why some elements might not be testable.

📝 Code of Conduct & Contributing Guidelines

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

Copy link

codecov bot commented Dec 8, 2024

Codecov Report

Attention: Patch coverage is 55.78947% with 42 lines in your changes missing coverage. Please review.

Project coverage is 40.31%. Comparing base (e4fba86) to head (b9afe7f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../notification/setting/NotificationSettingScreen.kt 0.00% 21 Missing ⚠️
...anford/bdh/engagehf/bluetooth/screen/HomeScreen.kt 0.00% 15 Missing ⚠️
...spezi/core/design/component/PermissionRequester.kt 0.00% 2 Missing ⚠️
...u/stanford/bdh/engagehf/bluetooth/HomeViewModel.kt 97.06% 0 Missing and 1 partial ⚠️
...nford/bdh/engagehf/navigation/screens/AppScreen.kt 0.00% 1 Missing ⚠️
...d/spezi/core/notification/di/NotificationModule.kt 0.00% 1 Missing ⚠️
...tification/setting/NotificationSettingViewModel.kt 88.89% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #150      +/-   ##
============================================
+ Coverage     40.07%   40.31%   +0.25%     
- Complexity      842      847       +5     
============================================
  Files           297      300       +3     
  Lines         11453    11459       +6     
  Branches       1720     1720              
============================================
+ Hits           4589     4619      +30     
+ Misses         6395     6369      -26     
- Partials        469      471       +2     
Flag Coverage Δ
uitests 36.07% <0.00%> (-0.02%) ⬇️
unittests 31.70% <55.79%> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...n/kotlin/edu/stanford/bdh/engagehf/MainActivity.kt 0.00% <ø> (ø)
...hf/bluetooth/data/mapper/BluetoothUiStateMapper.kt 90.08% <ø> (-3.10%) ⬇️
...nford/bdh/engagehf/bluetooth/data/models/Action.kt 80.00% <100.00%> (ø)
...engagehf/bluetooth/data/models/BluetoothUiState.kt 100.00% <ø> (ø)
...ford/bdh/engagehf/bluetooth/data/models/UiState.kt 100.00% <100.00%> (ø)
...spezi/core/notification/NotificationPermissions.kt 100.00% <100.00%> (ø)
.../kotlin/edu/stanford/spezi/core/utils/BuildInfo.kt 100.00% <100.00%> (ø)
...in/edu/stanford/spezi/core/utils/di/UtilsModule.kt 0.00% <ø> (ø)
...u/stanford/bdh/engagehf/bluetooth/HomeViewModel.kt 77.38% <97.06%> (ø)
...nford/bdh/engagehf/navigation/screens/AppScreen.kt 0.00% <0.00%> (ø)
... and 5 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4fba86...b9afe7f. Read the comment docs.

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

Thank you for the quick fix and improving the naming of the Home Screen related elements to be more descriptive @eldcn!

@PSchmiedmayer PSchmiedmayer added bug An unexpected problem enhancement New feature or request ENGAGE HF ENGAGE-HF-specific issues labels Dec 9, 2024
@PSchmiedmayer PSchmiedmayer enabled auto-merge (squash) December 9, 2024 00:46
@PSchmiedmayer PSchmiedmayer merged commit 0c864f3 into main Dec 9, 2024
11 checks passed
@PSchmiedmayer PSchmiedmayer deleted the task/initial-app-permissions branch December 9, 2024 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem ENGAGE HF ENGAGE-HF-specific issues enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants