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

[BWA-108] Don't Show QR Code Scan Link When Camera Is Unauthorized #219

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brant-livefront
Copy link
Collaborator

@brant-livefront brant-livefront commented Dec 27, 2024

๐ŸŽŸ๏ธ Tracking

BWA-108

๐Ÿ“” Objective

This PR adds a check for camera authorization when setting the ManualEntryState.deviceSupportsCamera. Previously, this was true when the device had a camera even if the user had denied access. Now it will be false if there is no camera present or the user has denied access to the camera (either by initially saying No to the dialog asking for authorization, or if they agreed at first but have since turned it off in Settings).

The net-net of this change is that the Manual Entry View will not show the Scan QR code link suggestion at the bottom if the user has denied access to the camera. We already do a check for this when they hit the add code button, and they land silently on the manual entry view if the camera is not present or the access is not authorized. But previously we'd still show a Scan QR code link if the device had a camera (even when it was not authorized) and you could tap that link only to silently return to the Manual Entry View.

We could also take the approach of leaving the link but showing an error dialog when the link is tapped (something along those lines is mentioned in the ticket). I didn't see any designs for that, so I didn't pursue it for now. But it would be easy to pivot to that if we prefer to show a dialog.

๐Ÿ“ธ Screenshots

This screen existed previously (if your device did not have a camera). But it now will look like this if you have a camera but have denied access.

Simulator Screenshot - iPhone 15 Pro - 2024-12-27 at 16 07 36

โฐ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

๐Ÿฆฎ Reviewer guidelines

  • ๐Ÿ‘ (:+1:) or similar for great changes
  • ๐Ÿ“ (:memo:) or โ„น๏ธ (:information_source:) for notes or general info
  • โ“ (:question:) for questions
  • ๐Ÿค” (:thinking:) or ๐Ÿ’ญ (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • ๐ŸŽจ (:art:) for suggestions / improvements
  • โŒ (:x:) or โš ๏ธ (:warning:) for more significant problems or concerns needing attention
  • ๐ŸŒฑ (:seedling:) or โ™ป๏ธ (:recycle:) for future improvements or indications of technical debt
  • โ› (:pick:) for minor or nitpick changes

Copy link
Contributor

Logo
Checkmarx One โ€“ Scan Summary & Details โ€“ 5e353a5f-6908-4a8f-b5f8-ecc3e289c596

No New Or Fixed Issues Found

Copy link

codecov bot commented Dec 27, 2024

Codecov Report

Attention: Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.

Project coverage is 70.09%. Comparing base (caccb6a) to head (b067566).

Files with missing lines Patch % Lines
...rShared/Core/Platform/Services/CameraService.swift 0.00% 5 Missing โš ๏ธ
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #219      +/-   ##
==========================================
- Coverage   70.11%   70.09%   -0.02%     
==========================================
  Files         215      215              
  Lines        9873     9877       +4     
==========================================
+ Hits         6922     6923       +1     
- Misses       2951     2954       +3     

โ˜” View full report in Codecov by Sentry.
๐Ÿ“ข Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant