fixes
This commit is contained in:
@@ -10,19 +10,16 @@ use Livewire\Component;
|
||||
|
||||
class DiscordSettings extends Component
|
||||
{
|
||||
public Team|Server $model;
|
||||
public Team $model;
|
||||
|
||||
protected $rules = [
|
||||
'model.extra_attributes.discord_active' => 'nullable|boolean',
|
||||
'model.extra_attributes.discord_webhook' => 'required|url',
|
||||
];
|
||||
protected $validationAttributes = [
|
||||
'model.extra_attributes.discord_webhook' => 'Discord Webhook',
|
||||
'model.extra_attributes.discord_webhook' => '',
|
||||
];
|
||||
public function mount($model)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function instantSave()
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -2,15 +2,12 @@
|
||||
|
||||
namespace App\Http\Livewire\Notifications;
|
||||
|
||||
use App\Models\Server;
|
||||
use App\Models\Team;
|
||||
use App\Notifications\TestNotification;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Livewire\Component;
|
||||
|
||||
class EmailSettings extends Component
|
||||
{
|
||||
public Team|Server $model;
|
||||
public Team $model;
|
||||
|
||||
protected $rules = [
|
||||
'model.extra_attributes.smtp_active' => 'nullable|boolean',
|
||||
@@ -36,10 +33,6 @@ class EmailSettings extends Component
|
||||
'model.extra_attributes.smtp_password' => '',
|
||||
'model.extra_attributes.test_notification_recipients' => '',
|
||||
];
|
||||
public function mount($model)
|
||||
{
|
||||
//
|
||||
}
|
||||
public function submit()
|
||||
{
|
||||
$this->resetErrorBag();
|
||||
|
||||
@@ -10,7 +10,7 @@ use Notification;
|
||||
|
||||
class Test extends Component
|
||||
{
|
||||
public Team|Server $model;
|
||||
public Team $model;
|
||||
public function sendTestNotification()
|
||||
{
|
||||
Notification::send($this->model, new TestNotification);
|
||||
|
||||
@@ -13,7 +13,7 @@ class Deployments extends Component
|
||||
public string $current_url;
|
||||
public int $skip = 0;
|
||||
public int $default_take = 8;
|
||||
public bool $show_next = true;
|
||||
public bool $show_next = false;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
@@ -33,8 +33,11 @@ class Deployments extends Component
|
||||
['deployments' => $deployments, 'count' => $count] = Application::find($this->application_id)->deployments($this->skip, $take);
|
||||
$this->deployments = $deployments;
|
||||
$this->deployments_count = $count;
|
||||
if (count($this->deployments) !== 0 && count($this->deployments) < $take) {
|
||||
$this->show_next = false;
|
||||
if (count($this->deployments) !== 0) {
|
||||
$this->show_next = true;
|
||||
if (count($this->deployments) < $take) {
|
||||
$this->show_next = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,9 +37,14 @@ class Previews extends Component
|
||||
}
|
||||
public function load_prs()
|
||||
{
|
||||
['rate_limit_remaining' => $rate_limit_remaining, 'data' => $data] = get_from_git_api($this->application->source, "/repos/{$this->application->git_repository}/pulls");
|
||||
$this->rate_limit_remaining = $rate_limit_remaining;
|
||||
$this->pull_requests = $data->sortBy('number')->values();
|
||||
try {
|
||||
['rate_limit_remaining' => $rate_limit_remaining, 'data' => $data] = get_from_git_api($this->application->source, "/repos/{$this->application->git_repository}/pulls");
|
||||
$this->rate_limit_remaining = $rate_limit_remaining;
|
||||
$this->pull_requests = $data->sortBy('number')->values();
|
||||
} catch (\Throwable $th) {
|
||||
$this->rate_limit_remaining = 0;
|
||||
return general_error_handler($th, $this);
|
||||
}
|
||||
}
|
||||
public function deploy(int $pull_request_id, string|null $pull_request_html_url = null)
|
||||
{
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\Settings;
|
||||
|
||||
use App\Models\InstanceSettings;
|
||||
use Livewire\Component;
|
||||
|
||||
class Email extends Component
|
||||
{
|
||||
public InstanceSettings $model;
|
||||
|
||||
protected $rules = [
|
||||
'model.extra_attributes.from_address' => 'nullable',
|
||||
'model.extra_attributes.from_name' => 'nullable',
|
||||
'model.extra_attributes.recipients' => 'nullable',
|
||||
'model.extra_attributes.smtp_host' => 'nullable',
|
||||
'model.extra_attributes.smtp_port' => 'nullable',
|
||||
'model.extra_attributes.smtp_encryption' => 'nullable',
|
||||
'model.extra_attributes.smtp_username' => 'nullable',
|
||||
'model.extra_attributes.smtp_password' => 'nullable',
|
||||
'model.extra_attributes.smtp_timeout' => 'nullable',
|
||||
];
|
||||
protected $validationAttributes = [
|
||||
'model.extra_attributes.from_address' => 'From Address',
|
||||
'model.extra_attributes.from_name' => 'From Name',
|
||||
'model.extra_attributes.recipients' => 'Recipients',
|
||||
'model.extra_attributes.smtp_host' => 'Host',
|
||||
'model.extra_attributes.smtp_port' => 'Port',
|
||||
'model.extra_attributes.smtp_encryption' => 'Encryption',
|
||||
'model.extra_attributes.smtp_username' => 'Username',
|
||||
'model.extra_attributes.smtp_password' => 'Password',
|
||||
];
|
||||
public function mount($model)
|
||||
{
|
||||
//
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.settings.email');
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,11 @@ use Livewire\Component;
|
||||
|
||||
class SwitchTeam extends Component
|
||||
{
|
||||
public string $selectedTeamId = 'default';
|
||||
public function updatedSelectedTeamId()
|
||||
{
|
||||
$this->switch_to($this->selectedTeamId);
|
||||
}
|
||||
public function switch_to($team_id)
|
||||
{
|
||||
if (!auth()->user()->teams->contains($team_id)) {
|
||||
|
||||
15
app/Http/Livewire/Team/Member.php
Normal file
15
app/Http/Livewire/Team/Member.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\Team;
|
||||
|
||||
use App\Models\User;
|
||||
use Livewire\Component;
|
||||
|
||||
class Member extends Component
|
||||
{
|
||||
public User $member;
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.team.member');
|
||||
}
|
||||
}
|
||||
@@ -60,4 +60,8 @@ class Team extends BaseModel implements SendsDiscord, SendsEmail
|
||||
{
|
||||
return $this->hasMany(PrivateKey::class);
|
||||
}
|
||||
public function members()
|
||||
{
|
||||
return $this->belongsToMany(User::class, 'team_user', 'team_id', 'user_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user