Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
baracudda committed Jun 13, 2024
2 parents c3ca21b + bdbce68 commit fe0ec34
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 23 deletions.
6 changes: 6 additions & 0 deletions engage/channels/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ def lookup_field_link(self, context, field, obj):
if field == 'channel_log':
return reverse('channels.channellog_list', args=[obj.uuid])
elif field == 'settings':
if obj.channel_type == "PSM":
if "pm_service" in obj.schemes:
return reverse("pm.postmaster_read", args=[obj.uuid])
elif obj.parent is not None:
return reverse("pm.postmaster_read", args=[obj.parent.uuid])

return reverse("channels.channel_configuration", args=[obj.uuid])
else:
return reverse('channels.channel_read', args=[obj.uuid])
Expand Down
21 changes: 1 addition & 20 deletions engage/hamls/channels/types/postmaster/config.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,4 @@

%h4
-blocktrans
To finish the configuration of Line channel you'll need to set the following callback URL in the Line Bot settings page, following the steps below:

.info

%p

%ol.line-steps
%li
-blocktrans
Configure "Callback URL" in the channel page (the same page which get the information Channel Secret and Channel Access Token) by clicking on the "Edit" button, filling the field "webhook URL" and pressing on the "Save" button.

%li
-blocktrans
Fill the IP addresses in the "Server IP Whitelist" with the list of addresses displayed below.

%h4
-trans "Callback URL"

%code
https://{{ channel.callback_domain }}{% url 'courier.ln' channel.uuid %}
No settings available.
1 change: 1 addition & 0 deletions engage/hamls/flows/flow_editor.haml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
environment: base + 'environment',
activity: '/flow/activity/{{object.uuid}}/',
recipients: '/contact/omnibox?v=2&types=gc',
contact: '/contact/read/',

{% if can_simulate %}
simulateStart: '/flow/simulate/{{object.id}}/',
Expand Down
3 changes: 3 additions & 0 deletions engage/pm/templatetags/pm.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@ def chat_mode_label(obj):

@register.filter
def chat_mode_app(chat_mode_apps, chat_mode):
if chat_mode_apps == "":
return {}

return chat_mode_apps.get(chat_mode, {})
#enddef chat_mode_app
6 changes: 5 additions & 1 deletion engage/pm/view/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@ def get_context_data(self, **kwargs):
context['device_name'] = obj.name
context['device_id'] = obj.address
device_info = Channel.fetch_device_info(user, obj.address)

if device_info is None:
device_info = {}

context['device_info'] = device_info
context['device_meta'] = device_info.get('meta', {})

# app list versions sorted by chat mode
if device_info['meta'] is not None:
if device_info.get('meta') is not None:
if device_info['meta']['extras'] is not None:
chat_mode_apps = {}
inactive_apps = {}
Expand Down
4 changes: 2 additions & 2 deletions engage/static/engage/js/broadcast_send.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
$(document).ready(function() {
let rootSelectorName = "#send-msg";
if ( $(document.querySelector("#send-message") ) !== undefined ) {
if ( document.querySelector("#send-message") ) {
rootSelectorName = "#send-message";
}
else if ( $(document.querySelector("#send-message-modal") ) !== undefined ) {
else if ( document.querySelector("#send-message-modal") ) {
rootSelectorName = "#send-message-modal";
}
else if ( $(document.querySelector("temba-modax")
Expand Down

0 comments on commit fe0ec34

Please sign in to comment.