Skip to content

Commit bc89fe0

Browse files
authored
fix: unpublished org/team avatar and i18n (#11429)
* fix: unpublished org/team avatar and i18n * Fixing e2e
1 parent 64850b5 commit bc89fe0

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

apps/web/playwright/unpublished.e2e.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test.describe.configure({ mode: "parallel" });
99
const title = (name: string) => `${name} is unpublished`;
1010
const description = (entity: string) =>
1111
`This ${entity} link is currently not available. Please contact the ${entity} owner or ask them to publish it.`;
12-
const avatar = (slug: string) => `/team/${slug}/avatar.png`;
12+
const avatar = (slug: string, entity = "team") => `/${entity}/${slug}/avatar.png`;
1313

1414
test.afterAll(async ({ users }) => {
1515
await users.deleteAll();
@@ -52,7 +52,7 @@ test.describe("Unpublished", () => {
5252
expect(await page.locator('[data-testid="empty-screen"]').count()).toBe(1);
5353
expect(await page.locator(`h2:has-text("${title(org.name)}")`).count()).toBe(1);
5454
expect(await page.locator(`div:text("${description("organization")}")`).count()).toBe(1);
55-
await expect(page.locator(`img`)).toHaveAttribute("src", avatar(requestedSlug));
55+
await expect(page.locator(`img`)).toHaveAttribute("src", avatar(requestedSlug, "org"));
5656
});
5757

5858
test("Organization sub-team", async ({ users, page }) => {
@@ -70,7 +70,7 @@ test.describe("Unpublished", () => {
7070
expect(await page.locator('[data-testid="empty-screen"]').count()).toBe(1);
7171
expect(await page.locator(`h2:has-text("${title(org.name)}")`).count()).toBe(1);
7272
expect(await page.locator(`div:text("${description("organization")}")`).count()).toBe(1);
73-
await expect(page.locator(`img`)).toHaveAttribute("src", avatar(requestedSlug));
73+
await expect(page.locator(`img`)).toHaveAttribute("src", avatar(requestedSlug, "org"));
7474
});
7575

7676
test("Organization sub-team event-type", async ({ users, page }) => {
@@ -90,7 +90,7 @@ test.describe("Unpublished", () => {
9090
expect(await page.locator('[data-testid="empty-screen"]').count()).toBe(1);
9191
expect(await page.locator(`h2:has-text("${title(org.name)}")`).count()).toBe(1);
9292
expect(await page.locator(`div:text("${description("organization")}")`).count()).toBe(1);
93-
await expect(page.locator(`img`)).toHaveAttribute("src", avatar(requestedSlug));
93+
await expect(page.locator(`img`)).toHaveAttribute("src", avatar(requestedSlug, "org"));
9494
});
9595

9696
test("Organization user", async ({ users, page }) => {
@@ -102,7 +102,7 @@ test.describe("Unpublished", () => {
102102
expect(await page.locator('[data-testid="empty-screen"]').count()).toBe(1);
103103
expect(await page.locator(`h2:has-text("${title(org.name)}")`).count()).toBe(1);
104104
expect(await page.locator(`div:text("${description("organization")}")`).count()).toBe(1);
105-
await expect(page.locator(`img`)).toHaveAttribute("src", avatar(requestedSlug));
105+
await expect(page.locator(`img`)).toHaveAttribute("src", avatar(requestedSlug, "org"));
106106
});
107107

108108
test("Organization user event-type", async ({ users, page }) => {
@@ -115,6 +115,6 @@ test.describe("Unpublished", () => {
115115
expect(await page.locator('[data-testid="empty-screen"]').count()).toBe(1);
116116
expect(await page.locator(`h2:has-text("${title(org.name)}")`).count()).toBe(1);
117117
expect(await page.locator(`div:text("${description("organization")}")`).count()).toBe(1);
118-
await expect(page.locator(`img`)).toHaveAttribute("src", avatar(requestedSlug));
118+
await expect(page.locator(`img`)).toHaveAttribute("src", avatar(requestedSlug, "org"));
119119
});
120120
});

apps/web/public/static/locales/en/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,8 @@
17431743
"show_on_booking_page": "Show on booking page",
17441744
"get_started_zapier_templates": "Get started with Zapier templates",
17451745
"team_is_unpublished": "{{team}} is unpublished",
1746-
"team_is_unpublished_description": "This {{entity}} link is currently not available. Please contact the {{entity}} owner or ask them to publish it.",
1746+
"org_is_unpublished_description": "This organization link is currently not available. Please contact the organization owner or ask them to publish it.",
1747+
"team_is_unpublished_description": "This team link is currently not available. Please contact the team owner or ask them to publish it.",
17471748
"team_member": "Team member",
17481749
"a_routing_form": "A Routing Form",
17491750
"form_description_placeholder": "Form Description",

packages/ui/components/unpublished-entity/UnpublishedEntity.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ export function UnpublishedEntity(props: UnpublishedEntityProps) {
1313
return (
1414
<div className="m-8 flex items-center justify-center">
1515
<EmptyScreen
16-
avatar={<Avatar alt={slug ?? ""} imageSrc={`/team/${slug}/avatar.png`} size="lg" />}
16+
avatar={
17+
<Avatar
18+
alt={slug ?? ""}
19+
imageSrc={props.orgSlug ? `/org/${slug}/avatar.png` : `/team/${slug}/avatar.png`}
20+
size="lg"
21+
/>
22+
}
1723
headline={t("team_is_unpublished", {
1824
team: props.name,
1925
})}
20-
description={t("team_is_unpublished_description", {
21-
entity: props.orgSlug ? t("organization").toLowerCase() : t("team").toLowerCase(),
22-
})}
26+
description={t(`${props.orgSlug ? "org" : "team"}_is_unpublished_description`)}
2327
/>
2428
</div>
2529
);

0 commit comments

Comments
 (0)