mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: issue and properties filter dropdown improvement (#4733)
This commit is contained in:
parent
17ce1bceb6
commit
de8da176d3
@ -156,6 +156,8 @@ export const CycleMobileHeader = () => {
|
|||||||
layoutDisplayFiltersOptions={
|
layoutDisplayFiltersOptions={
|
||||||
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
||||||
}
|
}
|
||||||
|
displayFilters={issueFilters?.displayFilters ?? {}}
|
||||||
|
handleDisplayFiltersUpdate={handleDisplayFilters}
|
||||||
labels={projectLabels}
|
labels={projectLabels}
|
||||||
memberIds={projectMemberIds ?? undefined}
|
memberIds={projectMemberIds ?? undefined}
|
||||||
states={projectStates}
|
states={projectStates}
|
||||||
|
@ -241,6 +241,8 @@ export const CycleIssuesHeader: React.FC = observer(() => {
|
|||||||
layoutDisplayFiltersOptions={
|
layoutDisplayFiltersOptions={
|
||||||
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
||||||
}
|
}
|
||||||
|
displayFilters={issueFilters?.displayFilters ?? {}}
|
||||||
|
handleDisplayFiltersUpdate={handleDisplayFilters}
|
||||||
labels={projectLabels}
|
labels={projectLabels}
|
||||||
memberIds={projectMemberIds ?? undefined}
|
memberIds={projectMemberIds ?? undefined}
|
||||||
states={projectStates}
|
states={projectStates}
|
||||||
|
@ -117,6 +117,8 @@ export const GlobalIssuesHeader: React.FC = observer(() => {
|
|||||||
layoutDisplayFiltersOptions={ISSUE_DISPLAY_FILTERS_BY_LAYOUT.my_issues.spreadsheet}
|
layoutDisplayFiltersOptions={ISSUE_DISPLAY_FILTERS_BY_LAYOUT.my_issues.spreadsheet}
|
||||||
filters={issueFilters?.filters ?? {}}
|
filters={issueFilters?.filters ?? {}}
|
||||||
handleFiltersUpdate={handleFiltersUpdate}
|
handleFiltersUpdate={handleFiltersUpdate}
|
||||||
|
displayFilters={issueFilters?.displayFilters ?? {}}
|
||||||
|
handleDisplayFiltersUpdate={handleDisplayFilters}
|
||||||
labels={workspaceLabels ?? undefined}
|
labels={workspaceLabels ?? undefined}
|
||||||
memberIds={workspaceMemberIds ?? undefined}
|
memberIds={workspaceMemberIds ?? undefined}
|
||||||
/>
|
/>
|
||||||
|
@ -239,6 +239,8 @@ export const ModuleIssuesHeader: React.FC = observer(() => {
|
|||||||
<FilterSelection
|
<FilterSelection
|
||||||
filters={issueFilters?.filters ?? {}}
|
filters={issueFilters?.filters ?? {}}
|
||||||
handleFiltersUpdate={handleFiltersUpdate}
|
handleFiltersUpdate={handleFiltersUpdate}
|
||||||
|
displayFilters={issueFilters?.displayFilters ?? {}}
|
||||||
|
handleDisplayFiltersUpdate={handleDisplayFilters}
|
||||||
layoutDisplayFiltersOptions={
|
layoutDisplayFiltersOptions={
|
||||||
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
||||||
}
|
}
|
||||||
|
@ -138,6 +138,8 @@ export const ProjectDraftIssueHeader: FC = observer(() => {
|
|||||||
<FilterSelection
|
<FilterSelection
|
||||||
filters={issueFilters?.filters ?? {}}
|
filters={issueFilters?.filters ?? {}}
|
||||||
handleFiltersUpdate={handleFiltersUpdate}
|
handleFiltersUpdate={handleFiltersUpdate}
|
||||||
|
displayFilters={issueFilters?.displayFilters ?? {}}
|
||||||
|
handleDisplayFiltersUpdate={handleDisplayFilters}
|
||||||
layoutDisplayFiltersOptions={
|
layoutDisplayFiltersOptions={
|
||||||
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
||||||
}
|
}
|
||||||
|
@ -182,6 +182,8 @@ export const ProjectIssuesHeader: React.FC = observer(() => {
|
|||||||
<FilterSelection
|
<FilterSelection
|
||||||
filters={issueFilters?.filters ?? {}}
|
filters={issueFilters?.filters ?? {}}
|
||||||
handleFiltersUpdate={handleFiltersUpdate}
|
handleFiltersUpdate={handleFiltersUpdate}
|
||||||
|
displayFilters={issueFilters?.displayFilters ?? {}}
|
||||||
|
handleDisplayFiltersUpdate={handleDisplayFilters}
|
||||||
layoutDisplayFiltersOptions={
|
layoutDisplayFiltersOptions={
|
||||||
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
||||||
}
|
}
|
||||||
|
@ -216,6 +216,8 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => {
|
|||||||
<FilterSelection
|
<FilterSelection
|
||||||
filters={issueFilters?.filters ?? {}}
|
filters={issueFilters?.filters ?? {}}
|
||||||
handleFiltersUpdate={handleFiltersUpdate}
|
handleFiltersUpdate={handleFiltersUpdate}
|
||||||
|
displayFilters={issueFilters?.displayFilters ?? {}}
|
||||||
|
handleDisplayFiltersUpdate={handleDisplayFilters}
|
||||||
layoutDisplayFiltersOptions={
|
layoutDisplayFiltersOptions={
|
||||||
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,8 @@ export const ArchivedIssuesHeader: FC = observer(() => {
|
|||||||
<FilterSelection
|
<FilterSelection
|
||||||
filters={issueFilters?.filters || {}}
|
filters={issueFilters?.filters || {}}
|
||||||
handleFiltersUpdate={handleFiltersUpdate}
|
handleFiltersUpdate={handleFiltersUpdate}
|
||||||
|
displayFilters={issueFilters?.displayFilters ?? {}}
|
||||||
|
handleDisplayFiltersUpdate={handleDisplayFiltersUpdate}
|
||||||
layoutDisplayFiltersOptions={
|
layoutDisplayFiltersOptions={
|
||||||
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.archived_issues[activeLayout] : undefined
|
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.archived_issues[activeLayout] : undefined
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
FilterDisplayProperties,
|
FilterDisplayProperties,
|
||||||
FilterExtraOptions,
|
FilterExtraOptions,
|
||||||
FilterGroupBy,
|
FilterGroupBy,
|
||||||
FilterIssueType,
|
|
||||||
FilterOrderBy,
|
FilterOrderBy,
|
||||||
FilterSubGroupBy,
|
FilterSubGroupBy,
|
||||||
} from "@/components/issues";
|
} from "@/components/issues";
|
||||||
@ -111,20 +110,6 @@ export const DisplayFiltersSelection: React.FC<Props> = observer((props) => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* issue type */}
|
|
||||||
{isDisplayFilterEnabled("type") && (
|
|
||||||
<div className="py-2">
|
|
||||||
<FilterIssueType
|
|
||||||
selectedIssueType={displayFilters?.type}
|
|
||||||
handleUpdate={(val) =>
|
|
||||||
handleDisplayFiltersUpdate({
|
|
||||||
type: val,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Options */}
|
{/* Options */}
|
||||||
{layoutDisplayFiltersOptions?.extra_options.access && (
|
{layoutDisplayFiltersOptions?.extra_options.access && (
|
||||||
<div className="py-2">
|
<div className="py-2">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { Search, X } from "lucide-react";
|
import { Search, X } from "lucide-react";
|
||||||
import { IIssueFilterOptions, IIssueLabel, IState } from "@plane/types";
|
import { IIssueDisplayFilterOptions, IIssueFilterOptions, IIssueLabel, IState } from "@plane/types";
|
||||||
// hooks
|
// hooks
|
||||||
import {
|
import {
|
||||||
FilterAssignees,
|
FilterAssignees,
|
||||||
@ -16,6 +16,7 @@ import {
|
|||||||
FilterTargetDate,
|
FilterTargetDate,
|
||||||
FilterCycle,
|
FilterCycle,
|
||||||
FilterModule,
|
FilterModule,
|
||||||
|
FilterIssueType,
|
||||||
} from "@/components/issues";
|
} from "@/components/issues";
|
||||||
import { ILayoutDisplayFiltersOptions } from "@/constants/issue";
|
import { ILayoutDisplayFiltersOptions } from "@/constants/issue";
|
||||||
import { useAppRouter } from "@/hooks/store";
|
import { useAppRouter } from "@/hooks/store";
|
||||||
@ -25,6 +26,8 @@ import { useAppRouter } from "@/hooks/store";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
filters: IIssueFilterOptions;
|
filters: IIssueFilterOptions;
|
||||||
|
displayFilters?: IIssueDisplayFilterOptions | undefined;
|
||||||
|
handleDisplayFiltersUpdate?: (updatedDisplayFilter: Partial<IIssueDisplayFilterOptions>) => void;
|
||||||
handleFiltersUpdate: (key: keyof IIssueFilterOptions, value: string | string[]) => void;
|
handleFiltersUpdate: (key: keyof IIssueFilterOptions, value: string | string[]) => void;
|
||||||
layoutDisplayFiltersOptions: ILayoutDisplayFiltersOptions | undefined;
|
layoutDisplayFiltersOptions: ILayoutDisplayFiltersOptions | undefined;
|
||||||
labels?: IIssueLabel[] | undefined;
|
labels?: IIssueLabel[] | undefined;
|
||||||
@ -37,6 +40,8 @@ type Props = {
|
|||||||
export const FilterSelection: React.FC<Props> = observer((props) => {
|
export const FilterSelection: React.FC<Props> = observer((props) => {
|
||||||
const {
|
const {
|
||||||
filters,
|
filters,
|
||||||
|
displayFilters,
|
||||||
|
handleDisplayFiltersUpdate,
|
||||||
handleFiltersUpdate,
|
handleFiltersUpdate,
|
||||||
layoutDisplayFiltersOptions,
|
layoutDisplayFiltersOptions,
|
||||||
labels,
|
labels,
|
||||||
@ -52,6 +57,9 @@ export const FilterSelection: React.FC<Props> = observer((props) => {
|
|||||||
|
|
||||||
const isFilterEnabled = (filter: keyof IIssueFilterOptions) => layoutDisplayFiltersOptions?.filters.includes(filter);
|
const isFilterEnabled = (filter: keyof IIssueFilterOptions) => layoutDisplayFiltersOptions?.filters.includes(filter);
|
||||||
|
|
||||||
|
const isDisplayFilterEnabled = (displayFilter: keyof IIssueDisplayFilterOptions) =>
|
||||||
|
Object.keys(layoutDisplayFiltersOptions?.display_filters ?? {}).includes(displayFilter);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full w-full flex-col overflow-hidden">
|
<div className="flex h-full w-full flex-col overflow-hidden">
|
||||||
<div className="bg-custom-background-100 p-2.5 pb-0">
|
<div className="bg-custom-background-100 p-2.5 pb-0">
|
||||||
@ -187,7 +195,19 @@ export const FilterSelection: React.FC<Props> = observer((props) => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
{/* issue type */}
|
||||||
|
{isDisplayFilterEnabled("type") && displayFilters && handleDisplayFiltersUpdate && (
|
||||||
|
<div className="py-2">
|
||||||
|
<FilterIssueType
|
||||||
|
selectedIssueType={displayFilters.type}
|
||||||
|
handleUpdate={(val) =>
|
||||||
|
handleDisplayFiltersUpdate({
|
||||||
|
type: val,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{/* start_date */}
|
{/* start_date */}
|
||||||
{isFilterEnabled("start_date") && (
|
{isFilterEnabled("start_date") && (
|
||||||
<div className="py-2">
|
<div className="py-2">
|
||||||
|
@ -132,6 +132,8 @@ export const IssuesMobileHeader = observer(() => {
|
|||||||
<FilterSelection
|
<FilterSelection
|
||||||
filters={issueFilters?.filters ?? {}}
|
filters={issueFilters?.filters ?? {}}
|
||||||
handleFiltersUpdate={handleFiltersUpdate}
|
handleFiltersUpdate={handleFiltersUpdate}
|
||||||
|
displayFilters={issueFilters?.displayFilters ?? {}}
|
||||||
|
handleDisplayFiltersUpdate={handleDisplayFilters}
|
||||||
layoutDisplayFiltersOptions={
|
layoutDisplayFiltersOptions={
|
||||||
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
||||||
}
|
}
|
||||||
|
@ -134,6 +134,8 @@ export const ModuleMobileHeader = observer(() => {
|
|||||||
<FilterSelection
|
<FilterSelection
|
||||||
filters={issueFilters?.filters ?? {}}
|
filters={issueFilters?.filters ?? {}}
|
||||||
handleFiltersUpdate={handleFiltersUpdate}
|
handleFiltersUpdate={handleFiltersUpdate}
|
||||||
|
displayFilters={issueFilters?.displayFilters ?? {}}
|
||||||
|
handleDisplayFiltersUpdate={handleDisplayFilters}
|
||||||
layoutDisplayFiltersOptions={
|
layoutDisplayFiltersOptions={
|
||||||
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined
|
||||||
}
|
}
|
||||||
|
@ -113,6 +113,8 @@ export const ProfileIssuesFilter = observer(() => {
|
|||||||
}
|
}
|
||||||
filters={issueFilters?.filters ?? {}}
|
filters={issueFilters?.filters ?? {}}
|
||||||
handleFiltersUpdate={handleFiltersUpdate}
|
handleFiltersUpdate={handleFiltersUpdate}
|
||||||
|
displayFilters={issueFilters?.displayFilters ?? {}}
|
||||||
|
handleDisplayFiltersUpdate={handleDisplayFilters}
|
||||||
states={states}
|
states={states}
|
||||||
labels={workspaceLabels}
|
labels={workspaceLabels}
|
||||||
memberIds={members}
|
memberIds={members}
|
||||||
|
@ -147,6 +147,8 @@ const ProfileIssuesMobileHeader = observer(() => {
|
|||||||
}
|
}
|
||||||
filters={issueFilters?.filters ?? {}}
|
filters={issueFilters?.filters ?? {}}
|
||||||
handleFiltersUpdate={handleFiltersUpdate}
|
handleFiltersUpdate={handleFiltersUpdate}
|
||||||
|
displayFilters={issueFilters?.displayFilters ?? {}}
|
||||||
|
handleDisplayFiltersUpdate={handleDisplayFilters}
|
||||||
states={states}
|
states={states}
|
||||||
labels={workspaceLabels}
|
labels={workspaceLabels}
|
||||||
memberIds={members}
|
memberIds={members}
|
||||||
|
Loading…
Reference in New Issue
Block a user