Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): replace lowercase Refine in default titles #5949

Merged
merged 2 commits into from
May 21, 2024
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
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
Loading