Signal only WIP

This commit is contained in:
Darren Clarke 2025-10-15 17:09:56 +02:00
parent d9130fbaa2
commit 6288df7cf6
11 changed files with 676 additions and 1596 deletions

View file

@ -45,6 +45,13 @@ class CdrSignalReply
@articleTypes: (articleTypes, ticket, ui) ->
return articleTypes if !ui.permissionCheck('ticket.agent')
# Check CDR Link allowed channels setting
allowedChannels = ui.Config.get('cdr_link_allowed_channels')
if allowedChannels && allowedChannels.trim()
whitelist = (channel.trim() for channel in allowedChannels.split(','))
# Return early if 'cdr_signal' or 'signal message' not in whitelist
return articleTypes if 'cdr_signal' not in whitelist && 'signal message' not in whitelist
return articleTypes if !ticket || !ticket.create_article_type_id
articleTypeCreate = App.TicketArticleType.find(ticket.create_article_type_id).name

View file

@ -45,6 +45,13 @@ class CdrWhatsappReply
@articleTypes: (articleTypes, ticket, ui) ->
return articleTypes if !ui.permissionCheck('ticket.agent')
# Check CDR Link allowed channels setting
allowedChannels = ui.Config.get('cdr_link_allowed_channels')
if allowedChannels && allowedChannels.trim()
whitelist = (channel.trim() for channel in allowedChannels.split(','))
# Return early if 'cdr_whatsapp' or 'whatsapp message' not in whitelist
return articleTypes if 'cdr_whatsapp' not in whitelist && 'whatsapp message' not in whitelist
return articleTypes if !ticket || !ticket.create_article_type_id
articleTypeCreate = App.TicketArticleType.find(ticket.create_article_type_id).name

View file

@ -0,0 +1,12 @@
class EnableDesktopBetaSwitch < ActiveRecord::Migration[6.1]
def change
# Enable the desktop beta switch to allow users to toggle between old and new UI
Setting.set('ui_desktop_beta_switch', true)
# Also ensure the beta UI switch permission exists and is active
permission = Permission.find_by(name: 'user_preferences.beta_ui_switch')
if permission
permission.update(active: true)
end
end
end