Skip to content

Commit

Permalink
fix(core): replace lowercase Refine in default titles (#5949)
Browse files Browse the repository at this point in the history
  • Loading branch information
aliemir authored and BatuhanW committed Jun 4, 2024
1 parent 213b824 commit 208f771
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
7 changes: 7 additions & 0 deletions .changeset/few-sheep-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@refinedev/core": patch
---

fix(core): update default titles

Previously, default titles included lowercase "refine", which was not correct. This commit updates the default titles to include "Refine" instead.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ describe("generateDocumentTitle", () => {
});

it("should return the default title when resource is undefined", () => {
expect(generateDefaultDocumentTitle(translateMock)).toBe("refine");
expect(generateDefaultDocumentTitle(translateMock)).toBe("Refine");
});

it("should return `resource name` when action is `list`", () => {
expect(
generateDefaultDocumentTitle(translateMock, { name: "posts" }, "list"),
).toBe("Posts | refine");
).toBe("Posts | Refine");
});

it("should return the label of the resource when it is provided", () => {
Expand All @@ -34,7 +34,7 @@ describe("generateDocumentTitle", () => {
{ name: "posts", label: "Posts Label" },
"list",
),
).toBe("Posts Label | refine");
).toBe("Posts Label | Refine");
});

it("should return the meta.label of the resource when it is provided", () => {
Expand All @@ -48,13 +48,13 @@ describe("generateDocumentTitle", () => {
},
"list",
),
).toBe("Meta Label | refine");
).toBe("Meta Label | Refine");
});

it("should return `Create new resource name` when action is `create`", () => {
expect(
generateDefaultDocumentTitle(translateMock, { name: "posts" }, "create"),
).toBe("Create new Post | refine");
).toBe("Create new Post | Refine");
});

it("should return `#id Clone resource name` when action is `clone`", () => {
Expand All @@ -65,7 +65,7 @@ describe("generateDocumentTitle", () => {
"clone",
"1",
),
).toBe("#1 Clone Post | refine");
).toBe("#1 Clone Post | Refine");
});

it("should return `#id Edit resource name` when action is `edit`", () => {
Expand All @@ -76,7 +76,7 @@ describe("generateDocumentTitle", () => {
"edit",
"1",
),
).toBe("#1 Edit Post | refine");
).toBe("#1 Edit Post | Refine");
});

it("should return `#id Show resource name` when action is `show`", () => {
Expand All @@ -87,7 +87,7 @@ describe("generateDocumentTitle", () => {
"show",
"1",
),
).toBe("#1 Show Post | refine");
).toBe("#1 Show Post | Refine");
});

it("should pass `id` to `translate` function", () => {
Expand All @@ -96,7 +96,7 @@ describe("generateDocumentTitle", () => {
expect(translateMock).toHaveBeenCalledWith(
"documentTitle.posts.show",
{ id: "1" },
"#1 Show Post | refine",
"#1 Show Post | Refine",
);
});

Expand All @@ -109,6 +109,6 @@ describe("generateDocumentTitle", () => {
"show",
"1",
),
).toBe("#1 Show Post | refine");
).toBe("#1 Show Post | Refine");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export function generateDefaultDocumentTitle(
const defaultTitle = safeTranslate(
translate,
"documentTitle.default",
"refine",
"Refine",
);
const suffix = safeTranslate(translate, "documentTitle.suffix", " | refine");
const suffix = safeTranslate(translate, "documentTitle.suffix", " | Refine");
let autoGeneratedTitle = defaultTitle;

if (action && identifier) {
Expand Down

0 comments on commit 208f771

Please sign in to comment.