[WEB-5271] fix: empty state translation error and code refactoring (#8027)
* fix: workspace view empty state translation * chore: search empty state translation fix * chore: workspace view empty state translation
This commit is contained in:
parent
79537cd1df
commit
0560849f88
5 changed files with 16 additions and 15 deletions
|
|
@ -38,7 +38,7 @@ export const ProjectArchivedEmptyState: React.FC = observer(() => {
|
||||||
description={t("common_empty_state.search.description")}
|
description={t("common_empty_state.search.description")}
|
||||||
actions={[
|
actions={[
|
||||||
{
|
{
|
||||||
label: t("common.search.cta_secondary"),
|
label: "Clear filters",
|
||||||
onClick: archivedWorkItemFilter?.clearFilters,
|
onClick: archivedWorkItemFilter?.clearFilters,
|
||||||
disabled: !canPerformEmptyStateActions || !archivedWorkItemFilter,
|
disabled: !canPerformEmptyStateActions || !archivedWorkItemFilter,
|
||||||
variant: "outline-primary",
|
variant: "outline-primary",
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ export const CycleEmptyState: React.FC = observer(() => {
|
||||||
description={t("common_empty_state.search.description")}
|
description={t("common_empty_state.search.description")}
|
||||||
actions={[
|
actions={[
|
||||||
{
|
{
|
||||||
label: t("common_empty_state.search.cta_secondary"),
|
label: "Clear filters",
|
||||||
onClick: cycleWorkItemFilter?.clearFilters,
|
onClick: cycleWorkItemFilter?.clearFilters,
|
||||||
disabled: !canPerformEmptyStateActions || !cycleWorkItemFilter,
|
disabled: !canPerformEmptyStateActions || !cycleWorkItemFilter,
|
||||||
variant: "outline-primary",
|
variant: "outline-primary",
|
||||||
|
|
|
||||||
|
|
@ -47,13 +47,13 @@ export const GlobalViewEmptyState: React.FC = observer(() => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EmptyStateDetailed
|
<EmptyStateDetailed
|
||||||
title={t(`workspace.views.title`)}
|
title={t(`workspace_empty_state.views.title`)}
|
||||||
description={t(`workspace.views.description`)}
|
description={t(`workspace_empty_state.views.description`)}
|
||||||
assetKey="project"
|
assetKey="project"
|
||||||
assetClassName="size-40"
|
assetClassName="size-40"
|
||||||
actions={[
|
actions={[
|
||||||
{
|
{
|
||||||
label: t(`workspace.views.cta_primary`),
|
label: t(`workspace_empty_state.views.cta_primary`),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.EMPTY_STATE_ADD_BUTTON.GLOBAL_VIEW });
|
captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.EMPTY_STATE_ADD_BUTTON.GLOBAL_VIEW });
|
||||||
toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);
|
toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ export const ModuleEmptyState: React.FC = observer(() => {
|
||||||
description={t("common_empty_state.search.description")}
|
description={t("common_empty_state.search.description")}
|
||||||
actions={[
|
actions={[
|
||||||
{
|
{
|
||||||
label: t("common_empty_state.search.cta_secondary"),
|
label: "Clear filters",
|
||||||
onClick: moduleWorkItemFilter?.clearFilters,
|
onClick: moduleWorkItemFilter?.clearFilters,
|
||||||
disabled: !canPerformEmptyStateActions || !moduleWorkItemFilter,
|
disabled: !canPerformEmptyStateActions || !moduleWorkItemFilter,
|
||||||
variant: "outline-primary",
|
variant: "outline-primary",
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ import { useParams, useSearchParams } from "next/navigation";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
// plane imports
|
// plane imports
|
||||||
import { GLOBAL_VIEW_TRACKER_ELEMENTS, ISSUE_DISPLAY_FILTERS_BY_PAGE } from "@plane/constants";
|
import { GLOBAL_VIEW_TRACKER_ELEMENTS, ISSUE_DISPLAY_FILTERS_BY_PAGE } from "@plane/constants";
|
||||||
|
import { EmptyStateDetailed } from "@plane/propel/empty-state";
|
||||||
import type { EIssueLayoutTypes } from "@plane/types";
|
import type { EIssueLayoutTypes } from "@plane/types";
|
||||||
import { EIssuesStoreType, STATIC_VIEW_TYPES } from "@plane/types";
|
import { EIssuesStoreType, STATIC_VIEW_TYPES } from "@plane/types";
|
||||||
// components
|
// components
|
||||||
import { EmptyState } from "@/components/common/empty-state";
|
|
||||||
import { IssuePeekOverview } from "@/components/issues/peek-overview";
|
import { IssuePeekOverview } from "@/components/issues/peek-overview";
|
||||||
import { WorkspaceActiveLayout } from "@/components/views/helper";
|
import { WorkspaceActiveLayout } from "@/components/views/helper";
|
||||||
import { WorkspaceLevelWorkItemFiltersHOC } from "@/components/work-item-filters/filters-hoc/workspace-level";
|
import { WorkspaceLevelWorkItemFiltersHOC } from "@/components/work-item-filters/filters-hoc/workspace-level";
|
||||||
|
|
@ -18,8 +18,6 @@ import { useIssues } from "@/hooks/store/use-issues";
|
||||||
import { useAppRouter } from "@/hooks/use-app-router";
|
import { useAppRouter } from "@/hooks/use-app-router";
|
||||||
import { IssuesStoreContext } from "@/hooks/use-issue-layout-store";
|
import { IssuesStoreContext } from "@/hooks/use-issue-layout-store";
|
||||||
import { useWorkspaceIssueProperties } from "@/hooks/use-workspace-issue-properties";
|
import { useWorkspaceIssueProperties } from "@/hooks/use-workspace-issue-properties";
|
||||||
// public imports
|
|
||||||
import emptyView from "@/public/empty-state/view.svg";
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
isDefaultView: boolean;
|
isDefaultView: boolean;
|
||||||
|
|
@ -109,14 +107,17 @@ export const AllIssueLayoutRoot: React.FC<Props> = observer((props: Props) => {
|
||||||
// Empty state
|
// Empty state
|
||||||
if (!isLoading && !globalViewsLoading && !issuesLoading && !viewDetails && !isDefaultView) {
|
if (!isLoading && !globalViewsLoading && !issuesLoading && !viewDetails && !isDefaultView) {
|
||||||
return (
|
return (
|
||||||
<EmptyState
|
<EmptyStateDetailed
|
||||||
image={emptyView}
|
|
||||||
title="View does not exist"
|
title="View does not exist"
|
||||||
description="The view you are looking for does not exist or you don't have permission to view it."
|
description="The view you are looking for does not exist or you don't have permission to view it."
|
||||||
primaryButton={{
|
assetKey="view"
|
||||||
text: "Go to All work items",
|
actions={[
|
||||||
|
{
|
||||||
|
label: "Go to All work items",
|
||||||
onClick: () => router.push(`/${workspaceSlug}/workspace-views/all-issues`),
|
onClick: () => router.push(`/${workspaceSlug}/workspace-views/all-issues`),
|
||||||
}}
|
variant: "primary",
|
||||||
|
},
|
||||||
|
]}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue