mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 00:34:44 +02:00
Deselect all table records when switching primary allocation (#645)
This commit is contained in:
parent
bcbacb47cd
commit
de002324d7
@ -57,13 +57,13 @@ class AllocationsRelationManager extends RelationManager
|
|||||||
true => 'warning',
|
true => 'warning',
|
||||||
default => 'gray',
|
default => 'gray',
|
||||||
})
|
})
|
||||||
->action(fn (Allocation $allocation) => $this->getOwnerRecord()->update(['allocation_id' => $allocation->id]))
|
->action(fn (Allocation $allocation) => $this->getOwnerRecord()->update(['allocation_id' => $allocation->id]) && $this->deselectAllTableRecords())
|
||||||
->default(fn (Allocation $allocation) => $allocation->id === $this->getOwnerRecord()->allocation_id)
|
->default(fn (Allocation $allocation) => $allocation->id === $this->getOwnerRecord()->allocation_id)
|
||||||
->label('Primary'),
|
->label('Primary'),
|
||||||
])
|
])
|
||||||
->actions([
|
->actions([
|
||||||
Action::make('make-primary')
|
Action::make('make-primary')
|
||||||
->action(fn (Allocation $allocation) => $this->getOwnerRecord()->update(['allocation_id' => $allocation->id]))
|
->action(fn (Allocation $allocation) => $this->getOwnerRecord()->update(['allocation_id' => $allocation->id]) && $this->deselectAllTableRecords())
|
||||||
->label(fn (Allocation $allocation) => $allocation->id === $this->getOwnerRecord()->allocation_id ? '' : 'Make Primary'),
|
->label(fn (Allocation $allocation) => $allocation->id === $this->getOwnerRecord()->allocation_id ? '' : 'Make Primary'),
|
||||||
])
|
])
|
||||||
->headerActions([
|
->headerActions([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user