mirror of
https://github.com/BillyOutlast/posthog.git
synced 2026-02-04 03:01:23 +01:00
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:
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 |
@@ -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
|
||||
)
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user