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

@ -1,26 +1,32 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"noEmit": false,
"outDir": "./dist",
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"baseUrl": ".",
"paths": {
"@/*": ["./*", "../../node_modules/*"]
},
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"include": ["**.d.ts", "**/*.ts", "**/*.tsx", "**/*.png, **/*.svg"],
"exclude": ["node_modules", "babel__core", "dist"]
}

View file

@ -1,11 +1,15 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"noEmit": false,
"outDir": "./dist",
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
@ -24,5 +28,5 @@
]
},
"include": ["**.d.ts", "**/*.ts", "**/*.tsx", "**/*.png, **/*.svg"],
"exclude": ["node_modules", "babel__core"]
"exclude": ["node_modules", "babel__core", "dist"]
}

View file

@ -6,7 +6,10 @@
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"noEmit": false,
"outDir": "./dist",
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
@ -25,5 +28,5 @@
]
},
"include": ["**.d.ts", "**/*.ts", "**/*.tsx", "**/*.png, **/*.svg"],
"exclude": ["node_modules", "babel__core"]
"exclude": ["node_modules", "babel__core", "dist"]
}

View file

@ -6,7 +6,10 @@
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"noEmit": false,
"outDir": "./dist",
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
@ -25,5 +28,5 @@
]
},
"include": ["**.d.ts", "**/*.ts", "**/*.tsx", "**/*.png, **/*.svg"],
"exclude": ["node_modules", "babel__core"]
"exclude": ["node_modules", "babel__core", "dist"]
}

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