This commit is contained in:
Andras Bacsai
2023-06-02 12:34:45 +02:00
parent ea5c1b9e12
commit 39d37010a3
62 changed files with 618 additions and 596 deletions

View File

@@ -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;
}
}

View File

@@ -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)
{