Skip to content

Commit

Permalink
feat: added notification to server provider button
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislarsen committed Jul 6, 2024
1 parent 96f2873 commit 7ec7dbc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/Livewire/RemoteServers/CreateRemoteServerForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ public function returnToForm(): void

public function usingServerProvider(string $provider): void
{
Toaster::success(__('The username has been updated to ":username".', ['username' => $provider]));

$this->username = $provider;
$this->port = 22;
}
Expand Down
3 changes: 2 additions & 1 deletion lang/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,6 @@
"← Return to Home": "← Gå tilbage til forsiden",
"Light": "Lys",
"Dark": "Mørk",
"System": "System"
"System": "System",
"The username has been updated to \":username\".": "Brugernavnet er blevet opdateret til \":username\"."
}
3 changes: 2 additions & 1 deletion lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,6 @@
"← Return to Home": "← Вернуться на главную",
"Light": "Свет",
"Dark": "Тёмный",
"System": "Система"
"System": "Система",
"The username has been updated to \":username\".": "Имя пользователя было обновлено на \":username\"."
}
3 changes: 2 additions & 1 deletion lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,6 @@
"← Return to Home": "← 返回首页",
"Light": "",
"Dark": "",
"System": "系统"
"System": "系统",
"The username has been updated to \":username\".": "И用户名已更新为 \":username\"."
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,16 @@
->call('submit')
->assertHasErrors(['port']);
});

test('username is set correctly after provider method called', function () {
Toaster::fake();

$component = Livewire::test(CreateRemoteServerForm::class)
->set('username', 'test')
->call('usingServerProvider', 'ploi');

$component->assertSet('username', 'ploi');

Toaster::assertDispatched(__('The username has been updated to ":username".', ['username' => 'ploi']));
});

0 comments on commit 7ec7dbc

Please sign in to comment.