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:
rahulramesha 2023-12-01 18:51:52 +05:30 committed by Aaryan Khandelwal
parent ca8e685c9c
commit 108fc27a6e
6 changed files with 49 additions and 16 deletions

View File

@ -226,9 +226,10 @@ export const IssueForm: FC<IssueFormProps> = observer((props) => {
reset({
...defaultValues,
project: projectId,
...initialData,
});
}, [setFocus, reset]);
}, [setFocus, initialData, reset]);
// update projectId in form when projectId changes
useEffect(() => {

View File

@ -267,6 +267,7 @@ export const BaseKanBanRoot: React.FC<IBaseKanBanLayout> = observer((props: IBas
enableQuickIssueCreate={enableQuickAdd}
isReadOnly={!enableInlineEditing || !isEditingAllowed}
currentStore={currentStore}
quickAddCallback={issueStore?.quickAddIssue}
addIssuesToView={(issues) => {
console.log("kanban existingIds", issues);

View File

@ -91,6 +91,12 @@ interface ISubGroupSwimlane extends ISubGroupSwimlaneHeader {
currentStore?: EProjectStore;
enableQuickIssueCreate: boolean;
isReadOnly: boolean;
quickAddCallback?: (
workspaceSlug: string,
projectId: string,
data: IIssue,
viewId?: string
) => Promise<IIssue | undefined>;
}
const SubGroupSwimlane: React.FC<ISubGroupSwimlane> = observer((props) => {
const {
@ -118,6 +124,7 @@ const SubGroupSwimlane: React.FC<ISubGroupSwimlane> = observer((props) => {
enableQuickIssueCreate,
isReadOnly,
addIssuesToView,
quickAddCallback,
} = props;
const calculateIssueCount = (column_id: string) => {
@ -176,6 +183,7 @@ const SubGroupSwimlane: React.FC<ISubGroupSwimlane> = observer((props) => {
isDragStarted={isDragStarted}
isReadOnly={isReadOnly}
addIssuesToView={addIssuesToView}
quickAddCallback={quickAddCallback}
/>
</div>
)}
@ -208,6 +216,12 @@ export interface IKanBanSwimLanes {
currentStore?: EProjectStore;
addIssuesToView?: (issueIds: string[]) => Promise<IIssue>;
enableQuickIssueCreate: boolean;
quickAddCallback?: (
workspaceSlug: string,
projectId: string,
data: IIssue,
viewId?: string
) => Promise<IIssue | undefined>;
isReadOnly: boolean;
}
@ -236,6 +250,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
isReadOnly,
currentStore,
addIssuesToView,
quickAddCallback,
} = props;
return (
@ -378,6 +393,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
disableIssueCreation={disableIssueCreation}
enableQuickIssueCreate={enableQuickIssueCreate}
isReadOnly={isReadOnly}
quickAddCallback={quickAddCallback}
/>
)}
@ -406,6 +422,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
disableIssueCreation={disableIssueCreation}
enableQuickIssueCreate={enableQuickIssueCreate}
isReadOnly={isReadOnly}
quickAddCallback={quickAddCallback}
/>
)}
@ -434,6 +451,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
disableIssueCreation={disableIssueCreation}
enableQuickIssueCreate={enableQuickIssueCreate}
isReadOnly={isReadOnly}
quickAddCallback={quickAddCallback}
/>
)}
@ -462,6 +480,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
disableIssueCreation={disableIssueCreation}
enableQuickIssueCreate={enableQuickIssueCreate}
isReadOnly={isReadOnly}
quickAddCallback={quickAddCallback}
/>
)}
@ -490,6 +509,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
disableIssueCreation={disableIssueCreation}
enableQuickIssueCreate={enableQuickIssueCreate}
isReadOnly={isReadOnly}
quickAddCallback={quickAddCallback}
/>
)}
@ -518,6 +538,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
disableIssueCreation={disableIssueCreation}
enableQuickIssueCreate={enableQuickIssueCreate}
isReadOnly={isReadOnly}
quickAddCallback={quickAddCallback}
/>
)}
@ -546,6 +567,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
disableIssueCreation={disableIssueCreation}
enableQuickIssueCreate={enableQuickIssueCreate}
isReadOnly={isReadOnly}
quickAddCallback={quickAddCallback}
/>
)}
@ -574,6 +596,7 @@ export const KanBanSwimLanes: React.FC<IKanBanSwimLanes> = observer((props) => {
disableIssueCreation={disableIssueCreation}
enableQuickIssueCreate={enableQuickIssueCreate}
isReadOnly={isReadOnly}
quickAddCallback={quickAddCallback}
/>
)}
</div>

View File

@ -8,6 +8,7 @@ import useToast from "hooks/use-toast";
import { ProjectViewForm } from "components/views";
// types
import { IProjectView } from "types";
import { debounce } from "lodash";
type Props = {
data?: IProjectView | null;
@ -33,7 +34,9 @@ export const CreateUpdateProjectViewModal: FC<Props> = observer((props) => {
await projectViewsStore
.createView(workspaceSlug, projectId, payload)
.then(() => {
console.log("after calling store");
handleClose();
console.log("after closing");
setToastAlert({
type: "success",
title: "Success!",
@ -67,6 +70,8 @@ export const CreateUpdateProjectViewModal: FC<Props> = observer((props) => {
else await updateView(formData);
};
const debouncedFormSubmit = debounce(handleFormSubmit, 10, { leading: false, trailing: true });
return (
<Transition.Root show={isOpen} as={Fragment}>
<Dialog as="div" className="relative z-20" onClose={handleClose}>
@ -97,7 +102,7 @@ export const CreateUpdateProjectViewModal: FC<Props> = observer((props) => {
<ProjectViewForm
data={data}
handleClose={handleClose}
handleFormSubmit={handleFormSubmit}
handleFormSubmit={debouncedFormSubmit as (formData: IProjectView) => Promise<void>}
preLoadedData={preLoadedData}
/>
</Dialog.Panel>

View File

@ -115,7 +115,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
}
toggleCommandPaletteModal = (value?: boolean) => {
if (value) {
if (value !== undefined) {
this.isCommandPaletteOpen = value;
} else {
this.isCommandPaletteOpen = !this.isCommandPaletteOpen;
@ -123,7 +123,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
};
toggleShortcutModal = (value?: boolean) => {
if (value) {
if (value !== undefined) {
this.isShortcutModalOpen = value;
} else {
this.isShortcutModalOpen = !this.isShortcutModalOpen;
@ -131,7 +131,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
};
toggleCreateProjectModal = (value?: boolean) => {
if (value) {
if (value !== undefined) {
this.isCreateProjectModalOpen = value;
} else {
this.isCreateProjectModalOpen = !this.isCreateProjectModalOpen;
@ -139,7 +139,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
};
toggleCreateCycleModal = (value?: boolean) => {
if (value) {
if (value !== undefined) {
this.isCreateCycleModalOpen = value;
} else {
this.isCreateCycleModalOpen = !this.isCreateCycleModalOpen;
@ -147,7 +147,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
};
toggleCreateViewModal = (value?: boolean) => {
if (value) {
if (value !== undefined) {
this.isCreateViewModalOpen = value;
} else {
this.isCreateViewModalOpen = !this.isCreateViewModalOpen;
@ -155,7 +155,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
};
toggleCreatePageModal = (value?: boolean) => {
if (value) {
if (value !== undefined) {
this.isCreatePageModalOpen = value;
} else {
this.isCreatePageModalOpen = !this.isCreatePageModalOpen;
@ -163,7 +163,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
};
toggleCreateIssueModal = (value?: boolean, storeType?: EProjectStore) => {
if (value) {
if (value !== undefined) {
this.isCreateIssueModalOpen = value;
this.createIssueStoreType = storeType || EProjectStore.PROJECT;
} else {
@ -173,7 +173,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
};
toggleDeleteIssueModal = (value?: boolean) => {
if (value) {
if (value !== undefined) {
this.isDeleteIssueModalOpen = value;
} else {
this.isDeleteIssueModalOpen = !this.isDeleteIssueModalOpen;
@ -181,7 +181,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
};
toggleCreateModuleModal = (value?: boolean) => {
if (value) {
if (value !== undefined) {
this.isCreateModuleModalOpen = value;
} else {
this.isCreateModuleModalOpen = !this.isCreateModuleModalOpen;
@ -189,7 +189,7 @@ class CommandPaletteStore implements ICommandPaletteStore {
};
toggleBulkDeleteIssueModal = (value?: boolean) => {
if (value) {
if (value !== undefined) {
this.isBulkDeleteIssueModalOpen = value;
} else {
this.isBulkDeleteIssueModalOpen = !this.isBulkDeleteIssueModalOpen;

View File

@ -91,8 +91,9 @@ export class IssueBaseStore implements IIssueBaseStore {
for (const subGroup of subGroupArray) {
for (const group of groupArray) {
if (subGroup && group && _issues[subGroup][group]) _issues[subGroup][group].push(_issue.id);
else if (subGroup && group) _issues[subGroup][group] = [_issue.id];
if (subGroup && group && _issues?.[subGroup]?.[group]) _issues[subGroup][group].push(_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) {
if (Array.isArray(value)) return value;
else if (isDate) return [renderDateFormat(value) || "None"];
if (Array.isArray(value)) {
if (value.length) return value;
else return ["None"];
} else if (isDate) return [renderDateFormat(value) || "None"];
else return [value || "None"];
}
}