diff --git a/frontend/src/modules/2DViewer/interfaces.ts b/frontend/src/modules/2DViewer/interfaces.ts index 1c42c5ce3..29ceee88e 100644 --- a/frontend/src/modules/2DViewer/interfaces.ts +++ b/frontend/src/modules/2DViewer/interfaces.ts @@ -1,6 +1,6 @@ import { InterfaceInitialization } from "@framework/UniDirectionalModuleComponentsInterface"; -import { LayerManager } from "./layers/LayerManager"; +import { LayerManager } from "./layers/framework/LayerManager/LayerManager"; import { layerManagerAtom, preferredViewLayoutAtom } from "./settings/atoms/baseAtoms"; import { PreferredViewLayout } from "./types"; diff --git a/frontend/src/modules/2DViewer/layers/components/LayersActions.tsx b/frontend/src/modules/2DViewer/layers/LayersActions.tsx similarity index 100% rename from frontend/src/modules/2DViewer/layers/components/LayersActions.tsx rename to frontend/src/modules/2DViewer/layers/LayersActions.tsx diff --git a/frontend/src/modules/2DViewer/layers/delegates/GroupDelegate.ts b/frontend/src/modules/2DViewer/layers/delegates/GroupDelegate.ts index 3ef7673db..3be0e82ef 100644 --- a/frontend/src/modules/2DViewer/layers/delegates/GroupDelegate.ts +++ b/frontend/src/modules/2DViewer/layers/delegates/GroupDelegate.ts @@ -2,9 +2,9 @@ import { ItemDelegateTopic } from "./ItemDelegate"; import { PublishSubscribe, PublishSubscribeDelegate } from "./PublishSubscribeDelegate"; import { UnsubscribeHandlerDelegate } from "./UnsubscribeHandlerDelegate"; -import { DeserializationFactory } from "../DeserializationFactory"; -import { LayerManagerTopic } from "../LayerManager"; -import { SharedSetting } from "../SharedSetting"; +import { LayerManagerTopic } from "../framework/LayerManager/LayerManager"; +import { SharedSetting } from "../framework/SharedSetting/SharedSetting"; +import { DeserializationFactory } from "../framework/utils/DeserializationFactory"; import { Item, SerializedItem, instanceofGroup, instanceofLayer } from "../interfaces"; export enum GroupDelegateTopic { diff --git a/frontend/src/modules/2DViewer/layers/delegates/ItemDelegate.ts b/frontend/src/modules/2DViewer/layers/delegates/ItemDelegate.ts index f494a5b5c..607a70195 100644 --- a/frontend/src/modules/2DViewer/layers/delegates/ItemDelegate.ts +++ b/frontend/src/modules/2DViewer/layers/delegates/ItemDelegate.ts @@ -4,7 +4,7 @@ import { v4 } from "uuid"; import { GroupDelegate } from "./GroupDelegate"; import { PublishSubscribe, PublishSubscribeDelegate } from "./PublishSubscribeDelegate"; -import { LayerManager, LayerManagerTopic } from "../LayerManager"; +import { LayerManager, LayerManagerTopic } from "../framework/LayerManager/LayerManager"; import { SerializedItem } from "../interfaces"; export enum ItemDelegateTopic { diff --git a/frontend/src/modules/2DViewer/layers/delegates/LayerDelegate.ts b/frontend/src/modules/2DViewer/layers/delegates/LayerDelegate.ts index 096652901..2ba7c353a 100644 --- a/frontend/src/modules/2DViewer/layers/delegates/LayerDelegate.ts +++ b/frontend/src/modules/2DViewer/layers/delegates/LayerDelegate.ts @@ -7,8 +7,8 @@ import { PublishSubscribe, PublishSubscribeDelegate } from "./PublishSubscribeDe import { SettingsContextDelegateTopic } from "./SettingsContextDelegate"; import { UnsubscribeHandlerDelegate } from "./UnsubscribeHandlerDelegate"; -import { LayerManager, LayerManagerTopic } from "../LayerManager"; -import { SharedSetting } from "../SharedSetting"; +import { LayerManager, LayerManagerTopic } from "../framework/LayerManager/LayerManager"; +import { SharedSetting } from "../framework/SharedSetting/SharedSetting"; import { BoundingBox, Layer, SerializedLayer, SerializedType, Settings, SettingsContext } from "../interfaces"; export enum LayerDelegateTopic { diff --git a/frontend/src/modules/2DViewer/layers/delegates/SettingsContextDelegate.ts b/frontend/src/modules/2DViewer/layers/delegates/SettingsContextDelegate.ts index c1cf38c51..402bd7139 100644 --- a/frontend/src/modules/2DViewer/layers/delegates/SettingsContextDelegate.ts +++ b/frontend/src/modules/2DViewer/layers/delegates/SettingsContextDelegate.ts @@ -1,9 +1,9 @@ import { PublishSubscribe, PublishSubscribeDelegate } from "./PublishSubscribeDelegate"; import { SettingTopic } from "./SettingDelegate"; import { UnsubscribeHandlerDelegate } from "./UnsubscribeHandlerDelegate"; +import { Dependency } from "./_utils/Dependency"; -import { Dependency } from "../Dependency"; -import { GlobalSettings, LayerManager, LayerManagerTopic } from "../LayerManager"; +import { GlobalSettings, LayerManager, LayerManagerTopic } from "../framework/LayerManager/LayerManager"; import { AvailableValuesType, EachAvailableValuesType, diff --git a/frontend/src/modules/2DViewer/layers/Dependency.ts b/frontend/src/modules/2DViewer/layers/delegates/_utils/Dependency.ts similarity index 97% rename from frontend/src/modules/2DViewer/layers/Dependency.ts rename to frontend/src/modules/2DViewer/layers/delegates/_utils/Dependency.ts index 7e2228ba2..911d67df5 100644 --- a/frontend/src/modules/2DViewer/layers/Dependency.ts +++ b/frontend/src/modules/2DViewer/layers/delegates/_utils/Dependency.ts @@ -2,9 +2,9 @@ import { isCancelledError } from "@tanstack/react-query"; import { isEqual } from "lodash"; -import { GlobalSettings } from "./LayerManager"; -import { SettingsContextDelegate } from "./delegates/SettingsContextDelegate"; -import { Settings, UpdateFunc } from "./interfaces"; +import { GlobalSettings } from "../../framework/LayerManager/LayerManager"; +import { Settings, UpdateFunc } from "../../interfaces"; +import { SettingsContextDelegate } from "../SettingsContextDelegate"; /* * Dependency class is used to represent a node in the dependency graph of a layer settings context. diff --git a/frontend/src/modules/2DViewer/layers/ColorScale.ts b/frontend/src/modules/2DViewer/layers/framework/ColorScale/ColorScale.ts similarity index 90% rename from frontend/src/modules/2DViewer/layers/ColorScale.ts rename to frontend/src/modules/2DViewer/layers/framework/ColorScale/ColorScale.ts index 56ee21247..39928f9b3 100644 --- a/frontend/src/modules/2DViewer/layers/ColorScale.ts +++ b/frontend/src/modules/2DViewer/layers/framework/ColorScale/ColorScale.ts @@ -2,9 +2,9 @@ import { defaultContinuousSequentialColorPalettes } from "@framework/utils/color import { ColorScaleGradientType, ColorScaleType } from "@lib/utils/ColorScale"; import { ColorScale as ColorScaleImpl } from "@lib/utils/ColorScale"; -import { LayerManager, LayerManagerTopic } from "./LayerManager"; -import { ItemDelegate } from "./delegates/ItemDelegate"; -import { Item, SerializedColorScale, SerializedType } from "./interfaces"; +import { ItemDelegate } from "../../delegates/ItemDelegate"; +import { Item, SerializedColorScale, SerializedType } from "../../interfaces"; +import { LayerManager, LayerManagerTopic } from "../LayerManager/LayerManager"; export class ColorScale implements Item { private _itemDelegate: ItemDelegate; diff --git a/frontend/src/modules/2DViewer/layers/components/ColorScaleComponent.tsx b/frontend/src/modules/2DViewer/layers/framework/ColorScale/ColorScaleComponent.tsx similarity index 91% rename from frontend/src/modules/2DViewer/layers/components/ColorScaleComponent.tsx rename to frontend/src/modules/2DViewer/layers/framework/ColorScale/ColorScaleComponent.tsx index b1bb786df..2e7529a2f 100644 --- a/frontend/src/modules/2DViewer/layers/components/ColorScaleComponent.tsx +++ b/frontend/src/modules/2DViewer/layers/framework/ColorScale/ColorScaleComponent.tsx @@ -9,11 +9,11 @@ import { resolveClassNames } from "@lib/utils/resolveClassNames"; import { ColorScaleSelector } from "@modules/_shared/components/ColorScaleSelector/colorScaleSelector"; import { ExpandLess, ExpandMore } from "@mui/icons-material"; -import { RemoveItemButton } from "./RemoveItemButton"; +import { ColorScale } from "./ColorScale"; -import { ColorScale } from "../ColorScale"; -import { ItemDelegateTopic } from "../delegates/ItemDelegate"; -import { usePublishSubscribeTopicValue } from "../delegates/PublishSubscribeDelegate"; +import { ItemDelegateTopic } from "../../delegates/ItemDelegate"; +import { usePublishSubscribeTopicValue } from "../../delegates/PublishSubscribeDelegate"; +import { RemoveItemButton } from "../utilityComponents/RemoveItemButton"; export type ColorScaleComponentProps = { colorScale: ColorScale; diff --git a/frontend/src/modules/2DViewer/layers/DeltaSurface.ts b/frontend/src/modules/2DViewer/layers/framework/DeltaSurface/DeltaSurface.ts similarity index 85% rename from frontend/src/modules/2DViewer/layers/DeltaSurface.ts rename to frontend/src/modules/2DViewer/layers/framework/DeltaSurface/DeltaSurface.ts index 00caa36d3..01d66be31 100644 --- a/frontend/src/modules/2DViewer/layers/DeltaSurface.ts +++ b/frontend/src/modules/2DViewer/layers/framework/DeltaSurface/DeltaSurface.ts @@ -1,10 +1,10 @@ -import { LayerManager } from "./LayerManager"; -import { GroupDelegate, GroupDelegateTopic } from "./delegates/GroupDelegate"; -import { ItemDelegate } from "./delegates/ItemDelegate"; -import { LayerDelegate } from "./delegates/LayerDelegate"; -import { SettingsContextDelegateTopic } from "./delegates/SettingsContextDelegate"; -import { UnsubscribeHandlerDelegate } from "./delegates/UnsubscribeHandlerDelegate"; -import { Group, SerializedDeltaSurface, SerializedType, instanceofLayer } from "./interfaces"; +import { GroupDelegate, GroupDelegateTopic } from "../../delegates/GroupDelegate"; +import { ItemDelegate } from "../../delegates/ItemDelegate"; +import { LayerDelegate } from "../../delegates/LayerDelegate"; +import { SettingsContextDelegateTopic } from "../../delegates/SettingsContextDelegate"; +import { UnsubscribeHandlerDelegate } from "../../delegates/UnsubscribeHandlerDelegate"; +import { Group, SerializedDeltaSurface, SerializedType, instanceofLayer } from "../../interfaces"; +import { LayerManager } from "../LayerManager/LayerManager"; export class DeltaSurface implements Group { private _itemDelegate: ItemDelegate; diff --git a/frontend/src/modules/2DViewer/layers/components/DeltaSurfaceComponent.tsx b/frontend/src/modules/2DViewer/layers/framework/DeltaSurface/DeltaSurfaceComponent.tsx similarity index 75% rename from frontend/src/modules/2DViewer/layers/components/DeltaSurfaceComponent.tsx rename to frontend/src/modules/2DViewer/layers/framework/DeltaSurface/DeltaSurfaceComponent.tsx index 58139e921..47fcbbfc7 100644 --- a/frontend/src/modules/2DViewer/layers/components/DeltaSurfaceComponent.tsx +++ b/frontend/src/modules/2DViewer/layers/framework/DeltaSurface/DeltaSurfaceComponent.tsx @@ -1,18 +1,18 @@ import { SortableListGroup } from "@lib/components/SortableList"; -import { EditName } from "./EditName"; -import { EmptyContent } from "./EmptyContent"; -import { ExpandCollapseAllButton } from "./ExpandCollapseAllButton"; -import { LayersActionGroup, LayersActions } from "./LayersActions"; -import { RemoveItemButton } from "./RemoveItemButton"; -import { VisibilityToggle } from "./VisibilityToggle"; -import { makeSortableListItemComponent } from "./utils"; +import { DeltaSurface } from "./DeltaSurface"; -import { DeltaSurface } from "../DeltaSurface"; -import { GroupDelegateTopic } from "../delegates/GroupDelegate"; -import { ItemDelegateTopic } from "../delegates/ItemDelegate"; -import { usePublishSubscribeTopicValue } from "../delegates/PublishSubscribeDelegate"; -import { Group, Item, instanceofLayer } from "../interfaces"; +import { LayersActionGroup, LayersActions } from "../../LayersActions"; +import { GroupDelegateTopic } from "../../delegates/GroupDelegate"; +import { ItemDelegateTopic } from "../../delegates/ItemDelegate"; +import { usePublishSubscribeTopicValue } from "../../delegates/PublishSubscribeDelegate"; +import { Group, Item, instanceofLayer } from "../../interfaces"; +import { EditName } from "../utilityComponents/EditName"; +import { EmptyContent } from "../utilityComponents/EmptyContent"; +import { ExpandCollapseAllButton } from "../utilityComponents/ExpandCollapseAllButton"; +import { RemoveItemButton } from "../utilityComponents/RemoveItemButton"; +import { VisibilityToggle } from "../utilityComponents/VisibilityToggle"; +import { makeSortableListItemComponent } from "../utils/makeSortableListItemComponent"; export type DeltaSurfaceComponentProps = { deltaSurface: DeltaSurface; diff --git a/frontend/src/modules/2DViewer/layers/LayerManager.ts b/frontend/src/modules/2DViewer/layers/framework/LayerManager/LayerManager.ts similarity index 95% rename from frontend/src/modules/2DViewer/layers/LayerManager.ts rename to frontend/src/modules/2DViewer/layers/framework/LayerManager/LayerManager.ts index b96b529b3..98208330a 100644 --- a/frontend/src/modules/2DViewer/layers/LayerManager.ts +++ b/frontend/src/modules/2DViewer/layers/framework/LayerManager/LayerManager.ts @@ -10,11 +10,11 @@ import { QueryClient } from "@tanstack/react-query"; import { isEqual } from "lodash"; -import { GroupDelegate, GroupDelegateTopic } from "./delegates/GroupDelegate"; -import { ItemDelegate } from "./delegates/ItemDelegate"; -import { PublishSubscribe, PublishSubscribeDelegate } from "./delegates/PublishSubscribeDelegate"; -import { UnsubscribeHandlerDelegate } from "./delegates/UnsubscribeHandlerDelegate"; -import { Group, Item, SerializedLayerManager, SerializedType } from "./interfaces"; +import { GroupDelegate, GroupDelegateTopic } from "../../delegates/GroupDelegate"; +import { ItemDelegate } from "../../delegates/ItemDelegate"; +import { PublishSubscribe, PublishSubscribeDelegate } from "../../delegates/PublishSubscribeDelegate"; +import { UnsubscribeHandlerDelegate } from "../../delegates/UnsubscribeHandlerDelegate"; +import { Group, Item, SerializedLayerManager, SerializedType } from "../../interfaces"; export enum LayerManagerTopic { ITEMS_CHANGED = "ITEMS_CHANGED", diff --git a/frontend/src/modules/2DViewer/layers/framework/LayerManager/LayerManagerComponent.tsx b/frontend/src/modules/2DViewer/layers/framework/LayerManager/LayerManagerComponent.tsx new file mode 100644 index 000000000..727375833 --- /dev/null +++ b/frontend/src/modules/2DViewer/layers/framework/LayerManager/LayerManagerComponent.tsx @@ -0,0 +1,158 @@ +import React from "react"; + +import { IsMoveAllowedArgs, SortableList } from "@lib/components/SortableList"; +import { useElementSize } from "@lib/hooks/useElementSize"; +import { convertRemToPixels } from "@lib/utils/screenUnitConversions"; +import { GroupDelegate, GroupDelegateTopic } from "@modules/2DViewer/layers/delegates/GroupDelegate"; +import { usePublishSubscribeTopicValue } from "@modules/2DViewer/layers/delegates/PublishSubscribeDelegate"; +import { Group, Item, instanceofGroup } from "@modules/2DViewer/layers/interfaces"; +import { Add } from "@mui/icons-material"; + +import { LayerManager } from "./LayerManager"; + +import { LayersActionGroup, LayersActions } from "../../LayersActions"; +import { ColorScale } from "../ColorScale/ColorScale"; +import { SharedSetting } from "../SharedSetting/SharedSetting"; +import { View } from "../View/View"; +import { ExpandCollapseAllButton } from "../utilityComponents/ExpandCollapseAllButton"; +import { makeSortableListItemComponent } from "../utils/makeSortableListItemComponent"; + +export type LayerManagerComponentProps = { + layerManager: LayerManager; + additionalHeaderComponents: React.ReactNode; + layerActions: LayersActionGroup[]; + onLayerAction: (identifier: string, groupDelegate: GroupDelegate) => void; + isMoveAllowed?: (movedItem: Item, destinationGroup: Group) => boolean; +}; + +export function LayerManagerComponent(props: LayerManagerComponentProps): React.ReactNode { + const layerListRef = React.useRef(null); + const layerListSize = useElementSize(layerListRef); + + const groupDelegate = props.layerManager.getGroupDelegate(); + const items = usePublishSubscribeTopicValue(groupDelegate, GroupDelegateTopic.CHILDREN); + + function handleLayerAction(identifier: string, group?: Group) { + let groupDelegate = props.layerManager.getGroupDelegate(); + if (group) { + groupDelegate = group.getGroupDelegate(); + } + + props.onLayerAction(identifier, groupDelegate); + } + + function checkIfItemMoveAllowed(args: IsMoveAllowedArgs): boolean { + const movedItem = groupDelegate.findDescendantById(args.movedItemId); + if (!movedItem) { + return false; + } + + const destinationItem = args.destinationId + ? groupDelegate.findDescendantById(args.destinationId) + : props.layerManager; + + if (!destinationItem || !instanceofGroup(destinationItem)) { + return false; + } + + if (movedItem instanceof View && destinationItem instanceof View) { + return false; + } + + if (props.isMoveAllowed) { + if (!props.isMoveAllowed(movedItem, destinationItem)) { + return false; + } + } + + const numSharedSettingsAndColorScales = + destinationItem.getGroupDelegate().findChildren((item) => { + return item instanceof SharedSetting || item instanceof ColorScale; + }).length ?? 0; + + if (!(movedItem instanceof SharedSetting || movedItem instanceof ColorScale)) { + if (args.position < numSharedSettingsAndColorScales) { + return false; + } + } else { + if (args.originId === args.destinationId) { + if (args.position >= numSharedSettingsAndColorScales) { + return false; + } + } else { + if (args.position > numSharedSettingsAndColorScales) { + return false; + } + } + } + + return true; + } + + function handleItemMoved( + movedItemId: string, + originId: string | null, + destinationId: string | null, + position: number + ) { + const movedItem = groupDelegate.findDescendantById(movedItemId); + if (!movedItem) { + return; + } + + let origin = props.layerManager.getGroupDelegate(); + if (originId) { + const candidate = groupDelegate.findDescendantById(originId); + if (candidate && instanceofGroup(candidate)) { + origin = candidate.getGroupDelegate(); + } + } + + let destination = props.layerManager.getGroupDelegate(); + if (destinationId) { + const candidate = groupDelegate.findDescendantById(destinationId); + if (candidate && instanceofGroup(candidate)) { + destination = candidate.getGroupDelegate(); + } + } + + if (origin === destination) { + origin.moveChild(movedItem, position); + return; + } + + origin.removeChild(movedItem); + destination.insertChild(movedItem, position); + } + + return ( +
+
+
+
Layers
+ + + {props.additionalHeaderComponents} +
+
+ + Click on to add a layer. +
+ } + > + {items.map((item: Item) => + makeSortableListItemComponent(item, props.layerActions, handleLayerAction) + )} + +
+
+ + ); +} diff --git a/frontend/src/modules/2DViewer/layers/SettingsGroup.ts b/frontend/src/modules/2DViewer/layers/framework/SettingsGroup/SettingsGroup.ts similarity index 83% rename from frontend/src/modules/2DViewer/layers/SettingsGroup.ts rename to frontend/src/modules/2DViewer/layers/framework/SettingsGroup/SettingsGroup.ts index 59dae234c..84833c990 100644 --- a/frontend/src/modules/2DViewer/layers/SettingsGroup.ts +++ b/frontend/src/modules/2DViewer/layers/framework/SettingsGroup/SettingsGroup.ts @@ -1,7 +1,7 @@ -import { LayerManager } from "./LayerManager"; -import { GroupDelegate } from "./delegates/GroupDelegate"; -import { ItemDelegate } from "./delegates/ItemDelegate"; -import { Group, SerializedSettingsGroup, SerializedType } from "./interfaces"; +import { GroupDelegate } from "../../delegates/GroupDelegate"; +import { ItemDelegate } from "../../delegates/ItemDelegate"; +import { Group, SerializedSettingsGroup, SerializedType } from "../../interfaces"; +import { LayerManager } from "../LayerManager/LayerManager"; export class SettingsGroup implements Group { private _itemDelegate: ItemDelegate; diff --git a/frontend/src/modules/2DViewer/layers/components/SettingsGroupComponent.tsx b/frontend/src/modules/2DViewer/layers/framework/SettingsGroup/SettingsGroupComponent.tsx similarity index 78% rename from frontend/src/modules/2DViewer/layers/components/SettingsGroupComponent.tsx rename to frontend/src/modules/2DViewer/layers/framework/SettingsGroup/SettingsGroupComponent.tsx index 8d8c6060d..e121fb3f3 100644 --- a/frontend/src/modules/2DViewer/layers/components/SettingsGroupComponent.tsx +++ b/frontend/src/modules/2DViewer/layers/framework/SettingsGroup/SettingsGroupComponent.tsx @@ -1,16 +1,15 @@ import { SortableListGroup } from "@lib/components/SortableList"; import { SettingsApplications } from "@mui/icons-material"; -import { EmptyContent } from "./EmptyContent"; -import { ExpandCollapseAllButton } from "./ExpandCollapseAllButton"; -import { LayersActionGroup, LayersActions } from "./LayersActions"; -import { RemoveItemButton } from "./RemoveItemButton"; -import { makeSortableListItemComponent } from "./utils"; - -import { GroupDelegateTopic } from "../delegates/GroupDelegate"; -import { ItemDelegateTopic } from "../delegates/ItemDelegate"; -import { usePublishSubscribeTopicValue } from "../delegates/PublishSubscribeDelegate"; -import { Group, Item } from "../interfaces"; +import { LayersActionGroup, LayersActions } from "../../LayersActions"; +import { GroupDelegateTopic } from "../../delegates/GroupDelegate"; +import { ItemDelegateTopic } from "../../delegates/ItemDelegate"; +import { usePublishSubscribeTopicValue } from "../../delegates/PublishSubscribeDelegate"; +import { Group, Item } from "../../interfaces"; +import { EmptyContent } from "../utilityComponents/EmptyContent"; +import { ExpandCollapseAllButton } from "../utilityComponents/ExpandCollapseAllButton"; +import { RemoveItemButton } from "../utilityComponents/RemoveItemButton"; +import { makeSortableListItemComponent } from "../utils/makeSortableListItemComponent"; export type SettingsGroupComponentProps = { group: Group; diff --git a/frontend/src/modules/2DViewer/layers/SharedSetting.ts b/frontend/src/modules/2DViewer/layers/framework/SharedSetting/SharedSetting.ts similarity index 92% rename from frontend/src/modules/2DViewer/layers/SharedSetting.ts rename to frontend/src/modules/2DViewer/layers/framework/SharedSetting/SharedSetting.ts index b0a3123e5..eaba26e6d 100644 --- a/frontend/src/modules/2DViewer/layers/SharedSetting.ts +++ b/frontend/src/modules/2DViewer/layers/framework/SharedSetting/SharedSetting.ts @@ -1,8 +1,8 @@ -import { LayerManager, LayerManagerTopic } from "./LayerManager"; -import { ItemDelegate } from "./delegates/ItemDelegate"; -import { SettingTopic } from "./delegates/SettingDelegate"; -import { UnsubscribeHandlerDelegate } from "./delegates/UnsubscribeHandlerDelegate"; -import { Item, Layer, SerializedSharedSetting, SerializedType, Setting, instanceofLayer } from "./interfaces"; +import { ItemDelegate } from "../../delegates/ItemDelegate"; +import { SettingTopic } from "../../delegates/SettingDelegate"; +import { UnsubscribeHandlerDelegate } from "../../delegates/UnsubscribeHandlerDelegate"; +import { Item, Layer, SerializedSharedSetting, SerializedType, Setting, instanceofLayer } from "../../interfaces"; +import { LayerManager, LayerManagerTopic } from "../LayerManager/LayerManager"; export class SharedSetting implements Item { private _wrappedSetting: Setting; diff --git a/frontend/src/modules/2DViewer/layers/components/SharedSettingComponent.tsx b/frontend/src/modules/2DViewer/layers/framework/SharedSetting/SharedSettingComponent.tsx similarity index 91% rename from frontend/src/modules/2DViewer/layers/components/SharedSettingComponent.tsx rename to frontend/src/modules/2DViewer/layers/framework/SharedSetting/SharedSettingComponent.tsx index 27523b6d5..0ad9c38af 100644 --- a/frontend/src/modules/2DViewer/layers/components/SharedSettingComponent.tsx +++ b/frontend/src/modules/2DViewer/layers/framework/SharedSetting/SharedSettingComponent.tsx @@ -6,11 +6,11 @@ import { SortableListItem } from "@lib/components/SortableList"; import { resolveClassNames } from "@lib/utils/resolveClassNames"; import { Delete, ExpandLess, ExpandMore, Link } from "@mui/icons-material"; -import { SettingComponent } from "./SettingComponent"; +import { SharedSetting } from "./SharedSetting"; -import { SharedSetting } from "../SharedSetting"; -import { ItemDelegateTopic } from "../delegates/ItemDelegate"; -import { usePublishSubscribeTopicValue } from "../delegates/PublishSubscribeDelegate"; +import { ItemDelegateTopic } from "../../delegates/ItemDelegate"; +import { usePublishSubscribeTopicValue } from "../../delegates/PublishSubscribeDelegate"; +import { SettingComponent } from "../../settings/SettingComponent"; export type SharedSettingComponentProps = { sharedSetting: SharedSetting; diff --git a/frontend/src/modules/2DViewer/layers/View.ts b/frontend/src/modules/2DViewer/layers/framework/View/View.ts similarity index 80% rename from frontend/src/modules/2DViewer/layers/View.ts rename to frontend/src/modules/2DViewer/layers/framework/View/View.ts index 74f7f5119..1be6fdd9a 100644 --- a/frontend/src/modules/2DViewer/layers/View.ts +++ b/frontend/src/modules/2DViewer/layers/framework/View/View.ts @@ -1,7 +1,7 @@ -import { LayerManager } from "./LayerManager"; -import { GroupDelegate } from "./delegates/GroupDelegate"; -import { ItemDelegate } from "./delegates/ItemDelegate"; -import { Group, SerializedType, SerializedView } from "./interfaces"; +import { GroupDelegate } from "../../delegates/GroupDelegate"; +import { ItemDelegate } from "../../delegates/ItemDelegate"; +import { Group, SerializedType, SerializedView } from "../../interfaces"; +import { LayerManager } from "../LayerManager/LayerManager"; export class View implements Group { private _itemDelegate: ItemDelegate; diff --git a/frontend/src/modules/2DViewer/layers/components/ViewComponent.tsx b/frontend/src/modules/2DViewer/layers/framework/View/ViewComponent.tsx similarity index 75% rename from frontend/src/modules/2DViewer/layers/components/ViewComponent.tsx rename to frontend/src/modules/2DViewer/layers/framework/View/ViewComponent.tsx index 682cf14de..86817a450 100644 --- a/frontend/src/modules/2DViewer/layers/components/ViewComponent.tsx +++ b/frontend/src/modules/2DViewer/layers/framework/View/ViewComponent.tsx @@ -1,17 +1,16 @@ import { SortableListGroup } from "@lib/components/SortableList"; -import { EditName } from "./EditName"; -import { EmptyContent } from "./EmptyContent"; -import { ExpandCollapseAllButton } from "./ExpandCollapseAllButton"; -import { LayersActionGroup, LayersActions } from "./LayersActions"; -import { RemoveItemButton } from "./RemoveItemButton"; -import { VisibilityToggle } from "./VisibilityToggle"; -import { makeSortableListItemComponent } from "./utils"; - -import { GroupDelegateTopic } from "../delegates/GroupDelegate"; -import { ItemDelegateTopic } from "../delegates/ItemDelegate"; -import { usePublishSubscribeTopicValue } from "../delegates/PublishSubscribeDelegate"; -import { Group, Item } from "../interfaces"; +import { LayersActionGroup, LayersActions } from "../../LayersActions"; +import { GroupDelegateTopic } from "../../delegates/GroupDelegate"; +import { ItemDelegateTopic } from "../../delegates/ItemDelegate"; +import { usePublishSubscribeTopicValue } from "../../delegates/PublishSubscribeDelegate"; +import { Group, Item } from "../../interfaces"; +import { EditName } from "../utilityComponents/EditName"; +import { EmptyContent } from "../utilityComponents/EmptyContent"; +import { ExpandCollapseAllButton } from "../utilityComponents/ExpandCollapseAllButton"; +import { RemoveItemButton } from "../utilityComponents/RemoveItemButton"; +import { VisibilityToggle } from "../utilityComponents/VisibilityToggle"; +import { makeSortableListItemComponent } from "../utils/makeSortableListItemComponent"; export type ViewComponentProps = { group: Group; diff --git a/frontend/src/modules/2DViewer/layers/components/EditName.tsx b/frontend/src/modules/2DViewer/layers/framework/utilityComponents/EditName.tsx similarity index 91% rename from frontend/src/modules/2DViewer/layers/components/EditName.tsx rename to frontend/src/modules/2DViewer/layers/framework/utilityComponents/EditName.tsx index b4ec032ee..4e1a418e3 100644 --- a/frontend/src/modules/2DViewer/layers/components/EditName.tsx +++ b/frontend/src/modules/2DViewer/layers/framework/utilityComponents/EditName.tsx @@ -2,9 +2,9 @@ import React from "react"; import { Edit } from "@mui/icons-material"; -import { ItemDelegateTopic } from "../delegates/ItemDelegate"; -import { usePublishSubscribeTopicValue } from "../delegates/PublishSubscribeDelegate"; -import { Item } from "../interfaces"; +import { ItemDelegateTopic } from "../../delegates/ItemDelegate"; +import { usePublishSubscribeTopicValue } from "../../delegates/PublishSubscribeDelegate"; +import { Item } from "../../interfaces"; type EditItemNameProps = { item: Item; diff --git a/frontend/src/modules/2DViewer/layers/components/EmptyContent.tsx b/frontend/src/modules/2DViewer/layers/framework/utilityComponents/EmptyContent.tsx similarity index 100% rename from frontend/src/modules/2DViewer/layers/components/EmptyContent.tsx rename to frontend/src/modules/2DViewer/layers/framework/utilityComponents/EmptyContent.tsx diff --git a/frontend/src/modules/2DViewer/layers/components/ExpandCollapseAllButton.tsx b/frontend/src/modules/2DViewer/layers/framework/utilityComponents/ExpandCollapseAllButton.tsx similarity index 96% rename from frontend/src/modules/2DViewer/layers/components/ExpandCollapseAllButton.tsx rename to frontend/src/modules/2DViewer/layers/framework/utilityComponents/ExpandCollapseAllButton.tsx index 49ecbfb5f..c2e430598 100644 --- a/frontend/src/modules/2DViewer/layers/components/ExpandCollapseAllButton.tsx +++ b/frontend/src/modules/2DViewer/layers/framework/utilityComponents/ExpandCollapseAllButton.tsx @@ -3,7 +3,7 @@ import React from "react"; import { DenseIconButton } from "@lib/components/DenseIconButton"; import { UnfoldLessDouble, UnfoldMoreDouble } from "@mui/icons-material"; -import { Group } from "../interfaces"; +import { Group } from "../../interfaces"; export type ExpandCollapseAllButtonProps = { group: Group; diff --git a/frontend/src/modules/2DViewer/layers/components/RemoveItemButton.tsx b/frontend/src/modules/2DViewer/layers/framework/utilityComponents/RemoveItemButton.tsx similarity index 93% rename from frontend/src/modules/2DViewer/layers/components/RemoveItemButton.tsx rename to frontend/src/modules/2DViewer/layers/framework/utilityComponents/RemoveItemButton.tsx index 805d740b9..0db7c0b75 100644 --- a/frontend/src/modules/2DViewer/layers/components/RemoveItemButton.tsx +++ b/frontend/src/modules/2DViewer/layers/framework/utilityComponents/RemoveItemButton.tsx @@ -2,7 +2,7 @@ import { DenseIconButton } from "@lib/components/DenseIconButton"; import { DenseIconButtonColorScheme } from "@lib/components/DenseIconButton/denseIconButton"; import { Delete } from "@mui/icons-material"; -import { Item, instanceofLayer } from "../interfaces"; +import { Item, instanceofLayer } from "../../interfaces"; export type RemoveItemButtonProps = { item: Item; diff --git a/frontend/src/modules/2DViewer/layers/components/VisibilityToggle.tsx b/frontend/src/modules/2DViewer/layers/framework/utilityComponents/VisibilityToggle.tsx similarity index 78% rename from frontend/src/modules/2DViewer/layers/components/VisibilityToggle.tsx rename to frontend/src/modules/2DViewer/layers/framework/utilityComponents/VisibilityToggle.tsx index 366c17874..0f976b0be 100644 --- a/frontend/src/modules/2DViewer/layers/components/VisibilityToggle.tsx +++ b/frontend/src/modules/2DViewer/layers/framework/utilityComponents/VisibilityToggle.tsx @@ -1,9 +1,9 @@ import { DenseIconButton } from "@lib/components/DenseIconButton"; import { Visibility, VisibilityOff } from "@mui/icons-material"; -import { ItemDelegateTopic } from "../delegates/ItemDelegate"; -import { usePublishSubscribeTopicValue } from "../delegates/PublishSubscribeDelegate"; -import { Item } from "../interfaces"; +import { ItemDelegateTopic } from "../../delegates/ItemDelegate"; +import { usePublishSubscribeTopicValue } from "../../delegates/PublishSubscribeDelegate"; +import { Item } from "../../interfaces"; export type VisibilityToggleProps = { item: Item; diff --git a/frontend/src/modules/2DViewer/layers/DeserializationFactory.ts b/frontend/src/modules/2DViewer/layers/framework/utils/DeserializationFactory.ts similarity index 86% rename from frontend/src/modules/2DViewer/layers/DeserializationFactory.ts rename to frontend/src/modules/2DViewer/layers/framework/utils/DeserializationFactory.ts index bdddd8191..a2474f7d0 100644 --- a/frontend/src/modules/2DViewer/layers/DeserializationFactory.ts +++ b/frontend/src/modules/2DViewer/layers/framework/utils/DeserializationFactory.ts @@ -1,10 +1,3 @@ -import { ColorScale } from "./ColorScale"; -import { LayerManager } from "./LayerManager"; -import { LayerRegistry } from "./LayerRegistry"; -import { SettingRegistry } from "./SettingRegistry"; -import { SettingsGroup } from "./SettingsGroup"; -import { SharedSetting } from "./SharedSetting"; -import { View } from "./View"; import { Item, SerializedColorScale, @@ -14,7 +7,14 @@ import { SerializedSharedSetting, SerializedType, SerializedView, -} from "./interfaces"; +} from "../../interfaces"; +import { LayerRegistry } from "../../layers/LayerRegistry"; +import { SettingRegistry } from "../../settings/SettingRegistry"; +import { ColorScale } from "../ColorScale/ColorScale"; +import { LayerManager } from "../LayerManager/LayerManager"; +import { SettingsGroup } from "../SettingsGroup/SettingsGroup"; +import { SharedSetting } from "../SharedSetting/SharedSetting"; +import { View } from "../View/View"; export class DeserializationFactory { private _layerManager: LayerManager; diff --git a/frontend/src/modules/2DViewer/layers/components/utils.tsx b/frontend/src/modules/2DViewer/layers/framework/utils/makeSortableListItemComponent.tsx similarity index 74% rename from frontend/src/modules/2DViewer/layers/components/utils.tsx rename to frontend/src/modules/2DViewer/layers/framework/utils/makeSortableListItemComponent.tsx index f6991d95e..19f4a674e 100644 --- a/frontend/src/modules/2DViewer/layers/components/utils.tsx +++ b/frontend/src/modules/2DViewer/layers/framework/utils/makeSortableListItemComponent.tsx @@ -1,17 +1,16 @@ -import { ColorScaleComponent } from "./ColorScaleComponent"; -import { DeltaSurfaceComponent } from "./DeltaSurfaceComponent"; -import { LayerComponent } from "./LayerComponent"; -import { LayersActionGroup } from "./LayersActions"; -import { SettingsGroupComponent } from "./SettingsGroupComponent"; -import { SharedSettingComponent } from "./SharedSettingComponent"; -import { ViewComponent } from "./ViewComponent"; - -import { ColorScale } from "../ColorScale"; -import { DeltaSurface } from "../DeltaSurface"; -import { SettingsGroup } from "../SettingsGroup"; -import { SharedSetting } from "../SharedSetting"; -import { View } from "../View"; -import { Group, Item, instanceofLayer } from "../interfaces"; +import { LayersActionGroup } from "../../LayersActions"; +import { Group, Item, instanceofLayer } from "../../interfaces"; +import { LayerComponent } from "../../layers/LayerComponent"; +import { ColorScale } from "../ColorScale/ColorScale"; +import { ColorScaleComponent } from "../ColorScale/ColorScaleComponent"; +import { DeltaSurface } from "../DeltaSurface/DeltaSurface"; +import { DeltaSurfaceComponent } from "../DeltaSurface/DeltaSurfaceComponent"; +import { SettingsGroup } from "../SettingsGroup/SettingsGroup"; +import { SettingsGroupComponent } from "../SettingsGroup/SettingsGroupComponent"; +import { SharedSetting } from "../SharedSetting/SharedSetting"; +import { SharedSettingComponent } from "../SharedSetting/SharedSettingComponent"; +import { View } from "../View/View"; +import { ViewComponent } from "../View/ViewComponent"; export function makeSortableListItemComponent( item: Item, diff --git a/frontend/src/modules/2DViewer/layers/interfaces.ts b/frontend/src/modules/2DViewer/layers/interfaces.ts index 02b80912b..8a492e11b 100644 --- a/frontend/src/modules/2DViewer/layers/interfaces.ts +++ b/frontend/src/modules/2DViewer/layers/interfaces.ts @@ -3,14 +3,14 @@ import { WorkbenchSettings } from "@framework/WorkbenchSettings"; import { ColorScaleSerialization } from "@lib/utils/ColorScale"; import { QueryClient } from "@tanstack/react-query"; -import { Dependency } from "./Dependency"; -import { GlobalSettings } from "./LayerManager"; import { GroupDelegate } from "./delegates/GroupDelegate"; import { ItemDelegate } from "./delegates/ItemDelegate"; import { LayerDelegate } from "./delegates/LayerDelegate"; import { SettingDelegate } from "./delegates/SettingDelegate"; import { SettingsContextDelegate } from "./delegates/SettingsContextDelegate"; -import { SettingType } from "./implementations/settings/settingsTypes"; +import { Dependency } from "./delegates/_utils/Dependency"; +import { GlobalSettings } from "./framework/LayerManager/LayerManager"; +import { SettingType } from "./settings/settingsTypes"; export enum SerializedType { LAYER_MANAGER = "layer-manager", diff --git a/frontend/src/modules/2DViewer/layers/components/LayerComponent.tsx b/frontend/src/modules/2DViewer/layers/layers/LayerComponent.tsx similarity index 95% rename from frontend/src/modules/2DViewer/layers/components/LayerComponent.tsx rename to frontend/src/modules/2DViewer/layers/layers/LayerComponent.tsx index 8345551ac..db3ef4490 100644 --- a/frontend/src/modules/2DViewer/layers/components/LayerComponent.tsx +++ b/frontend/src/modules/2DViewer/layers/layers/LayerComponent.tsx @@ -7,16 +7,15 @@ import { SortableListItem } from "@lib/components/SortableList"; import { resolveClassNames } from "@lib/utils/resolveClassNames"; import { Block, CheckCircle, Difference, Error, ExpandLess, ExpandMore } from "@mui/icons-material"; -import { EditName } from "./EditName"; -import { RemoveItemButton } from "./RemoveItemButton"; -import { SettingComponent } from "./SettingComponent"; -import { VisibilityToggle } from "./VisibilityToggle"; - import { ItemDelegateTopic } from "../delegates/ItemDelegate"; import { LayerDelegateTopic, LayerStatus } from "../delegates/LayerDelegate"; import { usePublishSubscribeTopicValue } from "../delegates/PublishSubscribeDelegate"; import { SettingsContextDelegateTopic, SettingsContextLoadingState } from "../delegates/SettingsContextDelegate"; +import { EditName } from "../framework/utilityComponents/EditName"; +import { RemoveItemButton } from "../framework/utilityComponents/RemoveItemButton"; +import { VisibilityToggle } from "../framework/utilityComponents/VisibilityToggle"; import { Layer, Setting } from "../interfaces"; +import { SettingComponent } from "../settings/SettingComponent"; export type LayerComponentProps = { layer: Layer; diff --git a/frontend/src/modules/2DViewer/layers/LayerRegistry.ts b/frontend/src/modules/2DViewer/layers/layers/LayerRegistry.ts similarity index 84% rename from frontend/src/modules/2DViewer/layers/LayerRegistry.ts rename to frontend/src/modules/2DViewer/layers/layers/LayerRegistry.ts index cb1455e94..c27ed29b7 100644 --- a/frontend/src/modules/2DViewer/layers/LayerRegistry.ts +++ b/frontend/src/modules/2DViewer/layers/layers/LayerRegistry.ts @@ -1,5 +1,5 @@ -import { LayerManager } from "./LayerManager"; -import { Layer } from "./interfaces"; +import { LayerManager } from "../framework/LayerManager/LayerManager"; +import { Layer } from "../interfaces"; export class LayerRegistry { private static _registeredLayers: Map }> = new Map(); diff --git a/frontend/src/modules/2DViewer/layers/queryConstants.ts b/frontend/src/modules/2DViewer/layers/layers/_utils/queryConstants.ts similarity index 100% rename from frontend/src/modules/2DViewer/layers/queryConstants.ts rename to frontend/src/modules/2DViewer/layers/layers/_utils/queryConstants.ts diff --git a/frontend/src/modules/2DViewer/layers/utils.ts b/frontend/src/modules/2DViewer/layers/layers/_utils/utils.ts similarity index 100% rename from frontend/src/modules/2DViewer/layers/utils.ts rename to frontend/src/modules/2DViewer/layers/layers/_utils/utils.ts diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesLayer.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesLayer.ts similarity index 94% rename from frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesLayer.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesLayer.ts index d89976ce1..75bc1752f 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesLayer.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesLayer.ts @@ -1,9 +1,9 @@ import { WellboreTrajectory_api } from "@api"; import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; -import { LayerRegistry } from "@modules/2DViewer/layers/LayerRegistry"; import { ItemDelegate } from "@modules/2DViewer/layers/delegates/ItemDelegate"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { LayerRegistry } from "@modules/2DViewer/layers/layers/LayerRegistry"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; import { QueryClient } from "@tanstack/react-query"; import { isEqual } from "lodash"; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesSettingsContext.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesSettingsContext.ts similarity index 86% rename from frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesSettingsContext.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesSettingsContext.ts index 9889366dc..29c7da0c9 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesSettingsContext.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesSettingsContext.ts @@ -1,15 +1,15 @@ import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; import { SettingsContextDelegate } from "@modules/2DViewer/layers/delegates/SettingsContextDelegate"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; -import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/queryConstants"; -import { cancelPromiseOnAbort } from "@modules/2DViewer/layers/utils"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/layers/_utils/queryConstants"; +import { cancelPromiseOnAbort } from "@modules/2DViewer/layers/layers/_utils/utils"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; import { DrilledWellTrajectoriesSettings } from "./types"; import { DefineDependenciesArgs, SettingsContext } from "../../../interfaces"; -import { DrilledWellboresSetting } from "../../settings/DrilledWellboresSetting"; -import { EnsembleSetting } from "../../settings/EnsembleSetting"; +import { DrilledWellboresSetting } from "../../../settings/implementations/DrilledWellboresSetting"; +import { EnsembleSetting } from "../../../settings/implementations/EnsembleSetting"; export class DrilledWellTrajectoriesSettingsContext implements SettingsContext { private _contextDelegate: SettingsContextDelegate; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellTrajectoriesLayer/types.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellTrajectoriesLayer/types.ts similarity index 74% rename from frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellTrajectoriesLayer/types.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellTrajectoriesLayer/types.ts index f4877d5b6..b8423380e 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellTrajectoriesLayer/types.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellTrajectoriesLayer/types.ts @@ -1,6 +1,6 @@ import { WellboreHeader_api } from "@api"; import { EnsembleIdent } from "@framework/EnsembleIdent"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; export type DrilledWellTrajectoriesSettings = { [SettingType.ENSEMBLE]: EnsembleIdent | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellborePicksLayer/DrilledWellborePicksLayer.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellborePicksLayer/DrilledWellborePicksLayer.ts similarity index 93% rename from frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellborePicksLayer/DrilledWellborePicksLayer.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellborePicksLayer/DrilledWellborePicksLayer.ts index 8cce2eb4e..fa06b0092 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellborePicksLayer/DrilledWellborePicksLayer.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellborePicksLayer/DrilledWellborePicksLayer.ts @@ -1,10 +1,9 @@ import { WellborePick_api } from "@api"; import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; -import { LayerRegistry } from "@modules/2DViewer/layers/LayerRegistry"; import { ItemDelegate } from "@modules/2DViewer/layers/delegates/ItemDelegate"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; -import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/queryConstants"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { LayerRegistry } from "@modules/2DViewer/layers/layers/LayerRegistry"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; import { QueryClient } from "@tanstack/react-query"; import { isEqual } from "lodash"; @@ -14,6 +13,7 @@ import { DrilledWellborePicksSettings } from "./types"; import { LayerColoringType, LayerDelegate } from "../../../delegates/LayerDelegate"; import { BoundingBox, Layer, SerializedLayer } from "../../../interfaces"; +import { CACHE_TIME, STALE_TIME } from "../../_utils/queryConstants"; export class DrilledWellborePicksLayer implements Layer { private _layerDelegate: LayerDelegate; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellborePicksLayer/DrilledWellborePicksSettingsContext.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellborePicksLayer/DrilledWellborePicksSettingsContext.ts similarity index 89% rename from frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellborePicksLayer/DrilledWellborePicksSettingsContext.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellborePicksLayer/DrilledWellborePicksSettingsContext.ts index df55f46b5..e628151fc 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellborePicksLayer/DrilledWellborePicksSettingsContext.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellborePicksLayer/DrilledWellborePicksSettingsContext.ts @@ -1,16 +1,16 @@ import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; import { SettingsContextDelegate } from "@modules/2DViewer/layers/delegates/SettingsContextDelegate"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; -import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/queryConstants"; -import { cancelPromiseOnAbort } from "@modules/2DViewer/layers/utils"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; import { DrilledWellborePicksSettings } from "./types"; import { DefineDependenciesArgs, SettingsContext } from "../../../interfaces"; -import { DrilledWellboresSetting } from "../../settings/DrilledWellboresSetting"; -import { EnsembleSetting } from "../../settings/EnsembleSetting"; -import { SurfaceNameSetting } from "../../settings/SurfaceNameSetting"; +import { DrilledWellboresSetting } from "../../../settings/implementations/DrilledWellboresSetting"; +import { EnsembleSetting } from "../../../settings/implementations/EnsembleSetting"; +import { SurfaceNameSetting } from "../../../settings/implementations/SurfaceNameSetting"; +import { CACHE_TIME, STALE_TIME } from "../../_utils/queryConstants"; +import { cancelPromiseOnAbort } from "../../_utils/utils"; export class DrilledWellborePicksSettingsContext implements SettingsContext { private _contextDelegate: SettingsContextDelegate; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellborePicksLayer/types.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellborePicksLayer/types.ts similarity index 76% rename from frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellborePicksLayer/types.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellborePicksLayer/types.ts index ace87b9b8..1796ddad5 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/DrilledWellborePicksLayer/types.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/DrilledWellborePicksLayer/types.ts @@ -1,6 +1,6 @@ import { WellboreHeader_api } from "@api"; import { EnsembleIdent } from "@framework/EnsembleIdent"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; export type DrilledWellborePicksSettings = { [SettingType.ENSEMBLE]: EnsembleIdent | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/ObservedSurfaceLayer/ObservedSurfaceLayer.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/ObservedSurfaceLayer/ObservedSurfaceLayer.ts similarity index 94% rename from frontend/src/modules/2DViewer/layers/implementations/layers/ObservedSurfaceLayer/ObservedSurfaceLayer.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/ObservedSurfaceLayer/ObservedSurfaceLayer.ts index 2cce9a964..ebfdc7f0b 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/ObservedSurfaceLayer/ObservedSurfaceLayer.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/ObservedSurfaceLayer/ObservedSurfaceLayer.ts @@ -1,10 +1,10 @@ import { SurfaceDataPng_api } from "@api"; import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; -import { LayerRegistry } from "@modules/2DViewer/layers/LayerRegistry"; import { ItemDelegate } from "@modules/2DViewer/layers/delegates/ItemDelegate"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; -import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/queryConstants"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { LayerRegistry } from "@modules/2DViewer/layers/layers/LayerRegistry"; +import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/layers/_utils/queryConstants"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; import { FullSurfaceAddress, SurfaceAddressBuilder } from "@modules/_shared/Surface"; import { SurfaceDataFloat_trans, transformSurfaceData } from "@modules/_shared/Surface/queryDataTransforms"; import { encodeSurfAddrStr } from "@modules/_shared/Surface/surfaceAddress"; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/ObservedSurfaceLayer/ObservedSurfaceSettingsContext.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/ObservedSurfaceLayer/ObservedSurfaceSettingsContext.ts similarity index 88% rename from frontend/src/modules/2DViewer/layers/implementations/layers/ObservedSurfaceLayer/ObservedSurfaceSettingsContext.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/ObservedSurfaceLayer/ObservedSurfaceSettingsContext.ts index 08faa47b3..7ea07106a 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/ObservedSurfaceLayer/ObservedSurfaceSettingsContext.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/ObservedSurfaceLayer/ObservedSurfaceSettingsContext.ts @@ -1,18 +1,18 @@ import { SurfaceTimeType_api } from "@api"; import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; import { SettingsContextDelegate } from "@modules/2DViewer/layers/delegates/SettingsContextDelegate"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; -import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/queryConstants"; -import { cancelPromiseOnAbort } from "@modules/2DViewer/layers/utils"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/layers/_utils/queryConstants"; +import { cancelPromiseOnAbort } from "@modules/2DViewer/layers/layers/_utils/utils"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; import { ObservedSurfaceSettings } from "./types"; import { DefineDependenciesArgs, SettingsContext } from "../../../interfaces"; -import { EnsembleSetting } from "../../settings/EnsembleSetting"; -import { SurfaceAttributeSetting } from "../../settings/SurfaceAttributeSetting"; -import { SurfaceNameSetting } from "../../settings/SurfaceNameSetting"; -import { TimeOrIntervalSetting } from "../../settings/TimeOrIntervalSetting"; +import { EnsembleSetting } from "../../../settings/implementations/EnsembleSetting"; +import { SurfaceAttributeSetting } from "../../../settings/implementations/SurfaceAttributeSetting"; +import { SurfaceNameSetting } from "../../../settings/implementations/SurfaceNameSetting"; +import { TimeOrIntervalSetting } from "../../../settings/implementations/TimeOrIntervalSetting"; export class ObservedSurfaceSettingsContext implements SettingsContext { private _contextDelegate: SettingsContextDelegate; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/ObservedSurfaceLayer/types.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/ObservedSurfaceLayer/types.ts similarity index 76% rename from frontend/src/modules/2DViewer/layers/implementations/layers/ObservedSurfaceLayer/types.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/ObservedSurfaceLayer/types.ts index 26d641e44..a4bc063f3 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/ObservedSurfaceLayer/types.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/ObservedSurfaceLayer/types.ts @@ -1,5 +1,5 @@ import { EnsembleIdent } from "@framework/EnsembleIdent"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; export type ObservedSurfaceSettings = { [SettingType.ENSEMBLE]: EnsembleIdent | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationGridLayer/RealizationGridLayer.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationGridLayer/RealizationGridLayer.ts similarity index 96% rename from frontend/src/modules/2DViewer/layers/implementations/layers/RealizationGridLayer/RealizationGridLayer.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/RealizationGridLayer/RealizationGridLayer.ts index 5b9f64894..efb001eda 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationGridLayer/RealizationGridLayer.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationGridLayer/RealizationGridLayer.ts @@ -1,9 +1,9 @@ import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; -import { LayerRegistry } from "@modules/2DViewer/layers/LayerRegistry"; import { ItemDelegate } from "@modules/2DViewer/layers/delegates/ItemDelegate"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; -import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/queryConstants"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { LayerRegistry } from "@modules/2DViewer/layers/layers/LayerRegistry"; +import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/layers/_utils/queryConstants"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; import { GridMappedProperty_trans, GridSurface_trans, diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationGridLayer/RealizationGridSettingsContext.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationGridLayer/RealizationGridSettingsContext.ts similarity index 88% rename from frontend/src/modules/2DViewer/layers/implementations/layers/RealizationGridLayer/RealizationGridSettingsContext.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/RealizationGridLayer/RealizationGridSettingsContext.ts index 0fe62f597..bd53b1a0c 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationGridLayer/RealizationGridSettingsContext.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationGridLayer/RealizationGridSettingsContext.ts @@ -1,20 +1,20 @@ import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; import { SettingsContextDelegate } from "@modules/2DViewer/layers/delegates/SettingsContextDelegate"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; -import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/queryConstants"; -import { cancelQueryOnAbort } from "@modules/2DViewer/layers/utils"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/layers/_utils/queryConstants"; +import { cancelQueryOnAbort } from "@modules/2DViewer/layers/layers/_utils/utils"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; import { RealizationGridSettings } from "./types"; import { DefineDependenciesArgs, SettingsContext } from "../../../interfaces"; -import { EnsembleSetting } from "../../settings/EnsembleSetting"; -import { GridAttributeSetting } from "../../settings/GridAttributeSetting"; -import { GridLayerSetting } from "../../settings/GridLayerSetting"; -import { GridNameSetting } from "../../settings/GridNameSetting"; -import { RealizationSetting } from "../../settings/RealizationSetting"; -import { ShowGridLinesSetting } from "../../settings/ShowGridLinesSetting"; -import { TimeOrIntervalSetting } from "../../settings/TimeOrIntervalSetting"; +import { EnsembleSetting } from "../../../settings/implementations/EnsembleSetting"; +import { GridAttributeSetting } from "../../../settings/implementations/GridAttributeSetting"; +import { GridLayerSetting } from "../../../settings/implementations/GridLayerSetting"; +import { GridNameSetting } from "../../../settings/implementations/GridNameSetting"; +import { RealizationSetting } from "../../../settings/implementations/RealizationSetting"; +import { ShowGridLinesSetting } from "../../../settings/implementations/ShowGridLinesSetting"; +import { TimeOrIntervalSetting } from "../../../settings/implementations/TimeOrIntervalSetting"; export class RealizationGridSettingsContext implements SettingsContext { private _contextDelegate: SettingsContextDelegate; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationGridLayer/types.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationGridLayer/types.ts similarity index 81% rename from frontend/src/modules/2DViewer/layers/implementations/layers/RealizationGridLayer/types.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/RealizationGridLayer/types.ts index 8dbbeb749..2ac9df1c2 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationGridLayer/types.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationGridLayer/types.ts @@ -1,5 +1,5 @@ import { EnsembleIdent } from "@framework/EnsembleIdent"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; export type RealizationGridSettings = { [SettingType.ENSEMBLE]: EnsembleIdent | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationPolygonsLayer/RealizationPolygonsLayer.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationPolygonsLayer/RealizationPolygonsLayer.ts similarity index 94% rename from frontend/src/modules/2DViewer/layers/implementations/layers/RealizationPolygonsLayer/RealizationPolygonsLayer.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/RealizationPolygonsLayer/RealizationPolygonsLayer.ts index 81b069a54..7df1d8210 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationPolygonsLayer/RealizationPolygonsLayer.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationPolygonsLayer/RealizationPolygonsLayer.ts @@ -1,11 +1,11 @@ import { PolygonData_api } from "@api"; import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; -import { LayerRegistry } from "@modules/2DViewer/layers/LayerRegistry"; import { ItemDelegate } from "@modules/2DViewer/layers/delegates/ItemDelegate"; import { LayerColoringType, LayerDelegate } from "@modules/2DViewer/layers/delegates/LayerDelegate"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; -import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/queryConstants"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { LayerRegistry } from "@modules/2DViewer/layers/layers/LayerRegistry"; +import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/layers/_utils/queryConstants"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; import { QueryClient } from "@tanstack/react-query"; import { isEqual } from "lodash"; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationPolygonsLayer/RealizationPolygonsSettingsContext.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationPolygonsLayer/RealizationPolygonsSettingsContext.ts similarity index 86% rename from frontend/src/modules/2DViewer/layers/implementations/layers/RealizationPolygonsLayer/RealizationPolygonsSettingsContext.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/RealizationPolygonsLayer/RealizationPolygonsSettingsContext.ts index 6da787736..e736b165d 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationPolygonsLayer/RealizationPolygonsSettingsContext.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationPolygonsLayer/RealizationPolygonsSettingsContext.ts @@ -1,17 +1,17 @@ import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; import { SettingsContextDelegate } from "@modules/2DViewer/layers/delegates/SettingsContextDelegate"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; -import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/queryConstants"; -import { cancelPromiseOnAbort } from "@modules/2DViewer/layers/utils"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/layers/_utils/queryConstants"; +import { cancelPromiseOnAbort } from "@modules/2DViewer/layers/layers/_utils/utils"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; import { RealizationPolygonsSettings } from "./types"; import { DefineDependenciesArgs, SettingsContext } from "../../../interfaces"; -import { EnsembleSetting } from "../../settings/EnsembleSetting"; -import { PolygonsAttributeSetting } from "../../settings/PolygonsAttributeSetting"; -import { PolygonsNameSetting } from "../../settings/PolygonsNameSetting"; -import { RealizationSetting } from "../../settings/RealizationSetting"; +import { EnsembleSetting } from "../../../settings/implementations/EnsembleSetting"; +import { PolygonsAttributeSetting } from "../../../settings/implementations/PolygonsAttributeSetting"; +import { PolygonsNameSetting } from "../../../settings/implementations/PolygonsNameSetting"; +import { RealizationSetting } from "../../../settings/implementations/RealizationSetting"; export class RealizationPolygonsSettingsContext implements SettingsContext { private _contextDelegate: SettingsContextDelegate; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationPolygonsLayer/types.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationPolygonsLayer/types.ts similarity index 82% rename from frontend/src/modules/2DViewer/layers/implementations/layers/RealizationPolygonsLayer/types.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/RealizationPolygonsLayer/types.ts index cc5807a1e..1b79a705b 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationPolygonsLayer/types.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationPolygonsLayer/types.ts @@ -1,6 +1,6 @@ import { EnsembleIdent } from "@framework/EnsembleIdent"; -import { SettingType } from "../../settings/settingsTypes"; +import { SettingType } from "../../../settings/settingsTypes"; export type RealizationPolygonsSettings = { [SettingType.ENSEMBLE]: EnsembleIdent | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationSurfaceLayer/RealizationSurfaceLayer.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationSurfaceLayer/RealizationSurfaceLayer.ts similarity index 94% rename from frontend/src/modules/2DViewer/layers/implementations/layers/RealizationSurfaceLayer/RealizationSurfaceLayer.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/RealizationSurfaceLayer/RealizationSurfaceLayer.ts index 0af3bf577..f5159e8b2 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationSurfaceLayer/RealizationSurfaceLayer.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationSurfaceLayer/RealizationSurfaceLayer.ts @@ -1,11 +1,11 @@ import { SurfaceDataPng_api, SurfaceTimeType_api } from "@api"; import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; -import { LayerRegistry } from "@modules/2DViewer/layers/LayerRegistry"; import { ItemDelegate } from "@modules/2DViewer/layers/delegates/ItemDelegate"; import { LayerColoringType, LayerDelegate } from "@modules/2DViewer/layers/delegates/LayerDelegate"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; -import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/queryConstants"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { LayerRegistry } from "@modules/2DViewer/layers/layers/LayerRegistry"; +import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/layers/_utils/queryConstants"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; import { FullSurfaceAddress, SurfaceAddressBuilder } from "@modules/_shared/Surface"; import { SurfaceDataFloat_trans, transformSurfaceData } from "@modules/_shared/Surface/queryDataTransforms"; import { encodeSurfAddrStr } from "@modules/_shared/Surface/surfaceAddress"; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationSurfaceLayer/RealizationSurfaceSettingsContext.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationSurfaceLayer/RealizationSurfaceSettingsContext.ts similarity index 88% rename from frontend/src/modules/2DViewer/layers/implementations/layers/RealizationSurfaceLayer/RealizationSurfaceSettingsContext.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/RealizationSurfaceLayer/RealizationSurfaceSettingsContext.ts index c59a67635..2322f86bd 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationSurfaceLayer/RealizationSurfaceSettingsContext.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationSurfaceLayer/RealizationSurfaceSettingsContext.ts @@ -1,19 +1,19 @@ import { SurfaceTimeType_api } from "@api"; import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; import { SettingsContextDelegate } from "@modules/2DViewer/layers/delegates/SettingsContextDelegate"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; -import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/queryConstants"; -import { cancelPromiseOnAbort } from "@modules/2DViewer/layers/utils"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/layers/_utils/queryConstants"; +import { cancelPromiseOnAbort } from "@modules/2DViewer/layers/layers/_utils/utils"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; import { RealizationSurfaceSettings } from "./types"; import { DefineDependenciesArgs, SettingsContext } from "../../../interfaces"; -import { EnsembleSetting } from "../../settings/EnsembleSetting"; -import { RealizationSetting } from "../../settings/RealizationSetting"; -import { SurfaceAttributeSetting } from "../../settings/SurfaceAttributeSetting"; -import { SurfaceNameSetting } from "../../settings/SurfaceNameSetting"; -import { TimeOrIntervalSetting } from "../../settings/TimeOrIntervalSetting"; +import { EnsembleSetting } from "../../../settings/implementations/EnsembleSetting"; +import { RealizationSetting } from "../../../settings/implementations/RealizationSetting"; +import { SurfaceAttributeSetting } from "../../../settings/implementations/SurfaceAttributeSetting"; +import { SurfaceNameSetting } from "../../../settings/implementations/SurfaceNameSetting"; +import { TimeOrIntervalSetting } from "../../../settings/implementations/TimeOrIntervalSetting"; export class RealizationSurfaceSettingsContext implements SettingsContext { private _contextDelegate: SettingsContextDelegate; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationSurfaceLayer/types.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationSurfaceLayer/types.ts similarity index 84% rename from frontend/src/modules/2DViewer/layers/implementations/layers/RealizationSurfaceLayer/types.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/RealizationSurfaceLayer/types.ts index 4eb3e2c98..6477cdcc6 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/RealizationSurfaceLayer/types.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/RealizationSurfaceLayer/types.ts @@ -1,6 +1,6 @@ import { EnsembleIdent } from "@framework/EnsembleIdent"; -import { SettingType } from "../../settings/settingsTypes"; +import { SettingType } from "../../../settings/settingsTypes"; export type RealizationSurfaceSettings = { [SettingType.ENSEMBLE]: EnsembleIdent | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/StatisticalSurfaceLayer.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/StatisticalSurfaceLayer/StatisticalSurfaceLayer.ts similarity index 95% rename from frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/StatisticalSurfaceLayer.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/StatisticalSurfaceLayer/StatisticalSurfaceLayer.ts index db7910e60..d34862f1f 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/StatisticalSurfaceLayer.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/StatisticalSurfaceLayer/StatisticalSurfaceLayer.ts @@ -1,11 +1,11 @@ import { SurfaceDataPng_api, SurfaceTimeType_api } from "@api"; import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; -import { LayerRegistry } from "@modules/2DViewer/layers/LayerRegistry"; import { ItemDelegate } from "@modules/2DViewer/layers/delegates/ItemDelegate"; import { LayerColoringType, LayerDelegate } from "@modules/2DViewer/layers/delegates/LayerDelegate"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; -import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/queryConstants"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { LayerRegistry } from "@modules/2DViewer/layers/layers/LayerRegistry"; +import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/layers/_utils/queryConstants"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; import { FullSurfaceAddress, SurfaceAddressBuilder } from "@modules/_shared/Surface"; import { SurfaceDataFloat_trans, transformSurfaceData } from "@modules/_shared/Surface/queryDataTransforms"; import { encodeSurfAddrStr } from "@modules/_shared/Surface/surfaceAddress"; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/StatisticalSurfaceSettingsContext.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/StatisticalSurfaceLayer/StatisticalSurfaceSettingsContext.ts similarity index 89% rename from frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/StatisticalSurfaceSettingsContext.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/StatisticalSurfaceLayer/StatisticalSurfaceSettingsContext.ts index f849997de..c052e92db 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/StatisticalSurfaceSettingsContext.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/StatisticalSurfaceLayer/StatisticalSurfaceSettingsContext.ts @@ -1,20 +1,20 @@ import { SurfaceStatisticFunction_api, SurfaceTimeType_api } from "@api"; import { apiService } from "@framework/ApiService"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; -import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/queryConstants"; -import { cancelPromiseOnAbort } from "@modules/2DViewer/layers/utils"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { CACHE_TIME, STALE_TIME } from "@modules/2DViewer/layers/layers/_utils/queryConstants"; +import { cancelPromiseOnAbort } from "@modules/2DViewer/layers/layers/_utils/utils"; import { StatisticalSurfaceSettings } from "./types"; import { SettingsContextDelegate } from "../../../delegates/SettingsContextDelegate"; import { DefineDependenciesArgs, SettingsContext } from "../../../interfaces"; -import { EnsembleSetting } from "../../settings/EnsembleSetting"; -import { SensitivityNameCasePair, SensitivitySetting } from "../../settings/SensitivitySetting"; -import { StatisticFunctionSetting } from "../../settings/StatisticFunctionSetting"; -import { SurfaceAttributeSetting } from "../../settings/SurfaceAttributeSetting"; -import { SurfaceNameSetting } from "../../settings/SurfaceNameSetting"; -import { TimeOrIntervalSetting } from "../../settings/TimeOrIntervalSetting"; -import { SettingType } from "../../settings/settingsTypes"; +import { EnsembleSetting } from "../../../settings/implementations/EnsembleSetting"; +import { SensitivityNameCasePair, SensitivitySetting } from "../../../settings/implementations/SensitivitySetting"; +import { StatisticFunctionSetting } from "../../../settings/implementations/StatisticFunctionSetting"; +import { SurfaceAttributeSetting } from "../../../settings/implementations/SurfaceAttributeSetting"; +import { SurfaceNameSetting } from "../../../settings/implementations/SurfaceNameSetting"; +import { TimeOrIntervalSetting } from "../../../settings/implementations/TimeOrIntervalSetting"; +import { SettingType } from "../../../settings/settingsTypes"; export class StatisticalSurfaceSettingsContext implements SettingsContext { private _contextDelegate: SettingsContextDelegate; diff --git a/frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/types.ts b/frontend/src/modules/2DViewer/layers/layers/implementations/StatisticalSurfaceLayer/types.ts similarity index 73% rename from frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/types.ts rename to frontend/src/modules/2DViewer/layers/layers/implementations/StatisticalSurfaceLayer/types.ts index 6d6b08349..639fc8253 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/types.ts +++ b/frontend/src/modules/2DViewer/layers/layers/implementations/StatisticalSurfaceLayer/types.ts @@ -1,8 +1,8 @@ import { SurfaceStatisticFunction_api } from "@api"; import { EnsembleIdent } from "@framework/EnsembleIdent"; -import { SettingType } from "@modules/2DViewer/layers/implementations/settings/settingsTypes"; +import { SettingType } from "@modules/2DViewer/layers/settings/settingsTypes"; -import { SensitivityNameCasePair } from "../../settings/SensitivitySetting"; +import { SensitivityNameCasePair } from "../../../settings/implementations/SensitivitySetting"; export type StatisticalSurfaceSettings = { [SettingType.ENSEMBLE]: EnsembleIdent | null; diff --git a/frontend/src/modules/2DViewer/layers/components/SettingComponent.tsx b/frontend/src/modules/2DViewer/layers/settings/SettingComponent.tsx similarity index 98% rename from frontend/src/modules/2DViewer/layers/components/SettingComponent.tsx rename to frontend/src/modules/2DViewer/layers/settings/SettingComponent.tsx index 122fad595..360bc91c2 100644 --- a/frontend/src/modules/2DViewer/layers/components/SettingComponent.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/SettingComponent.tsx @@ -4,9 +4,9 @@ import { PendingWrapper } from "@lib/components/PendingWrapper"; import { resolveClassNames } from "@lib/utils/resolveClassNames"; import { Link, Warning } from "@mui/icons-material"; -import { LayerManager, LayerManagerTopic } from "../LayerManager"; import { usePublishSubscribeTopicValue } from "../delegates/PublishSubscribeDelegate"; import { SettingTopic } from "../delegates/SettingDelegate"; +import { LayerManager, LayerManagerTopic } from "../framework/LayerManager/LayerManager"; import { Setting, SettingComponentProps as SettingComponentPropsInterface } from "../interfaces"; export type SettingComponentProps = { diff --git a/frontend/src/modules/2DViewer/layers/SettingRegistry.ts b/frontend/src/modules/2DViewer/layers/settings/SettingRegistry.ts similarity index 90% rename from frontend/src/modules/2DViewer/layers/SettingRegistry.ts rename to frontend/src/modules/2DViewer/layers/settings/SettingRegistry.ts index b8e8b8a76..ade7db21c 100644 --- a/frontend/src/modules/2DViewer/layers/SettingRegistry.ts +++ b/frontend/src/modules/2DViewer/layers/settings/SettingRegistry.ts @@ -1,4 +1,4 @@ -import { Setting } from "./interfaces"; +import { Setting } from "../interfaces"; export class SettingRegistry { private static _registeredSettings: Record }> = {}; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/DrilledWellboresSetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/DrilledWellboresSetting.tsx similarity index 97% rename from frontend/src/modules/2DViewer/layers/implementations/settings/DrilledWellboresSetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/DrilledWellboresSetting.tsx index dbac02115..1bf1840a6 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/DrilledWellboresSetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/DrilledWellboresSetting.tsx @@ -5,11 +5,10 @@ import { DenseIconButton } from "@lib/components/DenseIconButton"; import { Select, SelectOption } from "@lib/components/Select"; import { Deselect, SelectAll } from "@mui/icons-material"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { AvailableValuesType, Setting, SettingComponentProps } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; type ValueType = WellboreHeader_api[] | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/EnsembleSetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/EnsembleSetting.tsx similarity index 95% rename from frontend/src/modules/2DViewer/layers/implementations/settings/EnsembleSetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/EnsembleSetting.tsx index fd874de2d..de7eeb630 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/EnsembleSetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/EnsembleSetting.tsx @@ -3,11 +3,10 @@ import React from "react"; import { EnsembleIdent } from "@framework/EnsembleIdent"; import { EnsembleDropdown } from "@framework/components/EnsembleDropdown"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { Setting, SettingComponentProps, ValueToStringArgs } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; export class EnsembleSetting implements Setting { private _delegate: SettingDelegate; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/GridAttributeSetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/GridAttributeSetting.tsx similarity index 93% rename from frontend/src/modules/2DViewer/layers/implementations/settings/GridAttributeSetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/GridAttributeSetting.tsx index abe416206..d12897bc6 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/GridAttributeSetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/GridAttributeSetting.tsx @@ -2,11 +2,10 @@ import React from "react"; import { Dropdown, DropdownOption } from "@lib/components/Dropdown"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { Setting, SettingComponentProps } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; type ValueType = string | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/GridLayerSetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/GridLayerSetting.tsx similarity index 96% rename from frontend/src/modules/2DViewer/layers/implementations/settings/GridLayerSetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/GridLayerSetting.tsx index 64f21a64f..b4fd2c994 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/GridLayerSetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/GridLayerSetting.tsx @@ -2,11 +2,10 @@ import React from "react"; import { Dropdown, DropdownOption } from "@lib/components/Dropdown"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { AvailableValuesType, Setting, SettingComponentProps } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; type ValueType = number | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/GridNameSetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/GridNameSetting.tsx similarity index 93% rename from frontend/src/modules/2DViewer/layers/implementations/settings/GridNameSetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/GridNameSetting.tsx index 3b5382cc1..ff08eb941 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/GridNameSetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/GridNameSetting.tsx @@ -2,11 +2,10 @@ import React from "react"; import { Dropdown, DropdownOption } from "@lib/components/Dropdown"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { Setting, SettingComponentProps } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; type ValueType = string | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/PolygonsAttributeSetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/PolygonsAttributeSetting.tsx similarity index 93% rename from frontend/src/modules/2DViewer/layers/implementations/settings/PolygonsAttributeSetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/PolygonsAttributeSetting.tsx index c30ef2f7d..b3408e10a 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/PolygonsAttributeSetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/PolygonsAttributeSetting.tsx @@ -2,11 +2,10 @@ import React from "react"; import { Dropdown, DropdownOption } from "@lib/components/Dropdown"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { Setting, SettingComponentProps } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; type ValueType = string | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/PolygonsNameSetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/PolygonsNameSetting.tsx similarity index 93% rename from frontend/src/modules/2DViewer/layers/implementations/settings/PolygonsNameSetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/PolygonsNameSetting.tsx index 21174f149..c9f740da6 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/PolygonsNameSetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/PolygonsNameSetting.tsx @@ -2,11 +2,10 @@ import React from "react"; import { Dropdown, DropdownOption } from "@lib/components/Dropdown"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { Setting, SettingComponentProps } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; type ValueType = string | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/RealizationSetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/RealizationSetting.tsx similarity index 94% rename from frontend/src/modules/2DViewer/layers/implementations/settings/RealizationSetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/RealizationSetting.tsx index e87ef2a04..26a55ed42 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/RealizationSetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/RealizationSetting.tsx @@ -2,11 +2,10 @@ import React from "react"; import { Dropdown, DropdownOption } from "@lib/components/Dropdown"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { Setting, SettingComponentProps } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; export class RealizationSetting implements Setting { private _delegate: SettingDelegate; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/SensitivitySetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/SensitivitySetting.tsx similarity index 98% rename from frontend/src/modules/2DViewer/layers/implementations/settings/SensitivitySetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/SensitivitySetting.tsx index b6683c24c..6e4376636 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/SensitivitySetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/SensitivitySetting.tsx @@ -2,11 +2,10 @@ import React from "react"; import { Dropdown } from "@lib/components/Dropdown"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { AvailableValuesType, Setting, SettingComponentProps } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; export type SensitivityNameCasePair = { sensitivityName: string; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/ShowGridLinesSetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/ShowGridLinesSetting.tsx similarity index 92% rename from frontend/src/modules/2DViewer/layers/implementations/settings/ShowGridLinesSetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/ShowGridLinesSetting.tsx index a33565697..e10ce01af 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/ShowGridLinesSetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/ShowGridLinesSetting.tsx @@ -2,11 +2,10 @@ import React, { ChangeEvent } from "react"; import { Switch } from "@lib/components/Switch"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { Setting, SettingComponentProps } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; type ValueType = boolean; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/StatisticFunctionSetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/StatisticFunctionSetting.tsx similarity index 95% rename from frontend/src/modules/2DViewer/layers/implementations/settings/StatisticFunctionSetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/StatisticFunctionSetting.tsx index c79805957..a130a38f1 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/StatisticFunctionSetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/StatisticFunctionSetting.tsx @@ -3,11 +3,10 @@ import React from "react"; import { SurfaceStatisticFunction_api } from "@api"; import { Dropdown, DropdownOption } from "@lib/components/Dropdown"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { Setting, SettingComponentProps } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; export class StatisticFunctionSetting implements Setting { private _delegate: SettingDelegate; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/SurfaceAttributeSetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/SurfaceAttributeSetting.tsx similarity index 93% rename from frontend/src/modules/2DViewer/layers/implementations/settings/SurfaceAttributeSetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/SurfaceAttributeSetting.tsx index 31f553c18..8564c554e 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/SurfaceAttributeSetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/SurfaceAttributeSetting.tsx @@ -2,11 +2,10 @@ import React from "react"; import { Dropdown, DropdownOption } from "@lib/components/Dropdown"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { Setting, SettingComponentProps } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; type ValueType = string | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/SurfaceNameSetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/SurfaceNameSetting.tsx similarity index 93% rename from frontend/src/modules/2DViewer/layers/implementations/settings/SurfaceNameSetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/SurfaceNameSetting.tsx index ab59a4bd2..2044fe335 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/SurfaceNameSetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/SurfaceNameSetting.tsx @@ -2,11 +2,10 @@ import React from "react"; import { Dropdown, DropdownOption } from "@lib/components/Dropdown"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { Setting, SettingComponentProps } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; type ValueType = string | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/TimeOrIntervalSetting.tsx b/frontend/src/modules/2DViewer/layers/settings/implementations/TimeOrIntervalSetting.tsx similarity index 95% rename from frontend/src/modules/2DViewer/layers/implementations/settings/TimeOrIntervalSetting.tsx rename to frontend/src/modules/2DViewer/layers/settings/implementations/TimeOrIntervalSetting.tsx index dcd5d3b8b..84ec928f6 100644 --- a/frontend/src/modules/2DViewer/layers/implementations/settings/TimeOrIntervalSetting.tsx +++ b/frontend/src/modules/2DViewer/layers/settings/implementations/TimeOrIntervalSetting.tsx @@ -3,11 +3,10 @@ import React from "react"; import { SurfaceTimeType_api } from "@api"; import { Dropdown, DropdownOption } from "@lib/components/Dropdown"; -import { SettingType } from "./settingsTypes"; - -import { SettingRegistry } from "../../SettingRegistry"; import { SettingDelegate } from "../../delegates/SettingDelegate"; import { Setting, SettingComponentProps, ValueToStringArgs } from "../../interfaces"; +import { SettingRegistry } from "../SettingRegistry"; +import { SettingType } from "../settingsTypes"; type ValueType = string | null; diff --git a/frontend/src/modules/2DViewer/layers/implementations/settings/settingsTypes.ts b/frontend/src/modules/2DViewer/layers/settings/settingsTypes.ts similarity index 100% rename from frontend/src/modules/2DViewer/layers/implementations/settings/settingsTypes.ts rename to frontend/src/modules/2DViewer/layers/settings/settingsTypes.ts diff --git a/frontend/src/modules/2DViewer/settings/atoms/baseAtoms.ts b/frontend/src/modules/2DViewer/settings/atoms/baseAtoms.ts index c67693fd1..cc7eb4953 100644 --- a/frontend/src/modules/2DViewer/settings/atoms/baseAtoms.ts +++ b/frontend/src/modules/2DViewer/settings/atoms/baseAtoms.ts @@ -1,4 +1,4 @@ -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; import { PreferredViewLayout } from "@modules/2DViewer/types"; import { atom } from "jotai"; diff --git a/frontend/src/modules/2DViewer/settings/components/layerManagerComponent.tsx b/frontend/src/modules/2DViewer/settings/components/layerManagerComponent.tsx index 0a96374f5..54e040211 100644 --- a/frontend/src/modules/2DViewer/settings/components/layerManagerComponent.tsx +++ b/frontend/src/modules/2DViewer/settings/components/layerManagerComponent.tsx @@ -8,37 +8,31 @@ import { Menu } from "@lib/components/Menu"; import { MenuButton } from "@lib/components/MenuButton"; import { MenuHeading } from "@lib/components/MenuHeading"; import { MenuItem } from "@lib/components/MenuItem"; -import { IsMoveAllowedArgs, SortableList } from "@lib/components/SortableList"; -import { useElementSize } from "@lib/hooks/useElementSize"; -import { convertRemToPixels } from "@lib/utils/screenUnitConversions"; -import { ColorScale } from "@modules/2DViewer/layers/ColorScale"; -import { DeltaSurface } from "@modules/2DViewer/layers/DeltaSurface"; -import { LayerManager } from "@modules/2DViewer/layers/LayerManager"; -import { SettingsGroup } from "@modules/2DViewer/layers/SettingsGroup"; -import { SharedSetting } from "@modules/2DViewer/layers/SharedSetting"; -import { View } from "@modules/2DViewer/layers/View"; -import { ExpandCollapseAllButton } from "@modules/2DViewer/layers/components/ExpandCollapseAllButton"; -import { LayersActionGroup, LayersActions } from "@modules/2DViewer/layers/components/LayersActions"; -import { makeSortableListItemComponent } from "@modules/2DViewer/layers/components/utils"; -import { GroupDelegateTopic } from "@modules/2DViewer/layers/delegates/GroupDelegate"; -import { usePublishSubscribeTopicValue } from "@modules/2DViewer/layers/delegates/PublishSubscribeDelegate"; -import { DrilledWellTrajectoriesLayer } from "@modules/2DViewer/layers/implementations/layers/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesLayer"; -import { DrilledWellborePicksLayer } from "@modules/2DViewer/layers/implementations/layers/DrilledWellborePicksLayer/DrilledWellborePicksLayer"; -import { ObservedSurfaceLayer } from "@modules/2DViewer/layers/implementations/layers/ObservedSurfaceLayer/ObservedSurfaceLayer"; -import { RealizationGridLayer } from "@modules/2DViewer/layers/implementations/layers/RealizationGridLayer/RealizationGridLayer"; -import { RealizationPolygonsLayer } from "@modules/2DViewer/layers/implementations/layers/RealizationPolygonsLayer/RealizationPolygonsLayer"; -import { RealizationSurfaceLayer } from "@modules/2DViewer/layers/implementations/layers/RealizationSurfaceLayer/RealizationSurfaceLayer"; -import { StatisticalSurfaceLayer } from "@modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/StatisticalSurfaceLayer"; -import { EnsembleSetting } from "@modules/2DViewer/layers/implementations/settings/EnsembleSetting"; -import { RealizationSetting } from "@modules/2DViewer/layers/implementations/settings/RealizationSetting"; -import { SurfaceAttributeSetting } from "@modules/2DViewer/layers/implementations/settings/SurfaceAttributeSetting"; -import { SurfaceNameSetting } from "@modules/2DViewer/layers/implementations/settings/SurfaceNameSetting"; -import { TimeOrIntervalSetting } from "@modules/2DViewer/layers/implementations/settings/TimeOrIntervalSetting"; +import { LayersActionGroup } from "@modules/2DViewer/layers/LayersActions"; +import { GroupDelegate } from "@modules/2DViewer/layers/delegates/GroupDelegate"; +import { ColorScale } from "@modules/2DViewer/layers/framework/ColorScale/ColorScale"; +import { DeltaSurface } from "@modules/2DViewer/layers/framework/DeltaSurface/DeltaSurface"; +import { LayerManager } from "@modules/2DViewer/layers/framework/LayerManager/LayerManager"; +import { LayerManagerComponent } from "@modules/2DViewer/layers/framework/LayerManager/LayerManagerComponent"; +import { SettingsGroup } from "@modules/2DViewer/layers/framework/SettingsGroup/SettingsGroup"; +import { SharedSetting } from "@modules/2DViewer/layers/framework/SharedSetting/SharedSetting"; +import { View } from "@modules/2DViewer/layers/framework/View/View"; import { Group, Item, instanceofGroup, instanceofLayer } from "@modules/2DViewer/layers/interfaces"; +import { DrilledWellTrajectoriesLayer } from "@modules/2DViewer/layers/layers/implementations/DrilledWellTrajectoriesLayer/DrilledWellTrajectoriesLayer"; +import { DrilledWellborePicksLayer } from "@modules/2DViewer/layers/layers/implementations/DrilledWellborePicksLayer/DrilledWellborePicksLayer"; +import { ObservedSurfaceLayer } from "@modules/2DViewer/layers/layers/implementations/ObservedSurfaceLayer/ObservedSurfaceLayer"; +import { RealizationGridLayer } from "@modules/2DViewer/layers/layers/implementations/RealizationGridLayer/RealizationGridLayer"; +import { RealizationPolygonsLayer } from "@modules/2DViewer/layers/layers/implementations/RealizationPolygonsLayer/RealizationPolygonsLayer"; +import { RealizationSurfaceLayer } from "@modules/2DViewer/layers/layers/implementations/RealizationSurfaceLayer/RealizationSurfaceLayer"; +import { StatisticalSurfaceLayer } from "@modules/2DViewer/layers/layers/implementations/StatisticalSurfaceLayer/StatisticalSurfaceLayer"; +import { EnsembleSetting } from "@modules/2DViewer/layers/settings/implementations/EnsembleSetting"; +import { RealizationSetting } from "@modules/2DViewer/layers/settings/implementations/RealizationSetting"; +import { SurfaceAttributeSetting } from "@modules/2DViewer/layers/settings/implementations/SurfaceAttributeSetting"; +import { SurfaceNameSetting } from "@modules/2DViewer/layers/settings/implementations/SurfaceNameSetting"; +import { TimeOrIntervalSetting } from "@modules/2DViewer/layers/settings/implementations/TimeOrIntervalSetting"; import { PreferredViewLayout } from "@modules/2DViewer/types"; import { Dropdown } from "@mui/base"; import { - Add, Check, Panorama, SettingsApplications, @@ -51,28 +45,20 @@ import { useAtom } from "jotai"; import { preferredViewLayoutAtom } from "../atoms/baseAtoms"; -export type LayerManagerComponentProps = { +export type LayerManagerComponentWrapperProps = { layerManager: LayerManager; workbenchSession: WorkbenchSession; workbenchSettings: WorkbenchSettings; }; -export function LayerManagerComponent(props: LayerManagerComponentProps): React.ReactNode { - const layerListRef = React.useRef(null); +export function LayerManagerComponentWrapper(props: LayerManagerComponentWrapperProps): React.ReactNode { const colorSet = props.workbenchSettings.useColorSet(); - const layerListSize = useElementSize(layerListRef); const [preferredViewLayout, setPreferredViewLayout] = useAtom(preferredViewLayoutAtom); const groupDelegate = props.layerManager.getGroupDelegate(); - const items = usePublishSubscribeTopicValue(groupDelegate, GroupDelegateTopic.CHILDREN); - - function handleLayerAction(identifier: string, group?: Group) { - let groupDelegate = props.layerManager.getGroupDelegate(); - if (group) { - groupDelegate = group.getGroupDelegate(); - } + function handleLayerAction(identifier: string, groupDelegate: GroupDelegate) { const numSharedSettings = groupDelegate.findChildren((item) => { return item instanceof SharedSetting; }).length; @@ -133,24 +119,7 @@ export function LayerManagerComponent(props: LayerManagerComponentProps): React. } } - function checkIfItemMoveAllowed(args: IsMoveAllowedArgs): boolean { - const movedItem = groupDelegate.findDescendantById(args.movedItemId); - if (!movedItem) { - return false; - } - - const destinationItem = args.destinationId - ? groupDelegate.findDescendantById(args.destinationId) - : props.layerManager; - - if (!destinationItem || !instanceofGroup(destinationItem)) { - return false; - } - - if (movedItem instanceof View && destinationItem instanceof View) { - return false; - } - + function checkIfItemMoveAllowed(movedItem: Item, destinationItem: Group): boolean { if (destinationItem instanceof DeltaSurface) { if ( instanceofLayer(movedItem) && @@ -172,117 +141,41 @@ export function LayerManagerComponent(props: LayerManagerComponentProps): React. } } - const numSharedSettingsAndColorScales = - destinationItem.getGroupDelegate().findChildren((item) => { - return item instanceof SharedSetting || item instanceof ColorScale; - }).length ?? 0; - - if (!(movedItem instanceof SharedSetting || movedItem instanceof ColorScale)) { - if (args.position < numSharedSettingsAndColorScales) { - return false; - } - } else { - if (args.originId === args.destinationId) { - if (args.position >= numSharedSettingsAndColorScales) { - return false; - } - } else { - if (args.position > numSharedSettingsAndColorScales) { - return false; - } - } - } - return true; } - function handleItemMoved( - movedItemId: string, - originId: string | null, - destinationId: string | null, - position: number - ) { - const movedItem = groupDelegate.findDescendantById(movedItemId); - if (!movedItem) { - return; - } - - let origin = props.layerManager.getGroupDelegate(); - if (originId) { - const candidate = groupDelegate.findDescendantById(originId); - if (candidate && instanceofGroup(candidate)) { - origin = candidate.getGroupDelegate(); - } - } - - let destination = props.layerManager.getGroupDelegate(); - if (destinationId) { - const candidate = groupDelegate.findDescendantById(destinationId); - if (candidate && instanceofGroup(candidate)) { - destination = candidate.getGroupDelegate(); - } - } - - if (origin === destination) { - origin.moveChild(movedItem, position); - return; - } - - origin.removeChild(movedItem); - destination.insertChild(movedItem, position); - } - const hasView = groupDelegate.getDescendantItems((item) => item instanceof View).length > 0; const adjustedLayerActions = hasView ? LAYER_ACTIONS : INITIAL_LAYER_ACTIONS; return ( -
-
-
-
Layers
- - - - - - - - Preferred view layout - setPreferredViewLayout(PreferredViewLayout.HORIZONTAL)} - > - Horizontal - - setPreferredViewLayout(PreferredViewLayout.VERTICAL)} - > - Vertical - - - -
-
- - Click on to add a layer. -
- } - > - {items.map((item: Item) => - makeSortableListItemComponent(item, LAYER_ACTIONS, handleLayerAction) - )} - -
-
- + + + + + + Preferred view layout + setPreferredViewLayout(PreferredViewLayout.HORIZONTAL)} + > + Horizontal + + setPreferredViewLayout(PreferredViewLayout.VERTICAL)} + > + Vertical + + + + } + layerActions={adjustedLayerActions} + onLayerAction={handleLayerAction} + isMoveAllowed={checkIfItemMoveAllowed} + /> ); } @@ -335,13 +228,6 @@ const LAYER_ACTIONS: LayersActionGroup[] = [ icon: , label: "Settings group", }, - /* - { - identifier: "delta-surface", - icon: , - label: "Delta Surface", - }, - */ ], }, { diff --git a/frontend/src/modules/2DViewer/settings/settings.tsx b/frontend/src/modules/2DViewer/settings/settings.tsx index b2c17d128..3c62c719e 100644 --- a/frontend/src/modules/2DViewer/settings/settings.tsx +++ b/frontend/src/modules/2DViewer/settings/settings.tsx @@ -10,10 +10,10 @@ import { useAtom, useAtomValue, useSetAtom } from "jotai"; import { layerManagerAtom, preferredViewLayoutAtom, userSelectedFieldIdentifierAtom } from "./atoms/baseAtoms"; import { selectedFieldIdentifierAtom } from "./atoms/derivedAtoms"; -import { LayerManagerComponent } from "./components/layerManagerComponent"; +import { LayerManagerComponentWrapper } from "./components/layerManagerComponent"; -import { LayerManager, LayerManagerTopic } from "../layers/LayerManager"; import { GroupDelegateTopic } from "../layers/delegates/GroupDelegate"; +import { LayerManager, LayerManagerTopic } from "../layers/framework/LayerManager/LayerManager"; export function Settings(props: ModuleSettingsProps): React.ReactNode { const ensembleSet = useEnsembleSet(props.workbenchSession); @@ -135,7 +135,7 @@ export function Settings(props: ModuleSettingsProps): React.ReactNode { {layerManager && ( -