fix(ui): pass values to Alpine correctly in component attributes

Blade does not compile @js() inside component tag attributes, so Alpine
got the literal text and threw an expression error.

- The environment variable editor closes again after an update
- The change email button in the profile gets a valid disabled state
This commit is contained in:
Andras Bacsai
2026-10-06 06:59:22 +02:00
parent e1f9e6fb39
commit 88ba00db2b
2 changed files with 2 additions and 2 deletions
@@ -134,7 +134,7 @@
<div class="flex items-end gap-2">
<x-forms.input id="email" label="Email" readonly />
<x-forms.button @click="openEmailModal()" type="button"
:disabled="$uses_sso" x-bind:disabled="emailModalOpen || @js($uses_sso)">
:disabled="$uses_sso" x-bind:disabled="emailModalOpen || {{ $uses_sso ? 'true' : 'false' }}">
Change
</x-forms.button>
</div>
@@ -90,7 +90,7 @@
{{-- Open modal immediately (Alpine); decrypt value in a follow-up Livewire request. --}}
<x-modal-input title="Edit environment variable" :closeOutside="false" :wireIgnore="false"
wireOpen="editorOpen"
@environment-variable-updated.window="if ($event.detail.envId === @js($env->id)) modalOpen = false">
@environment-variable-updated.window="if ($event.detail.envId === {{ (int) $env->id }}) modalOpen = false">
<x-slot:content>
<button type="button" wire:click="loadValues" data-env-settings-trigger class="icon-button shrink-0"
title="Edit environment variable" aria-label="Edit environment variable">