diff --git a/apps/web/src/components/Editor.tsx b/apps/web/src/components/Editor.tsx index 603e89a3..0f576446 100644 --- a/apps/web/src/components/Editor.tsx +++ b/apps/web/src/components/Editor.tsx @@ -85,7 +85,7 @@ export interface RenderSuggestionsProps { export interface WorkspaceMember { publicId: string; user: { - id: string; + id: string | null; name: string | null; image: string | null; } | null; diff --git a/apps/web/src/hooks/useLocalisation.ts b/apps/web/src/hooks/useLocalisation.ts index d2d1c461..b80d028c 100644 --- a/apps/web/src/hooks/useLocalisation.ts +++ b/apps/web/src/hooks/useLocalisation.ts @@ -1,6 +1,6 @@ import type { Locale as DateFnsLocale } from "date-fns"; import { useLingui } from "@lingui/react"; -import { de, enGB, es, fr, it, nl, pl, ru, ptBR} from "date-fns/locale"; +import { de, enGB, es, fr, it, nl, pl, ptBR, ru } from "date-fns/locale"; import type { Locale } from "~/locales"; import { useLinguiContext } from "~/providers/lingui"; @@ -19,7 +19,7 @@ export function useLocalisation() { nl, ru, pl, - "pt-BR": ptBR, + ptbr: ptBR, }; const currentDateLocale = dateLocaleMap[locale] ?? enGB; diff --git a/apps/web/src/utils/i18n.ts b/apps/web/src/utils/i18n.ts index 755290f1..ddd6eb5e 100644 --- a/apps/web/src/utils/i18n.ts +++ b/apps/web/src/utils/i18n.ts @@ -22,8 +22,8 @@ const loadMessages = async (locale: Locale) => { return (await import("~/locales/ru/messages")).messages; case "pl": return (await import("~/locales/pl/messages")).messages; - case "pt-BR": - return (await import("~/locales/pt-BR/messages")).messages; + case "ptbr": + return (await import("~/locales/ptbr/messages")).messages; default: return enMessages; } diff --git a/apps/web/src/views/board/index.tsx b/apps/web/src/views/board/index.tsx index 8d25696a..5c815af0 100644 --- a/apps/web/src/views/board/index.tsx +++ b/apps/web/src/views/board/index.tsx @@ -2,9 +2,9 @@ import type { DropResult } from "react-beautiful-dnd"; import Link from "next/link"; import { useParams } from "next/navigation"; import { useRouter } from "next/router"; -import { env } from "next-runtime-env"; import { t } from "@lingui/core/macro"; import { keepPreviousData } from "@tanstack/react-query"; +import { env } from "next-runtime-env"; import { useEffect, useState } from "react"; import { DragDropContext, Draggable } from "react-beautiful-dnd"; import { useForm } from "react-hook-form"; diff --git a/apps/web/src/views/card/components/ActivityList.tsx b/apps/web/src/views/card/components/ActivityList.tsx index 3cfc397a..6a70c10e 100644 --- a/apps/web/src/views/card/components/ActivityList.tsx +++ b/apps/web/src/views/card/components/ActivityList.tsx @@ -525,7 +525,6 @@ const ActivityList = ({ comment={activity.comment?.comment} isEdited={!!activity.comment?.updatedAt} isAuthor={activity.comment?.createdBy === sessionData?.user.id} - isAdmin={isAdmin ?? false} isViewOnly={!!isViewOnly} /> ); diff --git a/apps/web/src/views/settings/WorkspaceSettings.tsx b/apps/web/src/views/settings/WorkspaceSettings.tsx index 54d5d4a3..65b16855 100644 --- a/apps/web/src/views/settings/WorkspaceSettings.tsx +++ b/apps/web/src/views/settings/WorkspaceSettings.tsx @@ -17,11 +17,11 @@ import { useModal } from "~/providers/modal"; import { useWorkspace } from "~/providers/workspace"; import { api } from "~/utils/api"; import { DeleteWorkspaceConfirmation } from "./components/DeleteWorkspaceConfirmation"; +import UpdateWeekStartDayForm from "./components/UpdateWeekStartDayForm"; import UpdateWorkspaceDescriptionForm from "./components/UpdateWorkspaceDescriptionForm"; import UpdateWorkspaceEmailVisibilityForm from "./components/UpdateWorkspaceEmailVisibilityForm"; import UpdateWorkspaceNameForm from "./components/UpdateWorkspaceNameForm"; import UpdateWorkspaceUrlForm from "./components/UpdateWorkspaceUrlForm"; -import UpdateWeekStartDayForm from "./components/UpdateWeekStartDayForm"; import { UpgradeToProConfirmation } from "./components/UpgradeToProConfirmation"; export default function WorkspaceSettings() { diff --git a/apps/web/src/views/settings/components/DeleteWebhookConfirmation.tsx b/apps/web/src/views/settings/components/DeleteWebhookConfirmation.tsx index 48a67f9d..ee1bb4a1 100644 --- a/apps/web/src/views/settings/components/DeleteWebhookConfirmation.tsx +++ b/apps/web/src/views/settings/components/DeleteWebhookConfirmation.tsx @@ -13,20 +13,29 @@ interface DeleteWebhookConfirmationProps { export function DeleteWebhookConfirmation({ workspacePublicId, }: DeleteWebhookConfirmationProps) { - const { closeModal, entityId: webhookPublicId, entityLabel: webhookName } = useModal(); + const { + closeModal, + entityId: webhookPublicId, + entityLabel: webhookName, + } = useModal(); const { showPopup } = usePopup(); const utils = api.useUtils(); const deleteWebhookMutation = api.webhook.delete.useMutation({ onSuccess: () => { void utils.webhook.list.invalidate({ workspacePublicId }); - showPopup({ message: t`Webhook deleted successfully`, type: "success" }); + showPopup({ + header: t`Webhook deleted`, + message: t`Webhook deleted successfully`, + icon: "success", + }); closeModal(); }, onError: (error) => { showPopup({ + header: t`Unable to delete webhook`, message: error.message || t`Failed to delete webhook`, - type: "error", + icon: "error", }); }, }); @@ -35,7 +44,7 @@ export function DeleteWebhookConfirmation({ if (!webhookPublicId) return; deleteWebhookMutation.mutate({ workspacePublicId, - webhookPublicId: webhookPublicId as string, + webhookPublicId: webhookPublicId, }); }; diff --git a/apps/web/src/views/settings/components/NewWebhookModal.tsx b/apps/web/src/views/settings/components/NewWebhookModal.tsx index 6bdbe94d..3260f2f2 100644 --- a/apps/web/src/views/settings/components/NewWebhookModal.tsx +++ b/apps/web/src/views/settings/components/NewWebhookModal.tsx @@ -44,7 +44,12 @@ export function NewWebhookModal({ workspacePublicId, isEdit = false, }: NewWebhookModalProps) { - const { closeModal, entityId: webhookPublicId, getModalState, clearModalState } = useModal(); + const { + closeModal, + entityId: webhookPublicId, + getModalState, + clearModalState, + } = useModal(); const { showPopup } = usePopup(); const [isTestingWebhook, setIsTestingWebhook] = useState(false); @@ -101,13 +106,18 @@ export function NewWebhookModal({ const createWebhookMutation = api.webhook.create.useMutation({ onSuccess: () => { void utils.webhook.list.invalidate({ workspacePublicId }); - showPopup({ message: t`Webhook created successfully`, type: "success" }); + showPopup({ + header: t`Webhook created`, + message: t`Webhook created successfully`, + icon: "success", + }); closeModal(); }, onError: (error) => { showPopup({ + header: t`Unable to create webhook`, message: error.message || t`Failed to create webhook`, - type: "error", + icon: "error", }); }, }); @@ -115,13 +125,18 @@ export function NewWebhookModal({ const updateWebhookMutation = api.webhook.update.useMutation({ onSuccess: () => { void utils.webhook.list.invalidate({ workspacePublicId }); - showPopup({ message: t`Webhook updated successfully`, type: "success" }); + showPopup({ + header: t`Webhook updated`, + message: t`Webhook updated successfully`, + icon: "success", + }); closeModal(); }, onError: (error) => { showPopup({ + header: t`Unable to update webhook`, message: error.message || t`Failed to update webhook`, - type: "error", + icon: "error", }); }, }); @@ -129,19 +144,25 @@ export function NewWebhookModal({ const testWebhookMutation = api.webhook.test.useMutation({ onSuccess: (result) => { if (result.success) { - showPopup({ message: t`Test webhook sent successfully!`, type: "success" }); + showPopup({ + header: t`Test sent`, + message: t`Test webhook sent successfully!`, + icon: "success", + }); } else { showPopup({ + header: t`Test failed`, message: result.error || t`Webhook test failed`, - type: "error", + icon: "error", }); } setIsTestingWebhook(false); }, onError: (error) => { showPopup({ + header: t`Unable to test webhook`, message: error.message || t`Failed to test webhook`, - type: "error", + icon: "error", }); setIsTestingWebhook(false); }, @@ -151,7 +172,7 @@ export function NewWebhookModal({ if (isEdit && webhookPublicId) { updateWebhookMutation.mutate({ workspacePublicId, - webhookPublicId: webhookPublicId as string, + webhookPublicId: webhookPublicId, name: data.name, url: data.url, secret: data.secret || undefined, @@ -174,11 +195,12 @@ export function NewWebhookModal({ setIsTestingWebhook(true); testWebhookMutation.mutate({ workspacePublicId, - webhookPublicId: webhookPublicId as string, + webhookPublicId: webhookPublicId, }); }; - const isPending = createWebhookMutation.isPending || updateWebhookMutation.isPending; + const isPending = + createWebhookMutation.isPending || updateWebhookMutation.isPending; return (
@@ -231,7 +253,11 @@ export function NewWebhookModal({ @@ -252,7 +278,7 @@ export function NewWebhookModal({ {webhookEvents.map((event) => (