Fix styling

This commit is contained in:
Thijmen
2024-06-10 20:43:34 +00:00
committed by github-actions[bot]
parent 41fb6a1fc9
commit d86274cc37
429 changed files with 5307 additions and 2831 deletions

View File

@@ -9,27 +9,37 @@ use Livewire\Component;
class Index extends Component
{
public Application $application;
public ?Collection $deployments;
public int $deployments_count = 0;
public string $current_url;
public int $skip = 0;
public int $default_take = 40;
public bool $show_next = false;
public bool $show_prev = false;
public ?string $pull_request_id = null;
protected $queryString = ['pull_request_id'];
public function mount()
{
$project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (!$project) {
if (! $project) {
return redirect()->route('dashboard');
}
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
if (!$environment) {
if (! $environment) {
return redirect()->route('dashboard');
}
$application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
if (!$application) {
if (! $application) {
return redirect()->route('dashboard');
}
['deployments' => $deployments, 'count' => $count] = $application->deployments(0, 40);
@@ -40,12 +50,14 @@ class Index extends Component
$this->show_pull_request_only();
$this->show_more();
}
private function show_pull_request_only()
{
if ($this->pull_request_id) {
$this->deployments = $this->deployments->where('pull_request_id', $this->pull_request_id);
}
}
private function show_more()
{
if ($this->deployments->count() !== 0) {
@@ -53,6 +65,7 @@ class Index extends Component
if ($this->deployments->count() < $this->default_take) {
$this->show_next = false;
}
return;
}
}
@@ -61,6 +74,7 @@ class Index extends Component
{
$this->load_deployments();
}
public function previous_page(?int $take = null)
{
if ($take) {
@@ -73,6 +87,7 @@ class Index extends Component
}
$this->load_deployments();
}
public function next_page(?int $take = null)
{
if ($take) {
@@ -81,6 +96,7 @@ class Index extends Component
$this->show_prev = true;
$this->load_deployments();
}
public function load_deployments()
{
['deployments' => $deployments, 'count' => $count] = $this->application->deployments($this->skip, $this->default_take);
@@ -89,6 +105,7 @@ class Index extends Component
$this->show_pull_request_only();
$this->show_more();
}
public function render()
{
return view('livewire.project.application.deployment.index');

View File

@@ -9,24 +9,29 @@ use Livewire\Component;
class Show extends Component
{
public Application $application;
public ApplicationDeploymentQueue $application_deployment_queue;
public string $deployment_uuid;
public $isKeepAliveOn = true;
protected $listeners = ['refreshQueue'];
public function mount() {
public function mount()
{
$deploymentUuid = request()->route('deployment_uuid');
$project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (!$project) {
if (! $project) {
return redirect()->route('dashboard');
}
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
if (!$environment) {
if (! $environment) {
return redirect()->route('dashboard');
}
$application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
if (!$application) {
if (! $application) {
return redirect()->route('dashboard');
}
// $activity = Activity::where('properties->type_uuid', '=', $deploymentUuid)->first();
@@ -38,7 +43,7 @@ class Show extends Component
// ]);
// }
$application_deployment_queue = ApplicationDeploymentQueue::where('deployment_uuid', $deploymentUuid)->first();
if (!$application_deployment_queue) {
if (! $application_deployment_queue) {
return redirect()->route('project.application.deployment.index', [
'project_uuid' => $project->uuid,
'environment_name' => $environment->name,
@@ -63,6 +68,7 @@ class Show extends Component
$this->isKeepAliveOn = false;
}
}
public function render()
{
return view('livewire.project.application.deployment.show');