feat(domains): add inline indexing and redirect controls

Move domain indexing and redirect settings into domain management views and include noindex changes in deployment configuration diffs.
This commit is contained in:
Andras Bacsai committed 2026-08-10 15:10:30 +02:00
1 parent 8c9a7413d0
commit 69ba001e21
22 files changed
+327 -185

No files matched your search

@@ -194,6 +194,7 @@ class ApplicationConfigurationSnapshot
{
return [
$this->item('fqdn', 'Domains', $this->application->fqdn, 'redeploy'),
$this->item('noindex_domains', 'Search engine indexing', $this->application->noindexDomains()->all(), 'redeploy'),
$this->item('docker_compose_domains', 'Service domains', $this->decodedComposeDomains(), 'redeploy', displayValue: $this->summarizeText($this->composeDomainsText()), displayFull: $this->composeDomainsText(), diffMode: 'lines'),
$this->item('redirect', 'Redirect', $this->application->redirect, 'redeploy'),
$this->item('custom_labels', 'Container labels', $this->application->custom_labels, 'redeploy', displayValue: $this->summarizeText($this->decodeCustomLabels($this->application->custom_labels)), displayFull: $this->decodeCustomLabels($this->application->custom_labels), diffMode: 'lines'),
@@ -22,7 +22,7 @@ class ConfigurationDiffer
* stored. Older snapshots omitted these keys, which should not make an
* unchanged default look like a pending configuration change.
*
* @var array<string, bool|array<int, bool>>
* @var array<string, mixed>
*/
private const INTRODUCED_DEFAULTS = [
'build.is_static' => false,
@@ -37,6 +37,7 @@ class ConfigurationDiffer
'runtime.is_log_drain_enabled' => false,
'runtime.is_swarm_only_worker_nodes' => true,
'runtime.is_preserve_repository_enabled' => false,
'domains.noindex_domains' => [],
];
/**
@@ -61,7 +62,7 @@ class ConfigurationDiffer
if (
$previous === null
&& array_key_exists($key, self::INTRODUCED_DEFAULTS)
&& in_array((bool) data_get($current, 'compare_value'), (array) self::INTRODUCED_DEFAULTS[$key], true)
&& $this->matchesIntroducedDefault($key, data_get($current, 'compare_value'))
) {
continue;
}
@@ -126,6 +127,17 @@ class ConfigurationDiffer
return ConfigurationDiff::fromChanges($changes);
}
private function matchesIntroducedDefault(string $key, mixed $value): bool
{
$default = self::INTRODUCED_DEFAULTS[$key];
if (is_array($default) && $default !== [] && array_is_list($default)) {
return in_array($value, $default, true);
}
return $value === $default;
}
/**
* Reduce two multi-line values to only the lines that differ, so the modal
* shows just the changed container labels instead of the whole block.