fix: sync flow on_behalf_of_email on load (#8149)
This commit is contained in:
@@ -137,6 +137,13 @@
|
||||
let preserveOnBehalfOf = writable(false)
|
||||
let savedOnBehalfOfEmail = writable<string | undefined>(savedFlow?.on_behalf_of_email)
|
||||
|
||||
// Keep savedOnBehalfOfEmail in sync when savedFlow is loaded asynchronously
|
||||
$effect(() => {
|
||||
if (savedFlow?.on_behalf_of_email !== undefined) {
|
||||
savedOnBehalfOfEmail.set(savedFlow.on_behalf_of_email)
|
||||
}
|
||||
})
|
||||
|
||||
// used for new flows for captures
|
||||
let fakeInitialPath =
|
||||
'u/' +
|
||||
|
||||
@@ -1650,6 +1650,11 @@
|
||||
customEmail={customOnBehalfOfEmail}
|
||||
isDeployment={false}
|
||||
/>
|
||||
{:else if script.on_behalf_of_email && !canPreserve}
|
||||
<span class="text-xs text-tertiary">
|
||||
Currently: <span class="font-medium">{originalOnBehalfOfEmail ?? script.on_behalf_of_email}</span>.
|
||||
Will be set to <span class="font-medium">{$userStore?.email}</span> on deploy (requires admin or wm_deployers group to override)
|
||||
</span>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
{ name: 'Early Return', active: Boolean(flowStore.val.value.early_return) },
|
||||
{ name: 'Dedicated Worker', active: Boolean(flowStore.val.dedicated_worker) },
|
||||
{ name: 'Concurrent Limit', active: Boolean(flowStore.val.value.concurrent_limit) },
|
||||
{ name: 'Run on Behalf of Last Editor', active: Boolean(flowStore.val.on_behalf_of_email) },
|
||||
{ name: `Run on Behalf of ${flowStore.val.on_behalf_of_email ?? 'Last Editor'}`, active: Boolean(flowStore.val.on_behalf_of_email) },
|
||||
{ name: 'Worker Tag', active: displayWorkerTagPicker }
|
||||
])
|
||||
|
||||
@@ -428,6 +428,11 @@
|
||||
customEmail={customOnBehalfOfEmail}
|
||||
isDeployment={false}
|
||||
/>
|
||||
{:else if flowStore.val.on_behalf_of_email && !canPreserve}
|
||||
<span class="text-xs text-tertiary">
|
||||
Currently: <span class="font-medium">{$savedOnBehalfOfEmail ?? flowStore.val.on_behalf_of_email}</span>.
|
||||
Will be set to <span class="font-medium">{$userStore?.email}</span> on deploy (requires admin or wm_deployers group to override)
|
||||
</span>
|
||||
{/if}
|
||||
</span>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user