mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-05 16:03:47 +00:00
fix(datatables): a role picked at creation is the role the app keeps
Leaving it out when it happened to equal the data table's default meant "whatever the default is then", so an app created as `analyst` became a `reader` app the day an admin changed that default. The pick is written down. The hint says what is true of the choice in front of it and no more: what the assistant writes when an app names no data table is a property of the prompt, not of this data table. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5arH3G2Sa1Qqm32veJQ1n
This commit is contained in:
co-authored by
Claude Opus 5
parent
a253ba3d11
commit
7c68818da1
@@ -96,14 +96,11 @@
|
||||
selectedRole !== undefined && loadedRoles.includes(selectedRole) ? selectedRole : undefined
|
||||
)
|
||||
|
||||
// Omitted when it is the data table's own default, which is what the server
|
||||
// resolves anyway. Named otherwise: that default is not filtered by what this
|
||||
// caller may use, so a caller who cannot use it has to say what they can.
|
||||
const roleToSave = $derived(
|
||||
effectiveRole !== undefined && effectiveRole !== roles.current.defaultRole
|
||||
? effectiveRole
|
||||
: undefined
|
||||
)
|
||||
// The role this app is created with, written down rather than left to resolve.
|
||||
// Leaving it out means "whatever the default is then", which silently moves the
|
||||
// app the day an admin changes it — and that default is not filtered by what
|
||||
// this caller may use in the first place.
|
||||
const roleToSave = $derived(effectiveRole)
|
||||
|
||||
const availableDatatables = $derived(datatables.current)
|
||||
// `undefined` while the list loads, so this is false until it has answered.
|
||||
@@ -365,11 +362,8 @@
|
||||
class="w-40"
|
||||
/>
|
||||
{#if noUsableRole}
|
||||
<!-- Turning table creation off is not a way around this: the app
|
||||
then names no data table, and what the assistant writes falls
|
||||
back to the workspace's default — this one. -->
|
||||
<span class="text-xs text-red-600 dark:text-red-400">
|
||||
no role you can use — queries against it will be refused
|
||||
no role you can use
|
||||
</span>
|
||||
{/if}
|
||||
{#if showRolePicker}
|
||||
|
||||
Reference in New Issue
Block a user