From a062b5a355459b393a34b2b6b6a4983a7f716651 Mon Sep 17 00:00:00 2001 From: Sai Deepesh Date: Tue, 30 May 2023 19:54:17 +0530 Subject: [PATCH] chore: translation for unauthorized workflow error (#8573) * fix: translation for unauthorized workflow error * change to dynamic string --------- Co-authored-by: Peer Richelsen Co-authored-by: alannnc Co-authored-by: Alex van Andel --- apps/web/public/static/locales/en/common.json | 1 + .../ee/workflows/components/EventWorkflowsTab.tsx | 9 ++++++--- packages/features/shell/Shell.tsx | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index 4aecb5157e..489551a783 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -1816,6 +1816,7 @@ "email_invite_team_bulk": "{{userCount}} users have been invited", "error_collecting_card": "Error collecting card", "image_size_limit_exceed": "Uploaded image shouldn't exceed 5mb size limit", + "unauthorized_workflow_error_message": "{{errorCode}}: You are not authorized to enable or disable this workflow", "inline_embed": "Inline Embed", "load_inline_content": "Loads your event type directly inline with your other website content.", "floating_pop_up_button": "Floating pop-up button", diff --git a/packages/features/ee/workflows/components/EventWorkflowsTab.tsx b/packages/features/ee/workflows/components/EventWorkflowsTab.tsx index d8b018e71f..3ef8c58685 100644 --- a/packages/features/ee/workflows/components/EventWorkflowsTab.tsx +++ b/packages/features/ee/workflows/components/EventWorkflowsTab.tsx @@ -71,9 +71,12 @@ const WorkflowListItem = (props: ItemProps) => { showToast(message, "error"); } if (err.data?.code === "UNAUTHORIZED") { - // TODO: Add missing translation - const message = `${err.data.code}: You are not authorized to enable or disable this workflow`; - showToast(message, "error"); + showToast( + t("unauthorized_workflow_error_message", { + errorCode: err.data.code, + }), + "error" + ); } }, }); diff --git a/packages/features/shell/Shell.tsx b/packages/features/shell/Shell.tsx index 89427593b3..690ec1c50c 100644 --- a/packages/features/shell/Shell.tsx +++ b/packages/features/shell/Shell.tsx @@ -310,11 +310,11 @@ function UserDropdown({ small }: { small?: boolean }) { {!small && ( - - + + {user.name || "Nameless User"} - + {user.username ? process.env.NEXT_PUBLIC_WEBSITE_URL === "https://cal.com" ? `cal.com/${user.username}`