Refactor tags functionality and improve user experience

This commit is contained in:
Andras Bacsai 2024-02-03 12:44:18 +01:00
parent 0b5baf60a5
commit 1d3b7ffd3b
2 changed files with 2 additions and 1 deletions

View File

@ -54,6 +54,7 @@ class Tags extends Component
public function refresh() public function refresh()
{ {
$this->resource->load(['tags']); $this->resource->load(['tags']);
$this->tags = Tag::ownedByCurrentTeam()->get();
$this->new_tag = null; $this->new_tag = null;
} }
public function submit() public function submit()

View File

@ -24,7 +24,7 @@
</form> </form>
@if ($tags->count() > 0) @if ($tags->count() > 0)
<h3 class="pt-4">Already defined tags</h3> <h3 class="pt-4">Already defined tags</h3>
<div>Click to quickly add</div> <div>Click to quickly add one.</div>
<div class="flex gap-2 pt-4"> <div class="flex gap-2 pt-4">
@foreach ($tags as $tag) @foreach ($tags as $tag)
<x-forms.button wire:click="addTag('{{ $tag->id }}','{{ $tag->name }}')"> <x-forms.button wire:click="addTag('{{ $tag->id }}','{{ $tag->name }}')">