mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 05:49:40 +02:00
fix develop branch build issues
This commit is contained in:
@@ -186,7 +186,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
|
||||
}, [projectId]);
|
||||
|
||||
useEffect(() => {
|
||||
if (data?.description_html) setValue("description_html", data?.description_html);
|
||||
if (data?.description_html) setValue<"description_html">("description_html", data?.description_html);
|
||||
}, [data?.description_html]);
|
||||
|
||||
const issueName = watch("name");
|
||||
@@ -206,7 +206,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
|
||||
? formData
|
||||
: {
|
||||
...getChangedIssuefields(formData, dirtyFields as { [key: string]: boolean | undefined }),
|
||||
project_id: getValues("project_id"),
|
||||
project_id: getValues<"project_id">("project_id"),
|
||||
id: data.id,
|
||||
description_html: formData.description_html ?? "<p></p>",
|
||||
};
|
||||
@@ -221,7 +221,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
|
||||
reset({
|
||||
...defaultValues,
|
||||
...(isCreateMoreToggleEnabled ? { ...data } : {}),
|
||||
project_id: getValues("project_id"),
|
||||
project_id: getValues<"project_id">("project_id"),
|
||||
description_html: data?.description_html ?? "<p></p>",
|
||||
});
|
||||
editorRef?.current?.clearEditor();
|
||||
@@ -320,7 +320,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
|
||||
handleClose={() => setLabelModal(false)}
|
||||
projectId={projectId}
|
||||
onSuccess={(response) => {
|
||||
setValue("label_ids", [...watch("label_ids"), response.id]);
|
||||
setValue<"label_ids">("label_ids", [...watch("label_ids"), response.id]);
|
||||
handleFormChange();
|
||||
}}
|
||||
/>
|
||||
@@ -528,7 +528,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
|
||||
onChange(stateId);
|
||||
handleFormChange();
|
||||
}}
|
||||
projectId={projectId?? undefined}
|
||||
projectId={projectId ?? undefined}
|
||||
buttonVariant="border-with-text"
|
||||
tabIndex={getTabIndex("state_id")}
|
||||
/>
|
||||
@@ -651,7 +651,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
|
||||
render={({ field: { value, onChange } }) => (
|
||||
<div className="h-7">
|
||||
<ModuleDropdown
|
||||
projectId={projectId?? undefined}
|
||||
projectId={projectId ?? undefined}
|
||||
value={value ?? []}
|
||||
onChange={(moduleIds) => {
|
||||
onChange(moduleIds);
|
||||
@@ -748,7 +748,7 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
|
||||
handleFormChange();
|
||||
setSelectedParentIssue(issue);
|
||||
}}
|
||||
projectId={projectId?? undefined}
|
||||
projectId={projectId ?? undefined}
|
||||
issueId={isDraft ? undefined : data?.id}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -102,7 +102,13 @@ export const IssueEmbedCard: React.FC<Props> = observer((props) => {
|
||||
issue={issueDetails}
|
||||
displayProperties={displayProperties}
|
||||
activeLayout="Page issue embed"
|
||||
updateIssue={async (projectId, issueId, data) => await updateIssue(workspaceSlug, projectId, issueId, data)}
|
||||
updateIssue={async (projectId, issueId, data) => {
|
||||
if (projectId) {
|
||||
return await updateIssue(workspaceSlug, projectId, issueId, data);
|
||||
}
|
||||
|
||||
return;
|
||||
}}
|
||||
isReadOnly={isReadOnly}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -178,7 +178,7 @@ export const getIssueBlocksStructure = (block: TIssue): IGanttBlock => {
|
||||
};};
|
||||
|
||||
export function getChangedIssuefields(formData: Partial<TIssue>, dirtyFields: { [key: string]: boolean | undefined }) {
|
||||
const changedFields: Partial<TIssue> = {};
|
||||
const changedFields = {} as any;
|
||||
|
||||
const dirtyFieldKeys = Object.keys(dirtyFields) as (keyof TIssue)[];
|
||||
for (const dirtyField of dirtyFieldKeys) {
|
||||
@@ -187,7 +187,7 @@ export function getChangedIssuefields(formData: Partial<TIssue>, dirtyFields: {
|
||||
}
|
||||
}
|
||||
|
||||
return changedFields;
|
||||
return changedFields as Partial<TIssue>;
|
||||
}
|
||||
|
||||
export const formatTextList = (TextArray: string[]): string => {
|
||||
|
||||
@@ -65,7 +65,7 @@ export const useGroupIssuesDragNDrop = (
|
||||
|
||||
if (isCycleChanged && workspaceSlug) {
|
||||
if (data[cycleKey]) {
|
||||
addCycleToIssue(workspaceSlug.toString(), projectId, data[cycleKey], issueId).catch(() =>
|
||||
addCycleToIssue(workspaceSlug.toString(), projectId, data[cycleKey] as string, issueId).catch(() =>
|
||||
setToast(errorToastProps)
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -1448,10 +1448,12 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
||||
// if unGrouped, then return the path as ALL_ISSUES along with orderByUpdates
|
||||
if (!this.issueGroupKey) return action ? [{ path: [ALL_ISSUES], action }, ...orderByUpdates] : orderByUpdates;
|
||||
|
||||
const issueGroupValue = issue[this.issueGroupKey] as string | string[] | null | undefined;
|
||||
const issueGroupValueBeforeUpdate = issueBeforeUpdate?.[this.issueGroupKey] as string | string[] | null | undefined;
|
||||
// if grouped, the get the Difference between the two issue properties (this.issueGroupKey) on which groupBy is performed
|
||||
const groupActionsArray = getDifference(
|
||||
this.getArrayStringArray(issue[this.issueGroupKey], this.groupBy),
|
||||
this.getArrayStringArray(issueBeforeUpdate?.[this.issueGroupKey], this.groupBy),
|
||||
this.getArrayStringArray(issueGroupValue, this.groupBy),
|
||||
this.getArrayStringArray(issueGroupValueBeforeUpdate, this.groupBy),
|
||||
action
|
||||
);
|
||||
|
||||
@@ -1465,10 +1467,16 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
||||
...orderByUpdates,
|
||||
];
|
||||
|
||||
const issueSubGroupValue = issue[this.issueSubGroupKey] as string | string[] | null | undefined;
|
||||
const issueSubGroupValueBeforeUpdate = issueBeforeUpdate?.[this.issueSubGroupKey] as
|
||||
| string
|
||||
| string[]
|
||||
| null
|
||||
| undefined;
|
||||
// if subGrouped, the get the Difference between the two issue properties (this.issueGroupKey) on which subGroupBy is performed
|
||||
const subGroupActionsArray = getDifference(
|
||||
this.getArrayStringArray(issue[this.issueSubGroupKey], this.subGroupBy),
|
||||
this.getArrayStringArray(issueBeforeUpdate?.[this.issueSubGroupKey], this.subGroupBy),
|
||||
this.getArrayStringArray(issueSubGroupValue, this.subGroupBy),
|
||||
this.getArrayStringArray(issueSubGroupValueBeforeUpdate, this.subGroupBy),
|
||||
action
|
||||
);
|
||||
|
||||
@@ -1477,13 +1485,10 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
||||
...getSubGroupIssueKeyActions(
|
||||
groupActionsArray,
|
||||
subGroupActionsArray,
|
||||
this.getArrayStringArray(issueBeforeUpdate?.[this.issueGroupKey] ?? issue[this.issueGroupKey], this.groupBy),
|
||||
this.getArrayStringArray(issue[this.issueGroupKey], this.groupBy),
|
||||
this.getArrayStringArray(
|
||||
issueBeforeUpdate?.[this.issueSubGroupKey] ?? issue[this.issueSubGroupKey],
|
||||
this.subGroupBy
|
||||
),
|
||||
this.getArrayStringArray(issue[this.issueSubGroupKey], this.subGroupBy)
|
||||
this.getArrayStringArray(issueGroupValueBeforeUpdate ?? issueGroupValue, this.groupBy),
|
||||
this.getArrayStringArray(issueGroupValue, this.groupBy),
|
||||
this.getArrayStringArray(issueSubGroupValueBeforeUpdate ?? issueSubGroupValue, this.subGroupBy),
|
||||
this.getArrayStringArray(issueSubGroupValue, this.subGroupBy)
|
||||
),
|
||||
...orderByUpdates,
|
||||
];
|
||||
@@ -1511,9 +1516,10 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
||||
// if they are not equal and issues are not grouped then, provide path as ALL_ISSUES
|
||||
if (!this.issueGroupKey) return [{ path: [ALL_ISSUES], action: EIssueGroupedAction.REORDER }];
|
||||
|
||||
const issueGroupValue = issue[this.issueGroupKey] as string | string[] | null | undefined;
|
||||
// if they are grouped then identify the paths based on props on which group by is dependent on
|
||||
const issueKeyActions: { path: string[]; action: EIssueGroupedAction.REORDER }[] = [];
|
||||
const groupByValues = this.getArrayStringArray(issue[this.issueGroupKey]);
|
||||
const groupByValues = this.getArrayStringArray(issueGroupValue);
|
||||
|
||||
// if issues are not subGrouped then, provide path from groupByValues
|
||||
if (!this.issueSubGroupKey) {
|
||||
@@ -1524,8 +1530,9 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
|
||||
return issueKeyActions;
|
||||
}
|
||||
|
||||
const issueSubGroupValue = issue[this.issueSubGroupKey] as string | string[] | null | undefined;
|
||||
// if they are grouped then identify the paths based on props on which sub group by is dependent on
|
||||
const subGroupByValues = this.getArrayStringArray(issue[this.issueSubGroupKey]);
|
||||
const subGroupByValues = this.getArrayStringArray(issueSubGroupValue);
|
||||
|
||||
// if issues are subGrouped then, provide path from subGroupByValues
|
||||
for (const groupKey of groupByValues) {
|
||||
|
||||
Reference in New Issue
Block a user