chore: run fixes (#8257)
* chore: run fixes * fix: type, just use hocuspocusservercontext * fix: codemod --------- Co-authored-by: Palanikannan M <akashmalinimurugu@gmail.com>
This commit is contained in:
parent
a9e9cb2983
commit
0ab94ed6d6
172 changed files with 1784 additions and 1798 deletions
|
|
@ -78,7 +78,7 @@ export const getPasswordCriteria = (password: string): PasswordCriteria[] => [
|
|||
|
||||
// Error code messages
|
||||
const errorCodeMessages: {
|
||||
[key in EAuthErrorCodes]: { title: string; message: (email?: string | undefined) => ReactNode };
|
||||
[key in EAuthErrorCodes]: { title: string; message: (email?: string) => ReactNode };
|
||||
} = {
|
||||
// global
|
||||
[EAuthErrorCodes.INSTANCE_NOT_CONFIGURED]: {
|
||||
|
|
@ -293,10 +293,7 @@ const errorCodeMessages: {
|
|||
};
|
||||
|
||||
// Error handler
|
||||
export const authErrorHandler = (
|
||||
errorCode: EAuthErrorCodes,
|
||||
email?: string | undefined
|
||||
): TAuthErrorInfo | undefined => {
|
||||
export const authErrorHandler = (errorCode: EAuthErrorCodes, email?: string): TAuthErrorInfo | undefined => {
|
||||
const bannerAlertErrorCodes = [
|
||||
EAuthErrorCodes.INSTANCE_NOT_CONFIGURED,
|
||||
EAuthErrorCodes.INVALID_EMAIL,
|
||||
|
|
|
|||
|
|
@ -107,19 +107,14 @@ const formatV1Data = (isTypeIssue: boolean, cycle: ICycle, isBurnDown: boolean,
|
|||
|
||||
return {
|
||||
date: p,
|
||||
scope: p! < today ? scope(cycle, isTypeIssue) : null,
|
||||
scope: p < today ? scope(cycle, isTypeIssue) : null,
|
||||
completed,
|
||||
backlog: isTypeIssue ? cycle.backlog_issues : cycle.backlog_estimate_points,
|
||||
started: p === today ? cycle[isTypeIssue ? "started_issues" : "started_estimate_points"] : undefined,
|
||||
unstarted: p === today ? cycle[isTypeIssue ? "unstarted_issues" : "unstarted_estimate_points"] : undefined,
|
||||
cancelled: p === today ? cycle[isTypeIssue ? "cancelled_issues" : "cancelled_estimate_points"] : undefined,
|
||||
pending: Math.abs(pending || 0),
|
||||
ideal:
|
||||
p < today
|
||||
? ideal(p, total || 0, cycle)
|
||||
: p <= cycle.end_date!
|
||||
? ideal(today as string, total || 0, cycle)
|
||||
: null,
|
||||
ideal: p < today ? ideal(p, total || 0, cycle) : p <= cycle.end_date! ? ideal(today, total || 0, cycle) : null,
|
||||
actual: p <= today ? (isBurnDown ? Math.abs(pending) : completed) : undefined,
|
||||
};
|
||||
});
|
||||
|
|
@ -139,7 +134,7 @@ const formatV2Data = (isTypeIssue: boolean, cycle: ICycle, isBurnDown: boolean,
|
|||
if (!cycle.progress) return [];
|
||||
let today: Date | string = startOfToday();
|
||||
|
||||
const extendedArray = endDate > today ? generateDateArray(today as Date, endDate) : [];
|
||||
const extendedArray = endDate > today ? generateDateArray(today, endDate) : [];
|
||||
if (isEmpty(cycle.progress)) return extendedArray;
|
||||
today = format(startOfToday(), "yyyy-MM-dd");
|
||||
const todaysData = cycle?.progress[cycle?.progress.length - 1];
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export const getEditorAssetDownloadSrc = (args: TEditorSrcArgs): string | undefi
|
|||
return url;
|
||||
};
|
||||
|
||||
export const getTextContent = (jsx: React.ReactNode | React.ReactNode | null | undefined): string => {
|
||||
export const getTextContent = (jsx: React.ReactNode | null | undefined): string => {
|
||||
if (!jsx) return "";
|
||||
|
||||
const div = document.createElement("div");
|
||||
|
|
|
|||
|
|
@ -33,24 +33,21 @@ function addSpacesToCheckboxes() {
|
|||
child.properties &&
|
||||
child.properties["data-type"] === "taskItem"
|
||||
) {
|
||||
const liElement = child as HASTElement;
|
||||
const liElement = child;
|
||||
|
||||
// Find the label and div elements
|
||||
const label = liElement.children?.find(
|
||||
(c) => c.type === "element" && (c as HASTElement).tagName === "label"
|
||||
) as HASTElement | undefined;
|
||||
const label = liElement.children?.find((c) => c.type === "element" && c.tagName === "label") as
|
||||
| HASTElement
|
||||
| undefined;
|
||||
|
||||
const contentDiv = liElement.children?.find(
|
||||
(c) => c.type === "element" && (c as HASTElement).tagName === "div"
|
||||
) as HASTElement | undefined;
|
||||
const contentDiv = liElement.children?.find((c) => c.type === "element" && c.tagName === "div") as
|
||||
| HASTElement
|
||||
| undefined;
|
||||
|
||||
if (label && contentDiv) {
|
||||
// Find the checkbox input
|
||||
const checkbox = label.children?.find(
|
||||
(c) =>
|
||||
c.type === "element" &&
|
||||
(c as HASTElement).tagName === "input" &&
|
||||
(c as HASTElement).properties?.type === "checkbox"
|
||||
(c) => c.type === "element" && c.tagName === "input" && c.properties?.type === "checkbox"
|
||||
) as HASTElement | undefined;
|
||||
|
||||
if (checkbox) {
|
||||
|
|
@ -58,9 +55,9 @@ function addSpacesToCheckboxes() {
|
|||
const textContent: ElementContent[] = [];
|
||||
if (contentDiv.children) {
|
||||
for (const child of contentDiv.children) {
|
||||
if (child.type === "element" && (child as HASTElement).tagName === "p") {
|
||||
if (child.type === "element" && child.tagName === "p") {
|
||||
// Unwrap paragraph - add its children directly
|
||||
const pElement = child as HASTElement;
|
||||
const pElement = child;
|
||||
if (pElement.children) {
|
||||
textContent.push(...pElement.children);
|
||||
}
|
||||
|
|
@ -80,7 +77,7 @@ function addSpacesToCheckboxes() {
|
|||
}
|
||||
}
|
||||
} else if (child && child.type === "element") {
|
||||
helper(child as HASTElement);
|
||||
helper(child);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { EEstimateSystem } from "@plane/constants";
|
|||
export const isEstimatePointValuesRepeated = (
|
||||
estimatePoints: string[],
|
||||
estimateType: EEstimateSystem,
|
||||
newEstimatePoint?: string | undefined
|
||||
newEstimatePoint?: string
|
||||
) => {
|
||||
const currentEstimatePoints = estimatePoints.map((estimatePoint) => estimatePoint.trim());
|
||||
let isRepeated = false;
|
||||
|
|
|
|||
|
|
@ -166,11 +166,7 @@ export const findImmediateParent = <P extends TFilterProperty>(
|
|||
export const extractConditions = <P extends TFilterProperty>(
|
||||
expression: TFilterExpression<P>
|
||||
): TFilterConditionNode<P, TFilterValue>[] =>
|
||||
traverseExpressionTree(
|
||||
expression,
|
||||
(node) => (isConditionNode(node) ? node : null),
|
||||
TreeTraversalMode.CONDITIONS
|
||||
) as TFilterConditionNode<P, TFilterValue>[];
|
||||
traverseExpressionTree(expression, (node) => (isConditionNode(node) ? node : null), TreeTraversalMode.CONDITIONS);
|
||||
|
||||
/**
|
||||
* Extracts all conditions from a filter expression, including their display operators.
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export function getChangedIssuefields(formData: Partial<TIssue>, dirtyFields: {
|
|||
|
||||
const dirtyFieldKeys = Object.keys(dirtyFields) as (keyof TIssue)[];
|
||||
for (const dirtyField of dirtyFieldKeys) {
|
||||
if (!!dirtyFields[dirtyField]) {
|
||||
if (dirtyFields[dirtyField]) {
|
||||
set(changedFields, [dirtyField], formData[dirtyField]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue