refactor(errors): put in constants

This commit is contained in:
moklick
2023-01-25 18:32:13 +01:00
parent 3b543cb015
commit 54010e7ee6
10 changed files with 43 additions and 27 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ import type { RefObject } from 'react';
import { clampPosition, isNumeric } from '../../utils';
import type { CoordinateExtent, Node, NodeDragItem, NodeInternals, NodeOrigin, OnError, XYPosition } from '../../types';
import { getNodePositionWithOrigin } from '../../utils/graph';
import { errorMessages } from '../../contants';
export function isParentSelected(node: Node, nodeInternals: NodeInternals): boolean {
if (!node.parentNode) {
@@ -82,7 +83,7 @@ export function calcNextPosition(
]
: currentExtent;
} else {
onError?.('005', 'Only child nodes can use a parent extent.');
onError?.('005', errorMessages['005']());
currentExtent = nodeExtent;
}