refactor(SourceManagement): sort sources by name and improve UI for changing Git source with better error handling

This commit is contained in:
Andras Bacsai
2025-04-11 20:25:25 +02:00
parent 46fe0fd7c6
commit 4c95dccfb3
3 changed files with 26 additions and 18 deletions

View File

@@ -75,7 +75,7 @@ class Source extends Component
// filter the current source out
$this->sources = currentTeam()->sources()->whereNotNull('app_id')->reject(function ($source) {
return $source->id === $this->application->source_id;
});
})->sortBy('name');
}
public function setPrivateKey(int $privateKeyId)
@@ -113,6 +113,7 @@ class Source extends Component
'source_type' => $sourceType,
]);
$this->application->refresh();
$this->getSources();
$this->dispatch('success', 'Source updated!');
} catch (\Throwable $e) {
return handleError($e, $this);