forked from github/plane
fix: V3 release blocker bugs (#2968)
* fix add subgroup issue FED-1101 * fix subgroup by None assignee FED-1100 * fix grouping by asignee or labels FED-1096 * fix create view popup FED-1093 * fix subgroup exception in swimlanes
This commit is contained in:
parent
65253c6383
commit
d22c258c00
@ -226,9 +226,10 @@ export const IssueForm: FC<IssueFormProps> = observer((props) => {
|
|||||||
|
|
||||||
reset({
|
reset({
|
||||||
...defaultValues,
|
...defaultValues,
|
||||||
|
project: projectId,
|
||||||
...initialData,
|
...initialData,
|
||||||
});
|
});
|
||||||
}, [setFocus, reset]);
|
}, [setFocus, initialData, reset]);
|
||||||
|
|
||||||
// update projectId in form when projectId changes
|
// update projectId in form when projectId changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -267,6 +267,7 @@ export const BaseKanBanRoot: React.FC<IBaseKanBanLayout> = observer((props: IBas
|
|||||||
enableQuickIssueCreate={enableQuickAdd}
|
enableQuickIssueCreate={enableQuickAdd}
|
||||||
isReadOnly={!enableInlineEditing || !isEditingAllowed}
|
isReadOnly={!enableInlineEditing || !isEditingAllowed}
|
||||||
currentStore={currentStore}
|
currentStore={currentStore}
|
||||||
|
quickAddCallback={issueStore?.quickAddIssue}
|
||||||
addIssuesToView={(issues) => {
|
addIssuesToView={(issues) => {
|
||||||
console.log("kanban existingIds", issues);
|
console.log("kanban existingIds", issues);
|
||||||
|
|
||||||
|
@ -91,6 +91,12 @@ interface ISubGroupSwimlane extends ISubGroupSwimlaneHeader {
|
|||||||
currentStore?: EProjectStore;
|
currentStore?: EProjectStore;
|
||||||
enableQuickIssueCreate: boolean;
|
enableQuickIssueCreate: boolean;
|
||||||
isReadOnly: boolean;
|
isReadOnly: boolean;
|
||||||
|
quickAddCallback?: (
|
||||||
|
workspaceSlug: string,
|
||||||
|
projectId: string,
|
||||||
|
data: IIssue,
|
||||||
|
viewId?: string
|
||||||
|
) => Promise<IIssue | undefined>;
|
||||||
}
|
}
|
||||||
const SubGroupSwimlane: React.FC<ISubGroupSwimlane> = observer((props) => {
|
const SubGroupSwimlane: React.FC<ISubGroupSwimlane> = observer((props) => {
|
||||||
const {
|
const {
|
||||||
@ -118,6 +124,7 @@ const SubGroupSwimlane: React.FC<ISubGroupSwimlane> = observer((props) => {
|
|||||||
enableQuickIssueCreate,
|
enableQuickIssueCreate,
|
||||||
isReadOnly,
|
isReadOnly,
|
||||||
addIssuesToView,
|
addIssuesToView,
|
||||||
|
quickAddCallback,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const calculateIssueCount = (column_id: string) => {
|
const calculateIssueCount = (column_id: string) => {
|
||||||
@ -176,6 +183,7 @@ const SubGroupSwimlane: React.FC<ISubGroupSwimlane> = observer((props) => {
|
|||||||
isDragStarted={isDragStarted}
|
isDragStarted={isDragStarted}
|
||||||
isReadOnly={isReadOnly}
|
isReadOnly={isReadOnly}
|
||||||
addIssuesToView={addIssuesToView}
|
addIssuesToView={addIssuesToView}
|
||||||
|
quickAddCallback={quickAddCallback}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -208,6 +216,12 @@ export interface IKanBanSwimLanes {
|
|||||||
currentStore?: EProjectStore;
|
currentStore?: EProjectStore;
|
||||||
addIssuesToView?: (issueIds: string[]) => Promise<IIssue>;
|
addIssuesToView?: (issueIds: string[]) => Promise<IIssue>;
|
||||||
enableQuickIssueCreate: boolean;
|
enableQuickIssueCreate: boolean;
|
||||||
|
quickAddCallback?: (
|
||||||
|
workspaceSlug: string,
|
||||||
|
projectId: string,
|
||||||
|
data: IIssue,
|
||||||
|
viewId?: string
|
||||||
|
) => Promise<IIssue | undefined>;
|
||||||
isReadOnly: boolean;
|
isReadOnly: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,6 +250,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
|||||||
isReadOnly,
|
isReadOnly,
|
||||||
currentStore,
|
currentStore,
|
||||||
addIssuesToView,
|
addIssuesToView,
|
||||||
|
quickAddCallback,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -378,6 +393,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
|||||||
disableIssueCreation={disableIssueCreation}
|
disableIssueCreation={disableIssueCreation}
|
||||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||||
isReadOnly={isReadOnly}
|
isReadOnly={isReadOnly}
|
||||||
|
quickAddCallback={quickAddCallback}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -406,6 +422,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
|||||||
disableIssueCreation={disableIssueCreation}
|
disableIssueCreation={disableIssueCreation}
|
||||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||||
isReadOnly={isReadOnly}
|
isReadOnly={isReadOnly}
|
||||||
|
quickAddCallback={quickAddCallback}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -434,6 +451,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
|||||||
disableIssueCreation={disableIssueCreation}
|
disableIssueCreation={disableIssueCreation}
|
||||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||||
isReadOnly={isReadOnly}
|
isReadOnly={isReadOnly}
|
||||||
|
quickAddCallback={quickAddCallback}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -462,6 +480,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
|||||||
disableIssueCreation={disableIssueCreation}
|
disableIssueCreation={disableIssueCreation}
|
||||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||||
isReadOnly={isReadOnly}
|
isReadOnly={isReadOnly}
|
||||||
|
quickAddCallback={quickAddCallback}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -490,6 +509,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
|||||||
disableIssueCreation={disableIssueCreation}
|
disableIssueCreation={disableIssueCreation}
|
||||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||||
isReadOnly={isReadOnly}
|
isReadOnly={isReadOnly}
|
||||||
|
quickAddCallback={quickAddCallback}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -518,6 +538,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
|||||||
disableIssueCreation={disableIssueCreation}
|
disableIssueCreation={disableIssueCreation}
|
||||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||||
isReadOnly={isReadOnly}
|
isReadOnly={isReadOnly}
|
||||||
|
quickAddCallback={quickAddCallback}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -546,6 +567,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
|||||||
disableIssueCreation={disableIssueCreation}
|
disableIssueCreation={disableIssueCreation}
|
||||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||||
isReadOnly={isReadOnly}
|
isReadOnly={isReadOnly}
|
||||||
|
quickAddCallback={quickAddCallback}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -574,6 +596,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
|
|||||||
disableIssueCreation={disableIssueCreation}
|
disableIssueCreation={disableIssueCreation}
|
||||||
enableQuickIssueCreate={enableQuickIssueCreate}
|
enableQuickIssueCreate={enableQuickIssueCreate}
|
||||||
isReadOnly={isReadOnly}
|
isReadOnly={isReadOnly}
|
||||||
|
quickAddCallback={quickAddCallback}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -8,6 +8,7 @@ import useToast from "hooks/use-toast";
|
|||||||
import { ProjectViewForm } from "components/views";
|
import { ProjectViewForm } from "components/views";
|
||||||
// types
|
// types
|
||||||
import { IProjectView } from "types";
|
import { IProjectView } from "types";
|
||||||
|
import { debounce } from "lodash";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
data?: IProjectView | null;
|
data?: IProjectView | null;
|
||||||
@ -33,7 +34,9 @@ export const CreateUpdateProjectViewModal: FC<Props> = observer((props) => {
|
|||||||
await projectViewsStore
|
await projectViewsStore
|
||||||
.createView(workspaceSlug, projectId, payload)
|
.createView(workspaceSlug, projectId, payload)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
console.log("after calling store");
|
||||||
handleClose();
|
handleClose();
|
||||||
|
console.log("after closing");
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Success!",
|
title: "Success!",
|
||||||
@ -67,6 +70,8 @@ export const CreateUpdateProjectViewModal: FC<Props> = observer((props) => {
|
|||||||
else await updateView(formData);
|
else await updateView(formData);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const debouncedFormSubmit = debounce(handleFormSubmit, 10, { leading: false, trailing: true });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Transition.Root show={isOpen} as={Fragment}>
|
<Transition.Root show={isOpen} as={Fragment}>
|
||||||
<Dialog as="div" className="relative z-20" onClose={handleClose}>
|
<Dialog as="div" className="relative z-20" onClose={handleClose}>
|
||||||
@ -97,7 +102,7 @@ export const CreateUpdateProjectViewModal: FC<Props> = observer((props) => {
|
|||||||
<ProjectViewForm
|
<ProjectViewForm
|
||||||
data={data}
|
data={data}
|
||||||
handleClose={handleClose}
|
handleClose={handleClose}
|
||||||
handleFormSubmit={handleFormSubmit}
|
handleFormSubmit={debouncedFormSubmit as (formData: IProjectView) => Promise<void>}
|
||||||
preLoadedData={preLoadedData}
|
preLoadedData={preLoadedData}
|
||||||
/>
|
/>
|
||||||
</Dialog.Panel>
|
</Dialog.Panel>
|
||||||
|
@ -115,7 +115,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleCommandPaletteModal = (value?: boolean) => {
|
toggleCommandPaletteModal = (value?: boolean) => {
|
||||||
if (value) {
|
if (value !== undefined) {
|
||||||
this.isCommandPaletteOpen = value;
|
this.isCommandPaletteOpen = value;
|
||||||
} else {
|
} else {
|
||||||
this.isCommandPaletteOpen = !this.isCommandPaletteOpen;
|
this.isCommandPaletteOpen = !this.isCommandPaletteOpen;
|
||||||
@ -123,7 +123,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
toggleShortcutModal = (value?: boolean) => {
|
toggleShortcutModal = (value?: boolean) => {
|
||||||
if (value) {
|
if (value !== undefined) {
|
||||||
this.isShortcutModalOpen = value;
|
this.isShortcutModalOpen = value;
|
||||||
} else {
|
} else {
|
||||||
this.isShortcutModalOpen = !this.isShortcutModalOpen;
|
this.isShortcutModalOpen = !this.isShortcutModalOpen;
|
||||||
@ -131,7 +131,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
toggleCreateProjectModal = (value?: boolean) => {
|
toggleCreateProjectModal = (value?: boolean) => {
|
||||||
if (value) {
|
if (value !== undefined) {
|
||||||
this.isCreateProjectModalOpen = value;
|
this.isCreateProjectModalOpen = value;
|
||||||
} else {
|
} else {
|
||||||
this.isCreateProjectModalOpen = !this.isCreateProjectModalOpen;
|
this.isCreateProjectModalOpen = !this.isCreateProjectModalOpen;
|
||||||
@ -139,7 +139,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
toggleCreateCycleModal = (value?: boolean) => {
|
toggleCreateCycleModal = (value?: boolean) => {
|
||||||
if (value) {
|
if (value !== undefined) {
|
||||||
this.isCreateCycleModalOpen = value;
|
this.isCreateCycleModalOpen = value;
|
||||||
} else {
|
} else {
|
||||||
this.isCreateCycleModalOpen = !this.isCreateCycleModalOpen;
|
this.isCreateCycleModalOpen = !this.isCreateCycleModalOpen;
|
||||||
@ -147,7 +147,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
toggleCreateViewModal = (value?: boolean) => {
|
toggleCreateViewModal = (value?: boolean) => {
|
||||||
if (value) {
|
if (value !== undefined) {
|
||||||
this.isCreateViewModalOpen = value;
|
this.isCreateViewModalOpen = value;
|
||||||
} else {
|
} else {
|
||||||
this.isCreateViewModalOpen = !this.isCreateViewModalOpen;
|
this.isCreateViewModalOpen = !this.isCreateViewModalOpen;
|
||||||
@ -155,7 +155,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
toggleCreatePageModal = (value?: boolean) => {
|
toggleCreatePageModal = (value?: boolean) => {
|
||||||
if (value) {
|
if (value !== undefined) {
|
||||||
this.isCreatePageModalOpen = value;
|
this.isCreatePageModalOpen = value;
|
||||||
} else {
|
} else {
|
||||||
this.isCreatePageModalOpen = !this.isCreatePageModalOpen;
|
this.isCreatePageModalOpen = !this.isCreatePageModalOpen;
|
||||||
@ -163,7 +163,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
toggleCreateIssueModal = (value?: boolean, storeType?: EProjectStore) => {
|
toggleCreateIssueModal = (value?: boolean, storeType?: EProjectStore) => {
|
||||||
if (value) {
|
if (value !== undefined) {
|
||||||
this.isCreateIssueModalOpen = value;
|
this.isCreateIssueModalOpen = value;
|
||||||
this.createIssueStoreType = storeType || EProjectStore.PROJECT;
|
this.createIssueStoreType = storeType || EProjectStore.PROJECT;
|
||||||
} else {
|
} else {
|
||||||
@ -173,7 +173,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
toggleDeleteIssueModal = (value?: boolean) => {
|
toggleDeleteIssueModal = (value?: boolean) => {
|
||||||
if (value) {
|
if (value !== undefined) {
|
||||||
this.isDeleteIssueModalOpen = value;
|
this.isDeleteIssueModalOpen = value;
|
||||||
} else {
|
} else {
|
||||||
this.isDeleteIssueModalOpen = !this.isDeleteIssueModalOpen;
|
this.isDeleteIssueModalOpen = !this.isDeleteIssueModalOpen;
|
||||||
@ -181,7 +181,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
toggleCreateModuleModal = (value?: boolean) => {
|
toggleCreateModuleModal = (value?: boolean) => {
|
||||||
if (value) {
|
if (value !== undefined) {
|
||||||
this.isCreateModuleModalOpen = value;
|
this.isCreateModuleModalOpen = value;
|
||||||
} else {
|
} else {
|
||||||
this.isCreateModuleModalOpen = !this.isCreateModuleModalOpen;
|
this.isCreateModuleModalOpen = !this.isCreateModuleModalOpen;
|
||||||
@ -189,7 +189,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
toggleBulkDeleteIssueModal = (value?: boolean) => {
|
toggleBulkDeleteIssueModal = (value?: boolean) => {
|
||||||
if (value) {
|
if (value !== undefined) {
|
||||||
this.isBulkDeleteIssueModalOpen = value;
|
this.isBulkDeleteIssueModalOpen = value;
|
||||||
} else {
|
} else {
|
||||||
this.isBulkDeleteIssueModalOpen = !this.isBulkDeleteIssueModalOpen;
|
this.isBulkDeleteIssueModalOpen = !this.isBulkDeleteIssueModalOpen;
|
||||||
|
@ -91,8 +91,9 @@ export class IssueBaseStore implements IIssueBaseStore {
|
|||||||
|
|
||||||
for (const subGroup of subGroupArray) {
|
for (const subGroup of subGroupArray) {
|
||||||
for (const group of groupArray) {
|
for (const group of groupArray) {
|
||||||
if (subGroup && group && _issues[subGroup][group]) _issues[subGroup][group].push(_issue.id);
|
if (subGroup && group && _issues?.[subGroup]?.[group]) _issues[subGroup][group].push(_issue.id);
|
||||||
else if (subGroup && group) _issues[subGroup][group] = [_issue.id];
|
else if (subGroup && group && _issues[subGroup]) _issues[subGroup][group] = [_issue.id];
|
||||||
|
else if (subGroup && group) _issues[subGroup] = { [group]: [_issue.id] };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -197,8 +198,10 @@ export class IssueBaseStore implements IIssueBaseStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
getGroupArray(value: string[] | string | null, isDate: boolean = false) {
|
getGroupArray(value: string[] | string | null, isDate: boolean = false) {
|
||||||
if (Array.isArray(value)) return value;
|
if (Array.isArray(value)) {
|
||||||
else if (isDate) return [renderDateFormat(value) || "None"];
|
if (value.length) return value;
|
||||||
|
else return ["None"];
|
||||||
|
} else if (isDate) return [renderDateFormat(value) || "None"];
|
||||||
else return [value || "None"];
|
else return [value || "None"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user