feat(ui): unify team, security, and notification settings layouts

Extract shared settings-layout components and a dedicated team
danger-zone page. Enable modal editing for security resources,
polish OAuth/API-token controls, and align notification and
service configuration UI with the new navigation patterns.
This commit is contained in:
Andras Bacsai committed 2026-08-05 16:24:31 +02:00
1 parent 5842d77b81
commit 2291c3fa1c
83 files changed
+1585 -597

No files matched your search

+43 -1
View File
@@ -66,7 +66,7 @@ class SettingsOauth extends Component
'base_url' => $oauthData['base_url'],
]);
if (! $oauth->couldBeEnabled()) {
if ($oauthData['enabled'] && ! $oauth->couldBeEnabled()) {
$oauth->update(['enabled' => false]);
throw new \Exception('OAuth settings are not complete for '.$oauth->provider.'.<br/>Please fill in all required fields.');
}
@@ -141,6 +141,48 @@ class SettingsOauth extends Component
}
}
public function toggleProvider(string $provider): mixed
{
try {
$this->authorize('update', instanceSettings());
if (! array_key_exists($provider, $this->oauth_settings_map)) {
throw new \Exception('OAuth provider not found.');
}
$enabling = ! $this->oauth_settings_map[$provider]['enabled'];
if ($enabling) {
$this->validate($this->providerRules($provider));
}
$this->oauth_settings_map[$provider]['enabled'] = $enabling;
$this->updateOauthSettings($provider);
} catch (\Throwable $e) {
return handleError($e, $this);
}
return null;
}
private function providerRules(string $provider): array
{
$prefix = "oauth_settings_map.$provider";
$rules = [
"$prefix.client_id" => 'required',
"$prefix.client_secret" => 'required',
];
if ($provider === 'azure') {
$rules["$prefix.tenant"] = 'required';
}
if (in_array($provider, ['authentik', 'clerk'], true)) {
$rules["$prefix.base_url"] = 'required';
}
return $rules;
}
public function submit()
{
try {