Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/dotcom/client/e2e/fixtures/WorkspaceInviteDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class WorkspaceInviteDialog {
public readonly declineButton: Locator

constructor(public readonly page: Page) {
this.dialog = this.page.getByText('You have been invited to join workspace')
this.dialog = this.page.getByText('You have been invited to join:')
this.acceptButton = this.page.getByRole('button', { name: 'Accept and join workspace' })
this.declineButton = this.page.getByRole('button', { name: 'No thanks' })
}
Expand Down
57 changes: 56 additions & 1 deletion apps/dotcom/client/e2e/tests/ui.scenario.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ test.describe('UI scenarios', () => {
await expect(ownerDialog.getByPlaceholder('Workspace name')).toBeVisible()
await expect(ownerDialog.getByText('Invite teammates')).toBeVisible()
await expect(ownerDialog.getByRole('button', { name: 'Copy invite link' })).toBeVisible()
await expect(ownerDialog.getByText(/Members \(\d+\)/)).toBeVisible()
await expect(ownerDialog.getByRole('tab', { name: 'Members' })).toBeVisible()
await expect(ownerDialog.getByText(/\(you\)/)).toBeVisible()
const memberRoleSelect = ownerDialog.locator(`[id="workspace-member-role-${memberUserId}"]`)
await expect(memberRoleSelect).toHaveText('Member')
Expand Down Expand Up @@ -297,6 +297,61 @@ test.describe('UI scenarios', () => {
await member.sidebar.expectFileNotVisible(fileName)
})

test('home workspace settings show a private rename dialog, not an empty one', async ({
owner,
scenario,
}) => {
// Regression: the home workspace ("My workspace") used to render an empty dialog — the
// component returned null for it while the sidebar still opened the dialog, so the page
// just dimmed with no content. It's private: it can be renamed, but not shared or managed.
await scenario.ensureGroupsReady(owner)
await owner.sidebar.switchToHomeWorkspace()
await owner.page.getByTestId('tla-sidebar-workspace-settings').click()

const dialog = owner.page.getByRole('dialog', { name: 'Manage workspace' })
await expect(dialog).toBeVisible()
// Renameable: the name field is present and editable.
await expect(dialog.getByPlaceholder('Workspace name')).toBeEnabled()
// Private: a disabled invite control with an explanatory note (no shareable link).
await expect(
dialog.getByText(
'This is your private workspace. Create a new workspace to invite teammates.'
)
).toBeVisible()
await expect(dialog.getByRole('button', { name: 'Copy invite link' })).toBeDisabled()
// Nothing to manage, so the dialog has no Members/Settings tabs at all.
await expect(dialog.getByRole('tab')).toHaveCount(0)

await owner.page.keyboard.press('Escape')
})

test('the home workspace can be renamed from its settings dialog', async ({
owner,
scenario,
}) => {
// Regression: the home workspace is renameable (the reason its settings dialog exists at
// all), so the rename must apply. Restore the name afterwards so later serial tests still
// see the original.
await scenario.ensureGroupsReady(owner)
await owner.sidebar.switchToHomeWorkspace()
const originalName = await owner.page.getByTestId('tla-active-workspace-name').innerText()
const newName = scenario.name('home renamed')

await owner.page.getByTestId('tla-sidebar-workspace-settings').click()
const dialog = owner.page.getByRole('dialog', { name: 'Manage workspace' })
await dialog.getByPlaceholder('Workspace name').fill(newName)
await owner.page.getByRole('button', { name: 'Close' }).click()
await owner.waitForMutationResolution()
await owner.sidebar.expectActiveWorkspace(newName)

// Restore the original home workspace name.
await owner.page.getByTestId('tla-sidebar-workspace-settings').click()
await dialog.getByPlaceholder('Workspace name').fill(originalName)
await owner.page.getByRole('button', { name: 'Close' }).click()
await owner.waitForMutationResolution()
await owner.sidebar.expectActiveWorkspace(originalName)
})

test('workspace settings rename updates labels and persists', async ({ owner, scenario }) => {
const workspaceName = scenario.name('settings rename old')
const newWorkspaceName = scenario.name('settings rename new')
Expand Down
104 changes: 56 additions & 48 deletions apps/dotcom/client/public/tla/locales-compiled/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@
"value": "Unpin file"
}
],
"12c8a9838c": [
{
"type": 0,
"value": "Try the tldraw SDK"
}
],
"13ddd375ad": [
{
"type": 0,
Expand Down Expand Up @@ -159,6 +153,26 @@
"value": "Workspace name"
}
],
"23dcace54a": [
{
"type": 0,
"value": "You have been invited to join "
},
{
"children": [
{
"type": 1,
"value": "workspaceName"
}
],
"type": 8,
"value": "strong"
},
{
"type": 0,
"value": ". Create a free account to continue."
}
],
"250ddea65c": [
{
"type": 0,
Expand Down Expand Up @@ -231,6 +245,12 @@
"value": "Editor"
}
],
"34e34c43ec": [
{
"type": 0,
"value": "Manage"
}
],
"375396d6e5": [
{
"type": 0,
Expand Down Expand Up @@ -345,6 +365,12 @@
"value": "Unable to unpublish the file."
}
],
"51317dcad5": [
{
"type": 0,
"value": "This is your private workspace. Create a new workspace to invite teammates."
}
],
"517bb809d9": [
{
"type": 0,
Expand Down Expand Up @@ -385,6 +411,12 @@
"value": "PNG"
}
],
"5638176be5": [
{
"type": 0,
"value": "Create a workspace"
}
],
"5677e381d2": [
{
"type": 0,
Expand Down Expand Up @@ -595,12 +627,6 @@
"value": "Got it"
}
],
"78faf88f4d": [
{
"type": 0,
"value": "Enable invite link"
}
],
"797799f35e": [
{
"type": 0,
Expand All @@ -619,6 +645,12 @@
"value": "User manual"
}
],
"7bcdfeab70": [
{
"type": 0,
"value": "You have been invited to join:"
}
],
"7be10fc592": [
{
"type": 0,
Expand Down Expand Up @@ -927,22 +959,6 @@
"value": "File is getting large"
}
],
"a8c9ad7ea5": [
{
"type": 0,
"value": "You have been invited to join "
},
{
"children": [
{
"type": 1,
"value": "workspaceName"
}
],
"type": 8,
"value": "strong"
}
],
"a9ded1e5ce": [
{
"type": 0,
Expand Down Expand Up @@ -997,6 +1013,12 @@
"value": "Email address"
}
],
"b48becc771": [
{
"type": 0,
"value": "Enable invites"
}
],
"b6d4223e60": [
{
"type": 0,
Expand All @@ -1015,20 +1037,6 @@
"value": "Copy link"
}
],
"b9a68fbd56": [
{
"type": 0,
"value": "Members ("
},
{
"type": 1,
"value": "count"
},
{
"type": 0,
"value": ")"
}
],
"ba0318cb81": [
{
"type": 0,
Expand Down Expand Up @@ -1321,12 +1329,6 @@
"value": "or"
}
],
"e9e0f16850": [
{
"type": 0,
"value": "You have been invited to join workspace:"
}
],
"ea4788705e": [
{
"type": 0,
Expand Down Expand Up @@ -1389,6 +1391,12 @@
"value": " to learn more."
}
],
"ef53538ae4": [
{
"type": 0,
"value": "Members"
}
],
"ef7de3f485": [
{
"type": 0,
Expand Down
36 changes: 21 additions & 15 deletions apps/dotcom/client/public/tla/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@
"12a6766ba1": {
"translation": "Unpin file"
},
"12c8a9838c": {
"translation": "Try the tldraw SDK"
},
"13ddd375ad": {
"translation": "Export as"
},
Expand All @@ -77,6 +74,9 @@
"21f66c9c00": {
"translation": "Workspace name"
},
"23dcace54a": {
"translation": "You have been invited to join <strong>{workspaceName}</strong>. Create a free account to continue."
},
"250ddea65c": {
"translation": "About tldraw"
},
Expand Down Expand Up @@ -113,6 +113,9 @@
"344a7f427f": {
"translation": "Editor"
},
"34e34c43ec": {
"translation": "Manage"
},
"375396d6e5": {
"translation": "Remove member"
},
Expand Down Expand Up @@ -170,6 +173,9 @@
"50db1b7e1e": {
"translation": "Unable to unpublish the file."
},
"51317dcad5": {
"translation": "This is your private workspace. Create a new workspace to invite teammates."
},
"517bb809d9": {
"translation": "Page menu"
},
Expand All @@ -185,6 +191,9 @@
"55505ba281": {
"translation": "PNG"
},
"5638176be5": {
"translation": "Create a workspace"
},
"5677e381d2": {
"translation": "We use analytics cookies to make tldraw better."
},
Expand Down Expand Up @@ -290,9 +299,6 @@
"78e9815992": {
"translation": "Got it"
},
"78faf88f4d": {
"translation": "Enable invite link"
},
"797799f35e": {
"translation": "Submit an issue on GitHub"
},
Expand All @@ -302,6 +308,9 @@
"7b1329f5ca": {
"translation": "User manual"
},
"7bcdfeab70": {
"translation": "You have been invited to join:"
},
"7be10fc592": {
"translation": "Restore version"
},
Expand Down Expand Up @@ -431,9 +440,6 @@
"a8873770ab": {
"translation": "File is getting large"
},
"a8c9ad7ea5": {
"translation": "You have been invited to join <strong>{workspaceName}</strong>"
},
"a9ded1e5ce": {
"translation": "Background"
},
Expand All @@ -459,6 +465,9 @@
"b357b524e7": {
"translation": "Email address"
},
"b48becc771": {
"translation": "Enable invites"
},
"b6d4223e60": {
"translation": "Sign in"
},
Expand All @@ -468,9 +477,6 @@
"b758336699": {
"translation": "Copy link"
},
"b9a68fbd56": {
"translation": "Members ({count})"
},
"ba0318cb81": {
"translation": "Sign in to share"
},
Expand Down Expand Up @@ -576,9 +582,6 @@
"e81c4e4f2b": {
"translation": "or"
},
"e9e0f16850": {
"translation": "You have been invited to join workspace:"
},
"ea4788705e": {
"translation": "Cancel"
},
Expand All @@ -603,6 +606,9 @@
"ede55d955f": {
"translation": "Read our <a>cookie policy</a> to learn more."
},
"ef53538ae4": {
"translation": "Members"
},
"ef7de3f485": {
"translation": "selected"
},
Expand Down
Loading
Loading