-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support updating existing channels for Facebook and Instagram, remove… #5692
base: main
Are you sure you want to change the base?
Conversation
0b795f3
to
6538fa3
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5692 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 573 573
Lines 25798 25735 -63
=========================================
- Hits 25798 25735 -63 ☔ View full report in Codecov by Sentry. |
@@ -94,6 +94,7 @@ class Category(Enum): | |||
beta_only = False | |||
|
|||
unique_addresses = False | |||
matching_addresses_updates = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To allow update the existing channel with matching address
), | ||
] | ||
menu_items = [ | ||
dict(label=_("Reconnect Facebook Page"), view_name="channels.types.facebookapp.claim", obj_view=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This keep the link to reconnect on the channel page menu instead of trying to use add new channel that could be confusing to users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added obj_view
as we are linking to a view that will not take the obj uuid as parameter
error_connect = False | ||
if resp.status_code != 200: | ||
error_connect = True | ||
existing_channel = Channel.objects.filter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We first check for an existing channel and update it.
If none found we create a new one
So this changes claiming a channel so that it can update an existing channel if the address is the same? I'm not sure that's the most intuitive workflow. I was thinking that we could 1) show that a channel is broken 2) allow reconnecting it. And generally allow updating credentials on existing channels instead of treating them like immutable objects. Isn't that possible in the FB/IG case? |
On the Facebook app we need to add URLs that are allowed to receive the token from the Facebook login wizard, we can only use the claim URL for now, so that is why I use the approach to use the same view. |
Instead of the refresh token view we had that used to check the channel credentials is valid, We can have CheckValid view that will do the same but to reconnect the user will need to use the same claim view as adding a new channel I do not think we want to always use the token on the read page to check the token is valid, |
We already have |
|
ace1e1a
to
b1d5402
Compare
… old refresh token views
b1d5402
to
e3d5174
Compare
@@ -0,0 +1,18 @@ | |||
{% extends "smartmin/read.html" %} | |||
{% load smartmin temba humanize channels i18n tz %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e3d5174
to
7ae8ba7
Compare
{% blocktrans trimmed with name=branding.name %} | ||
You can connect your Facebook page to {{ name }} in just a few simple steps. | ||
{% endblocktrans %} | ||
{% if update_existing %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarification when the user gets to the page from reconnecting an existing channel
0c0dfde
to
e37fbd3
Compare
… old refresh token views