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

Update Settings: Update PIR Settings Item #5397

Merged
merged 27 commits into from
Dec 19, 2024

Conversation

mikescamell
Copy link
Contributor

@mikescamell mikescamell commented Dec 16, 2024

Task/Issue URL: https://app.asana.com/0/1207908166761516/1208966262488272/f

Description

Adds support for different PIR (Private Information Removal) subscription states in the settings menu, including active, expired, activating, and hidden states. Introduces a new subscription manager to handle PIR status and updates the UI to reflect these states with appropriate icons and interactions.

Steps to test this PR

Prerequisite: Enable newSettings feature toggle

Prerequisite: Apply the patch in the Asana task

Note: Only the VPN item, PIR and possibly the Settings item will be seen, depending on the different states. ITR is not included as part of this PR and so is not visible.

PIR Subscribed

  • In RealSubscriptions change ln 77 to return flowOf(listOf(NetP, PIR))
  • Open New Settings
  • Verify PIR item is visible with colored icon and status is on
  • Click PIR item
  • PIR screen should open

Unsubscribed

  • In SubscriptionManager change ln 442 to return SubscriptionStatus.UNKNOWN
  • Open New Settings
  • Verify VPN item is not visible

PIR Expired

  • In SubscriptionManager change ln 442 to return SubscriptionStatus.EXPIRED
  • Open New Settings
  • Verify PIR item is visible with grey icon and is not clickable, and status is off
  • Click PIR item
  • Nothing should happen

PPro Activating

  • In SubscriptionManager change ln 442 to return SubscriptionStatus.WAITING
  • Open New Settings
  • Verify PIR item is visible with grey icon and status is off
  • Click PIR item
  • Nothing should happen

No Entitlement

  • In SubscriptionManager change ln 442 to return SubscriptionStatus.AUTO_RENEWABLE
  • In RealSubscriptions change ln 77 to return flowOf(listOf())
  • Open New Settings
  • Verify PIR item is not visible

Legacy Support

  • Turn off newSettings
  • Verify old PIR settings works by repeating steps above

UI changes

Before After
old_pir_subscribed_active new_pir_subscribed
old_pir_expired pir_new_expired
old_pir_activating pir_new_activating
old_pir_no_entitlement pir_new_no_entitlement
old_pir_unsubscribed pir_unsubscribed

Copy link
Contributor Author

mikescamell commented Dec 16, 2024

@mikescamell mikescamell force-pushed the feature/mike/update-settings/update-ppro-vpn-item branch from d306ac3 to 2dbfc5b Compare December 17, 2024 09:17
@mikescamell mikescamell force-pushed the feature/mike/update-settings/update-pir-item branch from 9b7fcfa to 1cf3f4e Compare December 17, 2024 09:17
@mikescamell mikescamell force-pushed the feature/mike/update-settings/update-ppro-vpn-item branch from 2dbfc5b to 72f177a Compare December 17, 2024 09:24
@mikescamell mikescamell force-pushed the feature/mike/update-settings/update-pir-item branch from 1cf3f4e to ad94878 Compare December 17, 2024 09:24
@mikescamell mikescamell force-pushed the feature/mike/update-settings/update-ppro-vpn-item branch from 72f177a to 76b9911 Compare December 17, 2024 09:30
@mikescamell mikescamell force-pushed the feature/mike/update-settings/update-pir-item branch from ad94878 to 955be80 Compare December 17, 2024 09:30
@malmstein malmstein self-assigned this Dec 17, 2024
@mikescamell mikescamell marked this pull request as ready for review December 18, 2024 09:10
@mikescamell mikescamell force-pushed the feature/mike/update-settings/update-ppro-vpn-item branch from 76b9911 to 49dea28 Compare December 18, 2024 09:50
@mikescamell mikescamell force-pushed the feature/mike/update-settings/update-pir-item branch from 955be80 to b9ccd81 Compare December 18, 2024 09:50
Copy link
Contributor

@malmstein malmstein left a comment

Choose a reason for hiding this comment

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

Works as expected, nice work @mikescamell !

@mikescamell mikescamell force-pushed the feature/mike/update-settings/update-ppro-vpn-item branch from b9956a7 to 8bde9db Compare December 18, 2024 17:31
@mikescamell mikescamell force-pushed the feature/mike/update-settings/update-pir-item branch from b9ccd81 to 2c2bed6 Compare December 18, 2024 17:31
copy paste of legacy
We'll need more states to represent our new VPN statuses as we'll see in upcoming commits.
The VPN status states have changed for the new settings as we need to know more about the subscription status of the VPN to correctly render the new states, therefore we need to know if we're in a waiting state so we can in future render an "Activating" state

We
Locked and Unlocked are no longer sufficient for us to render the correct states.

We add a new NetPVisibilityState which tells us if we should show the VPN item to the user, and if we do, what it's subscription state is.

I'm not entirely sure about nesting the subscription status, or having this as a property of Visible state, I'm open to suggestions
With all the new information and states we can now render the VPN item correctly and kill off some of the legacy code we copied over
Seeing as we will aim to get rid of the netpAccessState.getLegacyState() function we need to change to use the new netpAccessState.getState() in the RealVpnTileStateProvider

Practically the same, just rejigged the order to make more sense
This is an internal only class used to determine the state for the settings item as we need to know more information about the user's subscription to determine how to show the new VPN item
After talking to Aitor about onboarding we decided even though no one could give me an answer yesterday RE if we still want onboarding checks we should probably add this back in so we're consistent with previous behaviour
@mikescamell mikescamell force-pushed the feature/mike/update-settings/update-ppro-vpn-item branch from 8bde9db to 81c774d Compare December 18, 2024 18:47
@mikescamell mikescamell force-pushed the feature/mike/update-settings/update-ppro-vpn-item branch from 81c774d to da4e853 Compare December 18, 2024 18:50
@mikescamell mikescamell force-pushed the feature/mike/update-settings/update-pir-item branch from 2c2bed6 to 28c7763 Compare December 18, 2024 18:52
Copy link
Contributor

@malmstein malmstein left a comment

Choose a reason for hiding this comment

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

Commenting just in case you missed it @mikescamell

Base automatically changed from feature/mike/update-settings/update-ppro-vpn-item to develop December 19, 2024 16:20
@mikescamell mikescamell merged commit 4b15b55 into develop Dec 19, 2024
7 checks passed
@mikescamell mikescamell deleted the feature/mike/update-settings/update-pir-item branch December 19, 2024 16:23
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.

2 participants