Skip to content

Commit

Permalink
fix: fix inconsistent import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
joaotomaspinheiro committed Jul 28, 2024
1 parent ab4d4b3 commit 4c0d5dc
Show file tree
Hide file tree
Showing 86 changed files with 116 additions and 137 deletions.
2 changes: 1 addition & 1 deletion web/src/domain/container.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { components } from "../../api/ecomap/http";
import type { components } from "$api/ecomap/http";

/**
* Container.
Expand Down
2 changes: 1 addition & 1 deletion web/src/domain/geojson.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { components } from "../../api/ecomap/http";
import type { components } from "$api/ecomap/http";

/**
* GeoJSON point feature.
Expand Down
2 changes: 1 addition & 1 deletion web/src/domain/landfill.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { components } from "../../api/ecomap/http";
import type { components } from "$api/ecomap/http";

/**
* Landfill.
Expand Down
2 changes: 1 addition & 1 deletion web/src/domain/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { components } from "../../api/ecomap/http";
import type { components } from "$api/ecomap/http";

/**
* Route.
Expand Down
2 changes: 1 addition & 1 deletion web/src/domain/routeEmployee.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { components } from "../../api/ecomap/http";
import type { components } from "$api/ecomap/http";

/**
* Route employee.
Expand Down
3 changes: 1 addition & 2 deletions web/src/domain/truck.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { components } from "$api/ecomap/http";
import type { SortingDirection } from "$lib/components/table/types";

import type { components } from "../../api/ecomap/http";

/**
* Truck.
*/
Expand Down
3 changes: 1 addition & 2 deletions web/src/domain/warehouse.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { components } from "$api/ecomap/http";
import type { SortingDirection } from "$lib/components/table/types";

import type { components } from "../../api/ecomap/http";

/**
* Warehouse.
*/
Expand Down
5 changes: 2 additions & 3 deletions web/src/lib/clients/ecomap/http.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import createClient, { type Middleware } from "openapi-fetch";

import type { components, paths } from "$api/ecomap/http";
import { goto } from "$app/navigation";
import { CommonRoutes } from "$lib/constants/routes";
import { clearToken, getToken } from "$lib/utils/auth";

import type { components, paths } from "../../../../api/ecomap/http";
import { CommonRoutes } from "../../../routes/constants/routes";

/**
* Endpoints that should be ignored if the status code from the server response is 401.
* Used to prevent the employee token from being deleted and the employee from being redirected to the sign in page.
Expand Down
3 changes: 2 additions & 1 deletion web/src/lib/components/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
MouseEventHandler,
} from "svelte/elements";
import type { IconSize } from "../../domain/components/icon";
import type { IconSize } from "$domain/components/icon";
import Icon from "./Icon.svelte";
type Variant = "primary" | "secondary" | "tertiary";
Expand Down
2 changes: 1 addition & 1 deletion web/src/lib/components/Field.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { MISSING_VALUE_SYMBOL } from "../constants/symbols";
import { MISSING_VALUE_SYMBOL } from "$lib/constants/symbols";
/**
* The label of the field.
Expand Down
2 changes: 1 addition & 1 deletion web/src/lib/components/Icon.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { IconSize } from "../../domain/components/icon";
import type { IconSize } from "$domain/components/icon";
/**
* The icon name.
Expand Down
3 changes: 2 additions & 1 deletion web/src/lib/components/IconButton.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<script lang="ts">
import type { MouseEventHandler } from "svelte/elements";
import type { IconSize } from "../../domain/components/icon";
import type { IconSize } from "$domain/components/icon";
import Icon from "./Icon.svelte";
/**
Expand Down
5 changes: 3 additions & 2 deletions web/src/lib/components/SelectLocation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
import OlMap from "ol/Map";
import VectorSource from "ol/source/Vector";
import ecomapHttpClient from "../clients/ecomap/http";
import {
DEFAULT_ANIMATION_DURATION,
DEFAULT_MAX_ZOOM,
DEFAULT_PIN_ICON_SRC,
} from "../constants/map";
} from "$lib/constants/map";
import ecomapHttpClient from "../clients/ecomap/http";
import { t } from "../utils/i8n";
import { getLocationName } from "../utils/location";
import {
Expand Down
3 changes: 2 additions & 1 deletion web/src/lib/components/Spinner.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import type { IconSize } from "../../domain/components/icon";
import type { IconSize } from "$domain/components/icon";
import Icon from "./Icon.svelte";
/**
Expand Down
3 changes: 2 additions & 1 deletion web/src/lib/components/Toast.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import { onMount } from "svelte";
import { writable } from "svelte/store";
import type { ToastOptions } from "../../domain/toast";
import type { ToastOptions } from "$domain/toast";
import { setToastContext } from "../contexts/toast";
import Icon from "./Icon.svelte";
Expand Down
3 changes: 2 additions & 1 deletion web/src/lib/components/map/LayerItem.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<script lang="ts">
import { Layer } from "ol/layer";
import { colorLayerKey, nameLayerKey } from "../../constants/map";
import { colorLayerKey, nameLayerKey } from "$lib/constants/map";
import Switch from "../Switch.svelte";
import Dot from "./Dot.svelte";
Expand Down
3 changes: 2 additions & 1 deletion web/src/lib/components/map/Map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
DEFAULT_MIN_ZOOM,
mapLayerName,
nameLayerKey,
} from "../../constants/map";
} from "$lib/constants/map";
import { t } from "../../utils/i8n";
import Icon from "../Icon.svelte";
import LayerItem from "./LayerItem.svelte";
Expand Down
5 changes: 3 additions & 2 deletions web/src/lib/components/map/mapUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type {
CreateMapOptions,
MapHelperClusterLayerOptions,
MapHelperPointLayerOptions,
} from "../../../domain/components/map";
} from "$domain/components/map";
import {
colorLayerKey,
DEFAULT_MAX_ZOOM,
Expand All @@ -28,7 +28,8 @@ import {
mapLayerName,
nameLayerKey,
OL_PROJECTION,
} from "../../constants/map";
} from "$lib/constants/map";

import { getCssVariable } from "../../utils/cssVars";

/**
Expand Down
3 changes: 2 additions & 1 deletion web/src/lib/components/table/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ROOT_FONT_SIZE } from "../../constants/fontSize";
import { ROOT_FONT_SIZE } from "$lib/constants/fontSize";

import type {
Column,
Columns,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion web/src/lib/contexts/toast.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getContext, setContext } from "svelte";

import type { ToastContext } from "../../domain/toast";
import type { ToastContext } from "$domain/toast";

const TOAST_CONTEXT_KEY = "toast";

Expand Down
4 changes: 2 additions & 2 deletions web/src/lib/stores/table.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { derived, get, type Writable, writable } from "svelte/store";

import { page } from "$app/stores";

import type {
DataFn,
FiltersToSearchParams,
SearchParamsToFilters,
TableStore,
} from "../../domain/stores/table";
} from "$domain/stores/table";

import { updateSearchParams } from "../utils/url";

/**
Expand Down
2 changes: 1 addition & 1 deletion web/src/lib/utils/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TokenPayload } from "../../domain/jwt";
import type { TokenPayload } from "$domain/jwt";

/**
* Cookie name for the JWT token.
Expand Down
3 changes: 2 additions & 1 deletion web/src/lib/utils/date.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { get } from "svelte/store";

import { DateFormats } from "../constants/date";
import { DateFormats } from "$lib/constants/date";

import { locale } from "./i8n";

/**
Expand Down
3 changes: 2 additions & 1 deletion web/src/lib/utils/i8n.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { derived, get, type Writable, writable } from "svelte/store";

import { LocaleNames, SupportedLocales } from "$lib/constants/locale";

import en from "../../locales/en.json";
import pt from "../../locales/pt.json";
import type schema from "../../locales/schema.json";
import { LocaleNames, SupportedLocales } from "../constants/locale";

/**
* Identifiers of the locale schema.
Expand Down
2 changes: 1 addition & 1 deletion web/src/lib/utils/map.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Coordinate } from "ol/coordinate";
import { transform } from "ol/proj";

import { OL_PROJECTION, RESOURCE_PROJECTION } from "../constants/map";
import { OL_PROJECTION, RESOURCE_PROJECTION } from "$lib/constants/map";

/**
* Converts coordinate in {@link OL_PROJECTION} projection to the resource geometry projection.
Expand Down
3 changes: 1 addition & 2 deletions web/src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { CommonRoutes } from "./constants/routes";
import { CommonRoutes } from "$lib/constants/routes";
goto(CommonRoutes.SIGN_IN, { replaceState: true });
</script>
3 changes: 1 addition & 2 deletions web/src/routes/back-office/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { BackOfficeRoutes } from "../constants/routes";
import { BackOfficeRoutes } from "$lib/constants/routes";
// Redirect to dashboard page if pathname is at back office root level.
goto(BackOfficeRoutes.DASHBOARD);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import { page } from "$app/stores";
import Icon from "$lib/components/Icon.svelte";
import { BackOfficeRoutes } from "$lib/constants/routes";
import { type LocaleTextID, t } from "$lib/utils/i8n";
import { BackOfficeRoutes } from "../../../constants/routes";
import Support from "./Support.svelte";
type MenuItem = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import Menu from "$lib/components/Menu.svelte";
import MenuItem from "$lib/components/MenuItem.svelte";
import Popover from "$lib/components/Popover.svelte";
import { BackOfficeRoutes, CommonRoutes } from "$lib/constants/routes";
import { clearToken, decodeTokenPayload, getToken } from "$lib/utils/auth";
import { t } from "$lib/utils/i8n";
import { BackOfficeRoutes, CommonRoutes } from "../../../constants/routes";
/**
* The employee popover element.
*/
Expand Down
3 changes: 2 additions & 1 deletion web/src/routes/back-office/components/topbar/TopBar.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import { BackOfficeRoutes } from "../../../constants/routes";
import { BackOfficeRoutes } from "$lib/constants/routes";
import EmployeeMenu from "./EmployeeMenu.svelte";
import Logo from "./Logo.svelte";
</script>
Expand Down
2 changes: 1 addition & 1 deletion web/src/routes/back-office/containers/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import Button from "$lib/components/Button.svelte";
import { BackOfficeRoutes } from "$lib/constants/routes";
import { t } from "$lib/utils/i8n";
import { BackOfficeRoutes } from "../../constants/routes";
import Card from "../components/Card.svelte";
import ContainersTable from "./list/ContainersTable.svelte";
import SearchContainers from "./list/SearchContainers.svelte";
Expand Down
2 changes: 1 addition & 1 deletion web/src/routes/back-office/containers/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
import Field from "$lib/components/Field.svelte";
import Spinner from "$lib/components/Spinner.svelte";
import { DateFormats } from "$lib/constants/date";
import { BackOfficeRoutes } from "$lib/constants/routes";
import { getToastContext } from "$lib/contexts/toast";
import { formatDate } from "$lib/utils/date";
import { t } from "$lib/utils/i8n";
import { getLocationName } from "$lib/utils/location";
import { BackOfficeRoutes } from "../../../constants/routes";
import Card from "../../components/Card.svelte";
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import type { GeoJSONFeaturePoint } from "$domain/geojson";
import ecomapHttpClient from "$lib/clients/ecomap/http";
import Spinner from "$lib/components/Spinner.svelte";
import { BackOfficeRoutes } from "$lib/constants/routes";
import { getToastContext } from "$lib/contexts/toast";
import { t } from "$lib/utils/i8n";
import { getLocationName } from "$lib/utils/location";
import { BackOfficeRoutes } from "../../../../constants/routes";
import Card from "../../../components/Card.svelte";
import ContainerForm from "../../components/ContainerForm.svelte";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import { MapHelper } from "$lib/components/map/mapUtils";
import Spinner from "$lib/components/Spinner.svelte";
import { CONTAINER_ICON_SRC } from "$lib/constants/map";
import { BackOfficeRoutes } from "$lib/constants/routes";
import { t } from "$lib/utils/i8n";
import { BackOfficeRoutes } from "../../../../constants/routes";
import ContainerBottomSheet from "./ContainerBottomSheet.svelte";
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Container } from "../../../../domain/container";
import type { Container } from "$domain/container";

/**
* List of container categories.
Expand Down
2 changes: 1 addition & 1 deletion web/src/routes/back-office/containers/create/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import type { ContainerCategory } from "$domain/container";
import type { GeoJSONFeaturePoint } from "$domain/geojson";
import ecomapHttpClient from "$lib/clients/ecomap/http";
import { BackOfficeRoutes } from "$lib/constants/routes";
import { getToastContext } from "$lib/contexts/toast";
import { t } from "$lib/utils/i8n";
import { BackOfficeRoutes } from "../../../constants/routes";
import Card from "../../components/Card.svelte";
import ContainerForm from "../components/ContainerForm.svelte";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script lang="ts">
import type { ComponentProps } from "svelte";
import type { Container } from "$domain/container";
import Table from "$lib/components/table/Table.svelte";
import TableDetailsAction from "$lib/components/table/TableDetailsAction.svelte";
import type { Columns } from "$lib/components/table/types";
import { DEFAULT_PAGE_SIZE } from "$lib/constants/pagination";
import { BackOfficeRoutes } from "$lib/constants/routes";
import { t } from "$lib/utils/i8n";
import { getLocationName } from "$lib/utils/location";
import type { Container } from "../../../../domain/container";
import { BackOfficeRoutes } from "../../../constants/routes";
import { categoryOptions } from "../constants/category";
import containersStore from "./containersStore";
Expand Down
8 changes: 2 additions & 6 deletions web/src/routes/back-office/containers/list/containersStore.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import type { ContainersFilters, PaginatedContainers } from "$domain/container";
import ecomapHttpClient from "$lib/clients/ecomap/http";
import { DEFAULT_PAGE_SIZE } from "$lib/constants/pagination";
import { BackOfficeRoutes } from "$lib/constants/routes";
import { createTableStore } from "$lib/stores/table";

import type {
ContainersFilters,
PaginatedContainers,
} from "../../../../domain/container";
import { BackOfficeRoutes } from "../../../constants/routes";

/**
* The search parameter names for each filter of the containers table.
*/
Expand Down
2 changes: 1 addition & 1 deletion web/src/routes/back-office/containers/utils/category.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ContainerCategory } from "../../../../domain/container";
import type { ContainerCategory } from "$domain/container";

/**
* Indicates if a given input is a valid container category.
Expand Down
Loading

0 comments on commit 4c0d5dc

Please sign in to comment.