fix: Fix error handler token injection (#2598)
* fix: Fix error handler token injection * Add frontend
This commit is contained in:
committed by
GitHub
parent
198e282566
commit
aefa43dcaf
@@ -218,7 +218,8 @@
|
||||
<span class="w-full flex mb-3">
|
||||
<Toggle
|
||||
disabled={!$enterpriseLicense || !isEditable}
|
||||
checked={handlerPath === slackHandlerScriptPath}
|
||||
checked={handlerPath?.startsWith('hub/') &&
|
||||
handlerPath?.endsWith('/workspace-or-schedule-error-handler-slack')}
|
||||
options={{ right: slackToggleText }}
|
||||
on:change={async (e) => {
|
||||
handlerPath = e.detail ? slackHandlerScriptPath : undefined
|
||||
@@ -238,7 +239,7 @@
|
||||
class="text-xs"
|
||||
/>
|
||||
{/if}
|
||||
{#if handlerPath === slackHandlerScriptPath && enterpriseLicense}
|
||||
{#if enterpriseLicense && handlerPath?.startsWith('hub/') && handlerPath?.endsWith('/workspace-or-schedule-error-handler-slack')}
|
||||
{#if !workspaceConnectedToSlack}
|
||||
<Alert type="error" title="Workspace not connected to Slack">
|
||||
<div class="flex flex-row gap-x-1 w-full items-center">
|
||||
|
||||
@@ -92,7 +92,10 @@
|
||||
errorHandlerPath = splitted.slice(1)?.join('/')
|
||||
errorHandlerExtraArgs = defaultErrorHandlerMaybe['errorHandlerExtraArgs']
|
||||
errorHandlerCustomInitialPath = errorHandlerPath
|
||||
if (errorHandlerPath === slackErrorHandler) {
|
||||
if (
|
||||
errorHandlerPath.startsWith('hub/') &&
|
||||
errorHandlerPath.endsWith('/workspace-or-schedule-error-handler-slack')
|
||||
) {
|
||||
errorHandlerSelected = 'slack'
|
||||
} else {
|
||||
errorHandlerSelected = 'custom'
|
||||
@@ -229,7 +232,12 @@
|
||||
failedTimes = s.on_failure_times ?? 1
|
||||
failedExact = s.on_failure_exact ?? false
|
||||
errorHandlerExtraArgs = s.on_failure_extra_args ?? {}
|
||||
if (errorHandlerPath !== slackErrorHandler) {
|
||||
if (
|
||||
errorHandlerPath.startsWith('hub/') &&
|
||||
errorHandlerPath.endsWith('/workspace-or-schedule-error-handler-slack')
|
||||
) {
|
||||
errorHandlerSelected = 'slack'
|
||||
} else {
|
||||
errorHandlerSelected = 'custom'
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -172,7 +172,9 @@
|
||||
errorHandlerSelected = 'custom'
|
||||
} else {
|
||||
errorHandlerSelected =
|
||||
emptyString(errorHandlerScriptPath) || errorHandlerScriptPath === slackErrorHandler
|
||||
emptyString(errorHandlerScriptPath) ||
|
||||
(errorHandlerScriptPath.startsWith('hub/') &&
|
||||
errorHandlerScriptPath.endsWith('/workspace-or-schedule-error-handler-slack'))
|
||||
? 'slack'
|
||||
: 'custom'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user