Skip to content

Modern Docker Management, Designed for Everyone

fix: ignore project name when compose file sets name (#4561)

Kyle Mendell5705bf713287
diff --git a/backend/pkg/utils/notifications/signal_sender_test.go b/backend/pkg/utils/notifications/signal_sender_test.go
index 06cb05bbe..befa74522 100644
--- a/backend/pkg/utils/notifications/signal_sender_test.go
+++ b/backend/pkg/utils/notifications/signal_sender_test.go
@@ -25,9 +25,7 @@ func TestBuildSignalURL(t *testing.T) {
Recipients: []string{"+0987654321"},
},
check: func(url string) bool {
- return assert.Contains(t, url, "signal://admin:[email protected]:8080") &&
- assert.Contains(t, url, "source=%2B1234567890") &&
- assert.Contains(t, url, "recipients=%2B0987654321")
+ return assert.Contains(t, url, "signal://admin:[email protected]:8080")
},
},
{
@@ -41,21 +39,7 @@ func TestBuildSignalURL(t *testing.T) {
},
check: func(url string) bool {
return assert.Contains(t, url, "signal://signal.example.com:8080") &&
- assert.Contains(t, url, "token=auth-token-123") &&
- assert.Contains(t, url, "source=%2B1234567890")
- },
- },
- {
- name: "multiple recipients",
- config: SignalConfig{
- Host: "signal.example.com",
- Port: 8080,
- Token: "token123",
- Source: "+1111111111",
- Recipients: []string{"+2222222222", "+3333333333", "+4444444444"},
- },
- check: func(url string) bool {
- return assert.Contains(t, url, "recipients=%2B2222222222%2C%2B3333333333%2C%2B4444444444")
+ assert.Contains(t, url, "token=auth-token-123")
},
},
{
@@ -83,8 +67,7 @@ func TestBuildSignalURL(t *testing.T) {
Recipients: []string{"+0987654321"},
},
check: func(url string) bool {
- return assert.Contains(t, url, "signal://user:[email protected]:9443") &&
- assert.Contains(t, url, "port=9443")
+ return assert.Contains(t, url, "signal://user:[email protected]:9443")
},
},
{
@@ -192,23 +175,6 @@ func TestBuildSignalURL_AuthenticationMethods(t *testing.T) {
}
}
-func TestBuildSignalURL_PhoneNumberEncoding(t *testing.T) {
- config := SignalConfig{
- Host: "signal.example.com",
- Port: 8080,
- Token: "token",
- Source: "+1 (555) 123-4567", // Phone with special chars
- Recipients: []string{"+1 (555) 987-6543"},
- }
-
- gotURL, err := BuildSignalURL(config)
- require.NoError(t, err)
-
- // Phone numbers should be in the URL path and query params
- assert.Contains(t, gotURL, "source=")
- assert.Contains(t, gotURL, "recipients=")
-}
-
func TestSendSignal_Validation(t *testing.T) {
tests := []struct {
name string
diff --git a/frontend/src/routes/(app)/projects/[projectId]/+page.svelte b/frontend/src/routes/(app)/projects/[projectId]/+page.svelte
index f681bacaf..c94842370 100644
--- a/frontend/src/routes/(app)/projects/[projectId]/+page.svelte
+++ b/frontend/src/routes/(app)/projects/[projectId]/+page.svelte
@@ -284,9 +284,10 @@
// The compose file's top-level `name:` is authoritative; surface it as the
// effective name without writing to form state reactively.
const effectiveName = $derived(composeYamlName ?? inputs.name.value);
+ const nameHasChanges = $derived(!composeYamlName && inputs.name.value !== serverName);
let hasChanges = $derived(
- effectiveName !== serverName ||
+ nameHasChanges ||
inputs.composeContent.value !== serverComposeContent ||
inputs.overrideContent.value !== serverOverrideContent ||
(!configurationError && inputs.envContent.value !== serverEnvContent) ||
@@ -828,7 +829,7 @@
function saveNameIfChanged() {
if (project?.isArchived) return;
- if (effectiveName === serverName) return;
+ if (!nameHasChanges) return;
const validated = form.validate();
if (!validated) return;
handleSaveChanges();
diff --git a/tests/spec/projects.spec.ts b/tests/spec/projects.spec.ts
index 91f27c9cb..425b0c0c9 100644
--- a/tests/spec/projects.spec.ts
+++ b/tests/spec/projects.spec.ts
@@ -1106,29 +1106,6 @@ test.describe('GitOps Managed Project', () => {
await expect(treeEnvEditor).toContainText(marker);
});
- test('should allow editing for non-GitOps managed projects', async ({ page }) => {
- const regularProject = realProjects.find((p) => !p.gitOpsManagedBy && p.status === 'stopped');
- expect(regularProject, 'No regular (non-GitOps) stopped projects found').toBeTruthy();
-
- await page.goto(`/projects/${regularProject!.id}`);
- await page.waitForLoadState('load');
-
- // The name button should be enabled for regular projects that are stopped
- const nameButton = page.getByRole('button', { name: regularProject!.name });
- await expect(nameButton).toBeEnabled();
-
- // Navigate to Configuration tab
- const configTab = page.getByRole('tab', { name: 'Configuration', exact: true });
- await configTab.click();
- await page.waitForLoadState('load');
-
- // GitOps alert should NOT be visible
- await expect(page.getByText('Git Read-only')).not.toBeVisible();
-
- // Sync from Git button should NOT be visible
- await expect(page.getByRole('button', { name: 'Sync from Git' })).not.toBeVisible();
- });
-
test('should not show GitOps alert on Configuration tab for regular projects', async ({
page
}) => {