Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Commit 426eedd

Browse files
committed
Fix frontend build problems.
1 parent 5221457 commit 426eedd

File tree

6 files changed

+12
-24
lines changed

6 files changed

+12
-24
lines changed

frontend/src/features/map_planning/layers/plant/PlantsLayer.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ import { KonvaEventListener, KonvaEventObject, Node } from 'konva/lib/Node';
33
import { useCallback, useEffect, useRef } from 'react';
44
import { Layer } from 'react-konva';
55
import * as uuid from 'uuid';
6-
import { LayerType, PlantingDto, PlantsSummaryDto, SeedDto } from '@/api_types/definitions';
6+
import {
7+
LayerType,
8+
MovePlantActionPayload,
9+
PlantingDto,
10+
PlantsSummaryDto,
11+
SeedDto,
12+
TransformPlantActionPayload,
13+
} from '@/api_types/definitions';
714
import IconButton from '@/components/Button/IconButton';
815
import {
916
KEYBINDINGS_SCOPE_PLANTS_LAYER,

frontend/src/features/map_planning/layers/plant/actions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export class CreatePlantAction
3333
return this._ids;
3434
}
3535

36-
// TODO: Sollte hier beim constructor nicht NewPlantingDto verwendet werden?
3736
constructor(private readonly _data: PlantingDto[], public actionId = v4()) {
3837
this._ids = _data.map(({ id }) => id);
3938
}

frontend/src/features/map_planning/layers/plant/components/Planting/Planting.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { PlantLabel } from '../PlantLabel';
88
import { usePlanting } from './hooks';
99
import { placeTooltip } from './utils';
1010

11-
export type PlantingElementProps = {
11+
export type PlantingProps = {
1212
planting: PlantingDto;
1313
};
1414

frontend/src/features/map_planning/layers/plant/components/PlantingAttributeEditForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export type SinglePlantingAttributeFormProps = EditPlantingAttributesProps & {
4545
planting: PlantingDto;
4646
};
4747

48-
export type EditMultiplePlantingsProps = EditPlantingAttributesProps & {
48+
export type MultiplePlantingsAttributeFormProps = EditPlantingAttributesProps & {
4949
plantings: PlantingDto[];
5050
};
5151

frontend/src/features/map_planning/store/MapStoreTypes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
import { FrontendOnlyLayerType } from '@/features/map_planning/layers/_frontend_only';
1313
import { PolygonGeometry } from '@/features/map_planning/types/PolygonTypes';
1414
import { convertToDateString } from '../utils/date-utils';
15+
import { TransformerStore } from './transformer/TransformerStore';
1516

1617
import Vector2d = Konva.Vector2d;
1718

@@ -171,7 +172,7 @@ export interface UntrackedMapSlice {
171172
) => void;
172173
lastActions: LastAction[];
173174
selectPlantForPlanting: (plant: PlantForPlanting | null) => void;
174-
selectPlantings: (plantings: PlantingDto[] | null) => void;
175+
selectPlantings: (plantings: PlantingDto[] | null, transformerStore?: TransformerStore) => void;
175176
toggleShowPlantLabel: () => void;
176177
baseLayerActivateMeasurement: () => void;
177178
baseLayerDeactivateMeasurement: () => void;

frontend/src/features/map_planning/store/TrackedMapStore.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,6 @@ export const createTrackedMapSlice: StateCreator<
2121
undo: () => undo(set, get),
2222
redo: () => redo(set, get),
2323
__applyRemoteAction: (action: Action<unknown, unknown>) => applyAction(action, set, get),
24-
setSingleNodeInTransformer: (node: Node) => {
25-
get().transformer?.current?.nodes([node]);
26-
},
27-
addNodeToTransformer: (node: Node) => {
28-
const currentNodes = get().transformer.current?.nodes() ?? [];
29-
if (!currentNodes.includes(node)) {
30-
get().transformer?.current?.nodes([...currentNodes, node]);
31-
}
32-
},
33-
removeNodeFromTransformer: (node: Node) => {
34-
const currentNodes = get().transformer.current?.nodes() ?? [];
35-
const nodeToRemove = currentNodes.indexOf(node);
36-
37-
if (nodeToRemove !== -1) {
38-
const newNodes = currentNodes.slice();
39-
newNodes.splice(nodeToRemove, 1);
40-
get().transformer.current?.nodes(newNodes);
41-
}
42-
},
4324
initPlantLayer: (plants: PlantingDto[]) => {
4425
set((state) => ({
4526
...state,

0 commit comments

Comments
 (0)