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

Always display identity server policies #4184

Merged
merged 18 commits into from
Oct 7, 2021
Merged

Conversation

ouchadam
Copy link
Contributor

@ouchadam ouchadam commented Oct 7, 2021

#4174 Always show identity server policies

  • Adds an expandable "Identity server policies" section in the Settings -> Discovery screen to view all terms/policies of the current identity server
  • Tapping a policy opens the policy url in an inapp chrome tab
  • Adds a "POLICY" link to the consent dialog, tapping takes the user to the discovery screen with the policies expanded
  • Updates the SettingsActivity navigation to allow sub screen payloads (eg expanding policies)
COLLAPSED EXPANDED POLICY DEEPLINK
device-2021-10-07-102025 device-2021-10-07-102032 after-policy-link

is DiscoverySettingsAction.FinalizeBind3pid -> finalizeBind3pid(action, true)
is DiscoverySettingsAction.SubmitMsisdnToken -> submitMsisdnToken(action)
is DiscoverySettingsAction.CancelBinding -> cancelBinding(action)
DiscoverySettingsAction.Refresh -> fetchContent()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

might be worth revisiting this formatting rule as it causes noisy diffs 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we had a debate about it... And noisy diff is THE inconvenient to keep aligned arrows. But with that we think the code is more readable...

@bmarty bmarty added this to the Sprint - Element 1.3.2 milestone Oct 7, 2021
@github-actions
Copy link

github-actions bot commented Oct 7, 2021

Unit Test Results

  42 files  ±0    42 suites  ±0   51s ⏱️ -1s
  83 tests ±0    83 ✔️ ±0  0 💤 ±0  0 ±0 
220 runs  ±0  220 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 5365e87. ± Comparison against base commit b71e2de.

♻️ This comment has been updated with latest results.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks for this PR.
Some (quite minor) remarks.
I do not always have strong opinion for all of them.
Also I'm wondering if we shouldn't make the same work for homeserver policies, but lets do it later.

@@ -21,10 +21,18 @@ import com.airbnb.mvrx.MvRxState
import com.airbnb.mvrx.Uninitialized

data class DiscoverySettingsState(
val identityServer: Async<String?> = Uninitialized,
val identityServer: Async<IdentityServerWithTerms?> = Uninitialized,
Copy link
Member

Choose a reason for hiding this comment

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

This is strange to me, maybe the Async should be removed here...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

something to chat about tomorrow, I'm not familiar enough with the design to know why this async is unexpected

Copy link
Member

Choose a reason for hiding this comment

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

More info can be found here: https://airbnb.io/mavericks/#/async

) : MvRxState

data class IdentityServerWithTerms(
val serverUrl: String,
Copy link
Member

Choose a reason for hiding this comment

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

... and added here ...


data class IdentityServerWithTerms(
val serverUrl: String,
val policies: List<IdentityServerPolicy>
Copy link
Member

Choose a reason for hiding this comment

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

... and here

vector/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
vector/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
vector/src/main/res/layout/item_discovery_policy.xml Outdated Show resolved Hide resolved

<!-- Do not use drawableEnd on the TextView because of RTL support -->
<ImageView
android:id="@+id/term_policy_arrow"
Copy link
Member

Choose a reason for hiding this comment

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

Minor: please rename this ID

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

You mean cb72609 :)

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks for the update, tested OK 👍

@bmarty bmarty merged commit d6af355 into develop Oct 7, 2021
@bmarty bmarty deleted the feature/adm/is-policy branch October 7, 2021 18:53
bmarty added a commit that referenced this pull request Oct 7, 2021
@bmarty
Copy link
Member

bmarty commented Oct 7, 2021

(I've added a commit on develop with the changelog: b411938)

@ouchadam
Copy link
Contributor Author

ouchadam commented Oct 8, 2021

@bmarty thanks! still not used to added them 🤦

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