fix(messaging): disable editing of source code for js functions (#39230)

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Meikel Ratz
2025-10-08 11:24:54 +02:00
committed by GitHub
parent 179d469ffe
commit 2473c0c1d1
3 changed files with 9 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 111 KiB

View File

@@ -1141,10 +1141,15 @@ export const hogFunctionConfigurationLogic = kea<hogFunctionConfigurationLogicTy
canEditSource: [
(s) => [s.type, s.template, s.hogFunction],
(type, template, hogFunction) => {
return (
['site_destination', 'site_app', 'source_webhook', 'transformation'].includes(type) ||
(type === 'destination' &&
(template?.code_language || hogFunction?.template?.code_language) === 'hog')
const codeLanguage = template?.code_language || hogFunction?.template?.code_language
// Only allow editing if code language is 'hog'
if (codeLanguage && codeLanguage !== 'hog') {
return false
}
return ['site_destination', 'site_app', 'source_webhook', 'transformation', 'destination'].includes(
type
)
},
],