Merge branch 'develop' of github.com:makeplane/plane into develop

This commit is contained in:
sriram veeraghanta 2024-03-06 19:52:46 +05:30
commit 466f69a0b9
2 changed files with 45 additions and 62 deletions

View File

@ -1,6 +1,5 @@
import React from "react";
import { observer } from "mobx-react-lite";
import { useRouter } from "next/router";
// components
import { ISSUE_DISPLAY_PROPERTIES } from "constants/issue";
import { IIssueDisplayProperties } from "@plane/types";
@ -14,19 +13,10 @@ type Props = {
};
export const FilterDisplayProperties: React.FC<Props> = observer((props) => {
const router = useRouter();
const { moduleId, cycleId } = router.query;
const { displayProperties, handleUpdate } = props;
const [previewEnabled, setPreviewEnabled] = React.useState(true);
const handleDisplayPropertyVisibility = (key: keyof IIssueDisplayProperties): boolean => {
const visibility = true;
if (key === "modules" && moduleId) return false;
if (key === "cycle" && cycleId) return false;
return visibility;
};
return (
<>
<FilterHeader
@ -36,9 +26,7 @@ export const FilterDisplayProperties: React.FC<Props> = observer((props) => {
/>
{previewEnabled && (
<div className="mt-1 flex flex-wrap items-center gap-2">
{ISSUE_DISPLAY_PROPERTIES.map(
(displayProperty) =>
handleDisplayPropertyVisibility(displayProperty?.key) && (
{ISSUE_DISPLAY_PROPERTIES.map((displayProperty) => (
<button
key={displayProperty.key}
type="button"
@ -55,8 +43,7 @@ export const FilterDisplayProperties: React.FC<Props> = observer((props) => {
>
{displayProperty.title}
</button>
)
)}
))}
</div>
)}
</>

View File

@ -52,7 +52,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
const { getStateById } = useProjectState();
// router
const router = useRouter();
const { workspaceSlug, cycleId, moduleId } = router.query;
const { workspaceSlug } = router.query;
const currentLayout = `${activeLayout} layout`;
// derived values
const stateDetails = getStateById(issue.state_id);
@ -328,7 +328,6 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
</WithDisplayPropertiesHOC>
{/* modules */}
{moduleId === undefined && (
<WithDisplayPropertiesHOC displayProperties={displayProperties} displayPropertyKey="modules">
<div className="h-5">
<ModuleDropdown
@ -343,10 +342,8 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
/>
</div>
</WithDisplayPropertiesHOC>
)}
{/* cycles */}
{cycleId === undefined && (
<WithDisplayPropertiesHOC displayProperties={displayProperties} displayPropertyKey="cycle">
<div className="h-5 truncate">
<CycleDropdown
@ -359,7 +356,6 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
/>
</div>
</WithDisplayPropertiesHOC>
)}
{/* estimates */}
{areEstimatesEnabledForCurrentProject && (