Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Livewire to v3 #14831

Merged
merged 41 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7d1acd3
Update Livewire via composer
marcusmoore May 29, 2024
4ae74fb
Remove alpinejs from package.json
marcusmoore May 29, 2024
b52380f
Migrate to new namespace
marcusmoore May 29, 2024
58e638d
Migrate to wire:model.live
marcusmoore May 29, 2024
29d8724
Migrate away from wire:model.defer
marcusmoore May 29, 2024
d8a480b
Migrate to wire:model.blur
marcusmoore May 29, 2024
4541958
Migrate away from wire:model.prevent
marcusmoore May 29, 2024
8ff6399
Migrate away from dispatchBrowserEvent()
marcusmoore May 29, 2024
73e3ac7
Migrate to $dispatch
marcusmoore May 29, 2024
9dc4f2c
Migrate config
marcusmoore May 29, 2024
43616d1
Remove alpine reference from webpack
marcusmoore May 29, 2024
17f0ac1
Set view correctly
marcusmoore May 29, 2024
093c665
Update select2 snippet for Livewire 3
marcusmoore May 29, 2024
638ae9b
Use new id method
marcusmoore May 29, 2024
34595c2
Update script tag
marcusmoore May 29, 2024
8d924b6
Replace references to @this in importer
marcusmoore May 29, 2024
ee75b30
Enable legacy_model_binding
marcusmoore May 29, 2024
7d95e77
Add a few .prevents
marcusmoore May 29, 2024
9e35441
Importer fixes
marcusmoore May 29, 2024
e80b80f
Remove manual livewire tags
marcusmoore May 29, 2024
f032498
Update id syntax in custom fields component
marcusmoore May 30, 2024
2eaac3d
Fix select2 re-renders
marcusmoore May 30, 2024
1736bf5
Merge branch 'develop' into chore/sc-23725/livewire3
marcusmoore May 30, 2024
5a9a231
Remove alpinejs
marcusmoore May 30, 2024
296cf3e
Update OauthClients component
marcusmoore Jun 4, 2024
5eb5742
Define property
marcusmoore Jun 4, 2024
ef91c81
Remove unneeded re-render of select2
marcusmoore Jun 4, 2024
99439f0
Define property
marcusmoore Jun 4, 2024
b2a0e79
Inject alpine on label engine page
marcusmoore Jun 5, 2024
48fc6ca
Remove commented code
marcusmoore Jun 5, 2024
60c7efa
Remove commented code
marcusmoore Jun 5, 2024
9044aa4
Import class
marcusmoore Jun 5, 2024
c51b7d7
Inline variable
marcusmoore Jun 10, 2024
c3e6e11
Merge branch 'develop' into chore/sc-23725/livewire3
marcusmoore Jun 12, 2024
d916428
Merge branch 'develop' into chore/sc-23725/livewire3
marcusmoore Jun 17, 2024
fc351a1
Remove .live from oauth clients
marcusmoore Jun 17, 2024
a3dea99
Fix category edit form component
marcusmoore Jun 17, 2024
f0a11be
Merge branch 'develop' into chore/sc-23725/livewire3
marcusmoore Jun 18, 2024
30dd8bc
Update Livewire
marcusmoore Jun 18, 2024
d4861a7
Merge branch 'develop' into chore/sc-23725/livewire3
marcusmoore Jun 25, 2024
8a562f1
Bump Livewire to 3.5.1
marcusmoore Jun 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use Livewire\Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use Livewire\Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use App\Models\CustomField;
use Livewire\Component;
Expand Down Expand Up @@ -60,7 +60,7 @@ class Importer extends Component
];

/**
* This is used in resources/views/livewire/importer.blade.php, and we kinda shouldn't need to check for
* This is used in resources/views/livewire.importer.blade.php, and we kinda shouldn't need to check for
* activeFile here, but there's some UI goofiness that allows this to crash out on some imports.
*
* @return string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
Expand All @@ -19,21 +19,11 @@ class OauthClients extends Component

public $authorizationError;

protected $clientRepository;
protected $tokenRepository;

public function __construct()
{
$this->clientRepository = app(ClientRepository::class);
$this->tokenRepository = app(TokenRepository::class);
parent::__construct();
}

public function render()
{
return view('livewire.oauth-clients', [
'clients' => $this->clientRepository->activeForUser(auth()->user()->id),
'authorized_tokens' => $this->tokenRepository->forUser(auth()->user()->id)->where('revoked', false),
'clients' => app(ClientRepository::class)->activeForUser(auth()->user()->id),
'authorized_tokens' => app(TokenRepository::class)->forUser(auth()->user()->id)->where('revoked', false),
]);
}

Expand All @@ -44,21 +34,21 @@ public function createClient(): void
'redirect' => 'required|url|max:255',
]);

$newClient = $this->clientRepository->create(
app(ClientRepository::class)->create(
auth()->user()->id,
$this->name,
$this->redirect,
);

$this->dispatchBrowserEvent('clientCreated');
$this->dispatch('clientCreated');
}

public function deleteClient(Client $clientId): void
{
// test for safety
// ->delete must be of type Client - thus the model binding
if ($clientId->user_id == auth()->user()->id) {
$this->clientRepository->delete($clientId);
app(ClientRepository::class)->delete($clientId);
} else {
Log::warning('User ' . auth()->user()->id . ' attempted to delete client ' . $clientId->id . ' which belongs to user ' . $clientId->user_id);
$this->authorizationError = 'You are not authorized to delete this client.';
Expand All @@ -67,9 +57,9 @@ public function deleteClient(Client $clientId): void

public function deleteToken($tokenId): void
{
$token = $this->tokenRepository->find($tokenId);
$token = app(TokenRepository::class)->find($tokenId);
if ($token->user_id == auth()->user()->id) {
$this->tokenRepository->revokeAccessToken($tokenId);
app(TokenRepository::class)->revokeAccessToken($tokenId);
} else {
Log::warning('User ' . auth()->user()->id . ' attempted to delete token ' . $tokenId . ' which belongs to user ' . $token->user_id);
$this->authorizationError = 'You are not authorized to delete this token.';
Expand All @@ -83,7 +73,7 @@ public function editClient(Client $editClientId): void

$this->editClientId = $editClientId->id;

$this->dispatchBrowserEvent('editClient');
$this->dispatch('editClient');
}

public function updateClient(Client $editClientId): void
Expand All @@ -93,7 +83,7 @@ public function updateClient(Client $editClientId): void
'editRedirect' => 'required|url|max:255',
]);

$client = $this->clientRepository->find($editClientId->id);
$client = app(ClientRepository::class)->find($editClientId->id);
if ($client->user_id == auth()->user()->id) {
$client->name = $this->editName;
$client->redirect = $this->editRedirect;
Expand All @@ -103,7 +93,7 @@ public function updateClient(Client $editClientId): void
$this->authorizationError = 'You are not authorized to edit this client.';
}

$this->dispatchBrowserEvent('clientUpdated');
$this->dispatch('clientUpdated');

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
Expand All @@ -17,7 +17,7 @@ class PersonalAccessTokens extends Component
//this is just an annoying thing to make the modal input autofocus
public function autoFocusModalEvent(): void
{
$this->dispatchBrowserEvent('autoFocusModal');
$this->dispatch('autoFocusModal');
}

public function render()
Expand All @@ -42,7 +42,7 @@ public function createToken(): void

$this->newTokenString = $newToken->accessToken;

$this->dispatchBrowserEvent('tokenCreated', $newToken->accessToken);
$this->dispatch('tokenCreated', token: $newToken->accessToken);
}

public function deleteToken($tokenId): void
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use GuzzleHttp\Client;
use Illuminate\Support\Facades\Http;
Expand All @@ -23,15 +23,17 @@ class SlackSettingsForm extends Component

public Setting $setting;

public $webhook_endpoint_rules;
public $save_button;

public $webhook_test;

public $webhook_endpoint_rules;
protected $rules = [
'webhook_endpoint' => 'required_with:webhook_channel|starts_with:http://,https://,ftp://,irc://,https://hooks.slack.com/services/|url|nullable',
'webhook_channel' => 'required_with:webhook_endpoint|starts_with:#|nullable',
'webhook_botname' => 'string|nullable',
];


public function mount() {
$this->webhook_text= [
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"laravelcollective/html": "^6.2",
"league/csv": "^9.7",
"league/flysystem-aws-s3-v3": "^3.0",
"livewire/livewire": "^2.4",
"livewire/livewire": "^3.0",
"neitanod/forceutf8": "^2.0",
"nesbot/carbon": "^2.32",
"nunomaduro/collision": "^6.1",
Expand Down
37 changes: 20 additions & 17 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading