fix(16.3): disable Create token until a scope is selected
Client-side canSubmit now matches the 422 rule so Submit stays disabled with an empty scope set (WR-02). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -61,7 +61,9 @@ const plaintextInput = ref<HTMLInputElement | null>(null)
|
||||
const copyButton = ref<HTMLElement | null>(null)
|
||||
|
||||
const starChecked = computed(() => checked.value.has('*'))
|
||||
const canSubmit = computed(() => !scopesLoading.value && !scopesFailed.value && scopes.value.length > 0 && !busy.value)
|
||||
const canSubmit = computed(
|
||||
() => !scopesLoading.value && !scopesFailed.value && scopes.value.length > 0 && checked.value.size > 0 && !busy.value,
|
||||
)
|
||||
|
||||
function pad(value: number): string {
|
||||
return String(value).padStart(2, '0')
|
||||
|
||||
@@ -213,6 +213,8 @@ describe('ApiTokenCreateDialog step 1', () => {
|
||||
pending.release(envelope(scopes))
|
||||
await flushPromises()
|
||||
expect(dialog()!.querySelector('[data-scope="admin:read"]')).toBeTruthy()
|
||||
// No scope selected yet — submit stays disabled (WR-02).
|
||||
expect(dialog()!.querySelector<HTMLButtonElement>('[data-action="create-token-submit"]')!.disabled).toBe(true)
|
||||
})
|
||||
|
||||
it('shows scopes failure alert when the scopes request fails', async () => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
modules/boardwalk/dist/index.html
vendored
2
modules/boardwalk/dist/index.html
vendored
@@ -7,7 +7,7 @@
|
||||
<meta name="summer-admin-base" content="__SUMMER_ADMIN_BASE__" />
|
||||
<link rel="icon" href="./favicon.ico" sizes="48x48" />
|
||||
<title>SummerCMS</title>
|
||||
<script type="module" crossorigin src="./assets/index-wuKo5sc0.js"></script>
|
||||
<script type="module" crossorigin src="./assets/index-BEInRo7D.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-d9w3cFkl.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user