From 4c0d5dcc832da55d3637cc953b4e0957f4685425 Mon Sep 17 00:00:00 2001 From: joaotomaspinheiro Date: Sun, 28 Jul 2024 18:51:29 +0100 Subject: [PATCH] fix: fix inconsistent import paths --- web/src/domain/container.ts | 2 +- web/src/domain/geojson.ts | 2 +- web/src/domain/landfill.ts | 2 +- web/src/domain/route.ts | 2 +- web/src/domain/routeEmployee.ts | 2 +- web/src/domain/truck.ts | 3 +-- web/src/domain/warehouse.ts | 3 +-- web/src/lib/clients/ecomap/http.ts | 5 ++--- web/src/lib/components/Button.svelte | 3 ++- web/src/lib/components/Field.svelte | 2 +- web/src/lib/components/Icon.svelte | 2 +- web/src/lib/components/IconButton.svelte | 3 ++- web/src/lib/components/SelectLocation.svelte | 5 +++-- web/src/lib/components/Spinner.svelte | 3 ++- web/src/lib/components/Toast.svelte | 3 ++- web/src/lib/components/map/LayerItem.svelte | 3 ++- web/src/lib/components/map/Map.svelte | 3 ++- web/src/lib/components/map/mapUtils.ts | 5 +++-- web/src/lib/components/table/utils.ts | 3 ++- web/src/{routes => lib}/constants/routes.ts | 0 web/src/lib/contexts/toast.ts | 2 +- web/src/lib/stores/table.ts | 4 ++-- web/src/lib/utils/auth.ts | 2 +- web/src/lib/utils/date.ts | 3 ++- web/src/lib/utils/i8n.ts | 3 ++- web/src/lib/utils/map.ts | 2 +- web/src/routes/+page.svelte | 3 +-- web/src/routes/back-office/+page.svelte | 3 +-- .../back-office/components/sidebar/SideBar.svelte | 2 +- .../back-office/components/topbar/EmployeeMenu.svelte | 3 +-- .../routes/back-office/components/topbar/TopBar.svelte | 3 ++- web/src/routes/back-office/containers/+page.svelte | 2 +- .../routes/back-office/containers/[id]/+page.svelte | 2 +- .../back-office/containers/[id]/edit/+page.svelte | 2 +- .../back-office/containers/[id]/map/+page.svelte | 2 +- .../back-office/containers/constants/category.ts | 2 +- .../routes/back-office/containers/create/+page.svelte | 2 +- .../back-office/containers/list/ContainersTable.svelte | 4 ++-- .../back-office/containers/list/containersStore.ts | 8 ++------ .../routes/back-office/containers/utils/category.ts | 2 +- .../dashboard/partials/ActiveEmployees.svelte | 2 +- .../dashboard/partials/ContainersAdded.svelte | 2 +- .../dashboard/partials/ContainersByCategory.svelte | 5 +---- .../dashboard/partials/ContainersByMunicipality.svelte | 2 +- web/src/routes/back-office/employees/+page.svelte | 2 +- web/src/routes/back-office/employees/[id]/+page.svelte | 2 +- .../back-office/employees/[id]/edit/+page.svelte | 2 +- .../routes/back-office/employees/constants/roles.ts | 2 +- .../routes/back-office/employees/create/+page.svelte | 2 +- .../back-office/employees/list/EmployeesTable.svelte | 7 ++----- .../back-office/employees/list/employeesStore.ts | 3 +-- web/src/routes/back-office/employees/utils/employee.ts | 2 +- web/src/routes/back-office/landfills/+page.svelte | 2 +- web/src/routes/back-office/landfills/[id]/+page.svelte | 2 +- .../back-office/landfills/[id]/edit/+page.svelte | 2 +- .../routes/back-office/landfills/[id]/map/+page.svelte | 2 +- .../routes/back-office/landfills/create/+page.svelte | 2 +- .../back-office/landfills/list/LandfillsTable.svelte | 2 +- .../back-office/landfills/list/landfillsStore.ts | 8 ++------ web/src/routes/back-office/map/MapBottomSheet.svelte | 10 +++++----- web/src/routes/back-office/routes/+page.svelte | 2 +- web/src/routes/back-office/routes/[id]/+page.svelte | 2 +- .../details/routeEmployees/RouteEmployeesTable.svelte | 2 +- .../[id]/details/routeEmployees/routeEmployeesStore.ts | 3 +-- .../routes/back-office/routes/[id]/edit/+page.svelte | 2 +- .../routes/back-office/routes/[id]/map/+page.svelte | 2 +- .../back-office/routes/constants/routeEmployee.ts | 2 +- web/src/routes/back-office/routes/create/+page.svelte | 2 +- .../routes/back-office/routes/list/RoutesTable.svelte | 2 +- web/src/routes/back-office/routes/list/routesStore.ts | 3 +-- web/src/routes/back-office/trucks/+page.svelte | 2 +- web/src/routes/back-office/trucks/[id]/+page.svelte | 2 +- .../routes/back-office/trucks/[id]/edit/+page.svelte | 2 +- .../routes/back-office/trucks/[id]/map/+page.svelte | 2 +- web/src/routes/back-office/trucks/create/+page.svelte | 2 +- .../routes/back-office/trucks/list/TrucksTable.svelte | 4 ++-- web/src/routes/back-office/trucks/list/trucksStore.ts | 5 ++--- web/src/routes/back-office/warehouses/+page.svelte | 2 +- .../routes/back-office/warehouses/[id]/+page.svelte | 4 ++-- .../back-office/warehouses/[id]/edit/+page.svelte | 2 +- .../back-office/warehouses/[id]/map/+page.svelte | 2 +- .../warehouses/components/WarehouseForm.svelte | 5 ++--- .../routes/back-office/warehouses/create/+page.svelte | 4 ++-- .../back-office/warehouses/list/WarehousesTable.svelte | 7 ++----- .../back-office/warehouses/list/warehousesStore.ts | 8 ++------ web/src/routes/signin/+page.svelte | 3 +-- 86 files changed, 116 insertions(+), 137 deletions(-) rename web/src/{routes => lib}/constants/routes.ts (100%) diff --git a/web/src/domain/container.ts b/web/src/domain/container.ts index 7e53c920..cf1c7615 100644 --- a/web/src/domain/container.ts +++ b/web/src/domain/container.ts @@ -1,4 +1,4 @@ -import type { components } from "../../api/ecomap/http"; +import type { components } from "$api/ecomap/http"; /** * Container. diff --git a/web/src/domain/geojson.ts b/web/src/domain/geojson.ts index 6bdfb0a7..530a359f 100644 --- a/web/src/domain/geojson.ts +++ b/web/src/domain/geojson.ts @@ -1,4 +1,4 @@ -import type { components } from "../../api/ecomap/http"; +import type { components } from "$api/ecomap/http"; /** * GeoJSON point feature. diff --git a/web/src/domain/landfill.ts b/web/src/domain/landfill.ts index b9ab62cc..76c673de 100644 --- a/web/src/domain/landfill.ts +++ b/web/src/domain/landfill.ts @@ -1,4 +1,4 @@ -import type { components } from "../../api/ecomap/http"; +import type { components } from "$api/ecomap/http"; /** * Landfill. diff --git a/web/src/domain/route.ts b/web/src/domain/route.ts index 207be331..688f0634 100644 --- a/web/src/domain/route.ts +++ b/web/src/domain/route.ts @@ -1,4 +1,4 @@ -import type { components } from "../../api/ecomap/http"; +import type { components } from "$api/ecomap/http"; /** * Route. diff --git a/web/src/domain/routeEmployee.ts b/web/src/domain/routeEmployee.ts index 2e4aa144..320cbb09 100644 --- a/web/src/domain/routeEmployee.ts +++ b/web/src/domain/routeEmployee.ts @@ -1,4 +1,4 @@ -import type { components } from "../../api/ecomap/http"; +import type { components } from "$api/ecomap/http"; /** * Route employee. diff --git a/web/src/domain/truck.ts b/web/src/domain/truck.ts index 68553457..d911712a 100644 --- a/web/src/domain/truck.ts +++ b/web/src/domain/truck.ts @@ -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. */ diff --git a/web/src/domain/warehouse.ts b/web/src/domain/warehouse.ts index 9479c500..86a712da 100644 --- a/web/src/domain/warehouse.ts +++ b/web/src/domain/warehouse.ts @@ -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. */ diff --git a/web/src/lib/clients/ecomap/http.ts b/web/src/lib/clients/ecomap/http.ts index 64ad3e06..53346583 100644 --- a/web/src/lib/clients/ecomap/http.ts +++ b/web/src/lib/clients/ecomap/http.ts @@ -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. diff --git a/web/src/lib/components/Button.svelte b/web/src/lib/components/Button.svelte index e215ac29..f85c8d43 100644 --- a/web/src/lib/components/Button.svelte +++ b/web/src/lib/components/Button.svelte @@ -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"; diff --git a/web/src/lib/components/Field.svelte b/web/src/lib/components/Field.svelte index 9feeac3a..636d55c7 100644 --- a/web/src/lib/components/Field.svelte +++ b/web/src/lib/components/Field.svelte @@ -1,5 +1,5 @@ diff --git a/web/src/routes/back-office/+page.svelte b/web/src/routes/back-office/+page.svelte index 248af735..a3d57dac 100644 --- a/web/src/routes/back-office/+page.svelte +++ b/web/src/routes/back-office/+page.svelte @@ -1,7 +1,6 @@ diff --git a/web/src/routes/back-office/containers/+page.svelte b/web/src/routes/back-office/containers/+page.svelte index 9d1ca861..493f4434 100644 --- a/web/src/routes/back-office/containers/+page.svelte +++ b/web/src/routes/back-office/containers/+page.svelte @@ -1,8 +1,8 @@ diff --git a/web/src/routes/back-office/employees/[id]/+page.svelte b/web/src/routes/back-office/employees/[id]/+page.svelte index 4f637ab7..f2cfed19 100644 --- a/web/src/routes/back-office/employees/[id]/+page.svelte +++ b/web/src/routes/back-office/employees/[id]/+page.svelte @@ -11,13 +11,13 @@ 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 { isViewingSelf } from "$lib/utils/auth"; import { formatDate, formatTime } from "$lib/utils/date"; import { getSupportedLocaleName, locale, t } from "$lib/utils/i8n"; import { getLocationName } from "$lib/utils/location"; - import { BackOfficeRoutes } from "../../../constants/routes"; import UpdatePasswordModal from "../components/UpdatePasswordModal.svelte"; /** diff --git a/web/src/routes/back-office/employees/[id]/edit/+page.svelte b/web/src/routes/back-office/employees/[id]/edit/+page.svelte index ad0a43f4..d059d7be 100644 --- a/web/src/routes/back-office/employees/[id]/edit/+page.svelte +++ b/web/src/routes/back-office/employees/[id]/edit/+page.svelte @@ -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 { isViewingSelf } from "$lib/utils/auth"; import { locale, t } from "$lib/utils/i8n"; - import { BackOfficeRoutes } from "../../../../constants/routes"; import EmployeeForm from "../../components/EmployeeForm.svelte"; /** diff --git a/web/src/routes/back-office/employees/constants/roles.ts b/web/src/routes/back-office/employees/constants/roles.ts index e5508105..64efa800 100644 --- a/web/src/routes/back-office/employees/constants/roles.ts +++ b/web/src/routes/back-office/employees/constants/roles.ts @@ -1,4 +1,4 @@ -import type { Employee } from "../../../../domain/employees"; +import type { Employee } from "$domain/employees"; /** * List of employees roles. diff --git a/web/src/routes/back-office/employees/create/+page.svelte b/web/src/routes/back-office/employees/create/+page.svelte index b8bb1f66..ece371da 100644 --- a/web/src/routes/back-office/employees/create/+page.svelte +++ b/web/src/routes/back-office/employees/create/+page.svelte @@ -3,10 +3,10 @@ import type { EmployeeRole } from "$domain/employees"; 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 EmployeeForm from "../components/EmployeeForm.svelte"; /** diff --git a/web/src/routes/back-office/employees/list/EmployeesTable.svelte b/web/src/routes/back-office/employees/list/EmployeesTable.svelte index f1985800..15efc323 100644 --- a/web/src/routes/back-office/employees/list/EmployeesTable.svelte +++ b/web/src/routes/back-office/employees/list/EmployeesTable.svelte @@ -1,18 +1,15 @@