+ {serviceAccount.pending
+ ? 'New service account, created when you deploy.'
+ : 'Service account.'}
+ {serviceAccountReads.length
+ ? `Reads ${serviceAccountReads.join(', ')}.`
+ : 'No folder is shared with it.'}
+
+ {/if}
{#if composesApp}
Apps you build run on behalf of you once you deploy them.
@@ -208,3 +245,16 @@
{@render picker()}
{/if}
+
+
+{#if showReads}
+
+
+
+{/if}
diff --git a/frontend/src/lib/components/raw_apps/RawAppEditor.svelte b/frontend/src/lib/components/raw_apps/RawAppEditor.svelte
index 95ae18f9f4..dd7bcb0c00 100644
--- a/frontend/src/lib/components/raw_apps/RawAppEditor.svelte
+++ b/frontend/src/lib/components/raw_apps/RawAppEditor.svelte
@@ -100,6 +100,7 @@
import { useOperatingWorkspace } from '$lib/components/operatingWorkspace.svelte'
import { useRoleCapabilities } from '$lib/operatorWriteRights'
import { conformBuilderAppPolicy } from './builderAppPolicy'
+ import { dropStalePending } from '../access/serviceAccounts.svelte'
const operatingWorkspace = useOperatingWorkspace()
const roleCaps = useRoleCapabilities()
@@ -280,6 +281,10 @@
// Everything under the editor acts on it too (see operatingWorkspace.svelte.ts).
setOperatingWorkspace(() => opWorkspace)
const operatingUser = useActingUser(() => opWorkspace)
+ dropStalePending(
+ untrack(() => opWorkspace),
+ untrack(() => policy)
+ )
let previewOnBehalfOf = $derived(appPreviewOnBehalfOf(operatingUser.current, policy))
// The path autosaves land on, which is what the session preview loads the app by.
diff --git a/frontend/src/lib/components/raw_apps/RawAppEditorHeader.svelte b/frontend/src/lib/components/raw_apps/RawAppEditorHeader.svelte
index 73e9bd1187..19cd4d1702 100644
--- a/frontend/src/lib/components/raw_apps/RawAppEditorHeader.svelte
+++ b/frontend/src/lib/components/raw_apps/RawAppEditorHeader.svelte
@@ -70,6 +70,8 @@
import DeployButton from '$lib/components/DeployButton.svelte'
import type { Runnable } from './RawAppInlineScriptRunnable.svelte'
import { updateRawAppPolicy } from './rawAppPolicy'
+ import { createPolicyServiceAccount } from '../access/serviceAccounts.svelte'
+ import type { NeedsSource } from '../access/detectNeeds'
import { withoutSharedPolicySettings } from '../apps/editor/appDraftSettings'
import { saveRawAppFork } from './forkRawApp.svelte'
import { aiChatManager } from '../copilot/chat/AIChatManager.svelte'
@@ -413,6 +415,8 @@
return updateRawAppPolicy(runnables, policy)
}
+ const needsSource = (): NeedsSource => ({ kind: 'app', value: runnables })
+
/** Resolves to whether the app was created. */
async function createApp(path: string): Promise
{
if (!app) {
@@ -422,6 +426,7 @@
if (!policy.execution_mode) {
policy.execution_mode = 'publisher'
}
+ if (!(await createPolicyServiceAccount(opWorkspace!, policy))) return false
// Read for the path being created: the first-deploy dialog may have just chosen it.
setDeployedOnBehalfOf(policy, actingUser, await folderDefault.refetch())
try {
@@ -483,6 +488,7 @@
}
async function handleUpdateApp(npath: string) {
+ if (!(await createPolicyServiceAccount(opWorkspace!, policy))) return
// We have to make sure there is no updates when we clicked the button
await compareVersions()
@@ -760,7 +766,8 @@
runAs: {
email: policy.on_behalf_of_email,
permissionedAs: policy.on_behalf_of,
- targetWorkspace: opWorkspace ?? ''
+ targetWorkspace: opWorkspace ?? '',
+ needsSource
}
})
if (!choice) return
@@ -1006,6 +1013,8 @@
executionMode={policy.execution_mode}
targetWorkspace={opWorkspace ?? ''}
rawApp
+ itemPath={newEditedPath || appPath}
+ {needsSource}
onConfirmed={deployNow}
/>
@@ -1036,6 +1045,7 @@
bind:labels
bind:customPath
onAppChanged={applyAppAccess}
+ {needsSource}
/>
{#if offersSharing}
diff --git a/frontend/src/lib/components/select/SelectDropdown.svelte b/frontend/src/lib/components/select/SelectDropdown.svelte
index 8dd952e5bf..1e76ffb167 100644
--- a/frontend/src/lib/components/select/SelectDropdown.svelte
+++ b/frontend/src/lib/components/select/SelectDropdown.svelte
@@ -119,10 +119,11 @@
>
{#each processedItems ?? [] as item, itemIndex}
{#if (item.__select_group && itemIndex === 0) || processedItems?.[itemIndex - 1]?.__select_group !== item.__select_group}
+
{item.__select_group}