mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
Compare commits
3 Commits
fix-commen
...
chore-ln-h
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cce5f4eab6 | ||
|
|
7e95386f9d | ||
|
|
680d1cbd72 |
@@ -316,5 +316,68 @@
|
||||
"change_parent_issue": "Change parent issue",
|
||||
"remove_parent_issue": "Remove parent issue",
|
||||
"add_parent": "Add parent",
|
||||
"loading_members": "Loading members..."
|
||||
"loading_members": "Loading members...",
|
||||
|
||||
"manage_widgets": "Manage widgets",
|
||||
"morning": "Morning",
|
||||
"afternoon": "Afternoon",
|
||||
"evening": "Evening",
|
||||
"good": "Good",
|
||||
"Monday": "Monday",
|
||||
"Tuesday": "Tuesday",
|
||||
"Wednesday": "Wednesday",
|
||||
"Thursday": "Thursday",
|
||||
"Friday": "Friday",
|
||||
"Saturday": "Saturday",
|
||||
"Sunday": "Sunday",
|
||||
"monday": "Monday",
|
||||
"tuesday": "Tuesday",
|
||||
"wednesday": "Wednesday",
|
||||
"thursday": "Thursday",
|
||||
"friday": "Friday",
|
||||
"saturday": "Saturday",
|
||||
"sunday": "Sunday",
|
||||
"january": "January",
|
||||
"february": "February",
|
||||
"march": "March",
|
||||
"april": "April",
|
||||
"may": "May",
|
||||
"june": "June",
|
||||
"july": "July",
|
||||
"august": "August",
|
||||
"september": "September",
|
||||
"october": "October",
|
||||
"november": "November",
|
||||
"december": "December",
|
||||
"jan": "Jan",
|
||||
"feb": "Feb",
|
||||
"mar": "Mar",
|
||||
"apr": "Apr",
|
||||
"jun": "Jun",
|
||||
"jul": "Jul",
|
||||
"aug": "Aug",
|
||||
"sept": "Sep",
|
||||
"oct": "Oct",
|
||||
"nov": "Nov",
|
||||
"dec": "Dec",
|
||||
|
||||
"quick_links_heading": "Quick links",
|
||||
"add_quick_link": "Add quick link",
|
||||
"adding" : "Adding",
|
||||
"quick_link": "Quick link",
|
||||
"display_title": "Display title",
|
||||
"quick_link_title_placeholder": "What you'd like to see this link as",
|
||||
"quick_link_url_placeholder": "Type or paste a URL",
|
||||
"optional": "Optional",
|
||||
"label": "Label",
|
||||
"show_less": "Show less",
|
||||
"show_more": "Show more",
|
||||
"show_all": "Show all",
|
||||
"stickies_heading": "My stickies",
|
||||
"sticky_placeholder": "Click to type here",
|
||||
"add_sticky": "Add sticky",
|
||||
"all_items": "All item",
|
||||
"recents": "Recents",
|
||||
"url": "URL",
|
||||
"star_on_github": "Star us on GitHub"
|
||||
}
|
||||
|
||||
@@ -316,5 +316,67 @@
|
||||
"remove_parent_issue": "Eliminar problema padre",
|
||||
"add_parent": "Agregar padre",
|
||||
"loading_members": "Cargando miembros...",
|
||||
"inbox": "bandeja de entrada"
|
||||
"inbox": "bandeja de entrada",
|
||||
|
||||
"manage_widgets": "Gestionar widgets",
|
||||
"morning": "Mañana",
|
||||
"afternoon": "Tarde",
|
||||
"evening": "Noche",
|
||||
"good": "Buen",
|
||||
"Monday": "Lunes",
|
||||
"Tuesday": "Martes",
|
||||
"Wednesday": "Miércoles",
|
||||
"Thursday": "Jueves",
|
||||
"Friday": "Viernes",
|
||||
"Saturday": "Sábado",
|
||||
"Sunday": "Domingo",
|
||||
"monday": "lunes",
|
||||
"tuesday": "martes",
|
||||
"wednesday": "miércoles",
|
||||
"thursday": "jueves",
|
||||
"friday": "viernes",
|
||||
"saturday": "sábado",
|
||||
"sunday": "domingo",
|
||||
"january": "enero",
|
||||
"february": "febrero",
|
||||
"march": "marzo",
|
||||
"april": "abril",
|
||||
"may": "mayo",
|
||||
"june": "junio",
|
||||
"july": "julio",
|
||||
"august": "agosto",
|
||||
"september": "septiembre",
|
||||
"october": "octubre",
|
||||
"november": "noviembre",
|
||||
"december": "diciembre",
|
||||
"jan": "ene",
|
||||
"feb": "feb",
|
||||
"mar": "mar",
|
||||
"apr": "abr",
|
||||
"jun": "jun",
|
||||
"jul": "jul",
|
||||
"aug": "ago",
|
||||
"sept": "sep",
|
||||
"oct": "oct",
|
||||
"nov": "nov",
|
||||
"dec": "dic",
|
||||
|
||||
"quick_links_heading": "Enlaces rápidos",
|
||||
"add_quick_link": "Añadir enlace rápido",
|
||||
"adding": "Añadiendo",
|
||||
"quick_link": "Enlace rápido",
|
||||
"display_title": "Título de visualización",
|
||||
"quick_link_title_placeholder": "Cómo te gustaría ver este enlace",
|
||||
"quick_link_url_placeholder": "Escribe o pega una URL",
|
||||
"optional": "Opcional",
|
||||
"show_less": "Mostrar menos",
|
||||
"show_more": "Mostrar más",
|
||||
"show_all": "Mostrar todo",
|
||||
"stickies_heading": "Mis notas adhesivas",
|
||||
"sticky_placeholder": "Haz clic para escribir aquí",
|
||||
"add_sticky": "Añadir nota adhesiva",
|
||||
"all_items": "Todos los elementos",
|
||||
"recents": "Recientes",
|
||||
"url": "URL",
|
||||
"star_on_github": "Danos una estrella en GitHub"
|
||||
}
|
||||
|
||||
@@ -316,5 +316,69 @@
|
||||
"remove_parent_issue": "Supprimer le problème parent",
|
||||
"add_parent": "Ajouter un parent",
|
||||
"loading_members": "Chargement des membres...",
|
||||
"inbox": "boîte de réception"
|
||||
"inbox": "boîte de réception",
|
||||
|
||||
|
||||
"manage_widgets": "Gérer les widgets",
|
||||
"morning": "Matin",
|
||||
"afternoon": "Après-midi",
|
||||
"evening": "Soir",
|
||||
"good": "Bon",
|
||||
"Monday": "Lundi",
|
||||
"Tuesday": "Mardi",
|
||||
"Wednesday": "Mercredi",
|
||||
"Thursday": "Jeudi",
|
||||
"Friday": "Vendredi",
|
||||
"Saturday": "Samedi",
|
||||
"Sunday": "Dimanche",
|
||||
"monday": "lundi",
|
||||
"tuesday": "mardi",
|
||||
"wednesday": "mercredi",
|
||||
"thursday": "jeudi",
|
||||
"friday": "vendredi",
|
||||
"saturday": "samedi",
|
||||
"sunday": "dimanche",
|
||||
"january": "janvier",
|
||||
"february": "février",
|
||||
"march": "mars",
|
||||
"april": "avril",
|
||||
"may": "mai",
|
||||
"june": "juin",
|
||||
"july": "juillet",
|
||||
"august": "août",
|
||||
"september": "septembre",
|
||||
"october": "octobre",
|
||||
"november": "novembre",
|
||||
"december": "décembre",
|
||||
"jan": "jan",
|
||||
"feb": "fév",
|
||||
"mar": "mar",
|
||||
"apr": "avr",
|
||||
"jun": "juin",
|
||||
"jul": "juil",
|
||||
"aug": "août",
|
||||
"sept": "sep",
|
||||
"oct": "oct",
|
||||
"nov": "nov",
|
||||
"dec": "déc",
|
||||
|
||||
"quick_links_heading": "Liens rapides",
|
||||
"add_quick_link": "Ajouter un lien rapide",
|
||||
"adding": "Ajout en cours",
|
||||
"quick_link": "Lien rapide",
|
||||
"display_title": "Titre d'affichage",
|
||||
"quick_link_title_placeholder": "Comment voulez-vous voir ce lien",
|
||||
"quick_link_url_placeholder": "Tapez ou collez une URL",
|
||||
"optional": "Optionnel",
|
||||
"show_less": "Afficher moins",
|
||||
"show_more": "Afficher plus",
|
||||
"show_all": "Tout afficher",
|
||||
"stickies_heading": "Mes notes adhésives",
|
||||
"sticky_placeholder": "Cliquez pour écrire ici",
|
||||
"add_sticky": "Ajouter une note adhésive",
|
||||
"all_items": "Tous les éléments",
|
||||
"recents": "Récents",
|
||||
"url": "URL",
|
||||
"star_on_github": "Ajoutez-nous une étoile sur GitHub"
|
||||
|
||||
}
|
||||
|
||||
@@ -316,5 +316,67 @@
|
||||
"remove_parent_issue": "親問題を削除",
|
||||
"add_parent": "親問題を追加",
|
||||
"loading_members": "メンバーを読み込んでいます...",
|
||||
"inbox": "受信箱"
|
||||
"inbox": "受信箱",
|
||||
|
||||
"manage_widgets": "ウィジェットを管理",
|
||||
"morning": "朝",
|
||||
"afternoon": "午後",
|
||||
"evening": "夕方",
|
||||
"good": "良い",
|
||||
"Monday": "月曜日",
|
||||
"Tuesday": "火曜日",
|
||||
"Wednesday": "水曜日",
|
||||
"Thursday": "木曜日",
|
||||
"Friday": "金曜日",
|
||||
"Saturday": "土曜日",
|
||||
"Sunday": "日曜日",
|
||||
"monday": "月曜日",
|
||||
"tuesday": "火曜日",
|
||||
"wednesday": "水曜日",
|
||||
"thursday": "木曜日",
|
||||
"friday": "金曜日",
|
||||
"saturday": "土曜日",
|
||||
"sunday": "日曜日",
|
||||
"january": "1月",
|
||||
"february": "2月",
|
||||
"march": "3月",
|
||||
"april": "4月",
|
||||
"may": "5月",
|
||||
"june": "6月",
|
||||
"july": "7月",
|
||||
"august": "8月",
|
||||
"september": "9月",
|
||||
"october": "10月",
|
||||
"november": "11月",
|
||||
"december": "12月",
|
||||
"jan": "1月",
|
||||
"feb": "2月",
|
||||
"mar": "3月",
|
||||
"apr": "4月",
|
||||
"jun": "6月",
|
||||
"jul": "7月",
|
||||
"aug": "8月",
|
||||
"sept": "9月",
|
||||
"oct": "10月",
|
||||
"nov": "11月",
|
||||
"dec": "12月",
|
||||
|
||||
"quick_links_heading": "クイックリンク",
|
||||
"add_quick_link": "クイックリンクを追加",
|
||||
"adding": "追加中",
|
||||
"quick_link": "クイックリンク",
|
||||
"display_title": "表示タイトル",
|
||||
"quick_link_title_placeholder": "このリンクをどのように表示したいか",
|
||||
"quick_link_url_placeholder": "URLを入力または貼り付け",
|
||||
"optional": "任意",
|
||||
"show_less": "表示を減らす",
|
||||
"show_more": "もっと表示",
|
||||
"show_all": "すべて表示",
|
||||
"stickies_heading": "私の付箋",
|
||||
"sticky_placeholder": "ここをクリックして入力",
|
||||
"add_sticky": "付箋を追加",
|
||||
"all_items": "すべてのアイテム",
|
||||
"recents": "最近",
|
||||
"url": "URL",
|
||||
"star_on_github": "GitHubでスターをつける"
|
||||
}
|
||||
|
||||
2
packages/types/src/home.d.ts
vendored
2
packages/types/src/home.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
import { TLogoProps } from "./common";
|
||||
import { TIssuePriorities } from "./issues";
|
||||
|
||||
export type TRecentActivityFilterKeys = "all item" | "issue" | "page" | "project";
|
||||
export type TRecentActivityFilterKeys = "all_item" | "issue" | "page" | "project";
|
||||
export type THomeWidgetKeys = "quick_links" | "recents" | "my_stickies" | "quick_tutorial" | "new_at_plane";
|
||||
|
||||
export type THomeWidgetProps = {
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Home } from "lucide-react";
|
||||
import githubBlackImage from "/public/logos/github-black.png";
|
||||
import githubWhiteImage from "/public/logos/github-white.png";
|
||||
// ui
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { Breadcrumbs, Header } from "@plane/ui";
|
||||
// components
|
||||
import { BreadcrumbLink } from "@/components/common";
|
||||
@@ -19,6 +20,7 @@ export const WorkspaceDashboardHeader = () => {
|
||||
// hooks
|
||||
const { captureEvent } = useEventTracker();
|
||||
const { resolvedTheme } = useTheme();
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -28,7 +30,7 @@ export const WorkspaceDashboardHeader = () => {
|
||||
<Breadcrumbs>
|
||||
<Breadcrumbs.BreadcrumbItem
|
||||
type="text"
|
||||
link={<BreadcrumbLink label="Home" icon={<Home className="h-4 w-4 text-custom-text-300" />} />}
|
||||
link={<BreadcrumbLink label={t("home")} icon={<Home className="h-4 w-4 text-custom-text-300" />} />}
|
||||
/>
|
||||
</Breadcrumbs>
|
||||
</div>
|
||||
@@ -51,7 +53,7 @@ export const WorkspaceDashboardHeader = () => {
|
||||
width={16}
|
||||
alt="GitHub Logo"
|
||||
/>
|
||||
<span className="hidden text-xs font-medium sm:hidden md:block">Star us on GitHub</span>
|
||||
<span className="hidden text-xs font-medium sm:hidden md:block">{t("star_on_github")}</span>
|
||||
</a>
|
||||
</Header.RightItem>
|
||||
</Header>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ReactNode, useEffect, useRef, useState } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { cn } from "@plane/utils";
|
||||
|
||||
interface IContentOverflowWrapper {
|
||||
@@ -29,6 +30,7 @@ export const ContentOverflowWrapper = observer((props: IContentOverflowWrapper)
|
||||
const contentRef = useRef<HTMLDivElement>(null);
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const { t } = useTranslation();
|
||||
useEffect(() => {
|
||||
if (!contentRef?.current) return;
|
||||
|
||||
@@ -139,7 +141,7 @@ export const ContentOverflowWrapper = observer((props: IContentOverflowWrapper)
|
||||
onClick={handleToggle}
|
||||
disabled={isTransitioning}
|
||||
>
|
||||
{showAll ? "Show less" : "Show all"}
|
||||
{showAll ? t("show_less") : t("show_all")}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { FC } from "react";
|
||||
// hooks
|
||||
import { Shapes } from "lucide-react";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { IUser } from "@plane/types";
|
||||
import { useCurrentTime } from "@/hooks/use-current-time";
|
||||
// types
|
||||
@@ -14,17 +15,13 @@ export const UserGreetingsView: FC<IUserGreetingsView> = (props) => {
|
||||
const { user, handleWidgetModal } = props;
|
||||
// current time hook
|
||||
const { currentTime } = useCurrentTime();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const hour = new Intl.DateTimeFormat("en-US", {
|
||||
hour12: false,
|
||||
hour: "numeric",
|
||||
}).format(currentTime);
|
||||
|
||||
const date = new Intl.DateTimeFormat("en-US", {
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
}).format(currentTime);
|
||||
|
||||
const weekDay = new Intl.DateTimeFormat("en-US", {
|
||||
weekday: "long",
|
||||
}).format(currentTime);
|
||||
@@ -36,18 +33,26 @@ export const UserGreetingsView: FC<IUserGreetingsView> = (props) => {
|
||||
minute: "2-digit",
|
||||
}).format(currentTime);
|
||||
|
||||
const greeting = parseInt(hour, 10) < 12 ? "morning" : parseInt(hour, 10) < 18 ? "afternoon" : "evening";
|
||||
const month = new Intl.DateTimeFormat("en-US", {
|
||||
month: "short",
|
||||
}).format(currentTime);
|
||||
|
||||
const dateNumber = new Intl.DateTimeFormat("en-US", {
|
||||
day: "numeric",
|
||||
}).format(currentTime);
|
||||
|
||||
const greeting = parseInt(hour, 10) < 12 ? t("morning") : parseInt(hour, 10) < 18 ? t("afternoon") : t("evening");
|
||||
|
||||
return (
|
||||
<div className="flex justify-between">
|
||||
<div>
|
||||
<h3 className="text-xl font-semibold text-center">
|
||||
Good {greeting}, {user?.first_name} {user?.last_name}
|
||||
{t("good")} {greeting}, {user?.first_name} {user?.last_name}
|
||||
</h3>
|
||||
<h6 className="flex items-center gap-2 font-medium text-custom-text-400">
|
||||
<div>{greeting === "morning" ? "🌤️" : greeting === "afternoon" ? "🌥️" : "🌙️"}</div>
|
||||
<div>
|
||||
{weekDay}, {date} {timeString}
|
||||
{t(weekDay)}, {t(month.toLowerCase())} {dateNumber} {timeString}
|
||||
</div>
|
||||
</h6>
|
||||
</div>
|
||||
@@ -56,7 +61,7 @@ export const UserGreetingsView: FC<IUserGreetingsView> = (props) => {
|
||||
className="flex items-center gap-2 font-medium text-custom-text-300 justify-center border border-custom-border-200 rounded p-2 my-auto mb-0"
|
||||
>
|
||||
<Shapes size={16} />
|
||||
<div className="text-xs font-medium">Manage widgets</div>
|
||||
<div className="text-xs font-medium">{t("manage_widgets")}</div>
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -5,6 +5,7 @@ import { observer } from "mobx-react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
// plane types
|
||||
// plane ui
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { TLink, TLinkEditableFields } from "@plane/types";
|
||||
import { Button, Input, ModalCore } from "@plane/ui";
|
||||
import { TLinkOperations } from "./use-links";
|
||||
@@ -40,6 +41,7 @@ export const LinkCreateUpdateModal: FC<TLinkCreateEditModal> = observer((props)
|
||||
} = useForm<TLinkCreateFormFieldOptions>({
|
||||
defaultValues,
|
||||
});
|
||||
const { t } = useTranslation();
|
||||
|
||||
const onClose = () => {
|
||||
if (handleOnClose) handleOnClose();
|
||||
@@ -67,12 +69,12 @@ export const LinkCreateUpdateModal: FC<TLinkCreateEditModal> = observer((props)
|
||||
<form onSubmit={handleSubmit(handleFormSubmit)}>
|
||||
<div className="space-y-5 p-5">
|
||||
<h3 className="text-xl font-medium text-custom-text-200">
|
||||
{preloadedData?.id ? "Update" : "Add"} quick link
|
||||
{preloadedData?.id ? t("update") : t("add")} {t("quick_link")}
|
||||
</h3>
|
||||
<div className="mt-2 space-y-3">
|
||||
<div>
|
||||
<label htmlFor="url" className="mb-2 text-custom-text-200 text-base font-medium">
|
||||
URL
|
||||
<label htmlFor="url" className="mb-2 text-custom-text-200 text-base font-medium uppercase">
|
||||
{t("url")}
|
||||
</label>
|
||||
<Controller
|
||||
control={control}
|
||||
@@ -88,17 +90,17 @@ export const LinkCreateUpdateModal: FC<TLinkCreateEditModal> = observer((props)
|
||||
onChange={onChange}
|
||||
ref={ref}
|
||||
hasError={Boolean(errors.url)}
|
||||
placeholder="Type or paste a URL"
|
||||
placeholder={t("quick_link_url_placeholder")}
|
||||
className="w-full"
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
{errors.url && <span className="text-xs text-red-500">URL is invalid</span>}
|
||||
{errors.url && <span className="text-xs text-red-500">{t("url_is_invalid")}</span>}
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="title" className="mb-2 text-custom-text-200 text-base font-medium">
|
||||
Display title
|
||||
<span className="text-[10px] block">Optional</span>
|
||||
{t("display_title")}
|
||||
<span className="text-[10px] block">{t("optional")}</span>
|
||||
</label>
|
||||
<Controller
|
||||
control={control}
|
||||
@@ -111,7 +113,7 @@ export const LinkCreateUpdateModal: FC<TLinkCreateEditModal> = observer((props)
|
||||
onChange={onChange}
|
||||
ref={ref}
|
||||
hasError={Boolean(errors.title)}
|
||||
placeholder="What you'd like to see this link as"
|
||||
placeholder={t("quick_link_title_placeholder")}
|
||||
className="w-full"
|
||||
/>
|
||||
)}
|
||||
@@ -121,10 +123,11 @@ export const LinkCreateUpdateModal: FC<TLinkCreateEditModal> = observer((props)
|
||||
</div>
|
||||
<div className="px-5 py-4 flex items-center justify-end gap-2 border-t-[0.5px] border-custom-border-200">
|
||||
<Button variant="neutral-primary" size="sm" onClick={onClose}>
|
||||
Cancel
|
||||
{t("cancel")}
|
||||
</Button>
|
||||
<Button variant="primary" size="sm" type="submit" loading={isSubmitting}>
|
||||
{preloadedData?.id ? (isSubmitting ? "Updating" : "Update") : isSubmitting ? "Adding" : "Add"} quick link
|
||||
{preloadedData?.id ? (isSubmitting ? t("updating") : t("update")) : isSubmitting ? t("adding") : t("add")}
|
||||
{t("quick_link")}
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { observer } from "mobx-react";
|
||||
import useSWR from "swr";
|
||||
import { Plus } from "lucide-react";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { THomeWidgetProps } from "@plane/types";
|
||||
import { useHome } from "@/hooks/store/use-home";
|
||||
import { LinkCreateUpdateModal } from "./create-update-link-modal";
|
||||
@@ -13,6 +14,7 @@ export const DashboardQuickLinks = observer((props: THomeWidgetProps) => {
|
||||
const {
|
||||
quickLinks: { isLinkModalOpen, toggleLinkModal, linkData, setLinkData, fetchLinks },
|
||||
} = useHome();
|
||||
const { t } = useTranslation();
|
||||
|
||||
useSWR(
|
||||
workspaceSlug ? `HOME_LINKS_${workspaceSlug}` : null,
|
||||
@@ -34,14 +36,14 @@ export const DashboardQuickLinks = observer((props: THomeWidgetProps) => {
|
||||
/>
|
||||
<div className="mb-2">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<div className="text-base font-semibold text-custom-text-350">Quick links</div>
|
||||
<div className="text-base font-semibold text-custom-text-350">{t("quick_links_heading")}</div>
|
||||
<button
|
||||
onClick={() => {
|
||||
toggleLinkModal(true);
|
||||
}}
|
||||
className="flex gap-1 text-sm font-medium text-custom-primary-100 my-auto"
|
||||
>
|
||||
<Plus className="size-4 my-auto" /> <span>Add quick link</span>
|
||||
<Plus className="size-4 my-auto" /> <span>{t("add_quick_link")}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div className="flex flex-wrap w-full">
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { FC } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { ChevronDown } from "lucide-react";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { TRecentActivityFilterKeys } from "@plane/types";
|
||||
import { CustomMenu } from "@plane/ui";
|
||||
import { cn } from "@plane/utils";
|
||||
@@ -16,6 +17,7 @@ export type TFiltersDropdown = {
|
||||
|
||||
export const FiltersDropdown: FC<TFiltersDropdown> = observer((props) => {
|
||||
const { className, activeFilter, setActiveFilter, filters } = props;
|
||||
const { t } = useTranslation();
|
||||
|
||||
const DropdownOptions = () =>
|
||||
filters?.map((filter) => (
|
||||
@@ -27,7 +29,7 @@ export const FiltersDropdown: FC<TFiltersDropdown> = observer((props) => {
|
||||
}}
|
||||
>
|
||||
{filter.icon && <div>{filter.icon}</div>}
|
||||
<div className="truncate font-medium text-xs capitalize">{`${filter.name}s`}</div>
|
||||
<div className="truncate font-medium text-xs capitalize">{t(`${filter.name}s`)}</div>
|
||||
</CustomMenu.MenuItem>
|
||||
));
|
||||
|
||||
@@ -38,7 +40,7 @@ export const FiltersDropdown: FC<TFiltersDropdown> = observer((props) => {
|
||||
placement="bottom-start"
|
||||
customButton={
|
||||
<button className="flex hover:bg-custom-background-80 px-2 py-1 rounded gap-1 capitalize border border-custom-border-200">
|
||||
<span className="font-medium text-sm my-auto"> {activeFilter && `${activeFilter}s`}</span>
|
||||
<span className="font-medium text-sm my-auto"> {activeFilter && t(`${activeFilter}s`)}</span>
|
||||
<ChevronDown className={cn("size-3 my-auto text-custom-text-300 hover:text-custom-text-200 duration-300")} />
|
||||
</button>
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { observer } from "mobx-react";
|
||||
// types
|
||||
import useSWR from "swr";
|
||||
import { Briefcase, FileText } from "lucide-react";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { TActivityEntityData, THomeWidgetProps, TRecentActivityFilterKeys } from "@plane/types";
|
||||
// components
|
||||
import { LayersIcon } from "@plane/ui";
|
||||
@@ -22,7 +23,7 @@ import { RecentProject } from "./project";
|
||||
const WIDGET_KEY = EWidgetKeys.RECENT_ACTIVITY;
|
||||
const workspaceService = new WorkspaceService();
|
||||
const filters: { name: TRecentActivityFilterKeys; icon?: React.ReactNode }[] = [
|
||||
{ name: "all item" },
|
||||
{ name: "all_item" },
|
||||
{ name: "issue", icon: <LayersIcon className="w-4 h-4" /> },
|
||||
{ name: "page", icon: <FileText size={16} /> },
|
||||
{ name: "project", icon: <Briefcase size={16} /> },
|
||||
@@ -35,6 +36,7 @@ export const RecentActivityWidget: React.FC<THomeWidgetProps> = observer((props)
|
||||
// ref
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
const { joinedProjectIds, loader } = useProject();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data: recents, isLoading } = useSWR(
|
||||
workspaceSlug ? `WORKSPACE_RECENT_ACTIVITY_${workspaceSlug}_${filter}` : null,
|
||||
@@ -70,7 +72,7 @@ export const RecentActivityWidget: React.FC<THomeWidgetProps> = observer((props)
|
||||
return (
|
||||
<div ref={ref} className=" max-h-[500px] overflow-y-scroll">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<div className="text-base font-semibold text-custom-text-350">Recents</div>
|
||||
<div className="text-base font-semibold text-custom-text-350 capitalize">{t("recents")}</div>
|
||||
<FiltersDropdown filters={filters} activeFilter={filter} setActiveFilter={setFilter} />
|
||||
</div>
|
||||
<div className="flex flex-col items-center justify-center">
|
||||
@@ -87,7 +89,7 @@ export const RecentActivityWidget: React.FC<THomeWidgetProps> = observer((props)
|
||||
buttonClassName="bg-custom-background-90/20"
|
||||
>
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<div className="text-base font-semibold text-custom-text-350">Recents</div>
|
||||
<div className="text-base font-semibold text-custom-text-350 capitalize">{t("recents")}</div>
|
||||
|
||||
<FiltersDropdown filters={filters} activeFilter={filter} setActiveFilter={setFilter} />
|
||||
</div>
|
||||
|
||||
@@ -53,7 +53,7 @@ export const StickySearch: FC = observer(() => {
|
||||
<input
|
||||
ref={inputRef}
|
||||
className="w-full max-w-[234px] border-none bg-transparent text-sm text-custom-text-100 placeholder:text-custom-text-400 focus:outline-none"
|
||||
placeholder="Search by title"
|
||||
placeholder=""
|
||||
value={searchQuery}
|
||||
onChange={(e) => updateSearchQuery(e.target.value)}
|
||||
onKeyDown={handleInputKeyDown}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef } from "react";
|
||||
import { DebouncedFunc } from "lodash";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { EditorRefApi } from "@plane/editor";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { TSticky } from "@plane/types";
|
||||
import { TextArea } from "@plane/ui";
|
||||
import { useWorkspace } from "@/hooks/store";
|
||||
@@ -21,6 +22,7 @@ export const StickyInput = (props: TProps) => {
|
||||
const editorRef = useRef<EditorRefApi>(null);
|
||||
// store hooks
|
||||
const { getWorkspaceBySlug } = useWorkspace();
|
||||
const { t } = useTranslation();
|
||||
// form info
|
||||
const { handleSubmit, reset, control } = useForm<TSticky>({
|
||||
defaultValues: {
|
||||
@@ -93,7 +95,7 @@ export const StickyInput = (props: TProps) => {
|
||||
onChange(description_html);
|
||||
handleSubmit(handleFormSubmit)();
|
||||
}}
|
||||
placeholder={"Click to type here"}
|
||||
placeholder={t("sticky_placeholder")}
|
||||
containerClassName={"px-0 text-base min-h-[200px] w-full text-[#455068]"}
|
||||
uploadFile={async () => ""}
|
||||
showToolbar={false}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useParams } from "next/navigation";
|
||||
import { Plus } from "lucide-react";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { useSticky } from "@/hooks/use-stickies";
|
||||
import { STICKY_COLORS } from "../editor/sticky-editor/color-pallete";
|
||||
import { StickySearch } from "./modal/search";
|
||||
@@ -10,10 +11,11 @@ export const StickiesWidget = () => {
|
||||
const { workspaceSlug } = useParams();
|
||||
const { creatingSticky, toggleShowNewSticky } = useSticky();
|
||||
const { stickyOperations } = useStickyOperations({ workspaceSlug: workspaceSlug?.toString() });
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div>
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<div className="text-base font-semibold text-custom-text-350">My Stickies </div>
|
||||
<div className="text-base font-semibold text-custom-text-350"> {t("stickies_heading")}</div>
|
||||
{/* actions */}
|
||||
<div className="flex gap-2">
|
||||
<StickySearch />
|
||||
@@ -25,7 +27,7 @@ export const StickiesWidget = () => {
|
||||
className="flex gap-1 text-sm font-medium text-custom-primary-100 my-auto"
|
||||
disabled={creatingSticky}
|
||||
>
|
||||
<Plus className="size-4 my-auto" /> <span>Add sticky</span>
|
||||
<Plus className="size-4 my-auto" /> <span>{t("add_sticky")}</span>
|
||||
{creatingSticky && (
|
||||
<div className="flex items-center justify-center ml-2">
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user