fix: make system-wide warning reactive in Create view
The system-wide warning callout was not appearing when the checkbox was toggled because it was only evaluated on initial render. Changes: - Wrapped checkbox and warning in Alpine.js x-data scope - Used @entangle to bind showWarning to the is_system_wide Livewire property - Added x-show directive to reactively show/hide warning based on checkbox state - Added x-transition for smooth appearance/disappearance - Added style="display: none;" to prevent flash of content on load Now the warning appears immediately when the System Wide checkbox is checked and disappears when unchecked. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
e13a921403
commit
6746e44dba
1 changed files with 10 additions and 8 deletions
|
|
@ -9,15 +9,17 @@
|
|||
placeholder="If empty, your GitHub user will be used." id="organization" label="Organization (on GitHub)" />
|
||||
</div>
|
||||
@if (!isCloud())
|
||||
<div class="w-48">
|
||||
<x-forms.checkbox id="is_system_wide" label="System Wide"
|
||||
helper="If checked, this GitHub App will be available for everyone in this Coolify instance." />
|
||||
<div x-data="{ showWarning: @entangle('is_system_wide') }">
|
||||
<div class="w-48">
|
||||
<x-forms.checkbox id="is_system_wide" label="System Wide"
|
||||
helper="If checked, this GitHub App will be available for everyone in this Coolify instance." />
|
||||
</div>
|
||||
<div x-show="showWarning" x-transition style="display: none;">
|
||||
<x-callout type="warning" title="Not Recommended">
|
||||
System-wide GitHub Apps are shared across all teams on this Coolify instance. This means any team can use this GitHub App to deploy applications from your repositories. For better security and isolation, it's recommended to create team-specific GitHub Apps instead.
|
||||
</x-callout>
|
||||
</div>
|
||||
</div>
|
||||
@if ($is_system_wide)
|
||||
<x-callout type="warning" title="Not Recommended">
|
||||
System-wide GitHub Apps are shared across all teams on this Coolify instance. This means any team can use this GitHub App to deploy applications from your repositories. For better security and isolation, it's recommended to create team-specific GitHub Apps instead.
|
||||
</x-callout>
|
||||
@endif
|
||||
@endif
|
||||
<div x-data="{
|
||||
activeAccordion: '',
|
||||
|
|
|
|||
Loading…
Reference in a new issue