Skip to content

Commit

Permalink
Migrated from 'magic' module resolving to relative paths, this will b…
Browse files Browse the repository at this point in the history
…e needed to further migrate to e.g. Vite anyway, so it's good to fix it right away.
  • Loading branch information
jacobwod committed Aug 16, 2023
1 parent eadc703 commit 413d40a
Show file tree
Hide file tree
Showing 62 changed files with 86 additions and 86 deletions.
2 changes: 1 addition & 1 deletion new-client/src/components/Announcement/Announcement.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import CloseIcon from "@mui/icons-material/Close";

import {
customComponentsForReactMarkdown, // the object with all custom components
} from "utils/customComponentsForReactMarkdown";
} from "../../utils/customComponentsForReactMarkdown";

/**
* You should have something like this in your appConfig.json in
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import AppModel from "../models/AppModel.js";
import {
setConfig as setCookieConfig,
functionalOk as functionalCookieOk,
} from "models/Cookie";
} from "../models/Cookie";

import Window from "./Window.js";
import CookieNotice from "./CookieNotice";
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/components/CookieNotice.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
Slide,
} from "@mui/material";
import { styled } from "@mui/material/styles";
import { setLevel, shouldShowNotice } from "models/Cookie";
import { setLevel, shouldShowNotice } from "../models/Cookie";

// Default settings for the cookie-notice text and url if none is supplied from the configuration.
const DEFAULT_MESSAGE =
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/components/Dialog/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { useMediaQuery, useTheme } from "@mui/material";

import LegacyNonMarkdownRenderer from "./LegacyNonMarkdownRenderer";
import { customComponentsForReactMarkdown } from "utils/customComponentsForReactMarkdown";
import { customComponentsForReactMarkdown } from "../../utils/customComponentsForReactMarkdown";

export default function ResponsiveDialog(props) {
const theme = useTheme();
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/components/Drawer/DrawerToggleButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ToggleButtonGroup from "@mui/material/ToggleButtonGroup";

import CloseIcon from "@mui/icons-material/Close";
import { Paper, Hidden } from "@mui/material";
import { functionalOk as functionalCookieOk } from "models/Cookie";
import { functionalOk as functionalCookieOk } from "../../models/Cookie";

const StyledPaper = styled(Paper)(({ theme }) => ({
marginRight: theme.spacing(1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ import {
} from "@mui/material";

import FeaturePropsParsing from "./FeaturePropsParsing";
import { getInfoClickInfoFromLayerConfig } from "utils/InfoClickHelpers.js";
// import Diagram from "../Diagram";
// import HajkTable from "../Table";
import { getInfoClickInfoFromLayerConfig } from "../../utils/InfoClickHelpers";

const InfoContainer = styled(Grid)(() => ({
height: "100%",
Expand Down
4 changes: 2 additions & 2 deletions new-client/src/components/FeatureInfo/FeaturePropsFilters.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import AppModel from "models/AppModel";
import HajkTransformer from "utils/HajkTransformer";
import AppModel from "../../models/AppModel";
import HajkTransformer from "../../utils/HajkTransformer";

class PropFilters {
constructor() {
Expand Down
6 changes: 3 additions & 3 deletions new-client/src/components/FeatureInfo/FeaturePropsParsing.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import ReactMarkdown from "react-markdown";
import rehypeRaw from "rehype-raw";
import gfm from "remark-gfm";
import FeaturePropFilters from "./FeaturePropsFilters";
import AppModel from "models/AppModel.js";
import AppModel from "../../models/AppModel.js";

import {
customComponentsForReactMarkdown, // the object with all custom components
setOptions, // a method that will allow us to send infoclick options from here to the module that defines custom components
Paragraph, // special case - we want to override the Paragraph component here, so we import it separately
} from "utils/customComponentsForReactMarkdown";
import { isValidUrl } from "utils/Validator";
} from "../../utils/customComponentsForReactMarkdown";
import { isValidUrl } from "../../utils/Validator";

export default class FeaturePropsParsing {
constructor(settings) {
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/components/HajkThemeProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import CssBaseline from "@mui/material/CssBaseline";
import App from "./App";

import { deepMerge } from "../utils/DeepMerge";
import { functionalOk as functionalCookieOk } from "models/Cookie";
import { functionalOk as functionalCookieOk } from "../models/Cookie";

/**
* @summary Helper, used to determine if user's browser prefers dark mode.
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/components/Introduction.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import PluginControlButton from "../components/PluginControlButton";
import "intro.js/introjs.css";
import "intro.js/themes/introjs-modern.css";

import { functionalOk as functionalCookieOk } from "models/Cookie";
import { functionalOk as functionalCookieOk } from "../models/Cookie";

/**
* @summary Renders a guide that introduces new users to features present in Hajk.
Expand Down
4 changes: 2 additions & 2 deletions new-client/src/components/MapClickViewer/MapClickViewer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useCallback, useEffect, useRef, useState } from "react";

import Window from "components/Window";
import FeaturePropsParsing from "components/FeatureInfo/FeaturePropsParsing";
import Window from "../../components/Window";
import FeaturePropsParsing from "../../components/FeatureInfo/FeaturePropsParsing";

import MapClickViewerView from "./MapClickViewerView";
import { MapClickViewerContext } from "./MapClickViewerContext";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "@mui/material";
import CloseIcon from "@mui/icons-material/Close";

import { functionalOk } from "models/Cookie";
import { functionalOk } from "../../../models/Cookie";

const FeaturePagination = (props) => {
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from "react";
import { Box } from "@mui/system";

import { useMapClickViewerContext } from "components/MapClickViewer/MapClickViewerContext";
import { useMapClickViewerContext } from "../../MapClickViewerContext";

const Markdown = (props) => {
const { feature, featureCollection } = props;
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/components/Search/MapViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { fromExtent } from "ol/geom/Polygon";
import TileLayer from "ol/layer/Tile";
import ImageLayer from "ol/layer/Image";
import { handleClick } from "../../models/Click";
import { deepMerge } from "utils/DeepMerge";
import { deepMerge } from "../../utils/DeepMerge";
import { isValidLayerId } from "../../utils/Validator";

class MapViewModel {
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/components/Search/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import KmlExport from "./utils/KmlExport";
import XLSXExport from "./utils/XLSXExport";
import { encodeCommas, decodeCommas } from "../../utils/StringCommaCoder";
import LocalStorageHelper from "../../utils/LocalStorageHelper";
import { functionalOk as functionalCookieOk } from "models/Cookie";
import { functionalOk as functionalCookieOk } from "../../models/Cookie";

class Search extends React.PureComponent {
defaultSearchOptions = {
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/controls/ExternalLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { styled } from "@mui/material/styles";
import propTypes from "prop-types";
import { IconButton, Paper, Tooltip, Menu, MenuItem } from "@mui/material";
import LaunchIcon from "@mui/icons-material/Launch";
import HajkTransformer from "utils/HajkTransformer";
import HajkTransformer from "../utils/HajkTransformer";

const StyledPaper = styled(Paper)(({ theme }) => ({
marginBottom: theme.spacing(1),
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/controls/Information.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IconButton, Paper, Tooltip } from "@mui/material";
import InfoIcon from "@mui/icons-material/Info";

import Dialog from "../components/Dialog/Dialog";
import { functionalOk as functionalCookieOk } from "models/Cookie";
import { functionalOk as functionalCookieOk } from "../models/Cookie";

const StyledPaper = styled(Paper)(({ theme }) => ({
marginBottom: theme.spacing(1),
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/controls/MapSwitcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import { IconButton, Menu, MenuItem, Paper, Tooltip } from "@mui/material";
import { styled } from "@mui/material/styles";
import SwitchCameraIcon from "@mui/icons-material/SwitchCamera";
import { hfetch } from "utils/FetchWrapper";
import { hfetch } from "../utils/FetchWrapper";

const StyledPaper = styled(Paper)(({ theme }) => ({
marginBottom: theme.spacing(1),
Expand Down
6 changes: 3 additions & 3 deletions new-client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import { createRoot } from "react-dom/client";
import buildConfig from "./buildConfig.json";
import ErrorIcon from "@mui/icons-material/Error";
import HajkThemeProvider from "./components/HajkThemeProvider";
import { initHFetch, hfetch, initFetchWrapper } from "utils/FetchWrapper";
import LocalStorageHelper from "utils/LocalStorageHelper";
import { getMergedSearchAndHashParams } from "utils/getMergedSearchAndHashParams";
import { initHFetch, hfetch, initFetchWrapper } from "./utils/FetchWrapper";
import LocalStorageHelper from "./utils/LocalStorageHelper";
import { getMergedSearchAndHashParams } from "./utils/getMergedSearchAndHashParams";

initHFetch();

Expand Down
4 changes: 2 additions & 2 deletions new-client/src/models/AnchorModel.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PLUGINS_TO_IGNORE_IN_HASH_APP_STATE } from "constants";
import { isValidLayerId } from "utils/Validator";
import { debounce } from "utils/debounce";
import { isValidLayerId } from "../utils/Validator";
import { debounce } from "../utils/debounce";

class AnchorModel {
#app;
Expand Down
11 changes: 6 additions & 5 deletions new-client/src/models/AppModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import Plugin from "./Plugin";
import SnapHelper from "./SnapHelper";
import { bindMapClickEvent } from "./Click";

import ConfigMapper from "utils/ConfigMapper";
import CoordinateSystemLoader from "utils/CoordinateSystemLoader";
import { hfetch } from "utils/FetchWrapper";
import { isMobile } from "utils/IsMobile";
import { getMergedSearchAndHashParams } from "utils/getMergedSearchAndHashParams";
import ConfigMapper from "../utils/ConfigMapper";
import CoordinateSystemLoader from "../utils/CoordinateSystemLoader";
import { hfetch } from "../utils/FetchWrapper";
import { isMobile } from "../utils/IsMobile";
import { getMergedSearchAndHashParams } from "../utils/getMergedSearchAndHashParams";
// import ArcGISLayer from "./layers/ArcGISLayer.js";
// import DataLayer from "./layers/DataLayer.js";
import WMSLayer from "./layers/WMSLayer.js";
Expand Down Expand Up @@ -1156,4 +1156,5 @@ class AppModel {
}
}

/* eslint import/no-anonymous-default-export: [2, {"allowNew": true}] */
export default new AppModel();
2 changes: 1 addition & 1 deletion new-client/src/models/Click.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import WMSGetFeatureInfo from "ol/format/WMSGetFeatureInfo";
import TileLayer from "ol/layer/Tile";
import ImageLayer from "ol/layer/Image";

import { hfetch } from "utils/FetchWrapper";
import { hfetch } from "../utils/FetchWrapper";

function query(map, layer, evt) {
const coordinate = evt.coordinate;
Expand Down
8 changes: 4 additions & 4 deletions new-client/src/models/MapClickModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import VectorSource from "ol/source/Vector";

import { Style, Icon, Fill, Stroke, Circle } from "ol/style";

import AppModel from "models/AppModel";
import { hfetch } from "utils/FetchWrapper";
import { getInfoClickInfoFromLayerConfig } from "utils/InfoClickHelpers";
import AppModel from "./AppModel";
import { hfetch } from "../utils/FetchWrapper";
import { getInfoClickInfoFromLayerConfig } from "../utils/InfoClickHelpers";
import {
parseGMLFeatures,
parseGeoJsonFeatures,
experimentalParseEsriWmsRawXml,
parseWmsGetFeatureInfoXml,
} from "utils/wmsFeatureParsers";
} from "../utils/wmsFeatureParsers";

const convertRGBAtoString = (color) => {
if (
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/models/SearchModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Within from "ol/format/filter/Within";
import { fromCircle } from "ol/geom/Polygon";

import { decodeCommas } from "../utils/StringCommaCoder";
import { hfetch } from "utils/FetchWrapper";
import { hfetch } from "../utils/FetchWrapper";

const ESCAPE_CHAR = "!";
const SINGLE_CHAR = ".";
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/models/layers/VectorLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getPointResolution, transform } from "ol/proj";
import * as SLDReader from "@nieuwlandgeo/sldreader";

import LayerInfo from "./LayerInfo.js";
import { hfetch } from "utils/FetchWrapper";
import { hfetch } from "../../utils/FetchWrapper";

const vectorLayerProperties = {
url: "",
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/models/layers/WMSLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import GeoJSON from "ol/format/GeoJSON";
import LayerInfo from "./LayerInfo.js";
import { equals } from "ol/extent";
import { delay } from "../../utils/Delay";
import { hfetch, overrideLayerSourceParams } from "utils/FetchWrapper";
import { hfetch, overrideLayerSourceParams } from "../../utils/FetchWrapper";

class WMSLayer {
constructor(config, proxyUrl, globalObserver) {
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/models/layers/WMTSLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import TileLayer from "ol/layer/Tile";
import WMTS from "ol/source/WMTS";
import WMTSTileGrid from "ol/tilegrid/WMTS";
import LayerInfo from "./LayerInfo.js";
import { overrideLayerSourceParams } from "utils/FetchWrapper";
import { overrideLayerSourceParams } from "../../utils/FetchWrapper";

var wmtsLayerProperties = {
url: "",
Expand Down
4 changes: 2 additions & 2 deletions new-client/src/plugins/Bookmarks/BookmarksView.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import Typography from "@mui/material/Typography";
import ConfirmationDialog from "../../components/ConfirmationDialog";

// Hooks
import useUpdateEffect from "hooks/useUpdateEffect";
import useCookieStatus from "hooks/useCookieStatus";
import useUpdateEffect from "../../hooks/useUpdateEffect";
import useCookieStatus from "../../hooks/useCookieStatus";

const List = styled("div")(() => ({
display: "flex",
Expand Down
4 changes: 2 additions & 2 deletions new-client/src/plugins/Buffer/BufferModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { Vector as VectorLayer } from "ol/layer.js";

import GeoJSON from "ol/format/GeoJSON.js";

import HajkTransformer from "utils/HajkTransformer";
import { hfetch } from "utils/FetchWrapper";
import HajkTransformer from "../../utils/HajkTransformer";
import { hfetch } from "../../utils/FetchWrapper";

class BufferModel {
#HT;
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/plugins/Collector/CollectorModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import VectorSource from "ol/source/Vector";
import { all as strategyAll } from "ol/loadingstrategy";
import { Draw } from "ol/interaction";
import X2JS from "x2js";
import { hfetch } from "utils/FetchWrapper";
import { hfetch } from "../../utils/FetchWrapper";

class CollectorModel {
constructor(settings) {
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/plugins/Coordinates/CoordinatesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { withSnackbar } from "notistack";
import {
LOCATION_DENIED_SNACK_OPTIONS,
LOCATION_DENIED_SNACK_MESSAGE,
} from "plugins/Location/constants/index.js";
} from "../Location/constants";

const StyledGridContainer = styled(Grid)(({ theme }) => ({
padding: theme.spacing(2),
Expand Down
6 changes: 3 additions & 3 deletions new-client/src/plugins/DialogWindowPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import {
ListItemText,
} from "@mui/material";

import Card from "components/Card";
import Dialog from "components/Dialog/Dialog";
import PluginControlButton from "components/PluginControlButton";
import Card from "../components/Card";
import Dialog from "../components/Dialog/Dialog";
import PluginControlButton from "../components/PluginControlButton";

class DialogWindowPlugin extends React.PureComponent {
state = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from "./utils/ContentComponentFactory";

import DocumentSearchModel from "./documentSearch/DocumentSearchModel";
import { hfetch } from "utils/FetchWrapper";
import { hfetch } from "../../utils/FetchWrapper";

/**
* @summary DocumentHandler model that doesn't do much.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import ArrowForwardIcon from "@mui/icons-material/ArrowForward";
import OpenInNewIcon from "@mui/icons-material/OpenInNew";

import { deepMerge } from "utils/DeepMerge";
import { deepMerge } from "../../../utils/DeepMerge";

import PrintList from "./PrintList";
import TableOfContents from "./TableOfContents";
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/plugins/Dummy/Dummy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import BugReportIcon from "@mui/icons-material/BugReport";

// We might want to import some other classes or constants etc.
import { DEFAULT_MEASUREMENT_SETTINGS } from "./constants";
import DrawModel from "models/DrawModel";
import DrawModel from "../../models/DrawModel";

/**
* @summary Main component for the Dummy-plugin.
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/plugins/Dummy/DummyModel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import LocalStorageHelper from "utils/LocalStorageHelper";
import LocalStorageHelper from "../../utils/LocalStorageHelper";

export default class DummyModel {
#map;
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/plugins/Dummy/DummyView.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import BugReportIcon from "@mui/icons-material/BugReport";

import { useSnackbar } from "notistack";

import useCookieStatus from "hooks/useCookieStatus";
import useCookieStatus from "../../hooks/useCookieStatus";

// Hajk components are primarily styled in two ways:
// - Using the styled-utility, see: https://mui.com/system/styled/
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/plugins/Edit/EditModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { all as strategyAll } from "ol/loadingstrategy";
import { Select, Modify, Draw, Translate } from "ol/interaction";
import { never } from "ol/events/condition";
import X2JS from "x2js";
import { hfetch } from "utils/FetchWrapper";
import { hfetch } from "../../utils/FetchWrapper";

class EditModel {
constructor(settings) {
Expand Down
2 changes: 1 addition & 1 deletion new-client/src/plugins/Export/ExportModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Translate } from "ol/interaction.js";
import WMTS from "ol/source/WMTS";
import TileArcGISRest from "ol/source/TileArcGISRest";
import Collection from "ol/Collection";
import { hfetch } from "utils/FetchWrapper";
import { hfetch } from "../../utils/FetchWrapper";

var toHex = function (str) {
if (/^#/.test(str)) return str;
Expand Down
Loading

0 comments on commit 413d40a

Please sign in to comment.