build errors
This commit is contained in:
parent
c8e9304801
commit
31586d62c1
3 changed files with 8 additions and 30 deletions
|
|
@ -209,7 +209,7 @@ export const AddConnectionWizard: React.FC<AddConnectionWizardProps> = ({
|
||||||
onClose();
|
onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
const STEP_LABELS = ['Anbieter', 'Zustimmung', 'Einstellungen', 'Übersicht'];
|
const STEP_LABELS = ['Anbieter', 'Zustimmung', 'Einstellungen', 'Übersicht'] as const;
|
||||||
const visibleSteps = state.knowledgeEnabled
|
const visibleSteps = state.knowledgeEnabled
|
||||||
? [0, 1, 2, 3]
|
? [0, 1, 2, 3]
|
||||||
: [0, 1, 3];
|
: [0, 1, 3];
|
||||||
|
|
|
||||||
|
|
@ -154,28 +154,6 @@ function _treeMoveItemsToGroup(tree: TableGroupNode[], itemIds: string[], groupI
|
||||||
if (groupId) for (const id of itemIds) t = _treeAddItemToGroup(t, groupId, id);
|
if (groupId) for (const id of itemIds) t = _treeAddItemToGroup(t, groupId, id);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
function _treeReorder(tree: TableGroupNode[], groupId: string, dir: 'up' | 'down'): TableGroupNode[] {
|
|
||||||
const _at = (nodes: TableGroupNode[]): TableGroupNode[] => {
|
|
||||||
const idx = nodes.findIndex(n => n.id === groupId);
|
|
||||||
if (idx === -1) return nodes.map(n => ({ ...n, subGroups: _at(n.subGroups) }));
|
|
||||||
const arr = [...nodes];
|
|
||||||
if (dir === 'up' && idx > 0) [arr[idx - 1], arr[idx]] = [arr[idx], arr[idx - 1]];
|
|
||||||
if (dir === 'down' && idx < arr.length - 1) [arr[idx], arr[idx + 1]] = [arr[idx + 1], arr[idx]];
|
|
||||||
return arr;
|
|
||||||
};
|
|
||||||
return _at(tree);
|
|
||||||
}
|
|
||||||
function _treeFlatten(tree: TableGroupNode[]): Array<{ node: TableGroupNode; depth: number; parentId: string | null }> {
|
|
||||||
const result: Array<{ node: TableGroupNode; depth: number; parentId: string | null }> = [];
|
|
||||||
const _walk = (nodes: TableGroupNode[], depth: number, parentId: string | null) => {
|
|
||||||
nodes.forEach(n => {
|
|
||||||
result.push({ node: n, depth, parentId });
|
|
||||||
_walk(n.subGroups, depth + 1, n.id);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
_walk(tree, 0, null);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
/** Returns the id of the group that directly contains `itemId`, or null. */
|
/** Returns the id of the group that directly contains `itemId`, or null. */
|
||||||
function _treeGetItemDirectGroupId(tree: TableGroupNode[], itemId: string): string | null {
|
function _treeGetItemDirectGroupId(tree: TableGroupNode[], itemId: string): string | null {
|
||||||
for (const n of tree) {
|
for (const n of tree) {
|
||||||
|
|
@ -891,12 +869,12 @@ export function FormGeneratorTable<T extends Record<string, any>>({
|
||||||
}, [hookData, activeGroupId]);
|
}, [hookData, activeGroupId]);
|
||||||
|
|
||||||
/** Enter a group scope — refetch with groupId filter. */
|
/** Enter a group scope — refetch with groupId filter. */
|
||||||
const _enterGroup = useCallback((groupId: string) => {
|
const _enterGroup = (_groupId: string) => {
|
||||||
setActiveGroupId(groupId);
|
setActiveGroupId(_groupId);
|
||||||
if (!hookData?.refetch) return;
|
if (!hookData?.refetch) return;
|
||||||
const s = tableStateRef.current;
|
const s = tableStateRef.current;
|
||||||
hookData.refetch({ page: 1, pageSize: s.pageSize, groupId });
|
hookData.refetch({ page: 1, pageSize: s.pageSize, groupId: _groupId });
|
||||||
}, [hookData]);
|
};
|
||||||
|
|
||||||
/** Exit group scope — refetch without groupId. */
|
/** Exit group scope — refetch without groupId. */
|
||||||
const _exitGroup = useCallback(() => {
|
const _exitGroup = useCallback(() => {
|
||||||
|
|
@ -1024,7 +1002,7 @@ export function FormGeneratorTable<T extends Record<string, any>>({
|
||||||
const parentGroup = _treeGetGroupParentId(tree, curGroup);
|
const parentGroup = _treeGetGroupParentId(tree, curGroup);
|
||||||
actions.moveItemsToGroup([rowId], parentGroup);
|
actions.moveItemsToGroup([rowId], parentGroup);
|
||||||
// Keep the source group collapsed after the move
|
// Keep the source group collapsed after the move
|
||||||
setExpandedGroupsRef.current(prev => {
|
setExpandedGroupsRef.current?.(prev => {
|
||||||
const next = new Set(prev);
|
const next = new Set(prev);
|
||||||
next.add(`collapsed-${curGroup}`);
|
next.add(`collapsed-${curGroup}`);
|
||||||
return next;
|
return next;
|
||||||
|
|
@ -1039,7 +1017,7 @@ export function FormGeneratorTable<T extends Record<string, any>>({
|
||||||
actions.moveGroupToParent(gId, grandParentId);
|
actions.moveGroupToParent(gId, grandParentId);
|
||||||
// Keep the parent group collapsed after the move
|
// Keep the parent group collapsed after the move
|
||||||
if (parentId) {
|
if (parentId) {
|
||||||
setExpandedGroupsRef.current(prev => {
|
setExpandedGroupsRef.current?.(prev => {
|
||||||
const next = new Set(prev);
|
const next = new Set(prev);
|
||||||
next.add(`collapsed-${parentId}`);
|
next.add(`collapsed-${parentId}`);
|
||||||
return next;
|
return next;
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ export function GroupFolderRow({
|
||||||
onGroupDragLeave,
|
onGroupDragLeave,
|
||||||
}: GroupFolderRowProps) {
|
}: GroupFolderRowProps) {
|
||||||
const { t } = useLanguage();
|
const { t } = useLanguage();
|
||||||
const { confirm, ConfirmDialog } = useConfirm();
|
const { ConfirmDialog } = useConfirm();
|
||||||
const inputRef = useRef<HTMLInputElement>(null);
|
const inputRef = useRef<HTMLInputElement>(null);
|
||||||
const totalCount = node.itemIds.length;
|
const totalCount = node.itemIds.length;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue