Next release WIP #

This commit is contained in:
Darren Clarke 2025-10-27 21:02:19 +01:00
parent 7d7944fa90
commit 20078ccacc
10 changed files with 219 additions and 94 deletions

View file

@ -47,8 +47,14 @@ class CdrSignalReply
# Check CDR Link allowed channels setting
allowedChannels = ui.Config.get('cdr_link_allowed_channels')
if allowedChannels && allowedChannels.trim()
hasWhitelist = allowedChannels && allowedChannels.trim()
if hasWhitelist
whitelist = (channel.trim() for channel in allowedChannels.split(','))
# Filter articleTypes to only those in the whitelist (keep 'note' for internal notes)
articleTypes = articleTypes.filter (type) ->
type.name is 'note' or type.name in whitelist
# Return early if 'cdr_signal' or 'signal message' not in whitelist
return articleTypes if 'cdr_signal' not in whitelist && 'signal message' not in whitelist

View file

@ -0,0 +1,17 @@
# frozen_string_literal: true
class CdrTicketArticleTypesController < ApplicationController
prepend_before_action -> { authentication_check && authorize! }
def index
types = Ticket::Article::Type.all.map do |type|
{
id: type.id,
name: type.name,
communication: type.communication
}
end
render json: types
end
end

View file

@ -0,0 +1,9 @@
# frozen_string_literal: true
module Controllers
class CdrTicketArticleTypesControllerPolicy < Controllers::ApplicationControllerPolicy
def index?
true
end
end
end