diff --git a/packages/i18n/src/locales/en/translations.json b/packages/i18n/src/locales/en/translations.json index 8de6eeaac4..be2b4f2ad9 100644 --- a/packages/i18n/src/locales/en/translations.json +++ b/packages/i18n/src/locales/en/translations.json @@ -675,6 +675,16 @@ "disconnecting": "Disconnecting", "installing": "Installing", "install": "Install", + "reset": "Reset", + "live": "Live", + "change_history": "Change History", + "coming_soon": "Coming soon", + "members": "Members", + "you": "You", + "upgrade_cta": { + "higher_subscription": "Upgrade to higher subscription", + "talk_to_sales": "Talk to sales" + }, "category": "Category", "categories": "Categories", "saving": "Saving", diff --git a/packages/i18n/src/locales/es/translations.json b/packages/i18n/src/locales/es/translations.json index 587a90162a..b4c815332d 100644 --- a/packages/i18n/src/locales/es/translations.json +++ b/packages/i18n/src/locales/es/translations.json @@ -847,6 +847,16 @@ "disconnecting": "Desconectando", "installing": "Instalando", "install": "Instalar", + "reset": "Reiniciar", + "live": "En vivo", + "change_history": "Historial de cambios", + "coming_soon": "Próximamente", + "members": "Miembros", + "you": "Tú", + "upgrade_cta": { + "higher_subscription": "Mejorar a una suscripción más alta", + "talk_to_sales": "Hablar con ventas" + }, "category": "Categoría", "categories": "Categorías", "saving": "Guardando", diff --git a/packages/i18n/src/locales/fr/translations.json b/packages/i18n/src/locales/fr/translations.json index f78a4865df..e43e369701 100644 --- a/packages/i18n/src/locales/fr/translations.json +++ b/packages/i18n/src/locales/fr/translations.json @@ -845,6 +845,16 @@ "disconnecting": "Déconnexion", "installing": "Installation", "install": "Installer", + "reset": "Réinitialiser", + "live": "En direct", + "change_history": "Historique des modifications", + "coming_soon": "À venir", + "members": "Membres", + "you": "Vous", + "upgrade_cta": { + "higher_subscription": "Passer à une abonnement plus élevé", + "talk_to_sales": "Parler à la vente" + }, "category": "Catégorie", "categories": "Catégories", "saving": "Enregistrement", diff --git a/packages/i18n/src/locales/ja/translations.json b/packages/i18n/src/locales/ja/translations.json index 0612601ee3..5dd9240de1 100644 --- a/packages/i18n/src/locales/ja/translations.json +++ b/packages/i18n/src/locales/ja/translations.json @@ -845,6 +845,16 @@ "disconnecting": "切断中", "installing": "インストール中", "install": "インストール", + "reset": "リセット", + "live": "ライブ", + "change_history": "変更履歴", + "coming_soon": "近日公開", + "members": "メンバー", + "you": "あなた", + "upgrade_cta": { + "higher_subscription": "高いサブスクリプションにアップグレード", + "talk_to_sales": "セールスに連絡" + }, "category": "カテゴリー", "categories": "カテゴリーズ", "saving": "セービング", diff --git a/packages/i18n/src/locales/zh-CN/translations.json b/packages/i18n/src/locales/zh-CN/translations.json index 6ed9a3e330..e637809395 100644 --- a/packages/i18n/src/locales/zh-CN/translations.json +++ b/packages/i18n/src/locales/zh-CN/translations.json @@ -845,6 +845,16 @@ "disconnecting": "正在断开连接", "installing": "正在安装", "install": "安装", + "reset": "重置", + "live": "实时", + "change_history": "变更历史", + "coming_soon": "即将推出", + "members": "成员", + "you": "你", + "upgrade_cta": { + "higher_subscription": "升级到更高订阅", + "talk_to_sales": "联系销售" + }, "category": "类别", "categories": "类别", "saving": "保存中", diff --git a/packages/ui/src/tooltip/tooltip.tsx b/packages/ui/src/tooltip/tooltip.tsx index e485166ebc..d013414cdb 100644 --- a/packages/ui/src/tooltip/tooltip.tsx +++ b/packages/ui/src/tooltip/tooltip.tsx @@ -1,5 +1,5 @@ -import React, { useEffect, useRef, useState } from "react"; import { Tooltip2 } from "@blueprintjs/popover2"; +import React, { useEffect, useRef, useState } from "react"; // helpers import { cn } from "../../helpers"; @@ -23,7 +23,6 @@ export type TPosition = interface ITooltipProps { tooltipHeading?: string; tooltipContent: string | React.ReactNode; - jsxContent?: string | React.ReactNode; position?: TPosition; children: JSX.Element; disabled?: boolean; @@ -39,14 +38,13 @@ export const Tooltip: React.FC = ({ tooltipContent, position = "top", children, - jsxContent, disabled = false, className = "", openDelay = 200, closeDelay, isMobile = false, renderByDefault = true, //FIXME: tooltip should always render on hover and not by default, this is a temporary fix -}: ITooltipProps) => { +}) => { const toolTipRef = useRef(null); const [shouldRender, setShouldRender] = useState(renderByDefault); @@ -81,22 +79,18 @@ export const Tooltip: React.FC = ({ hoverOpenDelay={openDelay} hoverCloseDelay={closeDelay} content={ - jsxContent ? ( - <>{jsxContent} - ) : ( -
- {tooltipHeading &&
{tooltipHeading}
} - {tooltipContent} -
- ) +
+ {tooltipHeading &&
{tooltipHeading}
} + {tooltipContent} +
} position={position} renderTarget={({ diff --git a/web/ce/components/command-palette/actions/index.ts b/web/ce/components/command-palette/actions/index.ts new file mode 100644 index 0000000000..c7f1e122d1 --- /dev/null +++ b/web/ce/components/command-palette/actions/index.ts @@ -0,0 +1 @@ +export * from "./work-item-actions"; diff --git a/web/ce/components/command-palette/actions/work-item-actions/change-state-list.tsx b/web/ce/components/command-palette/actions/work-item-actions/change-state-list.tsx new file mode 100644 index 0000000000..9f59d226b3 --- /dev/null +++ b/web/ce/components/command-palette/actions/work-item-actions/change-state-list.tsx @@ -0,0 +1,43 @@ +import { Command } from "cmdk"; +import { observer } from "mobx-react"; +import { Check } from "lucide-react"; +// plane imports +import { Spinner, StateGroupIcon } from "@plane/ui"; +// store hooks +import { useProjectState } from "@/hooks/store"; + +export type TChangeWorkItemStateListProps = { + projectId: string | null; + currentStateId: string | null; + handleStateChange: (stateId: string) => void; +}; + +export const ChangeWorkItemStateList = observer((props: TChangeWorkItemStateListProps) => { + const { projectId, currentStateId, handleStateChange } = props; + // store hooks + const { getProjectStates } = useProjectState(); + // derived values + const projectStates = getProjectStates(projectId); + + return ( + <> + {projectStates ? ( + projectStates.length > 0 ? ( + projectStates.map((state) => ( + handleStateChange(state.id)} className="focus:outline-none"> +
+ +

{state.name}

+
+
{state.id === currentStateId && }
+
+ )) + ) : ( +
No states found
+ ) + ) : ( + + )} + + ); +}); diff --git a/web/ce/components/command-palette/actions/work-item-actions/index.ts b/web/ce/components/command-palette/actions/work-item-actions/index.ts new file mode 100644 index 0000000000..ac7f8aa866 --- /dev/null +++ b/web/ce/components/command-palette/actions/work-item-actions/index.ts @@ -0,0 +1 @@ +export * from "./change-state-list"; diff --git a/web/ce/components/workflow/add-state-transition.tsx b/web/ce/components/workflow/add-state-transition.tsx deleted file mode 100644 index a22769ba25..0000000000 --- a/web/ce/components/workflow/add-state-transition.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { Plus } from "lucide-react"; -// plane utils -import { cn } from "@plane/utils"; - -type Props = { - workspaceSlug: string; - projectId: string; - parentStateId: string; - onTransitionAdd?: () => void; -}; - -export const AddStateTransition = (props: Props) => ( -
- <> - - Add Transition -
Pro
- -
-); diff --git a/web/ce/components/workflow/index.tsx b/web/ce/components/workflow/index.ts similarity index 67% rename from web/ce/components/workflow/index.tsx rename to web/ce/components/workflow/index.ts index 3cf9d8d3f4..07b59ccc3f 100644 --- a/web/ce/components/workflow/index.tsx +++ b/web/ce/components/workflow/index.ts @@ -1,6 +1,5 @@ export * from "./state-option"; -export * from "./state-item-child"; -export * from "./state-transition-count"; export * from "./use-workflow-drag-n-drop"; export * from "./workflow-disabled-message"; export * from "./workflow-group-tree"; +export * from "./workflow-disabled-overlay"; diff --git a/web/ce/components/workflow/state-item-child.tsx b/web/ce/components/workflow/state-item-child.tsx deleted file mode 100644 index af686bbe57..0000000000 --- a/web/ce/components/workflow/state-item-child.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { SetStateAction } from "react"; -import { observer } from "mobx-react"; -// Plane -import { DISPLAY_WORKFLOW_PRO_CTA } from "@plane/constants"; -import { IState } from "@plane/types"; -// components -import { StateItemTitle } from "@/components/project-states/state-item-title"; -// constants -// -import { AddStateTransition } from "./add-state-transition"; - -export type StateItemChildProps = { - workspaceSlug: string; - projectId: string; - stateCount: number; - disabled: boolean; - state: IState; - setUpdateStateModal: (value: SetStateAction) => void; -}; - -export const StateItemChild = observer((props: StateItemChildProps) => { - const { workspaceSlug, projectId, stateCount, setUpdateStateModal, disabled, state } = props; - - return ( -
- - {DISPLAY_WORKFLOW_PRO_CTA && ( - - )} -
- ); -}); diff --git a/web/ce/components/workflow/state-option.tsx b/web/ce/components/workflow/state-option.tsx index aa9665d90b..c9bf24d61b 100644 --- a/web/ce/components/workflow/state-option.tsx +++ b/web/ce/components/workflow/state-option.tsx @@ -12,6 +12,7 @@ type Props = { filterAvailableStateIds: boolean; selectedValue: string | null | undefined; className?: string; + isForWorkItemCreation?: boolean; }; export const StateOption = observer((props: Props) => { diff --git a/web/ce/components/workflow/state-transition-count.tsx b/web/ce/components/workflow/state-transition-count.tsx deleted file mode 100644 index b9e4a22f9d..0000000000 --- a/web/ce/components/workflow/state-transition-count.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { IStateWorkFlow } from "@/plane-web/types"; - -type Props = { - currentTransitionMap?: IStateWorkFlow; -}; - -export const StateTransitionCount = (props: Props) => <>; diff --git a/web/ce/components/workflow/use-workflow-drag-n-drop.ts b/web/ce/components/workflow/use-workflow-drag-n-drop.ts index e4044d843b..f6117a0d80 100644 --- a/web/ce/components/workflow/use-workflow-drag-n-drop.ts +++ b/web/ce/components/workflow/use-workflow-drag-n-drop.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ import { TIssueGroupByOptions } from "@plane/types"; export const useWorkFlowFDragNDrop = ( @@ -6,6 +7,7 @@ export const useWorkFlowFDragNDrop = ( ) => ({ workflowDisabledSource: undefined, isWorkflowDropDisabled: false, + getIsWorkflowWorkItemCreationDisabled: (groupId: string, subGroupId?: string) => false, handleWorkFlowState: ( sourceGroupId: string, destinationGroupId: string, diff --git a/web/ce/components/workflow/workflow-disabled-message.tsx b/web/ce/components/workflow/workflow-disabled-message.tsx index bc2c2ee535..af3489556e 100644 --- a/web/ce/components/workflow/workflow-disabled-message.tsx +++ b/web/ce/components/workflow/workflow-disabled-message.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ type Props = { parentStateId: string; className?: string; diff --git a/web/ce/components/workflow/workflow-disabled-overlay.tsx b/web/ce/components/workflow/workflow-disabled-overlay.tsx new file mode 100644 index 0000000000..5ec69f432c --- /dev/null +++ b/web/ce/components/workflow/workflow-disabled-overlay.tsx @@ -0,0 +1,10 @@ +import { observer } from "mobx-react"; + +export type TWorkflowDisabledOverlayProps = { + messageContainerRef: React.RefObject; + workflowDisabledSource: string; + shouldOverlayBeVisible: boolean; +}; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export const WorkFlowDisabledOverlay = observer((props: TWorkflowDisabledOverlayProps) => <>); diff --git a/web/ce/components/workflow/workflow-group-tree.tsx b/web/ce/components/workflow/workflow-group-tree.tsx index 934db70f3c..5caed41705 100644 --- a/web/ce/components/workflow/workflow-group-tree.tsx +++ b/web/ce/components/workflow/workflow-group-tree.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ import { TIssueGroupByOptions } from "@plane/types"; type Props = { diff --git a/web/ce/hooks/use-workspace-issue-properties-extended.tsx b/web/ce/hooks/use-workspace-issue-properties-extended.tsx new file mode 100644 index 0000000000..6e9ba79f25 --- /dev/null +++ b/web/ce/hooks/use-workspace-issue-properties-extended.tsx @@ -0,0 +1,2 @@ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export const useWorkspaceIssuePropertiesExtended = (workspaceSlug: string | string[] | undefined) => {}; diff --git a/web/ce/types/index.ts b/web/ce/types/index.ts index d18d0137a5..105b7e96a4 100644 --- a/web/ce/types/index.ts +++ b/web/ce/types/index.ts @@ -1,4 +1,3 @@ export * from "./projects"; export * from "./issue-types"; export * from "./gantt-chart"; -export * from "./state.d"; diff --git a/web/ce/types/state.d.ts b/web/ce/types/state.d.ts deleted file mode 100644 index 22309db819..0000000000 --- a/web/ce/types/state.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface IStateTransition { - transition_state_id: string; - actors: string[]; -} - -export interface IStateWorkFlow { - [transitionId: string]: IStateTransition; -} diff --git a/web/core/components/command-palette/actions/issue-actions/change-state.tsx b/web/core/components/command-palette/actions/issue-actions/change-state.tsx index d848c2a767..154b578b9b 100644 --- a/web/core/components/command-palette/actions/issue-actions/change-state.tsx +++ b/web/core/components/command-palette/actions/issue-actions/change-state.tsx @@ -1,16 +1,13 @@ "use client"; -import { Command } from "cmdk"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; -// hooks -import { Check } from "lucide-react"; +// plane imports import { TIssue } from "@plane/types"; -import { Spinner, StateGroupIcon } from "@plane/ui"; -import { useProjectState, useIssueDetail } from "@/hooks/store"; -// ui -// icons -// types +// store hooks +import { useIssueDetail } from "@/hooks/store"; +// plane web imports +import { ChangeWorkItemStateList } from "@/plane-web/components/command-palette/actions/work-item-actions"; type Props = { closePalette: () => void; issue: TIssue }; @@ -20,10 +17,9 @@ export const ChangeIssueState: React.FC = observer((props) => { const { workspaceSlug } = useParams(); // store hooks const { updateIssue } = useIssueDetail(); - const { getProjectStates } = useProjectState(); // derived values const projectId = issue?.project_id; - const projectStates = getProjectStates(projectId); + const currentStateId = issue?.state_id; const submitChanges = async (formData: Partial) => { if (!workspaceSlug || !projectId || !issue) return; @@ -40,24 +36,10 @@ export const ChangeIssueState: React.FC = observer((props) => { }; return ( - <> - {projectStates ? ( - projectStates.length > 0 ? ( - projectStates.map((state) => ( - handleIssueState(state.id)} className="focus:outline-none"> -
- -

{state.name}

-
-
{state.id === issue.state_id && }
-
- )) - ) : ( -
No states found
- ) - ) : ( - - )} - + ); }); diff --git a/web/core/components/common/activity/activity-block.tsx b/web/core/components/common/activity/activity-block.tsx index 0f1c2429f4..61c1a0b7b4 100644 --- a/web/core/components/common/activity/activity-block.tsx +++ b/web/core/components/common/activity/activity-block.tsx @@ -29,15 +29,17 @@ export const ActivityBlockComponent: FC = (props) => { if (!activity) return <>; return (
{icon ? icon : }
-
- {children} +
+
+ {children} +
= observer((props) => { @@ -59,6 +60,7 @@ export const StateDropdown: React.FC = observer((props) => { renderByDefault = true, stateIds, filterAvailableStateIds = true, + isForWorkItemCreation = false, } = props; // states const [query, setQuery] = useState(""); @@ -98,7 +100,7 @@ export const StateDropdown: React.FC = observer((props) => { content: (
- {state?.name} + {state?.name}
), })); @@ -182,7 +184,7 @@ export const StateDropdown: React.FC = observer((props) => { /> )} {BUTTON_VARIANTS_WITH_TEXT.includes(buttonVariant) && ( - {selectedState?.name ?? t("state")} + {selectedState?.name ?? t("state")} )} {dropdownArrow && (
)} diff --git a/web/core/components/project-states/options/mark-as-default.tsx b/web/core/components/project-states/options/mark-as-default.tsx index 667b2063b4..d13700f299 100644 --- a/web/core/components/project-states/options/mark-as-default.tsx +++ b/web/core/components/project-states/options/mark-as-default.tsx @@ -32,7 +32,7 @@ export const StateMarksAsDefault: FC = observer((props) => return (