fix: spliting out the project members from project store and service (#2739)
This commit is contained in:
parent
7676aab773
commit
79df59f618
66 changed files with 496 additions and 415 deletions
|
|
@ -9,8 +9,6 @@ import { KanBanSwimLanes } from "../swimlanes";
|
|||
import { KanBan } from "../default";
|
||||
import { CycleIssueQuickActions } from "components/issues";
|
||||
import { Spinner } from "@plane/ui";
|
||||
// helpers
|
||||
import { orderArrayBy } from "helpers/array.helper";
|
||||
// types
|
||||
import { IIssue } from "types";
|
||||
// constants
|
||||
|
|
@ -25,13 +23,13 @@ export const CycleKanBanLayout: React.FC = observer(() => {
|
|||
// store
|
||||
const {
|
||||
project: projectStore,
|
||||
projectMember: { projectMembers },
|
||||
projectState: projectStateStore,
|
||||
cycleIssue: cycleIssueStore,
|
||||
issueFilter: issueFilterStore,
|
||||
cycleIssueKanBanView: cycleIssueKanBanViewStore,
|
||||
issueDetail: issueDetailStore,
|
||||
} = useMobxStore();
|
||||
const { currentProjectDetails } = projectStore;
|
||||
|
||||
const issues = cycleIssueStore?.getIssues;
|
||||
|
||||
|
|
@ -51,9 +49,9 @@ export const CycleKanBanLayout: React.FC = observer(() => {
|
|||
|
||||
const [isDragStarted, setIsDragStarted] = useState<boolean>(false);
|
||||
|
||||
const onDragStart = () => {
|
||||
setIsDragStarted(true);
|
||||
};
|
||||
// const onDragStart = () => {
|
||||
// setIsDragStarted(true);
|
||||
// };
|
||||
|
||||
const onDragEnd = (result: any) => {
|
||||
setIsDragStarted(false);
|
||||
|
|
@ -102,13 +100,12 @@ export const CycleKanBanLayout: React.FC = observer(() => {
|
|||
const states = projectStateStore?.projectStates || null;
|
||||
const priorities = ISSUE_PRIORITIES || null;
|
||||
const labels = projectStore?.projectLabels || null;
|
||||
const members = projectStore?.projectMembers || null;
|
||||
const stateGroups = ISSUE_STATE_GROUPS || null;
|
||||
const projects = workspaceSlug ? projectStore?.projects[workspaceSlug.toString()] || null : null;
|
||||
const estimates =
|
||||
currentProjectDetails?.estimate !== null
|
||||
? projectStore.projectEstimates?.find((e) => e.id === currentProjectDetails?.estimate) || null
|
||||
: null;
|
||||
// const estimates =
|
||||
// currentProjectDetails?.estimate !== null
|
||||
// ? projectStore.projectEstimates?.find((e) => e.id === currentProjectDetails?.estimate) || null
|
||||
// : null;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
@ -141,7 +138,7 @@ export const CycleKanBanLayout: React.FC = observer(() => {
|
|||
stateGroups={stateGroups}
|
||||
priorities={priorities}
|
||||
labels={labels}
|
||||
members={members?.map((m) => m.member) ?? null}
|
||||
members={projectMembers?.map((m) => m.member) ?? null}
|
||||
projects={projects}
|
||||
showEmptyGroup={userDisplayFilters?.show_empty_groups || true}
|
||||
isDragStarted={isDragStarted}
|
||||
|
|
@ -168,7 +165,7 @@ export const CycleKanBanLayout: React.FC = observer(() => {
|
|||
stateGroups={stateGroups}
|
||||
priorities={priorities}
|
||||
labels={labels}
|
||||
members={members?.map((m) => m.member) ?? null}
|
||||
members={projectMembers?.map((m) => m.member) ?? null}
|
||||
projects={projects}
|
||||
showEmptyGroup={userDisplayFilters?.show_empty_groups || true}
|
||||
isDragStarted={isDragStarted}
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@ export const ModuleKanBanLayout: React.FC = observer(() => {
|
|||
// store
|
||||
const {
|
||||
project: projectStore,
|
||||
projectMember: { projectMembers },
|
||||
projectState: projectStateStore,
|
||||
moduleIssue: moduleIssueStore,
|
||||
issueFilter: issueFilterStore,
|
||||
moduleIssueKanBanView: moduleIssueKanBanViewStore,
|
||||
issueDetail: issueDetailStore,
|
||||
} = useMobxStore();
|
||||
const { currentProjectDetails } = projectStore;
|
||||
|
||||
const issues = moduleIssueStore?.getIssues;
|
||||
|
||||
|
|
@ -48,9 +48,9 @@ export const ModuleKanBanLayout: React.FC = observer(() => {
|
|||
|
||||
const [isDragStarted, setIsDragStarted] = useState<boolean>(false);
|
||||
|
||||
const onDragStart = () => {
|
||||
setIsDragStarted(true);
|
||||
};
|
||||
// const onDragStart = () => {
|
||||
// setIsDragStarted(true);
|
||||
// };
|
||||
|
||||
const onDragEnd = (result: any) => {
|
||||
setIsDragStarted(false);
|
||||
|
|
@ -98,13 +98,12 @@ export const ModuleKanBanLayout: React.FC = observer(() => {
|
|||
const states = projectStateStore?.projectStates || null;
|
||||
const priorities = ISSUE_PRIORITIES || null;
|
||||
const labels = projectStore?.projectLabels || null;
|
||||
const members = projectStore?.projectMembers || null;
|
||||
const stateGroups = ISSUE_STATE_GROUPS || null;
|
||||
const projects = workspaceSlug ? projectStore?.projects[workspaceSlug.toString()] || null : null;
|
||||
const estimates =
|
||||
currentProjectDetails?.estimate !== null
|
||||
? projectStore.projectEstimates?.find((e) => e.id === currentProjectDetails?.estimate) || null
|
||||
: null;
|
||||
// const estimates =
|
||||
// currentProjectDetails?.estimate !== null
|
||||
// ? projectStore.projectEstimates?.find((e) => e.id === currentProjectDetails?.estimate) || null
|
||||
// : null;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
@ -137,7 +136,7 @@ export const ModuleKanBanLayout: React.FC = observer(() => {
|
|||
stateGroups={stateGroups}
|
||||
priorities={priorities}
|
||||
labels={labels}
|
||||
members={members?.map((m) => m.member) ?? null}
|
||||
members={projectMembers?.map((m) => m.member) ?? null}
|
||||
projects={projects}
|
||||
showEmptyGroup={userDisplayFilters?.show_empty_groups || true}
|
||||
isDragStarted={isDragStarted}
|
||||
|
|
@ -164,7 +163,7 @@ export const ModuleKanBanLayout: React.FC = observer(() => {
|
|||
stateGroups={stateGroups}
|
||||
priorities={priorities}
|
||||
labels={labels}
|
||||
members={members?.map((m) => m.member) ?? null}
|
||||
members={projectMembers?.map((m) => m.member) ?? null}
|
||||
projects={projects}
|
||||
showEmptyGroup={userDisplayFilters?.show_empty_groups || true}
|
||||
isDragStarted={isDragStarted}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ export const ProfileIssuesKanBanLayout: FC = observer(() => {
|
|||
const {
|
||||
workspace: workspaceStore,
|
||||
project: projectStore,
|
||||
projectMember: { projectMembers },
|
||||
projectState: projectStateStore,
|
||||
profileIssues: profileIssuesStore,
|
||||
profileIssueFilters: profileIssueFiltersStore,
|
||||
|
|
@ -48,9 +49,9 @@ export const ProfileIssuesKanBanLayout: FC = observer(() => {
|
|||
|
||||
const [isDragStarted, setIsDragStarted] = useState<boolean>(false);
|
||||
|
||||
const onDragStart = () => {
|
||||
setIsDragStarted(true);
|
||||
};
|
||||
// const onDragStart = () => {
|
||||
// setIsDragStarted(true);
|
||||
// };
|
||||
|
||||
const onDragEnd = (result: any) => {
|
||||
setIsDragStarted(false);
|
||||
|
|
@ -89,7 +90,6 @@ export const ProfileIssuesKanBanLayout: FC = observer(() => {
|
|||
const states = projectStateStore?.projectStates || null;
|
||||
const priorities = ISSUE_PRIORITIES || null;
|
||||
const labels = workspaceStore.workspaceLabels || null;
|
||||
const members = projectStore?.projectMembers || null;
|
||||
const stateGroups = ISSUE_STATE_GROUPS || null;
|
||||
const projects = projectStore?.workspaceProjects || null;
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ export const ProfileIssuesKanBanLayout: FC = observer(() => {
|
|||
stateGroups={stateGroups}
|
||||
priorities={priorities}
|
||||
labels={labels}
|
||||
members={members?.map((m) => m.member) ?? null}
|
||||
members={projectMembers?.map((m) => m.member) ?? null}
|
||||
projects={projects}
|
||||
showEmptyGroup={userDisplayFilters?.show_empty_groups || true}
|
||||
isDragStarted={isDragStarted}
|
||||
|
|
@ -149,7 +149,7 @@ export const ProfileIssuesKanBanLayout: FC = observer(() => {
|
|||
stateGroups={stateGroups}
|
||||
priorities={priorities}
|
||||
labels={labels}
|
||||
members={members?.map((m) => m.member) ?? null}
|
||||
members={projectMembers?.map((m) => m.member) ?? null}
|
||||
projects={projects}
|
||||
showEmptyGroup={userDisplayFilters?.show_empty_groups || true}
|
||||
isDragStarted={isDragStarted}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ export const KanBanLayout: React.FC = observer(() => {
|
|||
|
||||
const {
|
||||
project: projectStore,
|
||||
projectMember: { projectMembers },
|
||||
projectState: projectStateStore,
|
||||
issue: issueStore,
|
||||
issueFilter: issueFilterStore,
|
||||
|
|
@ -92,7 +93,6 @@ export const KanBanLayout: React.FC = observer(() => {
|
|||
const states = projectStateStore?.projectStates || null;
|
||||
const priorities = ISSUE_PRIORITIES || null;
|
||||
const labels = projectStore?.projectLabels || null;
|
||||
const members = projectStore?.projectMembers || null;
|
||||
const stateGroups = ISSUE_STATE_GROUPS || null;
|
||||
const projects = workspaceSlug ? projectStore?.projects?.[workspaceSlug] || null : null;
|
||||
const estimates =
|
||||
|
|
@ -130,7 +130,7 @@ export const KanBanLayout: React.FC = observer(() => {
|
|||
stateGroups={stateGroups}
|
||||
priorities={priorities}
|
||||
labels={labels}
|
||||
members={members?.map((m) => m.member) ?? null}
|
||||
members={projectMembers?.map((m) => m.member) ?? null}
|
||||
projects={projects}
|
||||
enableQuickIssueCreate
|
||||
showEmptyGroup={userDisplayFilters?.show_empty_groups || true}
|
||||
|
|
@ -157,7 +157,7 @@ export const KanBanLayout: React.FC = observer(() => {
|
|||
stateGroups={stateGroups}
|
||||
priorities={priorities}
|
||||
labels={labels}
|
||||
members={members?.map((m) => m.member) ?? null}
|
||||
members={projectMembers?.map((m) => m.member) ?? null}
|
||||
projects={projects}
|
||||
showEmptyGroup={userDisplayFilters?.show_empty_groups || true}
|
||||
isDragStarted={isDragStarted}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export interface IViewKanBanLayout {}
|
|||
export const ProjectViewKanBanLayout: React.FC = observer(() => {
|
||||
const {
|
||||
project: projectStore,
|
||||
projectMember: { projectMembers },
|
||||
projectState: projectStateStore,
|
||||
issue: issueStore,
|
||||
issueFilter: issueFilterStore,
|
||||
|
|
@ -56,7 +57,6 @@ export const ProjectViewKanBanLayout: React.FC = observer(() => {
|
|||
const states = projectStateStore?.projectStates || null;
|
||||
const priorities = ISSUE_PRIORITIES || null;
|
||||
const labels = projectStore?.projectLabels || null;
|
||||
const members = projectStore?.projectMembers || null;
|
||||
const stateGroups = ISSUE_STATE_GROUPS || null;
|
||||
const projects = projectStateStore?.projectStates || null;
|
||||
const estimates = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue