diff --git a/package.json b/package.json index 4c5335bf..dd31e6de 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "license": "MIT", "scripts": { "lint": "npm run lint:css && npm run lint:js", - "lint:css": "stylelint src/*.scss src/**/*.scss", - "lint:js": "eslint --ext .js,.ts,.tsx src test", + "lint:css": "stylelint src/*.scss src/**/*.scss shlink-web-component/*.scss shlink-web-component/**/*.scss", + "lint:js": "eslint --ext .js,.ts,.tsx src shlink-web-component test", "lint:fix": "npm run lint:css:fix && npm run lint:js:fix", "lint:css:fix": "npm run lint:css -- --fix", "lint:js:fix": "npm run lint:js -- --fix", diff --git a/src/shlink-web-component/Main.tsx b/shlink-web-component/Main.tsx similarity index 88% rename from src/shlink-web-component/Main.tsx rename to shlink-web-component/Main.tsx index e5858af7..a8a0fc1f 100644 --- a/src/shlink-web-component/Main.tsx +++ b/shlink-web-component/Main.tsx @@ -4,12 +4,16 @@ import classNames from 'classnames'; import type { FC } from 'react'; import { useEffect } from 'react'; import { Navigate, Route, Routes, useLocation } from 'react-router-dom'; -import { AsideMenu } from '../common/AsideMenu'; -import { NotFound } from '../common/NotFound'; -import { useSwipeable, useToggle } from '../utils/helpers/hooks'; +import { AsideMenu } from '../src/common/AsideMenu'; +import { NotFound } from '../src/common/NotFound'; +import { useSwipeable, useToggle } from '../src/utils/helpers/hooks'; import { useFeature } from './utils/features'; import { useRoutesPrefix } from './utils/routesPrefix'; +type MainProps = { + loadMercureInfo: () => void; +}; + export const Main = ( TagsList: FC, ShortUrlsList: FC, @@ -22,12 +26,17 @@ export const Main = ( Overview: FC, EditShortUrl: FC, ManageDomains: FC, -): FC => () => { +): FC => ({ loadMercureInfo }) => { const location = useLocation(); const routesPrefix = useRoutesPrefix(); const [sidebarVisible, toggleSidebar, showSidebar, hideSidebar] = useToggle(); useEffect(() => hideSidebar(), [location]); + // FIXME Re-load mercure info every time server changes + // useEffect(() => { + // loadMercureInfo(); + // }, []); + const addDomainVisitsRoute = useFeature('domainVisits'); const burgerClasses = classNames('menu-layout__burger-icon', { 'menu-layout__burger-icon--active': sidebarVisible }); const swipeableProps = useSwipeable(showSidebar, hideSidebar); diff --git a/src/shlink-web-component/ShlinkWebComponent.tsx b/shlink-web-component/ShlinkWebComponent.tsx similarity index 96% rename from src/shlink-web-component/ShlinkWebComponent.tsx rename to shlink-web-component/ShlinkWebComponent.tsx index 57c07742..9537b0fc 100644 --- a/src/shlink-web-component/ShlinkWebComponent.tsx +++ b/shlink-web-component/ShlinkWebComponent.tsx @@ -3,7 +3,7 @@ import type Bottle from 'bottlejs'; import type { FC, ReactNode } from 'react'; import { useEffect, useRef, useState } from 'react'; import { Provider } from 'react-redux'; -import type { SemVer } from '../utils/helpers/version'; +import type { SemVer } from '../src/utils/helpers/version'; import type { ShlinkApiClient } from './api-contract'; import { setUpStore } from './container/store'; import { FeaturesProvider, useFeatures } from './utils/features'; diff --git a/src/shlink-web-component/api-contract/ShlinkApiClient.ts b/shlink-web-component/api-contract/ShlinkApiClient.ts similarity index 100% rename from src/shlink-web-component/api-contract/ShlinkApiClient.ts rename to shlink-web-component/api-contract/ShlinkApiClient.ts diff --git a/src/shlink-web-component/api-contract/errors.ts b/shlink-web-component/api-contract/errors.ts similarity index 100% rename from src/shlink-web-component/api-contract/errors.ts rename to shlink-web-component/api-contract/errors.ts diff --git a/src/shlink-web-component/api-contract/index.ts b/shlink-web-component/api-contract/index.ts similarity index 100% rename from src/shlink-web-component/api-contract/index.ts rename to shlink-web-component/api-contract/index.ts diff --git a/src/shlink-web-component/api-contract/types.ts b/shlink-web-component/api-contract/types.ts similarity index 96% rename from src/shlink-web-component/api-contract/types.ts rename to shlink-web-component/api-contract/types.ts index 65b91718..a370f617 100644 --- a/src/shlink-web-component/api-contract/types.ts +++ b/shlink-web-component/api-contract/types.ts @@ -1,5 +1,5 @@ -import type { Order } from '../../utils/helpers/ordering'; -import type { OptionalString } from '../../utils/utils'; +import type { Order } from '../../src/utils/helpers/ordering'; +import type { OptionalString } from '../../src/utils/utils'; import type { ShortUrl, ShortUrlMeta } from '../short-urls/data'; import type { Visit } from '../visits/types'; diff --git a/src/shlink-web-component/api-contract/utils.ts b/shlink-web-component/api-contract/utils.ts similarity index 100% rename from src/shlink-web-component/api-contract/utils.ts rename to shlink-web-component/api-contract/utils.ts diff --git a/src/shlink-web-component/container/index.ts b/shlink-web-component/container/index.ts similarity index 83% rename from src/shlink-web-component/container/index.ts rename to shlink-web-component/container/index.ts index 672b5e07..c6456fab 100644 --- a/src/shlink-web-component/container/index.ts +++ b/shlink-web-component/container/index.ts @@ -2,13 +2,13 @@ import type { IContainer } from 'bottlejs'; import Bottle from 'bottlejs'; import { pick } from 'ramda'; import { connect as reduxConnect } from 'react-redux/es/exports'; -import { HttpClient } from '../../common/services/HttpClient'; -import { ImageDownloader } from '../../common/services/ImageDownloader'; -import { ReportExporter } from '../../common/services/ReportExporter'; -import { csvToJson, jsonToCsv } from '../../utils/helpers/csvjson'; -import { useTimeoutToggle } from '../../utils/helpers/hooks'; -import { ColorGenerator } from '../../utils/services/ColorGenerator'; -import { LocalStorage } from '../../utils/services/LocalStorage'; +import { HttpClient } from '../../src/common/services/HttpClient'; +import { ImageDownloader } from '../../src/common/services/ImageDownloader'; +import { ReportExporter } from '../../src/common/services/ReportExporter'; +import { csvToJson, jsonToCsv } from '../../src/utils/helpers/csvjson'; +import { useTimeoutToggle } from '../../src/utils/helpers/hooks'; +import { ColorGenerator } from '../../src/utils/services/ColorGenerator'; +import { LocalStorage } from '../../src/utils/services/LocalStorage'; import { provideServices as provideDomainsServices } from '../domains/services/provideServices'; import { provideServices as provideMercureServices } from '../mercure/services/provideServices'; import { provideServices as provideOverviewServices } from '../overview/services/provideServices'; @@ -38,7 +38,7 @@ const connect: ConnectDecorator = (propsFromState: string[] | null, actionServic actionServiceNames.reduce(mapActionService, {}), ); -provideWebComponentServices(bottle); +provideWebComponentServices(bottle, connect); provideShortUrlsServices(bottle, connect); provideTagsServices(bottle, connect); provideVisitsServices(bottle, connect); diff --git a/src/shlink-web-component/container/provideServices.ts b/shlink-web-component/container/provideServices.ts similarity index 63% rename from src/shlink-web-component/container/provideServices.ts rename to shlink-web-component/container/provideServices.ts index 8368c237..59b81daa 100644 --- a/src/shlink-web-component/container/provideServices.ts +++ b/shlink-web-component/container/provideServices.ts @@ -1,7 +1,8 @@ import type Bottle from 'bottlejs'; import { Main } from '../Main'; +import type { ConnectDecorator } from './index'; -export const provideServices = (bottle: Bottle) => { +export const provideServices = (bottle: Bottle, connect: ConnectDecorator) => { bottle.serviceFactory( 'Main', Main, @@ -17,4 +18,6 @@ export const provideServices = (bottle: Bottle) => { 'EditShortUrl', 'ManageDomains', ); + + bottle.decorator('Main', connect(null, ['loadMercureInfo'])); }; diff --git a/src/shlink-web-component/container/store.ts b/shlink-web-component/container/store.ts similarity index 100% rename from src/shlink-web-component/container/store.ts rename to shlink-web-component/container/store.ts diff --git a/src/shlink-web-component/domains/DomainRow.tsx b/shlink-web-component/domains/DomainRow.tsx similarity index 97% rename from src/shlink-web-component/domains/DomainRow.tsx rename to shlink-web-component/domains/DomainRow.tsx index 831aac8a..c171f443 100644 --- a/src/shlink-web-component/domains/DomainRow.tsx +++ b/shlink-web-component/domains/DomainRow.tsx @@ -3,7 +3,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC } from 'react'; import { useEffect } from 'react'; import { UncontrolledTooltip } from 'reactstrap'; -import type { OptionalString } from '../../utils/utils'; +import type { OptionalString } from '../../src/utils/utils'; import type { ShlinkDomainRedirects } from '../api-contract'; import type { Domain } from './data'; import { DomainDropdown } from './helpers/DomainDropdown'; diff --git a/src/shlink-web-component/domains/DomainSelector.scss b/shlink-web-component/domains/DomainSelector.scss similarity index 89% rename from src/shlink-web-component/domains/DomainSelector.scss rename to shlink-web-component/domains/DomainSelector.scss index 66e7a13e..ad6d71d1 100644 --- a/src/shlink-web-component/domains/DomainSelector.scss +++ b/shlink-web-component/domains/DomainSelector.scss @@ -1,5 +1,5 @@ -@import '../../utils/base'; -@import '../../utils/mixins/vertical-align'; +@import '../../src/utils/base'; +@import '../../src/utils/mixins/vertical-align'; .domains-dropdown__toggle-btn.domains-dropdown__toggle-btn, .domains-dropdown__toggle-btn.domains-dropdown__toggle-btn:hover, diff --git a/src/shlink-web-component/domains/DomainSelector.tsx b/shlink-web-component/domains/DomainSelector.tsx similarity index 95% rename from src/shlink-web-component/domains/DomainSelector.tsx rename to shlink-web-component/domains/DomainSelector.tsx index 5581768d..5d643ae9 100644 --- a/src/shlink-web-component/domains/DomainSelector.tsx +++ b/shlink-web-component/domains/DomainSelector.tsx @@ -4,8 +4,8 @@ import { isEmpty, pipe } from 'ramda'; import { useEffect } from 'react'; import type { InputProps } from 'reactstrap'; import { Button, DropdownItem, Input, InputGroup, UncontrolledTooltip } from 'reactstrap'; -import { DropdownBtn } from '../../utils/DropdownBtn'; -import { useToggle } from '../../utils/helpers/hooks'; +import { DropdownBtn } from '../../src/utils/DropdownBtn'; +import { useToggle } from '../../src/utils/helpers/hooks'; import type { DomainsList } from './reducers/domainsList'; import './DomainSelector.scss'; diff --git a/src/shlink-web-component/domains/ManageDomains.tsx b/shlink-web-component/domains/ManageDomains.tsx similarity index 88% rename from src/shlink-web-component/domains/ManageDomains.tsx rename to shlink-web-component/domains/ManageDomains.tsx index d8535666..77bf4c8b 100644 --- a/src/shlink-web-component/domains/ManageDomains.tsx +++ b/shlink-web-component/domains/ManageDomains.tsx @@ -1,10 +1,10 @@ import type { FC } from 'react'; import { useEffect } from 'react'; -import { ShlinkApiError } from '../../api/ShlinkApiError'; -import { Message } from '../../utils/Message'; -import { Result } from '../../utils/Result'; -import { SearchField } from '../../utils/SearchField'; -import { SimpleCard } from '../../utils/SimpleCard'; +import { ShlinkApiError } from '../../src/api/ShlinkApiError'; +import { Message } from '../../src/utils/Message'; +import { Result } from '../../src/utils/Result'; +import { SearchField } from '../../src/utils/SearchField'; +import { SimpleCard } from '../../src/utils/SimpleCard'; import { DomainRow } from './DomainRow'; import type { EditDomainRedirects } from './reducers/domainRedirects'; import type { DomainsList } from './reducers/domainsList'; diff --git a/src/shlink-web-component/domains/data/index.ts b/shlink-web-component/domains/data/index.ts similarity index 100% rename from src/shlink-web-component/domains/data/index.ts rename to shlink-web-component/domains/data/index.ts diff --git a/src/shlink-web-component/domains/helpers/DomainDropdown.tsx b/shlink-web-component/domains/helpers/DomainDropdown.tsx similarity index 93% rename from src/shlink-web-component/domains/helpers/DomainDropdown.tsx rename to shlink-web-component/domains/helpers/DomainDropdown.tsx index b033565e..e8b24116 100644 --- a/src/shlink-web-component/domains/helpers/DomainDropdown.tsx +++ b/shlink-web-component/domains/helpers/DomainDropdown.tsx @@ -3,8 +3,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC } from 'react'; import { Link } from 'react-router-dom'; import { DropdownItem } from 'reactstrap'; -import { useToggle } from '../../../utils/helpers/hooks'; -import { RowDropdownBtn } from '../../../utils/RowDropdownBtn'; +import { useToggle } from '../../../src/utils/helpers/hooks'; +import { RowDropdownBtn } from '../../../src/utils/RowDropdownBtn'; import { useFeature } from '../../utils/features'; import { useRoutesPrefix } from '../../utils/routesPrefix'; import { DEFAULT_DOMAIN } from '../../visits/reducers/domainVisits'; diff --git a/src/shlink-web-component/domains/helpers/DomainStatusIcon.tsx b/shlink-web-component/domains/helpers/DomainStatusIcon.tsx similarity index 93% rename from src/shlink-web-component/domains/helpers/DomainStatusIcon.tsx rename to shlink-web-component/domains/helpers/DomainStatusIcon.tsx index 4a4f6fb1..838aba4c 100644 --- a/src/shlink-web-component/domains/helpers/DomainStatusIcon.tsx +++ b/shlink-web-component/domains/helpers/DomainStatusIcon.tsx @@ -8,8 +8,8 @@ import type { FC } from 'react'; import { useEffect, useState } from 'react'; import { ExternalLink } from 'react-external-link'; import { UncontrolledTooltip } from 'reactstrap'; -import { useElementRef } from '../../../utils/helpers/hooks'; -import type { MediaMatcher } from '../../../utils/types'; +import { useElementRef } from '../../../src/utils/helpers/hooks'; +import type { MediaMatcher } from '../../../src/utils/types'; import type { DomainStatus } from '../data'; interface DomainStatusIconProps { diff --git a/src/shlink-web-component/domains/helpers/EditDomainRedirectsModal.tsx b/shlink-web-component/domains/helpers/EditDomainRedirectsModal.tsx similarity index 92% rename from src/shlink-web-component/domains/helpers/EditDomainRedirectsModal.tsx rename to shlink-web-component/domains/helpers/EditDomainRedirectsModal.tsx index 5dbd9397..99fc74eb 100644 --- a/src/shlink-web-component/domains/helpers/EditDomainRedirectsModal.tsx +++ b/shlink-web-component/domains/helpers/EditDomainRedirectsModal.tsx @@ -2,10 +2,10 @@ import type { FC } from 'react'; import { useState } from 'react'; import { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; import type { ShlinkDomain } from '../../../api/types'; -import type { InputFormGroupProps } from '../../../utils/forms/InputFormGroup'; -import { InputFormGroup } from '../../../utils/forms/InputFormGroup'; -import { InfoTooltip } from '../../../utils/InfoTooltip'; -import { handleEventPreventingDefault, nonEmptyValueOrNull } from '../../../utils/utils'; +import type { InputFormGroupProps } from '../../../src/utils/forms/InputFormGroup'; +import { InputFormGroup } from '../../../src/utils/forms/InputFormGroup'; +import { InfoTooltip } from '../../../src/utils/InfoTooltip'; +import { handleEventPreventingDefault, nonEmptyValueOrNull } from '../../../src/utils/utils'; import type { EditDomainRedirects } from '../reducers/domainRedirects'; interface EditDomainRedirectsModalProps { diff --git a/src/shlink-web-component/domains/reducers/domainRedirects.ts b/shlink-web-component/domains/reducers/domainRedirects.ts similarity index 89% rename from src/shlink-web-component/domains/reducers/domainRedirects.ts rename to shlink-web-component/domains/reducers/domainRedirects.ts index 342fe6a2..dea1e8c6 100644 --- a/src/shlink-web-component/domains/reducers/domainRedirects.ts +++ b/shlink-web-component/domains/reducers/domainRedirects.ts @@ -1,4 +1,4 @@ -import { createAsyncThunk } from '../../../utils/helpers/redux'; +import { createAsyncThunk } from '../../../src/utils/helpers/redux'; import type { ShlinkApiClient, ShlinkDomainRedirects } from '../../api-contract'; const EDIT_DOMAIN_REDIRECTS = 'shlink/domainRedirects/EDIT_DOMAIN_REDIRECTS'; diff --git a/src/shlink-web-component/domains/reducers/domainsList.ts b/shlink-web-component/domains/reducers/domainsList.ts similarity index 98% rename from src/shlink-web-component/domains/reducers/domainsList.ts rename to shlink-web-component/domains/reducers/domainsList.ts index 708165c6..39030f22 100644 --- a/src/shlink-web-component/domains/reducers/domainsList.ts +++ b/shlink-web-component/domains/reducers/domainsList.ts @@ -1,6 +1,6 @@ import type { AsyncThunk, SliceCaseReducers } from '@reduxjs/toolkit'; import { createAction, createSlice } from '@reduxjs/toolkit'; -import { createAsyncThunk } from '../../../utils/helpers/redux'; +import { createAsyncThunk } from '../../../src/utils/helpers/redux'; import type { ProblemDetailsError, ShlinkApiClient, ShlinkDomainRedirects } from '../../api-contract'; import { parseApiError } from '../../api-contract/utils'; import type { Domain, DomainStatus } from '../data'; diff --git a/src/shlink-web-component/domains/services/provideServices.ts b/shlink-web-component/domains/services/provideServices.ts similarity index 100% rename from src/shlink-web-component/domains/services/provideServices.ts rename to shlink-web-component/domains/services/provideServices.ts diff --git a/src/shlink-web-component/index.ts b/shlink-web-component/index.ts similarity index 100% rename from src/shlink-web-component/index.ts rename to shlink-web-component/index.ts diff --git a/src/shlink-web-component/mercure/helpers/Topics.ts b/shlink-web-component/mercure/helpers/Topics.ts similarity index 100% rename from src/shlink-web-component/mercure/helpers/Topics.ts rename to shlink-web-component/mercure/helpers/Topics.ts diff --git a/src/shlink-web-component/mercure/helpers/boundToMercureHub.tsx b/shlink-web-component/mercure/helpers/boundToMercureHub.tsx similarity index 96% rename from src/shlink-web-component/mercure/helpers/boundToMercureHub.tsx rename to shlink-web-component/mercure/helpers/boundToMercureHub.tsx index 854c9a4c..230552b1 100644 --- a/src/shlink-web-component/mercure/helpers/boundToMercureHub.tsx +++ b/shlink-web-component/mercure/helpers/boundToMercureHub.tsx @@ -23,6 +23,7 @@ export function boundToMercureHub( const { interval } = mercureInfo; const params = useParams(); + // Every time mercure info changes, re-bind useEffect(() => { const onMessage = (visit: CreateVisit) => (interval ? pendingUpdates.add(visit) : createNewVisits([visit])); const topics = getTopicsForProps(props, params); diff --git a/src/shlink-web-component/mercure/helpers/index.ts b/shlink-web-component/mercure/helpers/index.ts similarity index 100% rename from src/shlink-web-component/mercure/helpers/index.ts rename to shlink-web-component/mercure/helpers/index.ts diff --git a/src/shlink-web-component/mercure/reducers/mercureInfo.ts b/shlink-web-component/mercure/reducers/mercureInfo.ts similarity index 95% rename from src/shlink-web-component/mercure/reducers/mercureInfo.ts rename to shlink-web-component/mercure/reducers/mercureInfo.ts index 07d50c3a..ff48bd11 100644 --- a/src/shlink-web-component/mercure/reducers/mercureInfo.ts +++ b/shlink-web-component/mercure/reducers/mercureInfo.ts @@ -1,5 +1,5 @@ import { createSlice } from '@reduxjs/toolkit'; -import { createAsyncThunk } from '../../../utils/helpers/redux'; +import { createAsyncThunk } from '../../../src/utils/helpers/redux'; import type { ShlinkApiClient, ShlinkMercureInfo } from '../../api-contract'; const REDUCER_PREFIX = 'shlink/mercure'; diff --git a/src/shlink-web-component/mercure/services/provideServices.ts b/shlink-web-component/mercure/services/provideServices.ts similarity index 100% rename from src/shlink-web-component/mercure/services/provideServices.ts rename to shlink-web-component/mercure/services/provideServices.ts diff --git a/src/shlink-web-component/overview/Overview.tsx b/shlink-web-component/overview/Overview.tsx similarity index 98% rename from src/shlink-web-component/overview/Overview.tsx rename to shlink-web-component/overview/Overview.tsx index 5d80fbee..4d769f2a 100644 --- a/src/shlink-web-component/overview/Overview.tsx +++ b/shlink-web-component/overview/Overview.tsx @@ -2,7 +2,7 @@ import type { FC } from 'react'; import { useEffect } from 'react'; import { Link, useNavigate } from 'react-router-dom'; import { Card, CardBody, CardHeader, Row } from 'reactstrap'; -import { prettify } from '../../utils/helpers/numbers'; +import { prettify } from '../../src/utils/helpers/numbers'; import type { ShlinkShortUrlsListParams } from '../api-contract'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; diff --git a/src/shlink-web-component/overview/helpers/HighlightCard.scss b/shlink-web-component/overview/helpers/HighlightCard.scss similarity index 91% rename from src/shlink-web-component/overview/helpers/HighlightCard.scss rename to shlink-web-component/overview/helpers/HighlightCard.scss index 9892de65..009957bc 100644 --- a/src/shlink-web-component/overview/helpers/HighlightCard.scss +++ b/shlink-web-component/overview/helpers/HighlightCard.scss @@ -1,4 +1,4 @@ -@import '../../../utils/base'; +@import '../../../src/utils/base'; .highlight-card.highlight-card { text-align: center; diff --git a/src/shlink-web-component/overview/helpers/HighlightCard.tsx b/shlink-web-component/overview/helpers/HighlightCard.tsx similarity index 94% rename from src/shlink-web-component/overview/helpers/HighlightCard.tsx rename to shlink-web-component/overview/helpers/HighlightCard.tsx index b1bd05c9..b4a7d45f 100644 --- a/src/shlink-web-component/overview/helpers/HighlightCard.tsx +++ b/shlink-web-component/overview/helpers/HighlightCard.tsx @@ -3,7 +3,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC, PropsWithChildren, ReactNode } from 'react'; import { Link } from 'react-router-dom'; import { Card, CardText, CardTitle, UncontrolledTooltip } from 'reactstrap'; -import { useElementRef } from '../../../utils/helpers/hooks'; +import { useElementRef } from '../../../src/utils/helpers/hooks'; import './HighlightCard.scss'; export type HighlightCardProps = PropsWithChildren<{ diff --git a/src/shlink-web-component/overview/helpers/VisitsHighlightCard.tsx b/shlink-web-component/overview/helpers/VisitsHighlightCard.tsx similarity index 93% rename from src/shlink-web-component/overview/helpers/VisitsHighlightCard.tsx rename to shlink-web-component/overview/helpers/VisitsHighlightCard.tsx index 5612e498..761c45f0 100644 --- a/src/shlink-web-component/overview/helpers/VisitsHighlightCard.tsx +++ b/shlink-web-component/overview/helpers/VisitsHighlightCard.tsx @@ -1,5 +1,5 @@ import type { FC } from 'react'; -import { prettify } from '../../../utils/helpers/numbers'; +import { prettify } from '../../../src/utils/helpers/numbers'; import type { PartialVisitsSummary } from '../../visits/reducers/visitsOverview'; import type { HighlightCardProps } from './HighlightCard'; import { HighlightCard } from './HighlightCard'; diff --git a/src/shlink-web-component/overview/services/provideServices.ts b/shlink-web-component/overview/services/provideServices.ts similarity index 100% rename from src/shlink-web-component/overview/services/provideServices.ts rename to shlink-web-component/overview/services/provideServices.ts diff --git a/src/shlink-web-component/short-urls/CreateShortUrl.tsx b/shlink-web-component/short-urls/CreateShortUrl.tsx similarity index 100% rename from src/shlink-web-component/short-urls/CreateShortUrl.tsx rename to shlink-web-component/short-urls/CreateShortUrl.tsx diff --git a/src/shlink-web-component/short-urls/EditShortUrl.tsx b/shlink-web-component/short-urls/EditShortUrl.tsx similarity index 92% rename from src/shlink-web-component/short-urls/EditShortUrl.tsx rename to shlink-web-component/short-urls/EditShortUrl.tsx index b35de1b6..add730d4 100644 --- a/src/shlink-web-component/short-urls/EditShortUrl.tsx +++ b/shlink-web-component/short-urls/EditShortUrl.tsx @@ -5,11 +5,11 @@ import { useEffect, useMemo } from 'react'; import { ExternalLink } from 'react-external-link'; import { useLocation, useParams } from 'react-router-dom'; import { Button, Card } from 'reactstrap'; -import { ShlinkApiError } from '../../api/ShlinkApiError'; -import { useGoBack } from '../../utils/helpers/hooks'; -import { parseQuery } from '../../utils/helpers/query'; -import { Message } from '../../utils/Message'; -import { Result } from '../../utils/Result'; +import { ShlinkApiError } from '../../src/api/ShlinkApiError'; +import { useGoBack } from '../../src/utils/helpers/hooks'; +import { parseQuery } from '../../src/utils/helpers/query'; +import { Message } from '../../src/utils/Message'; +import { Result } from '../../src/utils/Result'; import { useSetting } from '../utils/settings'; import type { ShortUrlIdentifier } from './data'; import { shortUrlDataFromShortUrl, urlDecodeShortCode } from './helpers'; diff --git a/src/shlink-web-component/short-urls/Paginator.tsx b/shlink-web-component/short-urls/Paginator.tsx similarity index 94% rename from src/shlink-web-component/short-urls/Paginator.tsx rename to shlink-web-component/short-urls/Paginator.tsx index f1a2e0b4..0604d4e4 100644 --- a/src/shlink-web-component/short-urls/Paginator.tsx +++ b/shlink-web-component/short-urls/Paginator.tsx @@ -1,13 +1,13 @@ import { Link } from 'react-router-dom'; import { Pagination, PaginationItem, PaginationLink } from 'reactstrap'; import type { - NumberOrEllipsis } from '../../utils/helpers/pagination'; + NumberOrEllipsis } from '../../src/utils/helpers/pagination'; import { keyForPage, pageIsEllipsis, prettifyPageNumber, progressivePagination, -} from '../../utils/helpers/pagination'; +} from '../../src/utils/helpers/pagination'; import type { ShlinkPaginator } from '../api-contract'; import { useRoutesPrefix } from '../utils/routesPrefix'; diff --git a/src/shlink-web-component/short-urls/ShortUrlForm.scss b/shlink-web-component/short-urls/ShortUrlForm.scss similarity index 75% rename from src/shlink-web-component/short-urls/ShortUrlForm.scss rename to shlink-web-component/short-urls/ShortUrlForm.scss index e2642a7e..46a3ab9a 100644 --- a/src/shlink-web-component/short-urls/ShortUrlForm.scss +++ b/shlink-web-component/short-urls/ShortUrlForm.scss @@ -1,4 +1,4 @@ -@import '../../utils/base'; +@import '../../src/utils/base'; .short-url-form p:last-child { margin-bottom: 0; diff --git a/src/shlink-web-component/short-urls/ShortUrlForm.tsx b/shlink-web-component/short-urls/ShortUrlForm.tsx similarity index 95% rename from src/shlink-web-component/short-urls/ShortUrlForm.tsx rename to shlink-web-component/short-urls/ShortUrlForm.tsx index 200a927e..02c46f34 100644 --- a/src/shlink-web-component/short-urls/ShortUrlForm.tsx +++ b/shlink-web-component/short-urls/ShortUrlForm.tsx @@ -8,13 +8,13 @@ import type { ChangeEvent, FC } from 'react'; import { useEffect, useState } from 'react'; import { Button, FormGroup, Input, Row } from 'reactstrap'; import type { InputType } from 'reactstrap/types/lib/Input'; -import { Checkbox } from '../../utils/Checkbox'; -import type { DateTimeInputProps } from '../../utils/dates/DateTimeInput'; -import { DateTimeInput } from '../../utils/dates/DateTimeInput'; -import { formatIsoDate } from '../../utils/helpers/date'; -import { IconInput } from '../../utils/IconInput'; -import { SimpleCard } from '../../utils/SimpleCard'; -import { handleEventPreventingDefault, hasValue } from '../../utils/utils'; +import { Checkbox } from '../../src/utils/Checkbox'; +import type { DateTimeInputProps } from '../../src/utils/dates/DateTimeInput'; +import { DateTimeInput } from '../../src/utils/dates/DateTimeInput'; +import { formatIsoDate } from '../../src/utils/helpers/date'; +import { IconInput } from '../../src/utils/IconInput'; +import { SimpleCard } from '../../src/utils/SimpleCard'; +import { handleEventPreventingDefault, hasValue } from '../../src/utils/utils'; import type { DomainSelectorProps } from '../domains/DomainSelector'; import type { TagsSelectorProps } from '../tags/helpers/TagsSelector'; import { useFeature } from '../utils/features'; diff --git a/src/shlink-web-component/short-urls/ShortUrlsFilteringBar.scss b/shlink-web-component/short-urls/ShortUrlsFilteringBar.scss similarity index 100% rename from src/shlink-web-component/short-urls/ShortUrlsFilteringBar.scss rename to shlink-web-component/short-urls/ShortUrlsFilteringBar.scss diff --git a/src/shlink-web-component/short-urls/ShortUrlsFilteringBar.tsx b/shlink-web-component/short-urls/ShortUrlsFilteringBar.tsx similarity index 90% rename from src/shlink-web-component/short-urls/ShortUrlsFilteringBar.tsx rename to shlink-web-component/short-urls/ShortUrlsFilteringBar.tsx index 420c9f15..7949eb56 100644 --- a/src/shlink-web-component/short-urls/ShortUrlsFilteringBar.tsx +++ b/shlink-web-component/short-urls/ShortUrlsFilteringBar.tsx @@ -4,13 +4,13 @@ import classNames from 'classnames'; import { isEmpty, pipe } from 'ramda'; import type { FC } from 'react'; import { Button, InputGroup, Row, UncontrolledTooltip } from 'reactstrap'; -import { DateRangeSelector } from '../../utils/dates/DateRangeSelector'; -import { formatIsoDate } from '../../utils/helpers/date'; -import type { DateRange } from '../../utils/helpers/dateIntervals'; -import { datesToDateRange } from '../../utils/helpers/dateIntervals'; -import type { OrderDir } from '../../utils/helpers/ordering'; -import { OrderingDropdown } from '../../utils/OrderingDropdown'; -import { SearchField } from '../../utils/SearchField'; +import { DateRangeSelector } from '../../src/utils/dates/DateRangeSelector'; +import { formatIsoDate } from '../../src/utils/helpers/date'; +import type { DateRange } from '../../src/utils/helpers/dateIntervals'; +import { datesToDateRange } from '../../src/utils/helpers/dateIntervals'; +import type { OrderDir } from '../../src/utils/helpers/ordering'; +import { OrderingDropdown } from '../../src/utils/OrderingDropdown'; +import { SearchField } from '../../src/utils/SearchField'; import type { TagsSelectorProps } from '../tags/helpers/TagsSelector'; import { useFeature } from '../utils/features'; import { useSetting } from '../utils/settings'; diff --git a/src/shlink-web-component/short-urls/ShortUrlsList.tsx b/shlink-web-component/short-urls/ShortUrlsList.tsx similarity index 93% rename from src/shlink-web-component/short-urls/ShortUrlsList.tsx rename to shlink-web-component/short-urls/ShortUrlsList.tsx index ba84dd5d..a373f930 100644 --- a/src/shlink-web-component/short-urls/ShortUrlsList.tsx +++ b/shlink-web-component/short-urls/ShortUrlsList.tsx @@ -2,10 +2,10 @@ import { pipe } from 'ramda'; import { useEffect, useState } from 'react'; import { useLocation, useParams } from 'react-router-dom'; import { Card } from 'reactstrap'; -import { DEFAULT_SHORT_URLS_ORDERING } from '../../settings/reducers/settings'; -import type { OrderDir } from '../../utils/helpers/ordering'; -import { determineOrderDir } from '../../utils/helpers/ordering'; -import { TableOrderIcon } from '../../utils/table/TableOrderIcon'; +import { DEFAULT_SHORT_URLS_ORDERING } from '../../src/settings/reducers/settings'; +import type { OrderDir } from '../../src/utils/helpers/ordering'; +import { determineOrderDir } from '../../src/utils/helpers/ordering'; +import { TableOrderIcon } from '../../src/utils/table/TableOrderIcon'; import type { ShlinkShortUrlsListParams, ShlinkShortUrlsOrder } from '../api-contract'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; diff --git a/src/shlink-web-component/short-urls/ShortUrlsTable.scss b/shlink-web-component/short-urls/ShortUrlsTable.scss similarity index 100% rename from src/shlink-web-component/short-urls/ShortUrlsTable.scss rename to shlink-web-component/short-urls/ShortUrlsTable.scss diff --git a/src/shlink-web-component/short-urls/ShortUrlsTable.tsx b/shlink-web-component/short-urls/ShortUrlsTable.tsx similarity index 100% rename from src/shlink-web-component/short-urls/ShortUrlsTable.tsx rename to shlink-web-component/short-urls/ShortUrlsTable.tsx diff --git a/src/shlink-web-component/short-urls/UseExistingIfFoundInfoIcon.scss b/shlink-web-component/short-urls/UseExistingIfFoundInfoIcon.scss similarity index 100% rename from src/shlink-web-component/short-urls/UseExistingIfFoundInfoIcon.scss rename to shlink-web-component/short-urls/UseExistingIfFoundInfoIcon.scss diff --git a/src/shlink-web-component/short-urls/UseExistingIfFoundInfoIcon.tsx b/shlink-web-component/short-urls/UseExistingIfFoundInfoIcon.tsx similarity index 97% rename from src/shlink-web-component/short-urls/UseExistingIfFoundInfoIcon.tsx rename to shlink-web-component/short-urls/UseExistingIfFoundInfoIcon.tsx index 52031e0d..4ff7e19d 100644 --- a/src/shlink-web-component/short-urls/UseExistingIfFoundInfoIcon.tsx +++ b/shlink-web-component/short-urls/UseExistingIfFoundInfoIcon.tsx @@ -1,7 +1,7 @@ import { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Modal, ModalBody, ModalHeader } from 'reactstrap'; -import { useToggle } from '../../utils/helpers/hooks'; +import { useToggle } from '../../src/utils/helpers/hooks'; import './UseExistingIfFoundInfoIcon.scss'; const InfoModal = ({ isOpen, toggle }: { isOpen: boolean; toggle: () => void }) => ( diff --git a/src/shlink-web-component/short-urls/data/index.ts b/shlink-web-component/short-urls/data/index.ts similarity index 93% rename from src/shlink-web-component/short-urls/data/index.ts rename to shlink-web-component/short-urls/data/index.ts index d83ca981..ec1b14b7 100644 --- a/src/shlink-web-component/short-urls/data/index.ts +++ b/shlink-web-component/short-urls/data/index.ts @@ -1,6 +1,6 @@ import type { ShlinkVisitsSummary } from '../../../api/types'; -import type { Order } from '../../../utils/helpers/ordering'; -import type { Nullable, OptionalString } from '../../../utils/utils'; +import type { Order } from '../../../src/utils/helpers/ordering'; +import type { Nullable, OptionalString } from '../../../src/utils/utils'; export interface DeviceLongUrls { android?: OptionalString; diff --git a/src/shlink-web-component/short-urls/helpers/CreateShortUrlResult.scss b/shlink-web-component/short-urls/helpers/CreateShortUrlResult.scss similarity index 100% rename from src/shlink-web-component/short-urls/helpers/CreateShortUrlResult.scss rename to shlink-web-component/short-urls/helpers/CreateShortUrlResult.scss diff --git a/src/shlink-web-component/short-urls/helpers/CreateShortUrlResult.tsx b/shlink-web-component/short-urls/helpers/CreateShortUrlResult.tsx similarity index 91% rename from src/shlink-web-component/short-urls/helpers/CreateShortUrlResult.tsx rename to shlink-web-component/short-urls/helpers/CreateShortUrlResult.tsx index 06f86f13..0261f04a 100644 --- a/src/shlink-web-component/short-urls/helpers/CreateShortUrlResult.tsx +++ b/shlink-web-component/short-urls/helpers/CreateShortUrlResult.tsx @@ -4,9 +4,9 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useEffect } from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; import { Tooltip } from 'reactstrap'; -import { ShlinkApiError } from '../../../api/ShlinkApiError'; -import type { TimeoutToggle } from '../../../utils/helpers/hooks'; -import { Result } from '../../../utils/Result'; +import { ShlinkApiError } from '../../../src/api/ShlinkApiError'; +import type { TimeoutToggle } from '../../../src/utils/helpers/hooks'; +import { Result } from '../../../src/utils/Result'; import type { ShortUrlCreation } from '../reducers/shortUrlCreation'; import './CreateShortUrlResult.scss'; diff --git a/src/shlink-web-component/short-urls/helpers/DeleteShortUrlModal.tsx b/shlink-web-component/short-urls/helpers/DeleteShortUrlModal.tsx similarity index 93% rename from src/shlink-web-component/short-urls/helpers/DeleteShortUrlModal.tsx rename to shlink-web-component/short-urls/helpers/DeleteShortUrlModal.tsx index 2a3697a3..7771450c 100644 --- a/src/shlink-web-component/short-urls/helpers/DeleteShortUrlModal.tsx +++ b/shlink-web-component/short-urls/helpers/DeleteShortUrlModal.tsx @@ -1,9 +1,9 @@ import { pipe } from 'ramda'; import { useEffect, useState } from 'react'; import { Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; -import { ShlinkApiError } from '../../../api/ShlinkApiError'; -import { Result } from '../../../utils/Result'; -import { handleEventPreventingDefault } from '../../../utils/utils'; +import { ShlinkApiError } from '../../../src/api/ShlinkApiError'; +import { Result } from '../../../src/utils/Result'; +import { handleEventPreventingDefault } from '../../../src/utils/utils'; import { isInvalidDeletionError } from '../../api-contract/utils'; import type { ShortUrlIdentifier, ShortUrlModalProps } from '../data'; import type { ShortUrlDeletion } from '../reducers/shortUrlDeletion'; diff --git a/src/shlink-web-component/short-urls/helpers/ExportShortUrlsBtn.tsx b/shlink-web-component/short-urls/helpers/ExportShortUrlsBtn.tsx similarity index 90% rename from src/shlink-web-component/short-urls/helpers/ExportShortUrlsBtn.tsx rename to shlink-web-component/short-urls/helpers/ExportShortUrlsBtn.tsx index bb03cae1..96497676 100644 --- a/src/shlink-web-component/short-urls/helpers/ExportShortUrlsBtn.tsx +++ b/shlink-web-component/short-urls/helpers/ExportShortUrlsBtn.tsx @@ -1,8 +1,8 @@ import type { FC } from 'react'; import { useCallback } from 'react'; -import type { ReportExporter } from '../../../common/services/ReportExporter'; -import { ExportBtn } from '../../../utils/ExportBtn'; -import { useToggle } from '../../../utils/helpers/hooks'; +import type { ReportExporter } from '../../../src/common/services/ReportExporter'; +import { ExportBtn } from '../../../src/utils/ExportBtn'; +import { useToggle } from '../../../src/utils/helpers/hooks'; import type { ShlinkApiClient } from '../../api-contract'; import type { ShortUrl } from '../data'; import { useShortUrlsQuery } from './hooks'; diff --git a/src/shlink-web-component/short-urls/helpers/QrCodeModal.scss b/shlink-web-component/short-urls/helpers/QrCodeModal.scss similarity index 100% rename from src/shlink-web-component/short-urls/helpers/QrCodeModal.scss rename to shlink-web-component/short-urls/helpers/QrCodeModal.scss diff --git a/src/shlink-web-component/short-urls/helpers/QrCodeModal.tsx b/shlink-web-component/short-urls/helpers/QrCodeModal.tsx similarity index 91% rename from src/shlink-web-component/short-urls/helpers/QrCodeModal.tsx rename to shlink-web-component/short-urls/helpers/QrCodeModal.tsx index a2f25364..9c825bc1 100644 --- a/src/shlink-web-component/short-urls/helpers/QrCodeModal.tsx +++ b/shlink-web-component/short-urls/helpers/QrCodeModal.tsx @@ -3,10 +3,10 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useMemo, useState } from 'react'; import { ExternalLink } from 'react-external-link'; import { Button, FormGroup, Modal, ModalBody, ModalHeader, Row } from 'reactstrap'; -import type { ImageDownloader } from '../../../common/services/ImageDownloader'; -import { CopyToClipboardIcon } from '../../../utils/CopyToClipboardIcon'; -import type { QrCodeFormat, QrErrorCorrection } from '../../../utils/helpers/qrCodes'; -import { buildQrCodeUrl } from '../../../utils/helpers/qrCodes'; +import type { ImageDownloader } from '../../../src/common/services/ImageDownloader'; +import { CopyToClipboardIcon } from '../../../src/utils/CopyToClipboardIcon'; +import type { QrCodeFormat, QrErrorCorrection } from '../../../src/utils/helpers/qrCodes'; +import { buildQrCodeUrl } from '../../../src/utils/helpers/qrCodes'; import type { ShortUrlModalProps } from '../data'; import { QrErrorCorrectionDropdown } from './qr-codes/QrErrorCorrectionDropdown'; import { QrFormatDropdown } from './qr-codes/QrFormatDropdown'; diff --git a/src/shlink-web-component/short-urls/helpers/ShortUrlDetailLink.tsx b/shlink-web-component/short-urls/helpers/ShortUrlDetailLink.tsx similarity index 100% rename from src/shlink-web-component/short-urls/helpers/ShortUrlDetailLink.tsx rename to shlink-web-component/short-urls/helpers/ShortUrlDetailLink.tsx diff --git a/src/shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx b/shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx similarity index 83% rename from src/shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx rename to shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx index 911a6de5..54f16b2a 100644 --- a/src/shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx +++ b/shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx @@ -1,6 +1,6 @@ import type { ChangeEvent, FC, PropsWithChildren } from 'react'; -import { Checkbox } from '../../../utils/Checkbox'; -import { InfoTooltip } from '../../../utils/InfoTooltip'; +import { Checkbox } from '../../../src/utils/Checkbox'; +import { InfoTooltip } from '../../../src/utils/InfoTooltip'; type ShortUrlFormCheckboxGroupProps = PropsWithChildren<{ checked?: boolean; diff --git a/src/shlink-web-component/short-urls/helpers/ShortUrlStatus.tsx b/shlink-web-component/short-urls/helpers/ShortUrlStatus.tsx similarity index 94% rename from src/shlink-web-component/short-urls/helpers/ShortUrlStatus.tsx rename to shlink-web-component/short-urls/helpers/ShortUrlStatus.tsx index 28df5d9c..817bf30e 100644 --- a/src/shlink-web-component/short-urls/helpers/ShortUrlStatus.tsx +++ b/shlink-web-component/short-urls/helpers/ShortUrlStatus.tsx @@ -4,8 +4,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { isBefore } from 'date-fns'; import type { FC, ReactNode } from 'react'; import { UncontrolledTooltip } from 'reactstrap'; -import { formatHumanFriendly, now, parseISO } from '../../../utils/helpers/date'; -import { useElementRef } from '../../../utils/helpers/hooks'; +import { formatHumanFriendly, now, parseISO } from '../../../src/utils/helpers/date'; +import { useElementRef } from '../../../src/utils/helpers/hooks'; import type { ShortUrl } from '../data'; interface ShortUrlStatusProps { diff --git a/src/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.scss b/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.scss similarity index 100% rename from src/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.scss rename to shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.scss diff --git a/src/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.tsx b/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.tsx similarity index 92% rename from src/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.tsx rename to shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.tsx index edc68338..985992c7 100644 --- a/src/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.tsx +++ b/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.tsx @@ -2,9 +2,9 @@ import { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import classNames from 'classnames'; import { UncontrolledTooltip } from 'reactstrap'; -import { formatHumanFriendly, parseISO } from '../../../utils/helpers/date'; -import { useElementRef } from '../../../utils/helpers/hooks'; -import { prettify } from '../../../utils/helpers/numbers'; +import { formatHumanFriendly, parseISO } from '../../../src/utils/helpers/date'; +import { useElementRef } from '../../../src/utils/helpers/hooks'; +import { prettify } from '../../../src/utils/helpers/numbers'; import type { ShortUrl } from '../data'; import { ShortUrlDetailLink } from './ShortUrlDetailLink'; import './ShortUrlVisitsCount.scss'; diff --git a/src/shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown.tsx b/shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown.tsx similarity index 93% rename from src/shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown.tsx rename to shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown.tsx index 53de95ef..c8664cbe 100644 --- a/src/shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown.tsx +++ b/shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown.tsx @@ -1,6 +1,6 @@ import { DropdownItem } from 'reactstrap'; -import { DropdownBtn } from '../../../utils/DropdownBtn'; -import { hasValue } from '../../../utils/utils'; +import { DropdownBtn } from '../../../src/utils/DropdownBtn'; +import { hasValue } from '../../../src/utils/utils'; import type { ShortUrlsFilter } from '../data'; interface ShortUrlsFilterDropdownProps { diff --git a/src/shlink-web-component/short-urls/helpers/ShortUrlsRow.scss b/shlink-web-component/short-urls/helpers/ShortUrlsRow.scss similarity index 84% rename from src/shlink-web-component/short-urls/helpers/ShortUrlsRow.scss rename to shlink-web-component/short-urls/helpers/ShortUrlsRow.scss index dbe75f0a..b906c1b8 100644 --- a/src/shlink-web-component/short-urls/helpers/ShortUrlsRow.scss +++ b/shlink-web-component/short-urls/helpers/ShortUrlsRow.scss @@ -1,6 +1,6 @@ -@import '../../../utils/base'; -@import '../../../utils/mixins/text-ellipsis'; -@import '../../../utils/mixins/vertical-align'; +@import '../../../src/utils/base'; +@import '../../../src/utils/mixins/text-ellipsis'; +@import '../../../src/utils/mixins/vertical-align'; .short-urls-row__cell.short-urls-row__cell { vertical-align: middle !important; diff --git a/src/shlink-web-component/short-urls/helpers/ShortUrlsRow.tsx b/shlink-web-component/short-urls/helpers/ShortUrlsRow.tsx similarity index 92% rename from src/shlink-web-component/short-urls/helpers/ShortUrlsRow.tsx rename to shlink-web-component/short-urls/helpers/ShortUrlsRow.tsx index b83b109d..4c9a664c 100644 --- a/src/shlink-web-component/short-urls/helpers/ShortUrlsRow.tsx +++ b/shlink-web-component/short-urls/helpers/ShortUrlsRow.tsx @@ -1,10 +1,10 @@ import type { FC } from 'react'; import { useEffect, useRef } from 'react'; import { ExternalLink } from 'react-external-link'; -import { CopyToClipboardIcon } from '../../../utils/CopyToClipboardIcon'; -import { Time } from '../../../utils/dates/Time'; -import type { TimeoutToggle } from '../../../utils/helpers/hooks'; -import type { ColorGenerator } from '../../../utils/services/ColorGenerator'; +import { CopyToClipboardIcon } from '../../../src/utils/CopyToClipboardIcon'; +import { Time } from '../../../src/utils/dates/Time'; +import type { TimeoutToggle } from '../../../src/utils/helpers/hooks'; +import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; import { useSetting } from '../../utils/settings'; import type { ShortUrl } from '../data'; import { useShortUrlsQuery } from './hooks'; diff --git a/src/shlink-web-component/short-urls/helpers/ShortUrlsRowMenu.tsx b/shlink-web-component/short-urls/helpers/ShortUrlsRowMenu.tsx similarity index 93% rename from src/shlink-web-component/short-urls/helpers/ShortUrlsRowMenu.tsx rename to shlink-web-component/short-urls/helpers/ShortUrlsRowMenu.tsx index 30fb6bca..ce7401c5 100644 --- a/src/shlink-web-component/short-urls/helpers/ShortUrlsRowMenu.tsx +++ b/shlink-web-component/short-urls/helpers/ShortUrlsRowMenu.tsx @@ -7,8 +7,8 @@ import { import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC } from 'react'; import { DropdownItem } from 'reactstrap'; -import { useToggle } from '../../../utils/helpers/hooks'; -import { RowDropdownBtn } from '../../../utils/RowDropdownBtn'; +import { useToggle } from '../../../src/utils/helpers/hooks'; +import { RowDropdownBtn } from '../../../src/utils/RowDropdownBtn'; import type { ShortUrl, ShortUrlModalProps } from '../data'; import { ShortUrlDetailLink } from './ShortUrlDetailLink'; diff --git a/src/shlink-web-component/short-urls/helpers/Tags.tsx b/shlink-web-component/short-urls/helpers/Tags.tsx similarity index 88% rename from src/shlink-web-component/short-urls/helpers/Tags.tsx rename to shlink-web-component/short-urls/helpers/Tags.tsx index 22be6e00..f724cbcc 100644 --- a/src/shlink-web-component/short-urls/helpers/Tags.tsx +++ b/shlink-web-component/short-urls/helpers/Tags.tsx @@ -1,6 +1,6 @@ import { isEmpty } from 'ramda'; import type { FC } from 'react'; -import type { ColorGenerator } from '../../../utils/services/ColorGenerator'; +import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; import { Tag } from '../../tags/helpers/Tag'; interface TagsProps { diff --git a/src/shlink-web-component/short-urls/helpers/hooks.ts b/shlink-web-component/short-urls/helpers/hooks.ts similarity index 90% rename from src/shlink-web-component/short-urls/helpers/hooks.ts rename to shlink-web-component/short-urls/helpers/hooks.ts index 6788f221..9192a6d2 100644 --- a/src/shlink-web-component/short-urls/helpers/hooks.ts +++ b/shlink-web-component/short-urls/helpers/hooks.ts @@ -1,10 +1,10 @@ import { isEmpty, pipe } from 'ramda'; import { useMemo } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; -import { orderToString, stringToOrder } from '../../../utils/helpers/ordering'; -import { parseQuery, stringifyQuery } from '../../../utils/helpers/query'; -import type { BooleanString } from '../../../utils/utils'; -import { parseOptionalBooleanToString } from '../../../utils/utils'; +import { orderToString, stringToOrder } from '../../../src/utils/helpers/ordering'; +import { parseQuery, stringifyQuery } from '../../../src/utils/helpers/query'; +import type { BooleanString } from '../../../src/utils/utils'; +import { parseOptionalBooleanToString } from '../../../src/utils/utils'; import type { TagsFilteringMode } from '../../api-contract'; import { useRoutesPrefix } from '../../utils/routesPrefix'; import type { ShortUrlsOrder, ShortUrlsOrderableFields } from '../data'; diff --git a/src/shlink-web-component/short-urls/helpers/index.ts b/shlink-web-component/short-urls/helpers/index.ts similarity index 96% rename from src/shlink-web-component/short-urls/helpers/index.ts rename to shlink-web-component/short-urls/helpers/index.ts index ef4d5f71..2c1821c5 100644 --- a/src/shlink-web-component/short-urls/helpers/index.ts +++ b/shlink-web-component/short-urls/helpers/index.ts @@ -1,5 +1,5 @@ import { isNil } from 'ramda'; -import type { OptionalString } from '../../../utils/utils'; +import type { OptionalString } from '../../../src/utils/utils'; import type { ShortUrlCreationSettings } from '../../utils/settings'; import { DEFAULT_DOMAIN } from '../../visits/reducers/domainVisits'; import type { ShortUrl, ShortUrlData } from '../data'; diff --git a/src/shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx b/shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx similarity index 86% rename from src/shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx rename to shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx index 29312773..d7d7ded2 100644 --- a/src/shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx +++ b/shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import { DropdownItem } from 'reactstrap'; -import { DropdownBtn } from '../../../../utils/DropdownBtn'; -import type { QrErrorCorrection } from '../../../../utils/helpers/qrCodes'; +import { DropdownBtn } from '../../../../src/utils/DropdownBtn'; +import type { QrErrorCorrection } from '../../../../src/utils/helpers/qrCodes'; interface QrErrorCorrectionDropdownProps { errorCorrection: QrErrorCorrection; diff --git a/src/shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown.tsx b/shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown.tsx similarity index 79% rename from src/shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown.tsx rename to shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown.tsx index c42c34ed..a005b061 100644 --- a/src/shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown.tsx +++ b/shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import { DropdownItem } from 'reactstrap'; -import { DropdownBtn } from '../../../../utils/DropdownBtn'; -import type { QrCodeFormat } from '../../../../utils/helpers/qrCodes'; +import { DropdownBtn } from '../../../../src/utils/DropdownBtn'; +import type { QrCodeFormat } from '../../../../src/utils/helpers/qrCodes'; interface QrFormatDropdownProps { format: QrCodeFormat; diff --git a/src/shlink-web-component/short-urls/reducers/shortUrlCreation.ts b/shlink-web-component/short-urls/reducers/shortUrlCreation.ts similarity index 96% rename from src/shlink-web-component/short-urls/reducers/shortUrlCreation.ts rename to shlink-web-component/short-urls/reducers/shortUrlCreation.ts index 2c5a1060..5987b457 100644 --- a/src/shlink-web-component/short-urls/reducers/shortUrlCreation.ts +++ b/shlink-web-component/short-urls/reducers/shortUrlCreation.ts @@ -1,6 +1,6 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; -import { createAsyncThunk } from '../../../utils/helpers/redux'; +import { createAsyncThunk } from '../../../src/utils/helpers/redux'; import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract'; import { parseApiError } from '../../api-contract/utils'; import type { ShortUrl, ShortUrlData } from '../data'; diff --git a/src/shlink-web-component/short-urls/reducers/shortUrlDeletion.ts b/shlink-web-component/short-urls/reducers/shortUrlDeletion.ts similarity index 96% rename from src/shlink-web-component/short-urls/reducers/shortUrlDeletion.ts rename to shlink-web-component/short-urls/reducers/shortUrlDeletion.ts index ceea27d7..d4999a3b 100644 --- a/src/shlink-web-component/short-urls/reducers/shortUrlDeletion.ts +++ b/shlink-web-component/short-urls/reducers/shortUrlDeletion.ts @@ -1,5 +1,5 @@ import { createAction, createSlice } from '@reduxjs/toolkit'; -import { createAsyncThunk } from '../../../utils/helpers/redux'; +import { createAsyncThunk } from '../../../src/utils/helpers/redux'; import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract'; import { parseApiError } from '../../api-contract/utils'; import type { ShortUrl, ShortUrlIdentifier } from '../data'; diff --git a/src/shlink-web-component/short-urls/reducers/shortUrlDetail.ts b/shlink-web-component/short-urls/reducers/shortUrlDetail.ts similarity index 96% rename from src/shlink-web-component/short-urls/reducers/shortUrlDetail.ts rename to shlink-web-component/short-urls/reducers/shortUrlDetail.ts index 5da21087..86b80e2a 100644 --- a/src/shlink-web-component/short-urls/reducers/shortUrlDetail.ts +++ b/shlink-web-component/short-urls/reducers/shortUrlDetail.ts @@ -1,6 +1,6 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; -import { createAsyncThunk } from '../../../utils/helpers/redux'; +import { createAsyncThunk } from '../../../src/utils/helpers/redux'; import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract'; import { parseApiError } from '../../api-contract/utils'; import type { ShortUrl, ShortUrlIdentifier } from '../data'; diff --git a/src/shlink-web-component/short-urls/reducers/shortUrlEdition.ts b/shlink-web-component/short-urls/reducers/shortUrlEdition.ts similarity index 96% rename from src/shlink-web-component/short-urls/reducers/shortUrlEdition.ts rename to shlink-web-component/short-urls/reducers/shortUrlEdition.ts index 9025064c..f75b92b0 100644 --- a/src/shlink-web-component/short-urls/reducers/shortUrlEdition.ts +++ b/shlink-web-component/short-urls/reducers/shortUrlEdition.ts @@ -1,6 +1,6 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; -import { createAsyncThunk } from '../../../utils/helpers/redux'; +import { createAsyncThunk } from '../../../src/utils/helpers/redux'; import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract'; import { parseApiError } from '../../api-contract/utils'; import type { EditShortUrlData, ShortUrl, ShortUrlIdentifier } from '../data'; diff --git a/src/shlink-web-component/short-urls/reducers/shortUrlsList.ts b/shlink-web-component/short-urls/reducers/shortUrlsList.ts similarity index 98% rename from src/shlink-web-component/short-urls/reducers/shortUrlsList.ts rename to shlink-web-component/short-urls/reducers/shortUrlsList.ts index d76064f3..05506d37 100644 --- a/src/shlink-web-component/short-urls/reducers/shortUrlsList.ts +++ b/shlink-web-component/short-urls/reducers/shortUrlsList.ts @@ -1,6 +1,6 @@ import { createSlice } from '@reduxjs/toolkit'; import { assocPath, last, pipe, reject } from 'ramda'; -import { createAsyncThunk } from '../../../utils/helpers/redux'; +import { createAsyncThunk } from '../../../src/utils/helpers/redux'; import type { ShlinkApiClient, ShlinkShortUrlsListParams, ShlinkShortUrlsResponse } from '../../api-contract'; import { createNewVisits } from '../../visits/reducers/visitCreation'; import type { ShortUrl } from '../data'; diff --git a/src/shlink-web-component/short-urls/services/provideServices.ts b/shlink-web-component/short-urls/services/provideServices.ts similarity index 100% rename from src/shlink-web-component/short-urls/services/provideServices.ts rename to shlink-web-component/short-urls/services/provideServices.ts diff --git a/src/shlink-web-component/tags/TagsList.tsx b/shlink-web-component/tags/TagsList.tsx similarity index 88% rename from src/shlink-web-component/tags/TagsList.tsx rename to shlink-web-component/tags/TagsList.tsx index bcb1a5d1..916ca9a0 100644 --- a/src/shlink-web-component/tags/TagsList.tsx +++ b/shlink-web-component/tags/TagsList.tsx @@ -2,12 +2,12 @@ import { pipe } from 'ramda'; import type { FC } from 'react'; import { useEffect, useState } from 'react'; import { Row } from 'reactstrap'; -import { ShlinkApiError } from '../../api/ShlinkApiError'; -import { determineOrderDir, sortList } from '../../utils/helpers/ordering'; -import { Message } from '../../utils/Message'; -import { OrderingDropdown } from '../../utils/OrderingDropdown'; -import { Result } from '../../utils/Result'; -import { SearchField } from '../../utils/SearchField'; +import { ShlinkApiError } from '../../src/api/ShlinkApiError'; +import { determineOrderDir, sortList } from '../../src/utils/helpers/ordering'; +import { Message } from '../../src/utils/Message'; +import { OrderingDropdown } from '../../src/utils/OrderingDropdown'; +import { Result } from '../../src/utils/Result'; +import { SearchField } from '../../src/utils/SearchField'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; import { useSettings } from '../utils/settings'; diff --git a/src/shlink-web-component/tags/TagsTable.scss b/shlink-web-component/tags/TagsTable.scss similarity index 65% rename from src/shlink-web-component/tags/TagsTable.scss rename to shlink-web-component/tags/TagsTable.scss index 2e47f7e1..24032b8e 100644 --- a/src/shlink-web-component/tags/TagsTable.scss +++ b/shlink-web-component/tags/TagsTable.scss @@ -1,5 +1,5 @@ -@import '../../utils/base'; -@import '../../utils/mixins/sticky-cell'; +@import '../../src/utils/base'; +@import '../../src/utils/mixins/sticky-cell'; .tags-table__header-cell.tags-table__header-cell { @include sticky-cell(false); diff --git a/src/shlink-web-component/tags/TagsTable.tsx b/shlink-web-component/tags/TagsTable.tsx similarity index 89% rename from src/shlink-web-component/tags/TagsTable.tsx rename to shlink-web-component/tags/TagsTable.tsx index f223382c..891d2a66 100644 --- a/src/shlink-web-component/tags/TagsTable.tsx +++ b/shlink-web-component/tags/TagsTable.tsx @@ -2,11 +2,11 @@ import { splitEvery } from 'ramda'; import type { FC } from 'react'; import { useEffect, useRef } from 'react'; import { useLocation } from 'react-router-dom'; -import { SimplePaginator } from '../../common/SimplePaginator'; -import { useQueryState } from '../../utils/helpers/hooks'; -import { parseQuery } from '../../utils/helpers/query'; -import { SimpleCard } from '../../utils/SimpleCard'; -import { TableOrderIcon } from '../../utils/table/TableOrderIcon'; +import { SimplePaginator } from '../../src/common/SimplePaginator'; +import { useQueryState } from '../../src/utils/helpers/hooks'; +import { parseQuery } from '../../src/utils/helpers/query'; +import { SimpleCard } from '../../src/utils/SimpleCard'; +import { TableOrderIcon } from '../../src/utils/table/TableOrderIcon'; import type { TagsListChildrenProps, TagsOrder, TagsOrderableFields } from './data/TagsListChildrenProps'; import type { TagsTableRowProps } from './TagsTableRow'; import './TagsTable.scss'; diff --git a/src/shlink-web-component/tags/TagsTableRow.tsx b/shlink-web-component/tags/TagsTableRow.tsx similarity index 88% rename from src/shlink-web-component/tags/TagsTableRow.tsx rename to shlink-web-component/tags/TagsTableRow.tsx index 4ce7b37e..4dd7a403 100644 --- a/src/shlink-web-component/tags/TagsTableRow.tsx +++ b/shlink-web-component/tags/TagsTableRow.tsx @@ -3,10 +3,10 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC } from 'react'; import { Link } from 'react-router-dom'; import { DropdownItem } from 'reactstrap'; -import { useToggle } from '../../utils/helpers/hooks'; -import { prettify } from '../../utils/helpers/numbers'; -import { RowDropdownBtn } from '../../utils/RowDropdownBtn'; -import type { ColorGenerator } from '../../utils/services/ColorGenerator'; +import { useToggle } from '../../src/utils/helpers/hooks'; +import { prettify } from '../../src/utils/helpers/numbers'; +import { RowDropdownBtn } from '../../src/utils/RowDropdownBtn'; +import type { ColorGenerator } from '../../src/utils/services/ColorGenerator'; import { useRoutesPrefix } from '../utils/routesPrefix'; import type { SimplifiedTag, TagModalProps } from './data'; import { TagBullet } from './helpers/TagBullet'; diff --git a/src/shlink-web-component/tags/data/TagsListChildrenProps.ts b/shlink-web-component/tags/data/TagsListChildrenProps.ts similarity index 84% rename from src/shlink-web-component/tags/data/TagsListChildrenProps.ts rename to shlink-web-component/tags/data/TagsListChildrenProps.ts index 22d9ca8a..a3658887 100644 --- a/src/shlink-web-component/tags/data/TagsListChildrenProps.ts +++ b/shlink-web-component/tags/data/TagsListChildrenProps.ts @@ -1,4 +1,4 @@ -import type { Order } from '../../../utils/helpers/ordering'; +import type { Order } from '../../../src/utils/helpers/ordering'; import type { SimplifiedTag } from './index'; export const TAGS_ORDERABLE_FIELDS = { diff --git a/src/shlink-web-component/tags/data/index.ts b/shlink-web-component/tags/data/index.ts similarity index 100% rename from src/shlink-web-component/tags/data/index.ts rename to shlink-web-component/tags/data/index.ts diff --git a/src/shlink-web-component/tags/helpers/DeleteTagConfirmModal.tsx b/shlink-web-component/tags/helpers/DeleteTagConfirmModal.tsx similarity index 92% rename from src/shlink-web-component/tags/helpers/DeleteTagConfirmModal.tsx rename to shlink-web-component/tags/helpers/DeleteTagConfirmModal.tsx index f0f4817c..c16462e2 100644 --- a/src/shlink-web-component/tags/helpers/DeleteTagConfirmModal.tsx +++ b/shlink-web-component/tags/helpers/DeleteTagConfirmModal.tsx @@ -1,6 +1,6 @@ import { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; -import { ShlinkApiError } from '../../../api/ShlinkApiError'; -import { Result } from '../../../utils/Result'; +import { ShlinkApiError } from '../../../src/api/ShlinkApiError'; +import { Result } from '../../../src/utils/Result'; import type { TagModalProps } from '../data'; import type { TagDeletion } from '../reducers/tagDelete'; diff --git a/src/shlink-web-component/tags/helpers/EditTagModal.scss b/shlink-web-component/tags/helpers/EditTagModal.scss similarity index 100% rename from src/shlink-web-component/tags/helpers/EditTagModal.scss rename to shlink-web-component/tags/helpers/EditTagModal.scss diff --git a/src/shlink-web-component/tags/helpers/EditTagModal.tsx b/shlink-web-component/tags/helpers/EditTagModal.tsx similarity index 90% rename from src/shlink-web-component/tags/helpers/EditTagModal.tsx rename to shlink-web-component/tags/helpers/EditTagModal.tsx index ff2a2046..9fc65de6 100644 --- a/src/shlink-web-component/tags/helpers/EditTagModal.tsx +++ b/shlink-web-component/tags/helpers/EditTagModal.tsx @@ -4,11 +4,11 @@ import { pipe } from 'ramda'; import { useState } from 'react'; import { HexColorPicker } from 'react-colorful'; import { Button, Input, InputGroup, Modal, ModalBody, ModalFooter, ModalHeader, Popover } from 'reactstrap'; -import { ShlinkApiError } from '../../../api/ShlinkApiError'; -import { useToggle } from '../../../utils/helpers/hooks'; -import { Result } from '../../../utils/Result'; -import type { ColorGenerator } from '../../../utils/services/ColorGenerator'; -import { handleEventPreventingDefault } from '../../../utils/utils'; +import { ShlinkApiError } from '../../../src/api/ShlinkApiError'; +import { useToggle } from '../../../src/utils/helpers/hooks'; +import { Result } from '../../../src/utils/Result'; +import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; +import { handleEventPreventingDefault } from '../../../src/utils/utils'; import type { TagModalProps } from '../data'; import type { EditTag, TagEdition } from '../reducers/tagEdit'; import './EditTagModal.scss'; diff --git a/src/shlink-web-component/tags/helpers/Tag.scss b/shlink-web-component/tags/helpers/Tag.scss similarity index 100% rename from src/shlink-web-component/tags/helpers/Tag.scss rename to shlink-web-component/tags/helpers/Tag.scss diff --git a/src/shlink-web-component/tags/helpers/Tag.tsx b/shlink-web-component/tags/helpers/Tag.tsx similarity index 91% rename from src/shlink-web-component/tags/helpers/Tag.tsx rename to shlink-web-component/tags/helpers/Tag.tsx index f6ec0c38..6acf6bcc 100644 --- a/src/shlink-web-component/tags/helpers/Tag.tsx +++ b/shlink-web-component/tags/helpers/Tag.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import type { FC, MouseEventHandler, PropsWithChildren } from 'react'; -import type { ColorGenerator } from '../../../utils/services/ColorGenerator'; +import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; import './Tag.scss'; type TagProps = PropsWithChildren<{ diff --git a/src/shlink-web-component/tags/helpers/TagBullet.scss b/shlink-web-component/tags/helpers/TagBullet.scss similarity index 100% rename from src/shlink-web-component/tags/helpers/TagBullet.scss rename to shlink-web-component/tags/helpers/TagBullet.scss diff --git a/src/shlink-web-component/tags/helpers/TagBullet.tsx b/shlink-web-component/tags/helpers/TagBullet.tsx similarity index 77% rename from src/shlink-web-component/tags/helpers/TagBullet.tsx rename to shlink-web-component/tags/helpers/TagBullet.tsx index b92bfa3d..65c1038a 100644 --- a/src/shlink-web-component/tags/helpers/TagBullet.tsx +++ b/shlink-web-component/tags/helpers/TagBullet.tsx @@ -1,4 +1,4 @@ -import type { ColorGenerator } from '../../../utils/services/ColorGenerator'; +import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; import './TagBullet.scss'; interface TagBulletProps { diff --git a/src/shlink-web-component/tags/helpers/TagsSelector.tsx b/shlink-web-component/tags/helpers/TagsSelector.tsx similarity index 96% rename from src/shlink-web-component/tags/helpers/TagsSelector.tsx rename to shlink-web-component/tags/helpers/TagsSelector.tsx index 4ce55d7e..31993e84 100644 --- a/src/shlink-web-component/tags/helpers/TagsSelector.tsx +++ b/shlink-web-component/tags/helpers/TagsSelector.tsx @@ -1,7 +1,7 @@ import { useEffect } from 'react'; import type { SuggestionComponentProps, TagComponentProps } from 'react-tag-autocomplete'; import ReactTags from 'react-tag-autocomplete'; -import type { ColorGenerator } from '../../../utils/services/ColorGenerator'; +import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; import { useSetting } from '../../utils/settings'; import type { TagsList } from '../reducers/tagsList'; import { Tag } from './Tag'; diff --git a/src/shlink-web-component/tags/reducers/tagDelete.ts b/shlink-web-component/tags/reducers/tagDelete.ts similarity index 95% rename from src/shlink-web-component/tags/reducers/tagDelete.ts rename to shlink-web-component/tags/reducers/tagDelete.ts index 5b75941b..a2d81440 100644 --- a/src/shlink-web-component/tags/reducers/tagDelete.ts +++ b/shlink-web-component/tags/reducers/tagDelete.ts @@ -1,5 +1,5 @@ import { createAction, createSlice } from '@reduxjs/toolkit'; -import { createAsyncThunk } from '../../../utils/helpers/redux'; +import { createAsyncThunk } from '../../../src/utils/helpers/redux'; import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract'; import { parseApiError } from '../../api-contract/utils'; diff --git a/src/shlink-web-component/tags/reducers/tagEdit.ts b/shlink-web-component/tags/reducers/tagEdit.ts similarity index 92% rename from src/shlink-web-component/tags/reducers/tagEdit.ts rename to shlink-web-component/tags/reducers/tagEdit.ts index 8350e6d8..7b6235a1 100644 --- a/src/shlink-web-component/tags/reducers/tagEdit.ts +++ b/shlink-web-component/tags/reducers/tagEdit.ts @@ -1,8 +1,8 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createAction, createSlice } from '@reduxjs/toolkit'; import { pick } from 'ramda'; -import { createAsyncThunk } from '../../../utils/helpers/redux'; -import type { ColorGenerator } from '../../../utils/services/ColorGenerator'; +import { createAsyncThunk } from '../../../src/utils/helpers/redux'; +import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract'; import { parseApiError } from '../../api-contract/utils'; diff --git a/src/shlink-web-component/tags/reducers/tagsList.ts b/shlink-web-component/tags/reducers/tagsList.ts similarity index 98% rename from src/shlink-web-component/tags/reducers/tagsList.ts rename to shlink-web-component/tags/reducers/tagsList.ts index 0738ca6c..50577da3 100644 --- a/src/shlink-web-component/tags/reducers/tagsList.ts +++ b/shlink-web-component/tags/reducers/tagsList.ts @@ -1,6 +1,6 @@ import { createAction, createSlice } from '@reduxjs/toolkit'; import { isEmpty, reject } from 'ramda'; -import { createAsyncThunk } from '../../../utils/helpers/redux'; +import { createAsyncThunk } from '../../../src/utils/helpers/redux'; import type { ProblemDetailsError, ShlinkApiClient, ShlinkTags } from '../../api-contract'; import { parseApiError } from '../../api-contract/utils'; import type { createShortUrl } from '../../short-urls/reducers/shortUrlCreation'; diff --git a/src/shlink-web-component/tags/services/provideServices.ts b/shlink-web-component/tags/services/provideServices.ts similarity index 100% rename from src/shlink-web-component/tags/services/provideServices.ts rename to shlink-web-component/tags/services/provideServices.ts diff --git a/src/shlink-web-component/utils/features.ts b/shlink-web-component/utils/features.ts similarity index 91% rename from src/shlink-web-component/utils/features.ts rename to shlink-web-component/utils/features.ts index 0392a233..f616c753 100644 --- a/src/shlink-web-component/utils/features.ts +++ b/shlink-web-component/utils/features.ts @@ -1,6 +1,6 @@ import { createContext, useContext, useMemo } from 'react'; -import type { SemVer } from '../../utils/helpers/version'; -import { versionMatch } from '../../utils/helpers/version'; +import type { SemVer } from '../../src/utils/helpers/version'; +import { versionMatch } from '../../src/utils/helpers/version'; const supportedFeatures = { domainVisits: '3.1.0', diff --git a/src/shlink-web-component/utils/routesPrefix.ts b/shlink-web-component/utils/routesPrefix.ts similarity index 100% rename from src/shlink-web-component/utils/routesPrefix.ts rename to shlink-web-component/utils/routesPrefix.ts diff --git a/src/shlink-web-component/utils/settings.ts b/shlink-web-component/utils/settings.ts similarity index 94% rename from src/shlink-web-component/utils/settings.ts rename to shlink-web-component/utils/settings.ts index 432508ac..0a5a8c86 100644 --- a/src/shlink-web-component/utils/settings.ts +++ b/shlink-web-component/utils/settings.ts @@ -1,6 +1,6 @@ import { createContext, useContext } from 'react'; -import type { DateInterval } from '../../utils/helpers/dateIntervals'; -import type { Theme } from '../../utils/theme'; +import type { DateInterval } from '../../src/utils/helpers/dateIntervals'; +import type { Theme } from '../../src/utils/theme'; import type { ShortUrlsOrder } from '../short-urls/data'; import type { TagsOrder } from '../tags/data/TagsListChildrenProps'; diff --git a/src/shlink-web-component/visits/DomainVisits.tsx b/shlink-web-component/visits/DomainVisits.tsx similarity index 91% rename from src/shlink-web-component/visits/DomainVisits.tsx rename to shlink-web-component/visits/DomainVisits.tsx index 68710248..5ec2027c 100644 --- a/src/shlink-web-component/visits/DomainVisits.tsx +++ b/shlink-web-component/visits/DomainVisits.tsx @@ -1,6 +1,6 @@ import { useParams } from 'react-router-dom'; -import type { ReportExporter } from '../../common/services/ReportExporter'; -import { useGoBack } from '../../utils/helpers/hooks'; +import type { ReportExporter } from '../../src/common/services/ReportExporter'; +import { useGoBack } from '../../src/utils/helpers/hooks'; import type { ShlinkVisitsParams } from '../api-contract'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; diff --git a/src/shlink-web-component/visits/NonOrphanVisits.tsx b/shlink-web-component/visits/NonOrphanVisits.tsx similarity index 90% rename from src/shlink-web-component/visits/NonOrphanVisits.tsx rename to shlink-web-component/visits/NonOrphanVisits.tsx index 9a9ff889..afc31792 100644 --- a/src/shlink-web-component/visits/NonOrphanVisits.tsx +++ b/shlink-web-component/visits/NonOrphanVisits.tsx @@ -1,5 +1,5 @@ -import type { ReportExporter } from '../../common/services/ReportExporter'; -import { useGoBack } from '../../utils/helpers/hooks'; +import type { ReportExporter } from '../../src/common/services/ReportExporter'; +import { useGoBack } from '../../src/utils/helpers/hooks'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; import type { LoadVisits, VisitsInfo } from './reducers/types'; diff --git a/src/shlink-web-component/visits/OrphanVisits.tsx b/shlink-web-component/visits/OrphanVisits.tsx similarity index 91% rename from src/shlink-web-component/visits/OrphanVisits.tsx rename to shlink-web-component/visits/OrphanVisits.tsx index 3d70a032..b5db855c 100644 --- a/src/shlink-web-component/visits/OrphanVisits.tsx +++ b/shlink-web-component/visits/OrphanVisits.tsx @@ -1,5 +1,5 @@ -import type { ReportExporter } from '../../common/services/ReportExporter'; -import { useGoBack } from '../../utils/helpers/hooks'; +import type { ReportExporter } from '../../src/common/services/ReportExporter'; +import { useGoBack } from '../../src/utils/helpers/hooks'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; import type { LoadOrphanVisits } from './reducers/orphanVisits'; diff --git a/src/shlink-web-component/visits/ShortUrlVisits.tsx b/shlink-web-component/visits/ShortUrlVisits.tsx similarity index 92% rename from src/shlink-web-component/visits/ShortUrlVisits.tsx rename to shlink-web-component/visits/ShortUrlVisits.tsx index 67590c0b..02cc19ae 100644 --- a/src/shlink-web-component/visits/ShortUrlVisits.tsx +++ b/shlink-web-component/visits/ShortUrlVisits.tsx @@ -1,8 +1,8 @@ import { useEffect } from 'react'; import { useLocation, useParams } from 'react-router-dom'; -import type { ReportExporter } from '../../common/services/ReportExporter'; -import { useGoBack } from '../../utils/helpers/hooks'; -import { parseQuery } from '../../utils/helpers/query'; +import type { ReportExporter } from '../../src/common/services/ReportExporter'; +import { useGoBack } from '../../src/utils/helpers/hooks'; +import { parseQuery } from '../../src/utils/helpers/query'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; import type { ShortUrlIdentifier } from '../short-urls/data'; diff --git a/src/shlink-web-component/visits/ShortUrlVisitsHeader.scss b/shlink-web-component/visits/ShortUrlVisitsHeader.scss similarity index 100% rename from src/shlink-web-component/visits/ShortUrlVisitsHeader.scss rename to shlink-web-component/visits/ShortUrlVisitsHeader.scss diff --git a/src/shlink-web-component/visits/ShortUrlVisitsHeader.tsx b/shlink-web-component/visits/ShortUrlVisitsHeader.tsx similarity index 97% rename from src/shlink-web-component/visits/ShortUrlVisitsHeader.tsx rename to shlink-web-component/visits/ShortUrlVisitsHeader.tsx index 2a6237d4..91c55931 100644 --- a/src/shlink-web-component/visits/ShortUrlVisitsHeader.tsx +++ b/shlink-web-component/visits/ShortUrlVisitsHeader.tsx @@ -1,6 +1,6 @@ import { ExternalLink } from 'react-external-link'; import { UncontrolledTooltip } from 'reactstrap'; -import { Time } from '../../utils/dates/Time'; +import { Time } from '../../src/utils/dates/Time'; import type { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail'; import type { ShortUrlVisits } from './reducers/shortUrlVisits'; import { VisitsHeader } from './VisitsHeader'; diff --git a/src/shlink-web-component/visits/TagVisits.tsx b/shlink-web-component/visits/TagVisits.tsx similarity index 87% rename from src/shlink-web-component/visits/TagVisits.tsx rename to shlink-web-component/visits/TagVisits.tsx index a1839990..0fbd308b 100644 --- a/src/shlink-web-component/visits/TagVisits.tsx +++ b/shlink-web-component/visits/TagVisits.tsx @@ -1,8 +1,8 @@ import { useParams } from 'react-router-dom'; import type { ShlinkVisitsParams } from '../../api/types'; -import type { ReportExporter } from '../../common/services/ReportExporter'; -import { useGoBack } from '../../utils/helpers/hooks'; -import type { ColorGenerator } from '../../utils/services/ColorGenerator'; +import type { ReportExporter } from '../../src/common/services/ReportExporter'; +import { useGoBack } from '../../src/utils/helpers/hooks'; +import type { ColorGenerator } from '../../src/utils/services/ColorGenerator'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; import type { LoadTagVisits, TagVisits as TagVisitsState } from './reducers/tagVisits'; diff --git a/src/shlink-web-component/visits/TagVisitsHeader.tsx b/shlink-web-component/visits/TagVisitsHeader.tsx similarity index 90% rename from src/shlink-web-component/visits/TagVisitsHeader.tsx rename to shlink-web-component/visits/TagVisitsHeader.tsx index 730877ca..b53bd5e4 100644 --- a/src/shlink-web-component/visits/TagVisitsHeader.tsx +++ b/shlink-web-component/visits/TagVisitsHeader.tsx @@ -1,4 +1,4 @@ -import type { ColorGenerator } from '../../utils/services/ColorGenerator'; +import type { ColorGenerator } from '../../src/utils/services/ColorGenerator'; import { Tag } from '../tags/helpers/Tag'; import type { TagVisits } from './reducers/tagVisits'; import { VisitsHeader } from './VisitsHeader'; diff --git a/src/shlink-web-component/visits/VisitsHeader.tsx b/shlink-web-component/visits/VisitsHeader.tsx similarity index 100% rename from src/shlink-web-component/visits/VisitsHeader.tsx rename to shlink-web-component/visits/VisitsHeader.tsx diff --git a/src/shlink-web-component/visits/VisitsStats.tsx b/shlink-web-component/visits/VisitsStats.tsx similarity index 95% rename from src/shlink-web-component/visits/VisitsStats.tsx rename to shlink-web-component/visits/VisitsStats.tsx index b0c7bdd1..93facab0 100644 --- a/src/shlink-web-component/visits/VisitsStats.tsx +++ b/shlink-web-component/visits/VisitsStats.tsx @@ -7,15 +7,15 @@ import type { FC, PropsWithChildren } from 'react'; import { useEffect, useMemo, useRef, useState } from 'react'; import { Navigate, Route, Routes, useLocation } from 'react-router-dom'; import { Button, Progress, Row } from 'reactstrap'; -import { ShlinkApiError } from '../../api/ShlinkApiError'; -import { DateRangeSelector } from '../../utils/dates/DateRangeSelector'; -import { ExportBtn } from '../../utils/ExportBtn'; -import type { DateInterval, DateRange } from '../../utils/helpers/dateIntervals'; -import { toDateRange } from '../../utils/helpers/dateIntervals'; -import { prettify } from '../../utils/helpers/numbers'; -import { Message } from '../../utils/Message'; -import { NavPillItem, NavPills } from '../../utils/NavPills'; -import { Result } from '../../utils/Result'; +import { ShlinkApiError } from '../../src/api/ShlinkApiError'; +import { DateRangeSelector } from '../../src/utils/dates/DateRangeSelector'; +import { ExportBtn } from '../../src/utils/ExportBtn'; +import type { DateInterval, DateRange } from '../../src/utils/helpers/dateIntervals'; +import { toDateRange } from '../../src/utils/helpers/dateIntervals'; +import { prettify } from '../../src/utils/helpers/numbers'; +import { Message } from '../../src/utils/Message'; +import { NavPillItem, NavPills } from '../../src/utils/NavPills'; +import { Result } from '../../src/utils/Result'; import { useSetting } from '../utils/settings'; import { DoughnutChartCard } from './charts/DoughnutChartCard'; import { LineChartCard } from './charts/LineChartCard'; diff --git a/src/shlink-web-component/visits/VisitsTable.scss b/shlink-web-component/visits/VisitsTable.scss similarity index 88% rename from src/shlink-web-component/visits/VisitsTable.scss rename to shlink-web-component/visits/VisitsTable.scss index 119270a4..30a5e946 100644 --- a/src/shlink-web-component/visits/VisitsTable.scss +++ b/shlink-web-component/visits/VisitsTable.scss @@ -1,5 +1,5 @@ -@import '../../utils/base'; -@import '../../utils/mixins/sticky-cell'; +@import '../../src/utils/base'; +@import '../../src/utils/mixins/sticky-cell'; .visits-table { margin: 1.5rem 0 0; diff --git a/src/shlink-web-component/visits/VisitsTable.tsx b/shlink-web-component/visits/VisitsTable.tsx similarity index 94% rename from src/shlink-web-component/visits/VisitsTable.tsx rename to shlink-web-component/visits/VisitsTable.tsx index 727fd5f8..7ee7a74d 100644 --- a/src/shlink-web-component/visits/VisitsTable.tsx +++ b/shlink-web-component/visits/VisitsTable.tsx @@ -4,14 +4,14 @@ import classNames from 'classnames'; import { min, splitEvery } from 'ramda'; import { useEffect, useMemo, useRef, useState } from 'react'; import { UncontrolledTooltip } from 'reactstrap'; -import { SimplePaginator } from '../../common/SimplePaginator'; -import { Time } from '../../utils/dates/Time'; -import { prettify } from '../../utils/helpers/numbers'; -import type { Order } from '../../utils/helpers/ordering'; -import { determineOrderDir, sortList } from '../../utils/helpers/ordering'; -import { SearchField } from '../../utils/SearchField'; -import { TableOrderIcon } from '../../utils/table/TableOrderIcon'; -import type { MediaMatcher } from '../../utils/types'; +import { SimplePaginator } from '../../src/common/SimplePaginator'; +import { Time } from '../../src/utils/dates/Time'; +import { prettify } from '../../src/utils/helpers/numbers'; +import type { Order } from '../../src/utils/helpers/ordering'; +import { determineOrderDir, sortList } from '../../src/utils/helpers/ordering'; +import { SearchField } from '../../src/utils/SearchField'; +import { TableOrderIcon } from '../../src/utils/table/TableOrderIcon'; +import type { MediaMatcher } from '../../src/utils/types'; import type { NormalizedOrphanVisit, NormalizedVisit } from './types'; import './VisitsTable.scss'; diff --git a/src/shlink-web-component/visits/charts/ChartCard.scss b/shlink-web-component/visits/charts/ChartCard.scss similarity index 100% rename from src/shlink-web-component/visits/charts/ChartCard.scss rename to shlink-web-component/visits/charts/ChartCard.scss diff --git a/src/shlink-web-component/visits/charts/ChartCard.tsx b/shlink-web-component/visits/charts/ChartCard.tsx similarity index 100% rename from src/shlink-web-component/visits/charts/ChartCard.tsx rename to shlink-web-component/visits/charts/ChartCard.tsx diff --git a/src/shlink-web-component/visits/charts/DoughnutChart.tsx b/shlink-web-component/visits/charts/DoughnutChart.tsx similarity index 94% rename from src/shlink-web-component/visits/charts/DoughnutChart.tsx rename to shlink-web-component/visits/charts/DoughnutChart.tsx index 7d111540..51e96224 100644 --- a/src/shlink-web-component/visits/charts/DoughnutChart.tsx +++ b/shlink-web-component/visits/charts/DoughnutChart.tsx @@ -3,8 +3,8 @@ import { keys, values } from 'ramda'; import type { FC } from 'react'; import { memo, useState } from 'react'; import { Doughnut } from 'react-chartjs-2'; -import { renderPieChartLabel } from '../../../utils/helpers/charts'; -import { isDarkThemeEnabled, PRIMARY_DARK_COLOR, PRIMARY_LIGHT_COLOR } from '../../../utils/theme'; +import { renderPieChartLabel } from '../../../src/utils/helpers/charts'; +import { isDarkThemeEnabled, PRIMARY_DARK_COLOR, PRIMARY_LIGHT_COLOR } from '../../../src/utils/theme'; import type { Stats } from '../types'; import { DoughnutChartLegend } from './DoughnutChartLegend'; diff --git a/src/shlink-web-component/visits/charts/DoughnutChartCard.tsx b/shlink-web-component/visits/charts/DoughnutChartCard.tsx similarity index 100% rename from src/shlink-web-component/visits/charts/DoughnutChartCard.tsx rename to shlink-web-component/visits/charts/DoughnutChartCard.tsx diff --git a/src/shlink-web-component/visits/charts/DoughnutChartLegend.scss b/shlink-web-component/visits/charts/DoughnutChartLegend.scss similarity index 92% rename from src/shlink-web-component/visits/charts/DoughnutChartLegend.scss rename to shlink-web-component/visits/charts/DoughnutChartLegend.scss index e2a354ea..e0fefa91 100644 --- a/src/shlink-web-component/visits/charts/DoughnutChartLegend.scss +++ b/shlink-web-component/visits/charts/DoughnutChartLegend.scss @@ -1,4 +1,4 @@ -@import '../../../utils/base'; +@import '../../../src/utils/base'; .doughnut-chart-legend { list-style-type: none; diff --git a/src/shlink-web-component/visits/charts/DoughnutChartLegend.tsx b/shlink-web-component/visits/charts/DoughnutChartLegend.tsx similarity index 100% rename from src/shlink-web-component/visits/charts/DoughnutChartLegend.tsx rename to shlink-web-component/visits/charts/DoughnutChartLegend.tsx diff --git a/src/shlink-web-component/visits/charts/HorizontalBarChart.tsx b/shlink-web-component/visits/charts/HorizontalBarChart.tsx similarity index 95% rename from src/shlink-web-component/visits/charts/HorizontalBarChart.tsx rename to shlink-web-component/visits/charts/HorizontalBarChart.tsx index 7fef7699..bef040bf 100644 --- a/src/shlink-web-component/visits/charts/HorizontalBarChart.tsx +++ b/shlink-web-component/visits/charts/HorizontalBarChart.tsx @@ -3,9 +3,9 @@ import { keys, values } from 'ramda'; import type { FC, MutableRefObject } from 'react'; import { useRef } from 'react'; import { Bar, getElementAtEvent } from 'react-chartjs-2'; -import { pointerOnHover, renderChartLabel } from '../../../utils/helpers/charts'; -import { prettify } from '../../../utils/helpers/numbers'; -import { HIGHLIGHTED_COLOR, HIGHLIGHTED_COLOR_ALPHA, MAIN_COLOR, MAIN_COLOR_ALPHA } from '../../../utils/theme'; +import { pointerOnHover, renderChartLabel } from '../../../src/utils/helpers/charts'; +import { prettify } from '../../../src/utils/helpers/numbers'; +import { HIGHLIGHTED_COLOR, HIGHLIGHTED_COLOR_ALPHA, MAIN_COLOR, MAIN_COLOR_ALPHA } from '../../../src/utils/theme'; import type { Stats } from '../types'; import { fillTheGaps } from '../utils'; diff --git a/src/shlink-web-component/visits/charts/LineChartCard.scss b/shlink-web-component/visits/charts/LineChartCard.scss similarity index 78% rename from src/shlink-web-component/visits/charts/LineChartCard.scss rename to shlink-web-component/visits/charts/LineChartCard.scss index a9ee364d..7ce84c2d 100644 --- a/src/shlink-web-component/visits/charts/LineChartCard.scss +++ b/shlink-web-component/visits/charts/LineChartCard.scss @@ -1,4 +1,4 @@ -@import '../../../utils/base'; +@import '../../../src/utils/base'; .line-chart-card__body canvas { height: 300px !important; diff --git a/src/shlink-web-component/visits/charts/LineChartCard.tsx b/shlink-web-component/visits/charts/LineChartCard.tsx similarity index 94% rename from src/shlink-web-component/visits/charts/LineChartCard.tsx rename to shlink-web-component/visits/charts/LineChartCard.tsx index b13a4c76..0fc05bd3 100644 --- a/src/shlink-web-component/visits/charts/LineChartCard.tsx +++ b/shlink-web-component/visits/charts/LineChartCard.tsx @@ -23,13 +23,13 @@ import { DropdownToggle, UncontrolledDropdown, } from 'reactstrap'; -import { pointerOnHover, renderChartLabel } from '../../../utils/helpers/charts'; -import { STANDARD_DATE_FORMAT } from '../../../utils/helpers/date'; -import { useToggle } from '../../../utils/helpers/hooks'; -import { prettify } from '../../../utils/helpers/numbers'; -import { HIGHLIGHTED_COLOR, MAIN_COLOR } from '../../../utils/theme'; -import { ToggleSwitch } from '../../../utils/ToggleSwitch'; -import { rangeOf } from '../../../utils/utils'; +import { pointerOnHover, renderChartLabel } from '../../../src/utils/helpers/charts'; +import { STANDARD_DATE_FORMAT } from '../../../src/utils/helpers/date'; +import { useToggle } from '../../../src/utils/helpers/hooks'; +import { prettify } from '../../../src/utils/helpers/numbers'; +import { HIGHLIGHTED_COLOR, MAIN_COLOR } from '../../../src/utils/theme'; +import { ToggleSwitch } from '../../../src/utils/ToggleSwitch'; +import { rangeOf } from '../../../src/utils/utils'; import type { NormalizedVisit, Stats } from '../types'; import { fillTheGaps } from '../utils'; import './LineChartCard.scss'; diff --git a/src/shlink-web-component/visits/charts/SortableBarChartCard.tsx b/shlink-web-component/visits/charts/SortableBarChartCard.tsx similarity index 92% rename from src/shlink-web-component/visits/charts/SortableBarChartCard.tsx rename to shlink-web-component/visits/charts/SortableBarChartCard.tsx index 7621da27..5cef53ad 100644 --- a/src/shlink-web-component/visits/charts/SortableBarChartCard.tsx +++ b/shlink-web-component/visits/charts/SortableBarChartCard.tsx @@ -1,12 +1,12 @@ import { fromPairs, pipe, reverse, sortBy, splitEvery, toLower, toPairs, type, zipObj } from 'ramda'; import type { FC, ReactNode } from 'react'; import { useState } from 'react'; -import { SimplePaginator } from '../../../common/SimplePaginator'; -import { roundTen } from '../../../utils/helpers/numbers'; -import type { Order } from '../../../utils/helpers/ordering'; -import { OrderingDropdown } from '../../../utils/OrderingDropdown'; -import { PaginationDropdown } from '../../../utils/PaginationDropdown'; -import { rangeOf } from '../../../utils/utils'; +import { SimplePaginator } from '../../../src/common/SimplePaginator'; +import { roundTen } from '../../../src/utils/helpers/numbers'; +import type { Order } from '../../../src/utils/helpers/ordering'; +import { OrderingDropdown } from '../../../src/utils/OrderingDropdown'; +import { PaginationDropdown } from '../../../src/utils/PaginationDropdown'; +import { rangeOf } from '../../../src/utils/utils'; import type { Stats, StatsRow } from '../types'; import { ChartCard } from './ChartCard'; import type { HorizontalBarChartProps } from './HorizontalBarChart'; diff --git a/src/shlink-web-component/visits/helpers/MapModal.scss b/shlink-web-component/visits/helpers/MapModal.scss similarity index 90% rename from src/shlink-web-component/visits/helpers/MapModal.scss rename to shlink-web-component/visits/helpers/MapModal.scss index 1e53af6e..14344782 100644 --- a/src/shlink-web-component/visits/helpers/MapModal.scss +++ b/shlink-web-component/visits/helpers/MapModal.scss @@ -1,5 +1,5 @@ -@import '../../../utils/base'; -@import '../../../utils/mixins/fit-with-margin'; +@import '../../../src/utils/base'; +@import '../../../src/utils/mixins/fit-with-margin'; .map-modal__modal.map-modal__modal { @media (min-width: $mdMin) { diff --git a/src/shlink-web-component/visits/helpers/MapModal.tsx b/shlink-web-component/visits/helpers/MapModal.tsx similarity index 100% rename from src/shlink-web-component/visits/helpers/MapModal.tsx rename to shlink-web-component/visits/helpers/MapModal.tsx diff --git a/src/shlink-web-component/visits/helpers/OpenMapModalBtn.scss b/shlink-web-component/visits/helpers/OpenMapModalBtn.scss similarity index 100% rename from src/shlink-web-component/visits/helpers/OpenMapModalBtn.scss rename to shlink-web-component/visits/helpers/OpenMapModalBtn.scss diff --git a/src/shlink-web-component/visits/helpers/OpenMapModalBtn.tsx b/shlink-web-component/visits/helpers/OpenMapModalBtn.tsx similarity index 96% rename from src/shlink-web-component/visits/helpers/OpenMapModalBtn.tsx rename to shlink-web-component/visits/helpers/OpenMapModalBtn.tsx index ded059e6..5ed1c536 100644 --- a/src/shlink-web-component/visits/helpers/OpenMapModalBtn.tsx +++ b/shlink-web-component/visits/helpers/OpenMapModalBtn.tsx @@ -2,7 +2,7 @@ import { faMapMarkedAlt as mapIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useState } from 'react'; import { Button, Dropdown, DropdownItem, DropdownMenu, UncontrolledTooltip } from 'reactstrap'; -import { useDomId, useToggle } from '../../../utils/helpers/hooks'; +import { useDomId, useToggle } from '../../../src/utils/helpers/hooks'; import type { CityStats } from '../types'; import { MapModal } from './MapModal'; import './OpenMapModalBtn.scss'; diff --git a/src/shlink-web-component/visits/helpers/VisitsFilterDropdown.tsx b/shlink-web-component/visits/helpers/VisitsFilterDropdown.tsx similarity index 94% rename from src/shlink-web-component/visits/helpers/VisitsFilterDropdown.tsx rename to shlink-web-component/visits/helpers/VisitsFilterDropdown.tsx index cf7ff8e7..1e54d41a 100644 --- a/src/shlink-web-component/visits/helpers/VisitsFilterDropdown.tsx +++ b/shlink-web-component/visits/helpers/VisitsFilterDropdown.tsx @@ -1,7 +1,7 @@ import type { DropdownItemProps } from 'reactstrap'; import { DropdownItem } from 'reactstrap'; -import { DropdownBtn } from '../../../utils/DropdownBtn'; -import { hasValue } from '../../../utils/utils'; +import { DropdownBtn } from '../../../src/utils/DropdownBtn'; +import { hasValue } from '../../../src/utils/utils'; import type { OrphanVisitType, VisitsFilter } from '../types'; interface VisitsFilterDropdownProps { diff --git a/src/shlink-web-component/visits/helpers/hooks.ts b/shlink-web-component/visits/helpers/hooks.ts similarity index 83% rename from src/shlink-web-component/visits/helpers/hooks.ts rename to shlink-web-component/visits/helpers/hooks.ts index ddbe7f70..0b465453 100644 --- a/src/shlink-web-component/visits/helpers/hooks.ts +++ b/shlink-web-component/visits/helpers/hooks.ts @@ -2,12 +2,12 @@ import type { DeepPartial } from '@reduxjs/toolkit'; import { isEmpty, isNil, mergeDeepRight, pipe } from 'ramda'; import { useMemo } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; -import { formatIsoDate } from '../../../utils/helpers/date'; -import type { DateRange } from '../../../utils/helpers/dateIntervals'; -import { datesToDateRange } from '../../../utils/helpers/dateIntervals'; -import { parseQuery, stringifyQuery } from '../../../utils/helpers/query'; -import type { BooleanString } from '../../../utils/utils'; -import { parseBooleanToString } from '../../../utils/utils'; +import { formatIsoDate } from '../../../src/utils/helpers/date'; +import type { DateRange } from '../../../src/utils/helpers/dateIntervals'; +import { datesToDateRange } from '../../../src/utils/helpers/dateIntervals'; +import { parseQuery, stringifyQuery } from '../../../src/utils/helpers/query'; +import type { BooleanString } from '../../../src/utils/utils'; +import { parseBooleanToString } from '../../../src/utils/utils'; import type { OrphanVisitType, VisitsFilter } from '../types'; interface VisitsQuery { diff --git a/src/shlink-web-component/visits/reducers/common.ts b/shlink-web-component/visits/reducers/common.ts similarity index 95% rename from src/shlink-web-component/visits/reducers/common.ts rename to shlink-web-component/visits/reducers/common.ts index 6325e63d..15112f9c 100644 --- a/src/shlink-web-component/visits/reducers/common.ts +++ b/shlink-web-component/visits/reducers/common.ts @@ -1,9 +1,9 @@ import { createAction, createSlice } from '@reduxjs/toolkit'; import { flatten, prop, range, splitEvery } from 'ramda'; -import type { ShlinkState } from '../../../container/types'; -import type { DateInterval } from '../../../utils/helpers/dateIntervals'; -import { dateToMatchingInterval } from '../../../utils/helpers/dateIntervals'; -import { createAsyncThunk } from '../../../utils/helpers/redux'; +import type { ShlinkState } from '../../../src/container/types'; +import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; +import { dateToMatchingInterval } from '../../../src/utils/helpers/dateIntervals'; +import { createAsyncThunk } from '../../../src/utils/helpers/redux'; import type { ShlinkPaginator, ShlinkVisits, ShlinkVisitsParams } from '../../api-contract'; import { parseApiError } from '../../api-contract/utils'; import type { CreateVisit, Visit } from '../types'; diff --git a/src/shlink-web-component/visits/reducers/domainVisits.ts b/shlink-web-component/visits/reducers/domainVisits.ts similarity index 97% rename from src/shlink-web-component/visits/reducers/domainVisits.ts rename to shlink-web-component/visits/reducers/domainVisits.ts index 15a88556..c5d503b9 100644 --- a/src/shlink-web-component/visits/reducers/domainVisits.ts +++ b/shlink-web-component/visits/reducers/domainVisits.ts @@ -1,4 +1,4 @@ -import { isBetween } from '../../../utils/helpers/date'; +import { isBetween } from '../../../src/utils/helpers/date'; import type { ShlinkApiClient } from '../../api-contract'; import { domainMatches } from '../../short-urls/helpers'; import { createVisitsAsyncThunk, createVisitsReducer, lastVisitLoaderForLoader } from './common'; diff --git a/src/shlink-web-component/visits/reducers/nonOrphanVisits.ts b/shlink-web-component/visits/reducers/nonOrphanVisits.ts similarity index 96% rename from src/shlink-web-component/visits/reducers/nonOrphanVisits.ts rename to shlink-web-component/visits/reducers/nonOrphanVisits.ts index 600df155..3bed1262 100644 --- a/src/shlink-web-component/visits/reducers/nonOrphanVisits.ts +++ b/shlink-web-component/visits/reducers/nonOrphanVisits.ts @@ -1,4 +1,4 @@ -import { isBetween } from '../../../utils/helpers/date'; +import { isBetween } from '../../../src/utils/helpers/date'; import type { ShlinkApiClient } from '../../api-contract'; import { createVisitsAsyncThunk, createVisitsReducer, lastVisitLoaderForLoader } from './common'; import type { VisitsInfo } from './types'; diff --git a/src/shlink-web-component/visits/reducers/orphanVisits.ts b/shlink-web-component/visits/reducers/orphanVisits.ts similarity index 97% rename from src/shlink-web-component/visits/reducers/orphanVisits.ts rename to shlink-web-component/visits/reducers/orphanVisits.ts index 813b7279..219dea20 100644 --- a/src/shlink-web-component/visits/reducers/orphanVisits.ts +++ b/shlink-web-component/visits/reducers/orphanVisits.ts @@ -1,4 +1,4 @@ -import { isBetween } from '../../../utils/helpers/date'; +import { isBetween } from '../../../src/utils/helpers/date'; import type { ShlinkApiClient } from '../../api-contract'; import type { OrphanVisit, OrphanVisitType } from '../types'; import { isOrphanVisit } from '../types/helpers'; diff --git a/src/shlink-web-component/visits/reducers/shortUrlVisits.ts b/shlink-web-component/visits/reducers/shortUrlVisits.ts similarity index 97% rename from src/shlink-web-component/visits/reducers/shortUrlVisits.ts rename to shlink-web-component/visits/reducers/shortUrlVisits.ts index 17ca1638..ca6ef50b 100644 --- a/src/shlink-web-component/visits/reducers/shortUrlVisits.ts +++ b/shlink-web-component/visits/reducers/shortUrlVisits.ts @@ -1,4 +1,4 @@ -import { isBetween } from '../../../utils/helpers/date'; +import { isBetween } from '../../../src/utils/helpers/date'; import type { ShlinkApiClient } from '../../api-contract'; import type { ShortUrlIdentifier } from '../../short-urls/data'; import { shortUrlMatches } from '../../short-urls/helpers'; diff --git a/src/shlink-web-component/visits/reducers/tagVisits.ts b/shlink-web-component/visits/reducers/tagVisits.ts similarity index 96% rename from src/shlink-web-component/visits/reducers/tagVisits.ts rename to shlink-web-component/visits/reducers/tagVisits.ts index 068e6cb4..3bb4e994 100644 --- a/src/shlink-web-component/visits/reducers/tagVisits.ts +++ b/shlink-web-component/visits/reducers/tagVisits.ts @@ -1,4 +1,4 @@ -import { isBetween } from '../../../utils/helpers/date'; +import { isBetween } from '../../../src/utils/helpers/date'; import type { ShlinkApiClient } from '../../api-contract'; import { createVisitsAsyncThunk, createVisitsReducer, lastVisitLoaderForLoader } from './common'; import type { LoadVisits, VisitsInfo } from './types'; diff --git a/src/shlink-web-component/visits/reducers/types/index.ts b/shlink-web-component/visits/reducers/types/index.ts similarity index 87% rename from src/shlink-web-component/visits/reducers/types/index.ts rename to shlink-web-component/visits/reducers/types/index.ts index b27dec4e..751cd304 100644 --- a/src/shlink-web-component/visits/reducers/types/index.ts +++ b/shlink-web-component/visits/reducers/types/index.ts @@ -1,4 +1,4 @@ -import type { DateInterval } from '../../../../utils/helpers/dateIntervals'; +import type { DateInterval } from '../../../../src/utils/helpers/dateIntervals'; import type { ProblemDetailsError, ShlinkVisitsParams } from '../../../api-contract'; import type { Visit } from '../../types'; diff --git a/src/shlink-web-component/visits/reducers/visitCreation.ts b/shlink-web-component/visits/reducers/visitCreation.ts similarity index 100% rename from src/shlink-web-component/visits/reducers/visitCreation.ts rename to shlink-web-component/visits/reducers/visitCreation.ts diff --git a/src/shlink-web-component/visits/reducers/visitsOverview.ts b/shlink-web-component/visits/reducers/visitsOverview.ts similarity index 98% rename from src/shlink-web-component/visits/reducers/visitsOverview.ts rename to shlink-web-component/visits/reducers/visitsOverview.ts index 627759a6..d15dcc22 100644 --- a/src/shlink-web-component/visits/reducers/visitsOverview.ts +++ b/shlink-web-component/visits/reducers/visitsOverview.ts @@ -1,6 +1,6 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; -import { createAsyncThunk } from '../../../utils/helpers/redux'; +import { createAsyncThunk } from '../../../src/utils/helpers/redux'; import type { ShlinkApiClient, ShlinkVisitsOverview } from '../../api-contract'; import type { CreateVisit } from '../types'; import { groupNewVisitsByType } from '../types/helpers'; diff --git a/src/shlink-web-component/visits/services/VisitsParser.ts b/shlink-web-component/visits/services/VisitsParser.ts similarity index 98% rename from src/shlink-web-component/visits/services/VisitsParser.ts rename to shlink-web-component/visits/services/VisitsParser.ts index d65f1795..2184a682 100644 --- a/src/shlink-web-component/visits/services/VisitsParser.ts +++ b/shlink-web-component/visits/services/VisitsParser.ts @@ -1,5 +1,5 @@ import { isNil, map } from 'ramda'; -import { hasValue } from '../../../utils/utils'; +import { hasValue } from '../../../src/utils/utils'; import type { CityStats, NormalizedVisit, Stats, Visit, VisitsStats } from '../types'; import { isNormalizedOrphanVisit, isOrphanVisit } from '../types/helpers'; import { extractDomain, parseUserAgent } from '../utils'; diff --git a/src/shlink-web-component/visits/services/provideServices.ts b/shlink-web-component/visits/services/provideServices.ts similarity index 100% rename from src/shlink-web-component/visits/services/provideServices.ts rename to shlink-web-component/visits/services/provideServices.ts diff --git a/src/shlink-web-component/visits/types/helpers.ts b/shlink-web-component/visits/types/helpers.ts similarity index 96% rename from src/shlink-web-component/visits/types/helpers.ts rename to shlink-web-component/visits/types/helpers.ts index 2a61ac5c..85e01177 100644 --- a/src/shlink-web-component/visits/types/helpers.ts +++ b/shlink-web-component/visits/types/helpers.ts @@ -1,6 +1,6 @@ import { countBy, groupBy, pipe, prop } from 'ramda'; import type { ShlinkVisitsParams } from '../../../api/types'; -import { formatIsoDate } from '../../../utils/helpers/date'; +import { formatIsoDate } from '../../../src/utils/helpers/date'; import type { CreateVisit, NormalizedOrphanVisit, NormalizedVisit, OrphanVisit, Stats, Visit, VisitsParams } from './index'; export const isOrphanVisit = (visit: Visit): visit is OrphanVisit => (visit as OrphanVisit).visitedUrl !== undefined; diff --git a/src/shlink-web-component/visits/types/index.ts b/shlink-web-component/visits/types/index.ts similarity index 96% rename from src/shlink-web-component/visits/types/index.ts rename to shlink-web-component/visits/types/index.ts index 05307be7..905e280d 100644 --- a/src/shlink-web-component/visits/types/index.ts +++ b/shlink-web-component/visits/types/index.ts @@ -1,4 +1,4 @@ -import type { DateRange } from '../../../utils/helpers/dateIntervals'; +import type { DateRange } from '../../../src/utils/helpers/dateIntervals'; import type { ShortUrl } from '../../short-urls/data'; export type OrphanVisitType = 'base_url' | 'invalid_short_url' | 'regular_404'; diff --git a/src/shlink-web-component/visits/utils/index.ts b/shlink-web-component/visits/utils/index.ts similarity index 90% rename from src/shlink-web-component/visits/utils/index.ts rename to shlink-web-component/visits/utils/index.ts index a8f7b236..44f4a6e3 100644 --- a/src/shlink-web-component/visits/utils/index.ts +++ b/shlink-web-component/visits/utils/index.ts @@ -1,7 +1,7 @@ import bowser from 'bowser'; import { zipObj } from 'ramda'; -import type { Empty } from '../../../utils/utils'; -import { hasValue } from '../../../utils/utils'; +import type { Empty } from '../../../src/utils/utils'; +import { hasValue } from '../../../src/utils/utils'; import type { Stats, UserAgent } from '../types'; const DEFAULT = 'Others'; diff --git a/src/api/ShlinkApiError.tsx b/src/api/ShlinkApiError.tsx index a16d97d2..f08f1513 100644 --- a/src/api/ShlinkApiError.tsx +++ b/src/api/ShlinkApiError.tsx @@ -1,5 +1,5 @@ -import type { ProblemDetailsError } from '../shlink-web-component/api-contract'; -import { isInvalidArgumentError } from '../shlink-web-component/api-contract/utils'; +import type { ProblemDetailsError } from '../../shlink-web-component/api-contract'; +import { isInvalidArgumentError } from '../../shlink-web-component/api-contract/utils'; export interface ShlinkApiErrorProps { errorData?: ProblemDetailsError; diff --git a/src/api/services/ShlinkApiClient.ts b/src/api/services/ShlinkApiClient.ts index d1e22d2e..78b3efa8 100644 --- a/src/api/services/ShlinkApiClient.ts +++ b/src/api/services/ShlinkApiClient.ts @@ -1,5 +1,4 @@ import { isEmpty, isNil, reject } from 'ramda'; -import type { HttpClient } from '../../common/services/HttpClient'; import type { ShlinkApiClient as BaseShlinkApiClient, ShlinkDomainRedirects, @@ -16,9 +15,10 @@ import type { ShlinkTagsStatsResponse, ShlinkVisits, ShlinkVisitsOverview, - ShlinkVisitsParams } from '../../shlink-web-component/api-contract'; -import { isRegularNotFound, parseApiError } from '../../shlink-web-component/api-contract/utils'; -import type { ShortUrl, ShortUrlData } from '../../shlink-web-component/short-urls/data'; + ShlinkVisitsParams } from '../../../shlink-web-component/api-contract'; +import { isRegularNotFound, parseApiError } from '../../../shlink-web-component/api-contract/utils'; +import type { ShortUrl, ShortUrlData } from '../../../shlink-web-component/short-urls/data'; +import type { HttpClient } from '../../common/services/HttpClient'; import { orderToString } from '../../utils/helpers/ordering'; import { stringifyQuery } from '../../utils/helpers/query'; import { replaceAuthorityFromUri } from '../../utils/helpers/uri'; diff --git a/src/common/MenuLayout.tsx b/src/common/MenuLayout.tsx index 39891ea6..12c87569 100644 --- a/src/common/MenuLayout.tsx +++ b/src/common/MenuLayout.tsx @@ -1,10 +1,10 @@ import type { FC } from 'react'; import { useEffect } from 'react'; +import { ShlinkWebComponent } from '../../shlink-web-component'; +import type { Settings } from '../../shlink-web-component/utils/settings'; import type { ShlinkApiClientBuilder } from '../api/services/ShlinkApiClientBuilder'; import { isReachableServer } from '../servers/data'; import { withSelectedServer } from '../servers/helpers/withSelectedServer'; -import { ShlinkWebComponent } from '../shlink-web-component'; -import type { Settings } from '../shlink-web-component/utils/settings'; import './MenuLayout.scss'; interface MenuLayoutProps { diff --git a/src/common/services/ReportExporter.ts b/src/common/services/ReportExporter.ts index 51dc49c6..f3b81376 100644 --- a/src/common/services/ReportExporter.ts +++ b/src/common/services/ReportExporter.ts @@ -1,5 +1,5 @@ -import type { ExportableShortUrl } from '../../shlink-web-component/short-urls/data'; -import type { NormalizedVisit } from '../../shlink-web-component/visits/types'; +import type { ExportableShortUrl } from '../../../shlink-web-component/short-urls/data'; +import type { NormalizedVisit } from '../../../shlink-web-component/visits/types'; import type { JsonToCsv } from '../../utils/helpers/csvjson'; import { saveCsv } from '../../utils/helpers/files'; diff --git a/src/container/store.ts b/src/container/store.ts index 4b799ff0..3ae1572b 100644 --- a/src/container/store.ts +++ b/src/container/store.ts @@ -21,6 +21,5 @@ export const setUpStore = (container: IContainer) => configureStore({ preloadedState, middleware: (defaultMiddlewaresIncludingReduxThunk) => defaultMiddlewaresIncludingReduxThunk({ immutableCheck: false, serializableCheck: false }) // State is too big for these - .prepend(container.selectServerListener.middleware) .concat(save(localStorageConfig)), }); diff --git a/src/servers/reducers/selectedServer.ts b/src/servers/reducers/selectedServer.ts index 8833b97f..89a66bb2 100644 --- a/src/servers/reducers/selectedServer.ts +++ b/src/servers/reducers/selectedServer.ts @@ -60,24 +60,6 @@ export const selectServer = (buildShlinkApiClient: ShlinkApiClientBuilder) => cr type SelectServerThunk = ReturnType; -export const selectServerListener = ( - selectServerThunk: SelectServerThunk, - loadMercureInfo: () => PayloadAction, // TODO Consider setting actual type, if relevant -) => { - const listener = createListenerMiddleware(); - - // TODO Find a way for the mercure info to be re-loaded when server changes, without leaking mercure implementation - // details - // listener.startListening({ - // actionCreator: selectServerThunk.fulfilled, - // effect: ({ payload }, { dispatch }) => { - // isReachableServer(payload) && dispatch(loadMercureInfo()); - // }, - // }); - - return listener; -}; - export const selectedServerReducerCreator = (selectServerThunk: SelectServerThunk) => createSlice({ name: REDUCER_PREFIX, initialState, diff --git a/src/servers/services/provideServices.ts b/src/servers/services/provideServices.ts index 53d1a8a0..f4b6b63e 100644 --- a/src/servers/services/provideServices.ts +++ b/src/servers/services/provideServices.ts @@ -16,7 +16,6 @@ import { resetSelectedServer, selectedServerReducerCreator, selectServer, - selectServerListener, } from '../reducers/selectedServer'; import { createServers, deleteServer, editServer, setAutoConnect } from '../reducers/servers'; import { ServersDropdown } from '../ServersDropdown'; @@ -78,7 +77,6 @@ export const provideServices = (bottle: Bottle, connect: ConnectDecorator) => { bottle.serviceFactory('resetSelectedServer', () => resetSelectedServer); // Reducers - bottle.serviceFactory('selectServerListener', selectServerListener, 'selectServer', 'loadMercureInfo'); bottle.serviceFactory('selectedServerReducerCreator', selectedServerReducerCreator, 'selectServer'); bottle.serviceFactory('selectedServerReducer', prop('reducer'), 'selectedServerReducerCreator'); }; diff --git a/src/settings/ShortUrlsListSettings.tsx b/src/settings/ShortUrlsListSettings.tsx index 9dcfa644..5785fee0 100644 --- a/src/settings/ShortUrlsListSettings.tsx +++ b/src/settings/ShortUrlsListSettings.tsx @@ -1,5 +1,5 @@ import type { FC } from 'react'; -import { SHORT_URLS_ORDERABLE_FIELDS } from '../shlink-web-component/short-urls/data'; +import { SHORT_URLS_ORDERABLE_FIELDS } from '../../shlink-web-component/short-urls/data'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; import { OrderingDropdown } from '../utils/OrderingDropdown'; import { SimpleCard } from '../utils/SimpleCard'; diff --git a/src/settings/TagsSettings.tsx b/src/settings/TagsSettings.tsx index 49ff7194..aa089f93 100644 --- a/src/settings/TagsSettings.tsx +++ b/src/settings/TagsSettings.tsx @@ -1,5 +1,5 @@ import type { FC } from 'react'; -import { TAGS_ORDERABLE_FIELDS } from '../shlink-web-component/tags/data/TagsListChildrenProps'; +import { TAGS_ORDERABLE_FIELDS } from '../../shlink-web-component/tags/data/TagsListChildrenProps'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; import { OrderingDropdown } from '../utils/OrderingDropdown'; import { SimpleCard } from '../utils/SimpleCard'; diff --git a/src/settings/VisitsSettings.tsx b/src/settings/VisitsSettings.tsx index cd23df13..76f045b8 100644 --- a/src/settings/VisitsSettings.tsx +++ b/src/settings/VisitsSettings.tsx @@ -1,6 +1,6 @@ import type { FC } from 'react'; import { FormGroup } from 'reactstrap'; -import type { Settings } from '../shlink-web-component/utils/settings'; +import type { Settings } from '../../shlink-web-component/utils/settings'; import { DateIntervalSelector } from '../utils/dates/DateIntervalSelector'; import { FormText } from '../utils/forms/FormText'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; diff --git a/src/settings/reducers/settings.ts b/src/settings/reducers/settings.ts index aed418fe..2b578f58 100644 --- a/src/settings/reducers/settings.ts +++ b/src/settings/reducers/settings.ts @@ -1,8 +1,8 @@ import type { PayloadAction, PrepareAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; import { mergeDeepRight } from 'ramda'; -import type { ShortUrlsOrder } from '../../shlink-web-component/short-urls/data'; -import type { Settings } from '../../shlink-web-component/utils/settings'; +import type { ShortUrlsOrder } from '../../../shlink-web-component/short-urls/data'; +import type { Settings } from '../../../shlink-web-component/utils/settings'; export const DEFAULT_SHORT_URLS_ORDERING: ShortUrlsOrder = { field: 'dateCreated', diff --git a/test/api/services/ShlinkApiClient.test.ts b/test/api/services/ShlinkApiClient.test.ts index 28696577..52437c5d 100644 --- a/test/api/services/ShlinkApiClient.test.ts +++ b/test/api/services/ShlinkApiClient.test.ts @@ -1,9 +1,9 @@ import { fromPartial } from '@total-typescript/shoehorn'; +import type { ShortUrl, ShortUrlsOrder } from '../../../shlink-web-component/short-urls/data'; import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkDomain, ShlinkVisits, ShlinkVisitsOverview } from '../../../src/api/types'; import { ErrorTypeV2, ErrorTypeV3 } from '../../../src/api/types/errors'; import type { HttpClient } from '../../../src/common/services/HttpClient'; -import type { ShortUrl, ShortUrlsOrder } from '../../../src/shlink-web-component/short-urls/data'; import type { OptionalString } from '../../../src/utils/utils'; describe('ShlinkApiClient', () => { diff --git a/test/common/services/ReportExporter.test.ts b/test/common/services/ReportExporter.test.ts index 21495841..6d040e0c 100644 --- a/test/common/services/ReportExporter.test.ts +++ b/test/common/services/ReportExporter.test.ts @@ -1,6 +1,6 @@ +import type { ExportableShortUrl } from '../../../shlink-web-component/short-urls/data'; +import type { NormalizedVisit } from '../../../shlink-web-component/visits/types'; import { ReportExporter } from '../../../src/common/services/ReportExporter'; -import type { ExportableShortUrl } from '../../../src/shlink-web-component/short-urls/data'; -import type { NormalizedVisit } from '../../../src/shlink-web-component/visits/types'; import { windowMock } from '../../__mocks__/Window.mock'; describe('ReportExporter', () => { diff --git a/test/domains/DomainRow.test.tsx b/test/domains/DomainRow.test.tsx index 21dfe35f..0bbc4473 100644 --- a/test/domains/DomainRow.test.tsx +++ b/test/domains/DomainRow.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; +import type { Domain } from '../../shlink-web-component/domains/data'; +import { DomainRow } from '../../shlink-web-component/domains/DomainRow'; import type { ShlinkDomainRedirects } from '../../src/api/types'; -import type { Domain } from '../../src/shlink-web-component/domains/data'; -import { DomainRow } from '../../src/shlink-web-component/domains/DomainRow'; describe('', () => { const redirectsCombinations = [ diff --git a/test/domains/DomainSelector.test.tsx b/test/domains/DomainSelector.test.tsx index 1dfd5c58..54aa6818 100644 --- a/test/domains/DomainSelector.test.tsx +++ b/test/domains/DomainSelector.test.tsx @@ -1,7 +1,7 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { DomainSelector } from '../../src/shlink-web-component/domains/DomainSelector'; -import type { DomainsList } from '../../src/shlink-web-component/domains/reducers/domainsList'; +import { DomainSelector } from '../../shlink-web-component/domains/DomainSelector'; +import type { DomainsList } from '../../shlink-web-component/domains/reducers/domainsList'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/domains/ManageDomains.test.tsx b/test/domains/ManageDomains.test.tsx index eae2b2bc..bf3a9159 100644 --- a/test/domains/ManageDomains.test.tsx +++ b/test/domains/ManageDomains.test.tsx @@ -1,9 +1,9 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; +import { ManageDomains } from '../../shlink-web-component/domains/ManageDomains'; +import type { DomainsList } from '../../shlink-web-component/domains/reducers/domainsList'; import type { ShlinkDomain } from '../../src/api/types'; import type { ProblemDetailsError } from '../../src/api/types/errors'; -import { ManageDomains } from '../../src/shlink-web-component/domains/ManageDomains'; -import type { DomainsList } from '../../src/shlink-web-component/domains/reducers/domainsList'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/domains/helpers/DomainDropdown.test.tsx b/test/domains/helpers/DomainDropdown.test.tsx index 8959e971..7fb2751f 100644 --- a/test/domains/helpers/DomainDropdown.test.tsx +++ b/test/domains/helpers/DomainDropdown.test.tsx @@ -1,9 +1,9 @@ import { screen, waitForElementToBeRemoved } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; +import type { Domain } from '../../../shlink-web-component/domains/data'; +import { DomainDropdown } from '../../../shlink-web-component/domains/helpers/DomainDropdown'; import type { SelectedServer } from '../../../src/servers/data'; -import type { Domain } from '../../../src/shlink-web-component/domains/data'; -import { DomainDropdown } from '../../../src/shlink-web-component/domains/helpers/DomainDropdown'; import type { SemVer } from '../../../src/utils/helpers/version'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/domains/helpers/DomainStatusIcon.test.tsx b/test/domains/helpers/DomainStatusIcon.test.tsx index bf802f7b..272e2e48 100644 --- a/test/domains/helpers/DomainStatusIcon.test.tsx +++ b/test/domains/helpers/DomainStatusIcon.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import type { DomainStatus } from '../../../src/shlink-web-component/domains/data'; -import { DomainStatusIcon } from '../../../src/shlink-web-component/domains/helpers/DomainStatusIcon'; +import type { DomainStatus } from '../../../shlink-web-component/domains/data'; +import { DomainStatusIcon } from '../../../shlink-web-component/domains/helpers/DomainStatusIcon'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/domains/helpers/EditDomainRedirectsModal.test.tsx b/test/domains/helpers/EditDomainRedirectsModal.test.tsx index 7c703831..6e5f65c1 100644 --- a/test/domains/helpers/EditDomainRedirectsModal.test.tsx +++ b/test/domains/helpers/EditDomainRedirectsModal.test.tsx @@ -1,7 +1,7 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; +import { EditDomainRedirectsModal } from '../../../shlink-web-component/domains/helpers/EditDomainRedirectsModal'; import type { ShlinkDomain } from '../../../src/api/types'; -import { EditDomainRedirectsModal } from '../../../src/shlink-web-component/domains/helpers/EditDomainRedirectsModal'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/domains/reducers/domainRedirects.test.ts b/test/domains/reducers/domainRedirects.test.ts index c51229e6..f6e90aa4 100644 --- a/test/domains/reducers/domainRedirects.test.ts +++ b/test/domains/reducers/domainRedirects.test.ts @@ -1,7 +1,7 @@ import { fromPartial } from '@total-typescript/shoehorn'; +import { editDomainRedirects } from '../../../shlink-web-component/domains/reducers/domainRedirects'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkDomainRedirects } from '../../../src/api/types'; -import { editDomainRedirects } from '../../../src/shlink-web-component/domains/reducers/domainRedirects'; describe('domainRedirectsReducer', () => { describe('editDomainRedirects', () => { diff --git a/test/domains/reducers/domainsList.test.ts b/test/domains/reducers/domainsList.test.ts index 4392a3f5..4eba1a81 100644 --- a/test/domains/reducers/domainsList.test.ts +++ b/test/domains/reducers/domainsList.test.ts @@ -1,16 +1,16 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkDomainRedirects } from '../../../src/api/types'; -import { parseApiError } from '../../../src/api/utils'; -import type { ShlinkState } from '../../../src/container/types'; -import type { Domain } from '../../../src/shlink-web-component/domains/data'; -import type { EditDomainRedirects } from '../../../src/shlink-web-component/domains/reducers/domainRedirects'; -import { editDomainRedirects } from '../../../src/shlink-web-component/domains/reducers/domainRedirects'; +import type { Domain } from '../../../shlink-web-component/domains/data'; +import type { EditDomainRedirects } from '../../../shlink-web-component/domains/reducers/domainRedirects'; +import { editDomainRedirects } from '../../../shlink-web-component/domains/reducers/domainRedirects'; import { domainsListReducerCreator, replaceRedirectsOnDomain, replaceStatusOnDomain, -} from '../../../src/shlink-web-component/domains/reducers/domainsList'; +} from '../../../shlink-web-component/domains/reducers/domainsList'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkDomainRedirects } from '../../../src/api/types'; +import { parseApiError } from '../../../src/api/utils'; +import type { ShlinkState } from '../../../src/container/types'; describe('domainsListReducer', () => { const dispatch = vi.fn(); diff --git a/test/mercure/helpers/index.test.tsx b/test/mercure/helpers/index.test.tsx index 05899f02..abdfbd83 100644 --- a/test/mercure/helpers/index.test.tsx +++ b/test/mercure/helpers/index.test.tsx @@ -1,8 +1,8 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { EventSourcePolyfill } from 'event-source-polyfill'; import { identity } from 'ramda'; -import { bindToMercureTopic } from '../../../src/shlink-web-component/mercure/helpers'; -import type { MercureInfo } from '../../../src/shlink-web-component/mercure/reducers/mercureInfo'; +import { bindToMercureTopic } from '../../../shlink-web-component/mercure/helpers'; +import type { MercureInfo } from '../../../shlink-web-component/mercure/reducers/mercureInfo'; vi.mock('event-source-polyfill'); diff --git a/test/mercure/reducers/mercureInfo.test.ts b/test/mercure/reducers/mercureInfo.test.ts index c891cdd5..8e6532af 100644 --- a/test/mercure/reducers/mercureInfo.test.ts +++ b/test/mercure/reducers/mercureInfo.test.ts @@ -1,7 +1,7 @@ import { fromPartial } from '@total-typescript/shoehorn'; +import { mercureInfoReducerCreator } from '../../../shlink-web-component/mercure/reducers/mercureInfo'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { GetState } from '../../../src/container/types'; -import { mercureInfoReducerCreator } from '../../../src/shlink-web-component/mercure/reducers/mercureInfo'; describe('mercureInfoReducer', () => { const mercureInfo = { diff --git a/test/servers/Overview.test.tsx b/test/servers/Overview.test.tsx index 795c5eeb..dc3775c0 100644 --- a/test/servers/Overview.test.tsx +++ b/test/servers/Overview.test.tsx @@ -1,8 +1,8 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; -import type { MercureInfo } from '../../src/shlink-web-component/mercure/reducers/mercureInfo'; -import { Overview as overviewCreator } from '../../src/shlink-web-component/overview/Overview'; +import type { MercureInfo } from '../../shlink-web-component/mercure/reducers/mercureInfo'; +import { Overview as overviewCreator } from '../../shlink-web-component/overview/Overview'; import { prettify } from '../../src/utils/helpers/numbers'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/servers/helpers/HighlightCard.test.tsx b/test/servers/helpers/HighlightCard.test.tsx index b70f27c5..c41469f4 100644 --- a/test/servers/helpers/HighlightCard.test.tsx +++ b/test/servers/helpers/HighlightCard.test.tsx @@ -1,8 +1,8 @@ import { screen, waitFor } from '@testing-library/react'; import type { ReactNode } from 'react'; import { MemoryRouter } from 'react-router-dom'; -import type { HighlightCardProps } from '../../../src/shlink-web-component/overview/helpers/HighlightCard'; -import { HighlightCard } from '../../../src/shlink-web-component/overview/helpers/HighlightCard'; +import type { HighlightCardProps } from '../../../shlink-web-component/overview/helpers/HighlightCard'; +import { HighlightCard } from '../../../shlink-web-component/overview/helpers/HighlightCard'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/servers/helpers/VisitsHighlightCard.test.tsx b/test/servers/helpers/VisitsHighlightCard.test.tsx index 718da166..9bb32d88 100644 --- a/test/servers/helpers/VisitsHighlightCard.test.tsx +++ b/test/servers/helpers/VisitsHighlightCard.test.tsx @@ -1,6 +1,6 @@ import { screen, waitFor } from '@testing-library/react'; -import type { VisitsHighlightCardProps } from '../../../src/shlink-web-component/overview/helpers/VisitsHighlightCard'; -import { VisitsHighlightCard } from '../../../src/shlink-web-component/overview/helpers/VisitsHighlightCard'; +import type { VisitsHighlightCardProps } from '../../../shlink-web-component/overview/helpers/VisitsHighlightCard'; +import { VisitsHighlightCard } from '../../../shlink-web-component/overview/helpers/VisitsHighlightCard'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/servers/reducers/selectedServer.test.ts b/test/servers/reducers/selectedServer.test.ts index 689b71e2..b89af129 100644 --- a/test/servers/reducers/selectedServer.test.ts +++ b/test/servers/reducers/selectedServer.test.ts @@ -2,14 +2,13 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { v4 as uuid } from 'uuid'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkState } from '../../../src/container/types'; -import type { NonReachableServer, NotFoundServer, ReachableServer, RegularServer } from '../../../src/servers/data'; +import type { NonReachableServer, NotFoundServer, RegularServer } from '../../../src/servers/data'; import { MAX_FALLBACK_VERSION, MIN_FALLBACK_VERSION, resetSelectedServer, selectedServerReducerCreator, selectServer as selectServerCreator, - selectServerListener, } from '../../../src/servers/reducers/selectedServer'; describe('selectedServerReducer', () => { @@ -85,34 +84,4 @@ describe('selectedServerReducer', () => { expect(dispatch).toHaveBeenLastCalledWith(expect.objectContaining({ payload: expectedSelectedServer })); }); }); - - describe('selectServerListener', () => { - const getState = vi.fn(() => ({})); - const loadMercureInfo = vi.fn(); - const { middleware } = selectServerListener(selectServer, loadMercureInfo); - - it.each([ - [fromPartial({ version: '1.2.3' }), 1], - [fromPartial({ serverNotFound: true }), 0], - [fromPartial({ serverNotReachable: true }), 0], - ])('dispatches loadMercureInfo when provided server is reachable', (payload, expectedCalls) => { - middleware({ dispatch, getState })(vi.fn())({ - payload, - type: selectServer.fulfilled.toString(), - }); - - expect(dispatch).toHaveBeenCalledTimes(expectedCalls); - expect(loadMercureInfo).toHaveBeenCalledTimes(expectedCalls); - }); - - it('does not dispatch loadMercureInfo when action is not of the proper type', () => { - middleware({ dispatch, getState })(vi.fn())({ - payload: fromPartial({ version: '1.2.3' }), - type: 'something_else', - }); - - expect(dispatch).not.toHaveBeenCalled(); - expect(loadMercureInfo).not.toHaveBeenCalled(); - }); - }); }); diff --git a/test/settings/ShortUrlsListSettings.test.tsx b/test/settings/ShortUrlsListSettings.test.tsx index 50508909..b1ec4597 100644 --- a/test/settings/ShortUrlsListSettings.test.tsx +++ b/test/settings/ShortUrlsListSettings.test.tsx @@ -1,8 +1,8 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; +import type { ShortUrlsOrder } from '../../shlink-web-component/short-urls/data'; import type { ShortUrlsListSettings as ShortUrlsSettings } from '../../src/settings/reducers/settings'; import { ShortUrlsListSettings } from '../../src/settings/ShortUrlsListSettings'; -import type { ShortUrlsOrder } from '../../src/shlink-web-component/short-urls/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/settings/TagsSettings.test.tsx b/test/settings/TagsSettings.test.tsx index 529dfc3a..a6b8d06d 100644 --- a/test/settings/TagsSettings.test.tsx +++ b/test/settings/TagsSettings.test.tsx @@ -1,8 +1,8 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; +import type { TagsOrder } from '../../shlink-web-component/tags/data/TagsListChildrenProps'; import type { TagsSettings as TagsSettingsOptions } from '../../src/settings/reducers/settings'; import { TagsSettings } from '../../src/settings/TagsSettings'; -import type { TagsOrder } from '../../src/shlink-web-component/tags/data/TagsListChildrenProps'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/CreateShortUrl.test.tsx b/test/short-urls/CreateShortUrl.test.tsx index 4fc9be85..70e982ea 100644 --- a/test/short-urls/CreateShortUrl.test.tsx +++ b/test/short-urls/CreateShortUrl.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { CreateShortUrl as createShortUrlsCreator } from '../../src/shlink-web-component/short-urls/CreateShortUrl'; -import type { ShortUrlCreation } from '../../src/shlink-web-component/short-urls/reducers/shortUrlCreation'; +import { CreateShortUrl as createShortUrlsCreator } from '../../shlink-web-component/short-urls/CreateShortUrl'; +import type { ShortUrlCreation } from '../../shlink-web-component/short-urls/reducers/shortUrlCreation'; describe('', () => { const ShortUrlForm = () => ShortUrlForm; diff --git a/test/short-urls/EditShortUrl.test.tsx b/test/short-urls/EditShortUrl.test.tsx index 1f25d892..15a7d7d2 100644 --- a/test/short-urls/EditShortUrl.test.tsx +++ b/test/short-urls/EditShortUrl.test.tsx @@ -1,9 +1,9 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; -import { EditShortUrl as createEditShortUrl } from '../../src/shlink-web-component/short-urls/EditShortUrl'; -import type { ShortUrlDetail } from '../../src/shlink-web-component/short-urls/reducers/shortUrlDetail'; -import type { ShortUrlEdition } from '../../src/shlink-web-component/short-urls/reducers/shortUrlEdition'; +import { EditShortUrl as createEditShortUrl } from '../../shlink-web-component/short-urls/EditShortUrl'; +import type { ShortUrlDetail } from '../../shlink-web-component/short-urls/reducers/shortUrlDetail'; +import type { ShortUrlEdition } from '../../shlink-web-component/short-urls/reducers/shortUrlEdition'; describe('', () => { const shortUrlCreation = { validateUrls: true }; diff --git a/test/short-urls/Paginator.test.tsx b/test/short-urls/Paginator.test.tsx index 0b6d7805..9545aadc 100644 --- a/test/short-urls/Paginator.test.tsx +++ b/test/short-urls/Paginator.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; +import { Paginator } from '../../shlink-web-component/short-urls/Paginator'; import type { ShlinkPaginator } from '../../src/api/types'; -import { Paginator } from '../../src/shlink-web-component/short-urls/Paginator'; import { ELLIPSIS } from '../../src/utils/helpers/pagination'; describe('', () => { diff --git a/test/short-urls/ShortUrlForm.test.tsx b/test/short-urls/ShortUrlForm.test.tsx index b3efdcfe..49ed0f1c 100644 --- a/test/short-urls/ShortUrlForm.test.tsx +++ b/test/short-urls/ShortUrlForm.test.tsx @@ -2,9 +2,9 @@ import { screen } from '@testing-library/react'; import type { UserEvent } from '@testing-library/user-event/setup/setup'; import { fromPartial } from '@total-typescript/shoehorn'; import { formatISO } from 'date-fns'; +import type { Mode } from '../../shlink-web-component/short-urls/ShortUrlForm'; +import { ShortUrlForm as createShortUrlForm } from '../../shlink-web-component/short-urls/ShortUrlForm'; import type { ReachableServer, SelectedServer } from '../../src/servers/data'; -import type { Mode } from '../../src/shlink-web-component/short-urls/ShortUrlForm'; -import { ShortUrlForm as createShortUrlForm } from '../../src/shlink-web-component/short-urls/ShortUrlForm'; import { parseDate } from '../../src/utils/helpers/date'; import type { OptionalString } from '../../src/utils/utils'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/short-urls/ShortUrlsFilteringBar.test.tsx b/test/short-urls/ShortUrlsFilteringBar.test.tsx index 5cc7bac3..0476022c 100644 --- a/test/short-urls/ShortUrlsFilteringBar.test.tsx +++ b/test/short-urls/ShortUrlsFilteringBar.test.tsx @@ -2,8 +2,8 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { endOfDay, formatISO, startOfDay } from 'date-fns'; import { MemoryRouter, useLocation, useNavigate } from 'react-router-dom'; +import { ShortUrlsFilteringBar as filteringBarCreator } from '../../shlink-web-component/short-urls/ShortUrlsFilteringBar'; import type { ReachableServer, SelectedServer } from '../../src/servers/data'; -import { ShortUrlsFilteringBar as filteringBarCreator } from '../../src/shlink-web-component/short-urls/ShortUrlsFilteringBar'; import { formatDate } from '../../src/utils/helpers/date'; import type { DateRange } from '../../src/utils/helpers/dateIntervals'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/short-urls/ShortUrlsList.test.tsx b/test/short-urls/ShortUrlsList.test.tsx index 119195be..a0f28e05 100644 --- a/test/short-urls/ShortUrlsList.test.tsx +++ b/test/short-urls/ShortUrlsList.test.tsx @@ -1,12 +1,12 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter, useNavigate } from 'react-router-dom'; +import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub'; +import type { ShortUrlsOrder } from '../../shlink-web-component/short-urls/data'; +import type { ShortUrlsList as ShortUrlsListModel } from '../../shlink-web-component/short-urls/reducers/shortUrlsList'; +import { ShortUrlsList as createShortUrlsList } from '../../shlink-web-component/short-urls/ShortUrlsList'; +import type { ShortUrlsTableType } from '../../shlink-web-component/short-urls/ShortUrlsTable'; import type { Settings } from '../../src/settings/reducers/settings'; -import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub'; -import type { ShortUrlsOrder } from '../../src/shlink-web-component/short-urls/data'; -import type { ShortUrlsList as ShortUrlsListModel } from '../../src/shlink-web-component/short-urls/reducers/shortUrlsList'; -import { ShortUrlsList as createShortUrlsList } from '../../src/shlink-web-component/short-urls/ShortUrlsList'; -import type { ShortUrlsTableType } from '../../src/shlink-web-component/short-urls/ShortUrlsTable'; import type { SemVer } from '../../src/utils/helpers/version'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/short-urls/ShortUrlsTable.test.tsx b/test/short-urls/ShortUrlsTable.test.tsx index 67320cba..9c53d89a 100644 --- a/test/short-urls/ShortUrlsTable.test.tsx +++ b/test/short-urls/ShortUrlsTable.test.tsx @@ -1,10 +1,10 @@ import { fireEvent, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; +import type { ShortUrlsOrderableFields } from '../../shlink-web-component/short-urls/data'; +import { SHORT_URLS_ORDERABLE_FIELDS } from '../../shlink-web-component/short-urls/data'; +import type { ShortUrlsList } from '../../shlink-web-component/short-urls/reducers/shortUrlsList'; +import { ShortUrlsTable as shortUrlsTableCreator } from '../../shlink-web-component/short-urls/ShortUrlsTable'; import type { SelectedServer } from '../../src/servers/data'; -import type { ShortUrlsOrderableFields } from '../../src/shlink-web-component/short-urls/data'; -import { SHORT_URLS_ORDERABLE_FIELDS } from '../../src/shlink-web-component/short-urls/data'; -import type { ShortUrlsList } from '../../src/shlink-web-component/short-urls/reducers/shortUrlsList'; -import { ShortUrlsTable as shortUrlsTableCreator } from '../../src/shlink-web-component/short-urls/ShortUrlsTable'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/UseExistingIfFoundInfoIcon.test.tsx b/test/short-urls/UseExistingIfFoundInfoIcon.test.tsx index 3990d03d..95c6452d 100644 --- a/test/short-urls/UseExistingIfFoundInfoIcon.test.tsx +++ b/test/short-urls/UseExistingIfFoundInfoIcon.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react'; -import { UseExistingIfFoundInfoIcon } from '../../src/shlink-web-component/short-urls/UseExistingIfFoundInfoIcon'; +import { UseExistingIfFoundInfoIcon } from '../../shlink-web-component/short-urls/UseExistingIfFoundInfoIcon'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/CreateShortUrlResult.test.tsx b/test/short-urls/helpers/CreateShortUrlResult.test.tsx index 1fa5be26..d51fc7d0 100644 --- a/test/short-urls/helpers/CreateShortUrlResult.test.tsx +++ b/test/short-urls/helpers/CreateShortUrlResult.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { CreateShortUrlResult as createResult } from '../../../src/shlink-web-component/short-urls/helpers/CreateShortUrlResult'; -import type { ShortUrlCreation } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlCreation'; +import { CreateShortUrlResult as createResult } from '../../../shlink-web-component/short-urls/helpers/CreateShortUrlResult'; +import type { ShortUrlCreation } from '../../../shlink-web-component/short-urls/reducers/shortUrlCreation'; import type { TimeoutToggle } from '../../../src/utils/helpers/hooks'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/short-urls/helpers/DeleteShortUrlModal.test.tsx b/test/short-urls/helpers/DeleteShortUrlModal.test.tsx index 8845ec8a..20f26062 100644 --- a/test/short-urls/helpers/DeleteShortUrlModal.test.tsx +++ b/test/short-urls/helpers/DeleteShortUrlModal.test.tsx @@ -1,10 +1,10 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; +import type { ShortUrl } from '../../../shlink-web-component/short-urls/data'; +import { DeleteShortUrlModal } from '../../../shlink-web-component/short-urls/helpers/DeleteShortUrlModal'; +import type { ShortUrlDeletion } from '../../../shlink-web-component/short-urls/reducers/shortUrlDeletion'; import type { InvalidShortUrlDeletion } from '../../../src/api/types/errors'; import { ErrorTypeV2, ErrorTypeV3 } from '../../../src/api/types/errors'; -import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; -import { DeleteShortUrlModal } from '../../../src/shlink-web-component/short-urls/helpers/DeleteShortUrlModal'; -import type { ShortUrlDeletion } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlDeletion'; import { renderWithEvents } from '../../__helpers__/setUpTest'; import { TestModalWrapper } from '../../__helpers__/TestModalWrapper'; diff --git a/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx b/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx index 48d34ca8..8be25676 100644 --- a/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx +++ b/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx @@ -1,10 +1,10 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; +import type { ShortUrl } from '../../../shlink-web-component/short-urls/data'; +import { ExportShortUrlsBtn as createExportShortUrlsBtn } from '../../../shlink-web-component/short-urls/helpers/ExportShortUrlsBtn'; import type { ReportExporter } from '../../../src/common/services/ReportExporter'; import type { NotFoundServer, SelectedServer } from '../../../src/servers/data'; -import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; -import { ExportShortUrlsBtn as createExportShortUrlsBtn } from '../../../src/shlink-web-component/short-urls/helpers/ExportShortUrlsBtn'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/QrCodeModal.test.tsx b/test/short-urls/helpers/QrCodeModal.test.tsx index d636f2ed..4cfae4b2 100644 --- a/test/short-urls/helpers/QrCodeModal.test.tsx +++ b/test/short-urls/helpers/QrCodeModal.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { QrCodeModal as createQrCodeModal } from '../../../src/shlink-web-component/short-urls/helpers/QrCodeModal'; +import { QrCodeModal as createQrCodeModal } from '../../../shlink-web-component/short-urls/helpers/QrCodeModal'; import type { SemVer } from '../../../src/utils/helpers/version'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/short-urls/helpers/ShortUrlDetailLink.test.tsx b/test/short-urls/helpers/ShortUrlDetailLink.test.tsx index c5f4b799..c50e1ad0 100644 --- a/test/short-urls/helpers/ShortUrlDetailLink.test.tsx +++ b/test/short-urls/helpers/ShortUrlDetailLink.test.tsx @@ -1,10 +1,10 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; +import type { ShortUrl } from '../../../shlink-web-component/short-urls/data'; +import type { LinkSuffix } from '../../../shlink-web-component/short-urls/helpers/ShortUrlDetailLink'; +import { ShortUrlDetailLink } from '../../../shlink-web-component/short-urls/helpers/ShortUrlDetailLink'; import type { NotFoundServer, ReachableServer } from '../../../src/servers/data'; -import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; -import type { LinkSuffix } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlDetailLink'; -import { ShortUrlDetailLink } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlDetailLink'; describe('', () => { it.each([ diff --git a/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx b/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx index e9b25cbf..f013b3ad 100644 --- a/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx +++ b/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx @@ -1,5 +1,5 @@ import { render, screen } from '@testing-library/react'; -import { ShortUrlFormCheckboxGroup } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup'; +import { ShortUrlFormCheckboxGroup } from '../../../shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup'; describe('', () => { it.each([ diff --git a/test/short-urls/helpers/ShortUrlStatus.test.tsx b/test/short-urls/helpers/ShortUrlStatus.test.tsx index c1e39a1f..0afef506 100644 --- a/test/short-urls/helpers/ShortUrlStatus.test.tsx +++ b/test/short-urls/helpers/ShortUrlStatus.test.tsx @@ -1,9 +1,9 @@ import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { fromPartial } from '@total-typescript/shoehorn'; +import type { ShortUrl, ShortUrlMeta } from '../../../shlink-web-component/short-urls/data'; +import { ShortUrlStatus } from '../../../shlink-web-component/short-urls/helpers/ShortUrlStatus'; import type { ShlinkVisitsSummary } from '../../../src/api/types'; -import type { ShortUrl, ShortUrlMeta } from '../../../src/shlink-web-component/short-urls/data'; -import { ShortUrlStatus } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlStatus'; describe('', () => { const setUp = (shortUrl: ShortUrl) => ({ diff --git a/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx b/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx index 1516fd08..8ce9d72e 100644 --- a/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx +++ b/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx @@ -1,8 +1,8 @@ import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; -import { ShortUrlVisitsCount } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount'; +import type { ShortUrl } from '../../../shlink-web-component/short-urls/data'; +import { ShortUrlVisitsCount } from '../../../shlink-web-component/short-urls/helpers/ShortUrlVisitsCount'; describe('', () => { const setUp = (visitsCount: number, shortUrl: ShortUrl) => ({ diff --git a/test/short-urls/helpers/ShortUrlsFilterDropdown.test.tsx b/test/short-urls/helpers/ShortUrlsFilterDropdown.test.tsx index 21aecff1..16da4417 100644 --- a/test/short-urls/helpers/ShortUrlsFilterDropdown.test.tsx +++ b/test/short-urls/helpers/ShortUrlsFilterDropdown.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react'; -import { ShortUrlsFilterDropdown } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown'; +import { ShortUrlsFilterDropdown } from '../../../shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/ShortUrlsRow.test.tsx b/test/short-urls/helpers/ShortUrlsRow.test.tsx index d92a2b04..5d2c8730 100644 --- a/test/short-urls/helpers/ShortUrlsRow.test.tsx +++ b/test/short-urls/helpers/ShortUrlsRow.test.tsx @@ -3,10 +3,10 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { addDays, formatISO, subDays } from 'date-fns'; import { last } from 'ramda'; import { MemoryRouter, useLocation } from 'react-router-dom'; +import type { ShortUrl, ShortUrlMeta } from '../../../shlink-web-component/short-urls/data'; +import { ShortUrlsRow as createShortUrlsRow } from '../../../shlink-web-component/short-urls/helpers/ShortUrlsRow'; import type { ReachableServer } from '../../../src/servers/data'; import type { Settings } from '../../../src/settings/reducers/settings'; -import type { ShortUrl, ShortUrlMeta } from '../../../src/shlink-web-component/short-urls/data'; -import { ShortUrlsRow as createShortUrlsRow } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlsRow'; import { now, parseDate } from '../../../src/utils/helpers/date'; import type { TimeoutToggle } from '../../../src/utils/helpers/hooks'; import type { OptionalString } from '../../../src/utils/utils'; diff --git a/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx b/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx index 532669b5..cf921049 100644 --- a/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx +++ b/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx @@ -1,9 +1,9 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; +import type { ShortUrl } from '../../../shlink-web-component/short-urls/data'; +import { ShortUrlsRowMenu as createShortUrlsRowMenu } from '../../../shlink-web-component/short-urls/helpers/ShortUrlsRowMenu'; import type { ReachableServer } from '../../../src/servers/data'; -import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; -import { ShortUrlsRowMenu as createShortUrlsRowMenu } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlsRowMenu'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/Tags.test.tsx b/test/short-urls/helpers/Tags.test.tsx index 697dffe7..5c623f21 100644 --- a/test/short-urls/helpers/Tags.test.tsx +++ b/test/short-urls/helpers/Tags.test.tsx @@ -1,5 +1,5 @@ import { render, screen } from '@testing-library/react'; -import { Tags } from '../../../src/shlink-web-component/short-urls/helpers/Tags'; +import { Tags } from '../../../shlink-web-component/short-urls/helpers/Tags'; import { colorGeneratorMock } from '../../utils/services/__mocks__/ColorGenerator.mock'; describe('', () => { diff --git a/test/short-urls/helpers/index.test.ts b/test/short-urls/helpers/index.test.ts index b88a9441..7fb37d63 100644 --- a/test/short-urls/helpers/index.test.ts +++ b/test/short-urls/helpers/index.test.ts @@ -1,6 +1,6 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; -import { shortUrlDataFromShortUrl, urlDecodeShortCode, urlEncodeShortCode } from '../../../src/shlink-web-component/short-urls/helpers'; +import type { ShortUrl } from '../../../shlink-web-component/short-urls/data'; +import { shortUrlDataFromShortUrl, urlDecodeShortCode, urlEncodeShortCode } from '../../../shlink-web-component/short-urls/helpers'; describe('helpers', () => { describe('shortUrlDataFromShortUrl', () => { diff --git a/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx b/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx index 48ebe6bf..5a84e76a 100644 --- a/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx +++ b/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react'; -import { QrErrorCorrectionDropdown } from '../../../../src/shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown'; +import { QrErrorCorrectionDropdown } from '../../../../shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown'; import type { QrErrorCorrection } from '../../../../src/utils/helpers/qrCodes'; import { renderWithEvents } from '../../../__helpers__/setUpTest'; diff --git a/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx b/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx index 007b257b..944fd53c 100644 --- a/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx +++ b/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react'; -import { QrFormatDropdown } from '../../../../src/shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown'; +import { QrFormatDropdown } from '../../../../shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown'; import type { QrCodeFormat } from '../../../../src/utils/helpers/qrCodes'; import { renderWithEvents } from '../../../__helpers__/setUpTest'; diff --git a/test/short-urls/reducers/shortUrlCreation.test.ts b/test/short-urls/reducers/shortUrlCreation.test.ts index bc50287a..8af7941d 100644 --- a/test/short-urls/reducers/shortUrlCreation.test.ts +++ b/test/short-urls/reducers/shortUrlCreation.test.ts @@ -1,11 +1,11 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkState } from '../../../src/container/types'; -import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import type { ShortUrl } from '../../../shlink-web-component/short-urls/data'; import { createShortUrl as createShortUrlCreator, shortUrlCreationReducerCreator, -} from '../../../src/shlink-web-component/short-urls/reducers/shortUrlCreation'; +} from '../../../shlink-web-component/short-urls/reducers/shortUrlCreation'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkState } from '../../../src/container/types'; describe('shortUrlCreationReducer', () => { const shortUrl = fromPartial({}); diff --git a/test/short-urls/reducers/shortUrlDeletion.test.ts b/test/short-urls/reducers/shortUrlDeletion.test.ts index 522478f3..c6c43121 100644 --- a/test/short-urls/reducers/shortUrlDeletion.test.ts +++ b/test/short-urls/reducers/shortUrlDeletion.test.ts @@ -1,10 +1,10 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ProblemDetailsError } from '../../../src/api/types/errors'; import { deleteShortUrl as deleteShortUrlCreator, shortUrlDeletionReducerCreator, -} from '../../../src/shlink-web-component/short-urls/reducers/shortUrlDeletion'; +} from '../../../shlink-web-component/short-urls/reducers/shortUrlDeletion'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ProblemDetailsError } from '../../../src/api/types/errors'; describe('shortUrlDeletionReducer', () => { const deleteShortUrlCall = vi.fn(); diff --git a/test/short-urls/reducers/shortUrlDetail.test.ts b/test/short-urls/reducers/shortUrlDetail.test.ts index a3d7e5cc..daf96cd9 100644 --- a/test/short-urls/reducers/shortUrlDetail.test.ts +++ b/test/short-urls/reducers/shortUrlDetail.test.ts @@ -1,9 +1,9 @@ import { fromPartial } from '@total-typescript/shoehorn'; +import type { ShortUrl } from '../../../shlink-web-component/short-urls/data'; +import { shortUrlDetailReducerCreator } from '../../../shlink-web-component/short-urls/reducers/shortUrlDetail'; +import type { ShortUrlsList } from '../../../shlink-web-component/short-urls/reducers/shortUrlsList'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkState } from '../../../src/container/types'; -import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; -import { shortUrlDetailReducerCreator } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlDetail'; -import type { ShortUrlsList } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlsList'; describe('shortUrlDetailReducer', () => { const getShortUrlCall = vi.fn(); diff --git a/test/short-urls/reducers/shortUrlEdition.test.ts b/test/short-urls/reducers/shortUrlEdition.test.ts index 0f624de9..2b334c05 100644 --- a/test/short-urls/reducers/shortUrlEdition.test.ts +++ b/test/short-urls/reducers/shortUrlEdition.test.ts @@ -1,11 +1,11 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkState } from '../../../src/container/types'; -import type { SelectedServer } from '../../../src/servers/data'; -import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import type { ShortUrl } from '../../../shlink-web-component/short-urls/data'; import { editShortUrl as editShortUrlCreator, shortUrlEditionReducerCreator, -} from '../../../src/shlink-web-component/short-urls/reducers/shortUrlEdition'; +} from '../../../shlink-web-component/short-urls/reducers/shortUrlEdition'; +import type { ShlinkState } from '../../../src/container/types'; +import type { SelectedServer } from '../../../src/servers/data'; describe('shortUrlEditionReducer', () => { const longUrl = 'https://shlink.io'; diff --git a/test/short-urls/reducers/shortUrlsList.test.ts b/test/short-urls/reducers/shortUrlsList.test.ts index f8e1f5e6..2f67021d 100644 --- a/test/short-urls/reducers/shortUrlsList.test.ts +++ b/test/short-urls/reducers/shortUrlsList.test.ts @@ -1,16 +1,16 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkShortUrlsResponse } from '../../../src/api/types'; -import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; -import { createShortUrl as createShortUrlCreator } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlCreation'; -import { shortUrlDeleted } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlDeletion'; -import { editShortUrl as editShortUrlCreator } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlEdition'; +import type { ShortUrl } from '../../../shlink-web-component/short-urls/data'; +import { createShortUrl as createShortUrlCreator } from '../../../shlink-web-component/short-urls/reducers/shortUrlCreation'; +import { shortUrlDeleted } from '../../../shlink-web-component/short-urls/reducers/shortUrlDeletion'; +import { editShortUrl as editShortUrlCreator } from '../../../shlink-web-component/short-urls/reducers/shortUrlEdition'; import { listShortUrls as listShortUrlsCreator, shortUrlsListReducerCreator, -} from '../../../src/shlink-web-component/short-urls/reducers/shortUrlsList'; -import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; -import type { CreateVisit } from '../../../src/shlink-web-component/visits/types'; +} from '../../../shlink-web-component/short-urls/reducers/shortUrlsList'; +import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation'; +import type { CreateVisit } from '../../../shlink-web-component/visits/types'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkShortUrlsResponse } from '../../../src/api/types'; describe('shortUrlsListReducer', () => { const shortCode = 'abc123'; diff --git a/test/tags/TagsList.test.tsx b/test/tags/TagsList.test.tsx index e4bb0ca9..ff2428db 100644 --- a/test/tags/TagsList.test.tsx +++ b/test/tags/TagsList.test.tsx @@ -1,10 +1,10 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { identity } from 'ramda'; -import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub'; -import type { TagsList } from '../../src/shlink-web-component/tags/reducers/tagsList'; -import type { TagsListProps } from '../../src/shlink-web-component/tags/TagsList'; -import { TagsList as createTagsList } from '../../src/shlink-web-component/tags/TagsList'; +import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub'; +import type { TagsList } from '../../shlink-web-component/tags/reducers/tagsList'; +import type { TagsListProps } from '../../shlink-web-component/tags/TagsList'; +import { TagsList as createTagsList } from '../../shlink-web-component/tags/TagsList'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/tags/TagsTable.test.tsx b/test/tags/TagsTable.test.tsx index a65fc49b..e5891112 100644 --- a/test/tags/TagsTable.test.tsx +++ b/test/tags/TagsTable.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { useLocation } from 'react-router-dom'; -import { TagsTable as createTagsTable } from '../../src/shlink-web-component/tags/TagsTable'; +import { TagsTable as createTagsTable } from '../../shlink-web-component/tags/TagsTable'; import { rangeOf } from '../../src/utils/utils'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/tags/TagsTableRow.test.tsx b/test/tags/TagsTableRow.test.tsx index abe1d65c..94850105 100644 --- a/test/tags/TagsTableRow.test.tsx +++ b/test/tags/TagsTableRow.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; -import { TagsTableRow as createTagsTableRow } from '../../src/shlink-web-component/tags/TagsTableRow'; +import { TagsTableRow as createTagsTableRow } from '../../shlink-web-component/tags/TagsTableRow'; import { renderWithEvents } from '../__helpers__/setUpTest'; import { colorGeneratorMock } from '../utils/services/__mocks__/ColorGenerator.mock'; diff --git a/test/tags/helpers/DeleteTagConfirmModal.test.tsx b/test/tags/helpers/DeleteTagConfirmModal.test.tsx index fc7976ec..8ddfb1b7 100644 --- a/test/tags/helpers/DeleteTagConfirmModal.test.tsx +++ b/test/tags/helpers/DeleteTagConfirmModal.test.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; -import { DeleteTagConfirmModal } from '../../../src/shlink-web-component/tags/helpers/DeleteTagConfirmModal'; -import type { TagDeletion } from '../../../src/shlink-web-component/tags/reducers/tagDelete'; +import { DeleteTagConfirmModal } from '../../../shlink-web-component/tags/helpers/DeleteTagConfirmModal'; +import type { TagDeletion } from '../../../shlink-web-component/tags/reducers/tagDelete'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/tags/helpers/EditTagModal.test.tsx b/test/tags/helpers/EditTagModal.test.tsx index 56f9605b..b1fd3dc4 100644 --- a/test/tags/helpers/EditTagModal.test.tsx +++ b/test/tags/helpers/EditTagModal.test.tsx @@ -1,7 +1,7 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { EditTagModal as createEditTagModal } from '../../../src/shlink-web-component/tags/helpers/EditTagModal'; -import type { TagEdition } from '../../../src/shlink-web-component/tags/reducers/tagEdit'; +import { EditTagModal as createEditTagModal } from '../../../shlink-web-component/tags/helpers/EditTagModal'; +import type { TagEdition } from '../../../shlink-web-component/tags/reducers/tagEdit'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/tags/helpers/Tag.test.tsx b/test/tags/helpers/Tag.test.tsx index 2adcbc42..b0d840e7 100644 --- a/test/tags/helpers/Tag.test.tsx +++ b/test/tags/helpers/Tag.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import type { ReactNode } from 'react'; -import { Tag } from '../../../src/shlink-web-component/tags/helpers/Tag'; +import { Tag } from '../../../shlink-web-component/tags/helpers/Tag'; import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; import { MAIN_COLOR } from '../../../src/utils/theme'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/tags/helpers/TagsSelector.test.tsx b/test/tags/helpers/TagsSelector.test.tsx index 822edf70..a74be29b 100644 --- a/test/tags/helpers/TagsSelector.test.tsx +++ b/test/tags/helpers/TagsSelector.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { TagsSelector as createTagsSelector } from '../../../src/shlink-web-component/tags/helpers/TagsSelector'; -import type { TagsList } from '../../../src/shlink-web-component/tags/reducers/tagsList'; +import { TagsSelector as createTagsSelector } from '../../../shlink-web-component/tags/helpers/TagsSelector'; +import type { TagsList } from '../../../shlink-web-component/tags/reducers/tagsList'; import { renderWithEvents } from '../../__helpers__/setUpTest'; import { colorGeneratorMock } from '../../utils/services/__mocks__/ColorGenerator.mock'; diff --git a/test/tags/reducers/tagDelete.test.ts b/test/tags/reducers/tagDelete.test.ts index a126bd1e..a9fac07f 100644 --- a/test/tags/reducers/tagDelete.test.ts +++ b/test/tags/reducers/tagDelete.test.ts @@ -1,7 +1,7 @@ import { fromPartial } from '@total-typescript/shoehorn'; +import { tagDeleted, tagDeleteReducerCreator } from '../../../shlink-web-component/tags/reducers/tagDelete'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkState } from '../../../src/container/types'; -import { tagDeleted, tagDeleteReducerCreator } from '../../../src/shlink-web-component/tags/reducers/tagDelete'; describe('tagDeleteReducer', () => { const deleteTagsCall = vi.fn(); diff --git a/test/tags/reducers/tagEdit.test.ts b/test/tags/reducers/tagEdit.test.ts index 25dd8ec8..31500d5c 100644 --- a/test/tags/reducers/tagEdit.test.ts +++ b/test/tags/reducers/tagEdit.test.ts @@ -1,7 +1,7 @@ import { fromPartial } from '@total-typescript/shoehorn'; +import { editTag as editTagCreator, tagEdited, tagEditReducerCreator } from '../../../shlink-web-component/tags/reducers/tagEdit'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkState } from '../../../src/container/types'; -import { editTag as editTagCreator, tagEdited, tagEditReducerCreator } from '../../../src/shlink-web-component/tags/reducers/tagEdit'; import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; describe('tagEditReducer', () => { diff --git a/test/tags/reducers/tagsList.test.ts b/test/tags/reducers/tagsList.test.ts index be2af823..7a9b7767 100644 --- a/test/tags/reducers/tagsList.test.ts +++ b/test/tags/reducers/tagsList.test.ts @@ -1,18 +1,18 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkState } from '../../../src/container/types'; -import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; -import { createShortUrl as createShortUrlCreator } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlCreation'; -import { tagDeleted } from '../../../src/shlink-web-component/tags/reducers/tagDelete'; -import { tagEdited } from '../../../src/shlink-web-component/tags/reducers/tagEdit'; +import type { ShortUrl } from '../../../shlink-web-component/short-urls/data'; +import { createShortUrl as createShortUrlCreator } from '../../../shlink-web-component/short-urls/reducers/shortUrlCreation'; +import { tagDeleted } from '../../../shlink-web-component/tags/reducers/tagDelete'; +import { tagEdited } from '../../../shlink-web-component/tags/reducers/tagEdit'; import type { - TagsList } from '../../../src/shlink-web-component/tags/reducers/tagsList'; + TagsList } from '../../../shlink-web-component/tags/reducers/tagsList'; import { filterTags, listTags as listTagsCreator, tagsListReducerCreator, -} from '../../../src/shlink-web-component/tags/reducers/tagsList'; -import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; -import type { CreateVisit } from '../../../src/shlink-web-component/visits/types'; +} from '../../../shlink-web-component/tags/reducers/tagsList'; +import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation'; +import type { CreateVisit } from '../../../shlink-web-component/visits/types'; +import type { ShlinkState } from '../../../src/container/types'; describe('tagsListReducer', () => { const state = (props: Partial) => fromPartial(props); diff --git a/test/visits/DomainVisits.test.tsx b/test/visits/DomainVisits.test.tsx index a50565ae..830bf5e5 100644 --- a/test/visits/DomainVisits.test.tsx +++ b/test/visits/DomainVisits.test.tsx @@ -2,9 +2,9 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { formatISO } from 'date-fns'; import { MemoryRouter } from 'react-router-dom'; -import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub'; -import { DomainVisits as createDomainVisits } from '../../src/shlink-web-component/visits/DomainVisits'; -import type { DomainVisits } from '../../src/shlink-web-component/visits/reducers/domainVisits'; +import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub'; +import { DomainVisits as createDomainVisits } from '../../shlink-web-component/visits/DomainVisits'; +import type { DomainVisits } from '../../shlink-web-component/visits/reducers/domainVisits'; import { renderWithEvents } from '../__helpers__/setUpTest'; vi.mock('react-router-dom', async () => ({ diff --git a/test/visits/NonOrphanVisits.test.tsx b/test/visits/NonOrphanVisits.test.tsx index 2c34d205..eba7bd7d 100644 --- a/test/visits/NonOrphanVisits.test.tsx +++ b/test/visits/NonOrphanVisits.test.tsx @@ -2,9 +2,9 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { formatISO } from 'date-fns'; import { MemoryRouter } from 'react-router-dom'; -import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub'; -import { NonOrphanVisits as createNonOrphanVisits } from '../../src/shlink-web-component/visits/NonOrphanVisits'; -import type { VisitsInfo } from '../../src/shlink-web-component/visits/reducers/types'; +import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub'; +import { NonOrphanVisits as createNonOrphanVisits } from '../../shlink-web-component/visits/NonOrphanVisits'; +import type { VisitsInfo } from '../../shlink-web-component/visits/reducers/types'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/OrphanVisits.test.tsx b/test/visits/OrphanVisits.test.tsx index 1cd56646..306faaa4 100644 --- a/test/visits/OrphanVisits.test.tsx +++ b/test/visits/OrphanVisits.test.tsx @@ -2,9 +2,9 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { formatISO } from 'date-fns'; import { MemoryRouter } from 'react-router-dom'; -import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub'; -import { OrphanVisits as createOrphanVisits } from '../../src/shlink-web-component/visits/OrphanVisits'; -import type { VisitsInfo } from '../../src/shlink-web-component/visits/reducers/types'; +import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub'; +import { OrphanVisits as createOrphanVisits } from '../../shlink-web-component/visits/OrphanVisits'; +import type { VisitsInfo } from '../../shlink-web-component/visits/reducers/types'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/ShortUrlVisits.test.tsx b/test/visits/ShortUrlVisits.test.tsx index d41bdc60..090ae3c5 100644 --- a/test/visits/ShortUrlVisits.test.tsx +++ b/test/visits/ShortUrlVisits.test.tsx @@ -3,10 +3,10 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { formatISO } from 'date-fns'; import { identity } from 'ramda'; import { MemoryRouter } from 'react-router-dom'; -import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub'; -import type { ShortUrlVisits as ShortUrlVisitsState } from '../../src/shlink-web-component/visits/reducers/shortUrlVisits'; -import type { ShortUrlVisitsProps } from '../../src/shlink-web-component/visits/ShortUrlVisits'; -import { ShortUrlVisits as createShortUrlVisits } from '../../src/shlink-web-component/visits/ShortUrlVisits'; +import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub'; +import type { ShortUrlVisits as ShortUrlVisitsState } from '../../shlink-web-component/visits/reducers/shortUrlVisits'; +import type { ShortUrlVisitsProps } from '../../shlink-web-component/visits/ShortUrlVisits'; +import { ShortUrlVisits as createShortUrlVisits } from '../../shlink-web-component/visits/ShortUrlVisits'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/ShortUrlVisitsHeader.test.tsx b/test/visits/ShortUrlVisitsHeader.test.tsx index 1bec8b2a..1dfed5e7 100644 --- a/test/visits/ShortUrlVisitsHeader.test.tsx +++ b/test/visits/ShortUrlVisitsHeader.test.tsx @@ -1,9 +1,9 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { formatDistance, parseISO } from 'date-fns'; -import type { ShortUrlDetail } from '../../src/shlink-web-component/short-urls/reducers/shortUrlDetail'; -import type { ShortUrlVisits } from '../../src/shlink-web-component/visits/reducers/shortUrlVisits'; -import { ShortUrlVisitsHeader } from '../../src/shlink-web-component/visits/ShortUrlVisitsHeader'; +import type { ShortUrlDetail } from '../../shlink-web-component/short-urls/reducers/shortUrlDetail'; +import type { ShortUrlVisits } from '../../shlink-web-component/visits/reducers/shortUrlVisits'; +import { ShortUrlVisitsHeader } from '../../shlink-web-component/visits/ShortUrlVisitsHeader'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/TagVisits.test.tsx b/test/visits/TagVisits.test.tsx index 31908c23..749f0f9b 100644 --- a/test/visits/TagVisits.test.tsx +++ b/test/visits/TagVisits.test.tsx @@ -2,10 +2,10 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { formatISO } from 'date-fns'; import { MemoryRouter } from 'react-router'; -import type { MercureBoundProps } from '../../src/shlink-web-component/mercure/helpers/boundToMercureHub'; -import type { TagVisits as TagVisitsStats } from '../../src/shlink-web-component/visits/reducers/tagVisits'; -import type { TagVisitsProps } from '../../src/shlink-web-component/visits/TagVisits'; -import { TagVisits as createTagVisits } from '../../src/shlink-web-component/visits/TagVisits'; +import type { MercureBoundProps } from '../../shlink-web-component/mercure/helpers/boundToMercureHub'; +import type { TagVisits as TagVisitsStats } from '../../shlink-web-component/visits/reducers/tagVisits'; +import type { TagVisitsProps } from '../../shlink-web-component/visits/TagVisits'; +import { TagVisits as createTagVisits } from '../../shlink-web-component/visits/TagVisits'; import { renderWithEvents } from '../__helpers__/setUpTest'; vi.mock('react-router-dom', async () => ({ diff --git a/test/visits/TagVisitsHeader.test.tsx b/test/visits/TagVisitsHeader.test.tsx index 1835148d..df4f5a83 100644 --- a/test/visits/TagVisitsHeader.test.tsx +++ b/test/visits/TagVisitsHeader.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import type { TagVisits } from '../../src/shlink-web-component/visits/reducers/tagVisits'; -import { TagVisitsHeader } from '../../src/shlink-web-component/visits/TagVisitsHeader'; +import type { TagVisits } from '../../shlink-web-component/visits/reducers/tagVisits'; +import { TagVisitsHeader } from '../../shlink-web-component/visits/TagVisitsHeader'; import type { ColorGenerator } from '../../src/utils/services/ColorGenerator'; describe('', () => { diff --git a/test/visits/VisitsHeader.test.tsx b/test/visits/VisitsHeader.test.tsx index ae5951c5..ec6390e1 100644 --- a/test/visits/VisitsHeader.test.tsx +++ b/test/visits/VisitsHeader.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import type { Visit } from '../../src/shlink-web-component/visits/types'; -import { VisitsHeader } from '../../src/shlink-web-component/visits/VisitsHeader'; +import type { Visit } from '../../shlink-web-component/visits/types'; +import { VisitsHeader } from '../../shlink-web-component/visits/VisitsHeader'; describe('', () => { const visits: Visit[] = [fromPartial({}), fromPartial({}), fromPartial({})]; diff --git a/test/visits/VisitsStats.test.tsx b/test/visits/VisitsStats.test.tsx index 07d42df1..aac27d34 100644 --- a/test/visits/VisitsStats.test.tsx +++ b/test/visits/VisitsStats.test.tsx @@ -2,9 +2,9 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { createMemoryHistory } from 'history'; import { Router } from 'react-router-dom'; -import type { VisitsInfo } from '../../src/shlink-web-component/visits/reducers/types'; -import type { Visit } from '../../src/shlink-web-component/visits/types'; -import { VisitsStats } from '../../src/shlink-web-component/visits/VisitsStats'; +import type { VisitsInfo } from '../../shlink-web-component/visits/reducers/types'; +import type { Visit } from '../../shlink-web-component/visits/types'; +import { VisitsStats } from '../../shlink-web-component/visits/VisitsStats'; import { rangeOf } from '../../src/utils/utils'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/visits/VisitsTable.test.tsx b/test/visits/VisitsTable.test.tsx index 003edef8..21777480 100644 --- a/test/visits/VisitsTable.test.tsx +++ b/test/visits/VisitsTable.test.tsx @@ -1,8 +1,8 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import type { NormalizedVisit } from '../../src/shlink-web-component/visits/types'; -import type { VisitsTableProps } from '../../src/shlink-web-component/visits/VisitsTable'; -import { VisitsTable } from '../../src/shlink-web-component/visits/VisitsTable'; +import type { NormalizedVisit } from '../../shlink-web-component/visits/types'; +import type { VisitsTableProps } from '../../shlink-web-component/visits/VisitsTable'; +import { VisitsTable } from '../../shlink-web-component/visits/VisitsTable'; import { rangeOf } from '../../src/utils/utils'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/visits/charts/ChartCard.test.tsx b/test/visits/charts/ChartCard.test.tsx index d41c53ee..883b8fc9 100644 --- a/test/visits/charts/ChartCard.test.tsx +++ b/test/visits/charts/ChartCard.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; import type { ReactNode } from 'react'; -import { ChartCard } from '../../../src/shlink-web-component/visits/charts/ChartCard'; +import { ChartCard } from '../../../shlink-web-component/visits/charts/ChartCard'; describe('', () => { const setUp = (title: Function | string = '', footer?: ReactNode) => render( diff --git a/test/visits/charts/DoughnutChart.test.tsx b/test/visits/charts/DoughnutChart.test.tsx index d428836e..16262cc2 100644 --- a/test/visits/charts/DoughnutChart.test.tsx +++ b/test/visits/charts/DoughnutChart.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react'; -import { DoughnutChart } from '../../../src/shlink-web-component/visits/charts/DoughnutChart'; +import { DoughnutChart } from '../../../shlink-web-component/visits/charts/DoughnutChart'; import { setUpCanvas } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/charts/DoughnutChartLegend.test.tsx b/test/visits/charts/DoughnutChartLegend.test.tsx index af126b90..8cf3d690 100644 --- a/test/visits/charts/DoughnutChartLegend.test.tsx +++ b/test/visits/charts/DoughnutChartLegend.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import type { Chart, ChartDataset } from 'chart.js'; -import { DoughnutChartLegend } from '../../../src/shlink-web-component/visits/charts/DoughnutChartLegend'; +import { DoughnutChartLegend } from '../../../shlink-web-component/visits/charts/DoughnutChartLegend'; describe('', () => { const labels = ['foo', 'bar', 'baz', 'foo2', 'bar2']; diff --git a/test/visits/charts/HorizontalBarChart.test.tsx b/test/visits/charts/HorizontalBarChart.test.tsx index 11328825..b9ee8813 100644 --- a/test/visits/charts/HorizontalBarChart.test.tsx +++ b/test/visits/charts/HorizontalBarChart.test.tsx @@ -1,5 +1,5 @@ -import type { HorizontalBarChartProps } from '../../../src/shlink-web-component/visits/charts/HorizontalBarChart'; -import { HorizontalBarChart } from '../../../src/shlink-web-component/visits/charts/HorizontalBarChart'; +import type { HorizontalBarChartProps } from '../../../shlink-web-component/visits/charts/HorizontalBarChart'; +import { HorizontalBarChart } from '../../../shlink-web-component/visits/charts/HorizontalBarChart'; import { setUpCanvas } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/charts/LineChartCard.test.tsx b/test/visits/charts/LineChartCard.test.tsx index b7801517..dc1f92f0 100644 --- a/test/visits/charts/LineChartCard.test.tsx +++ b/test/visits/charts/LineChartCard.test.tsx @@ -2,8 +2,8 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { fromPartial } from '@total-typescript/shoehorn'; import { formatISO, subDays, subMonths, subYears } from 'date-fns'; -import { LineChartCard } from '../../../src/shlink-web-component/visits/charts/LineChartCard'; -import type { NormalizedVisit } from '../../../src/shlink-web-component/visits/types'; +import { LineChartCard } from '../../../shlink-web-component/visits/charts/LineChartCard'; +import type { NormalizedVisit } from '../../../shlink-web-component/visits/types'; import { setUpCanvas } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/charts/SortableBarChartCard.test.tsx b/test/visits/charts/SortableBarChartCard.test.tsx index fd51ae6e..00b48da8 100644 --- a/test/visits/charts/SortableBarChartCard.test.tsx +++ b/test/visits/charts/SortableBarChartCard.test.tsx @@ -1,8 +1,8 @@ import { screen } from '@testing-library/react'; import { range } from 'ramda'; import type { ReactNode } from 'react'; -import { SortableBarChartCard } from '../../../src/shlink-web-component/visits/charts/SortableBarChartCard'; -import type { Stats } from '../../../src/shlink-web-component/visits/types'; +import { SortableBarChartCard } from '../../../shlink-web-component/visits/charts/SortableBarChartCard'; +import type { Stats } from '../../../shlink-web-component/visits/types'; import { rangeOf } from '../../../src/utils/utils'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/visits/helpers/MapModal.test.tsx b/test/visits/helpers/MapModal.test.tsx index 066dac6c..74e3cf3a 100644 --- a/test/visits/helpers/MapModal.test.tsx +++ b/test/visits/helpers/MapModal.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; -import { MapModal } from '../../../src/shlink-web-component/visits/helpers/MapModal'; -import type { CityStats } from '../../../src/shlink-web-component/visits/types'; +import { MapModal } from '../../../shlink-web-component/visits/helpers/MapModal'; +import type { CityStats } from '../../../shlink-web-component/visits/types'; describe('', () => { const toggle = vi.fn(); diff --git a/test/visits/helpers/OpenMapModalBtn.test.tsx b/test/visits/helpers/OpenMapModalBtn.test.tsx index ad9c0083..37a401fc 100644 --- a/test/visits/helpers/OpenMapModalBtn.test.tsx +++ b/test/visits/helpers/OpenMapModalBtn.test.tsx @@ -1,7 +1,7 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { OpenMapModalBtn } from '../../../src/shlink-web-component/visits/helpers/OpenMapModalBtn'; -import type { CityStats } from '../../../src/shlink-web-component/visits/types'; +import { OpenMapModalBtn } from '../../../shlink-web-component/visits/helpers/OpenMapModalBtn'; +import type { CityStats } from '../../../shlink-web-component/visits/types'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/helpers/VisitsFilterDropdown.test.tsx b/test/visits/helpers/VisitsFilterDropdown.test.tsx index 380177f5..c2b602ef 100644 --- a/test/visits/helpers/VisitsFilterDropdown.test.tsx +++ b/test/visits/helpers/VisitsFilterDropdown.test.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; -import { VisitsFilterDropdown } from '../../../src/shlink-web-component/visits/helpers/VisitsFilterDropdown'; -import type { OrphanVisitType, VisitsFilter } from '../../../src/shlink-web-component/visits/types'; +import { VisitsFilterDropdown } from '../../../shlink-web-component/visits/helpers/VisitsFilterDropdown'; +import type { OrphanVisitType, VisitsFilter } from '../../../shlink-web-component/visits/types'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/reducers/domainVisits.test.ts b/test/visits/reducers/domainVisits.test.ts index dbf7e3d8..387947db 100644 --- a/test/visits/reducers/domainVisits.test.ts +++ b/test/visits/reducers/domainVisits.test.ts @@ -1,19 +1,19 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { addDays, formatISO, subDays } from 'date-fns'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkVisits } from '../../../src/api/types'; -import type { ShlinkState } from '../../../src/container/types'; -import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import type { ShortUrl } from '../../../shlink-web-component/short-urls/data'; import type { DomainVisits, LoadDomainVisits, -} from '../../../src/shlink-web-component/visits/reducers/domainVisits'; +} from '../../../shlink-web-component/visits/reducers/domainVisits'; import { DEFAULT_DOMAIN, domainVisitsReducerCreator, getDomainVisits as getDomainVisitsCreator, -} from '../../../src/shlink-web-component/visits/reducers/domainVisits'; -import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; -import type { Visit } from '../../../src/shlink-web-component/visits/types'; +} from '../../../shlink-web-component/visits/reducers/domainVisits'; +import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation'; +import type { Visit } from '../../../shlink-web-component/visits/types'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkVisits } from '../../../src/api/types'; +import type { ShlinkState } from '../../../src/container/types'; import { formatIsoDate } from '../../../src/utils/helpers/date'; import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; import { rangeOf } from '../../../src/utils/utils'; diff --git a/test/visits/reducers/nonOrphanVisits.test.ts b/test/visits/reducers/nonOrphanVisits.test.ts index 462e25e6..4f03494c 100644 --- a/test/visits/reducers/nonOrphanVisits.test.ts +++ b/test/visits/reducers/nonOrphanVisits.test.ts @@ -1,15 +1,15 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { addDays, formatISO, subDays } from 'date-fns'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkVisits } from '../../../src/api/types'; -import type { ShlinkState } from '../../../src/container/types'; import { getNonOrphanVisits as getNonOrphanVisitsCreator, nonOrphanVisitsReducerCreator, -} from '../../../src/shlink-web-component/visits/reducers/nonOrphanVisits'; -import type { VisitsInfo } from '../../../src/shlink-web-component/visits/reducers/types'; -import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; -import type { Visit } from '../../../src/shlink-web-component/visits/types'; +} from '../../../shlink-web-component/visits/reducers/nonOrphanVisits'; +import type { VisitsInfo } from '../../../shlink-web-component/visits/reducers/types'; +import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation'; +import type { Visit } from '../../../shlink-web-component/visits/types'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkVisits } from '../../../src/api/types'; +import type { ShlinkState } from '../../../src/container/types'; import { formatIsoDate } from '../../../src/utils/helpers/date'; import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; import { rangeOf } from '../../../src/utils/utils'; diff --git a/test/visits/reducers/orphanVisits.test.ts b/test/visits/reducers/orphanVisits.test.ts index 6dc98948..7740ec98 100644 --- a/test/visits/reducers/orphanVisits.test.ts +++ b/test/visits/reducers/orphanVisits.test.ts @@ -1,15 +1,15 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { addDays, formatISO, subDays } from 'date-fns'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkVisits } from '../../../src/api/types'; -import type { ShlinkState } from '../../../src/container/types'; import { getOrphanVisits as getOrphanVisitsCreator, orphanVisitsReducerCreator, -} from '../../../src/shlink-web-component/visits/reducers/orphanVisits'; -import type { VisitsInfo } from '../../../src/shlink-web-component/visits/reducers/types'; -import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; -import type { Visit } from '../../../src/shlink-web-component/visits/types'; +} from '../../../shlink-web-component/visits/reducers/orphanVisits'; +import type { VisitsInfo } from '../../../shlink-web-component/visits/reducers/types'; +import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation'; +import type { Visit } from '../../../shlink-web-component/visits/types'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkVisits } from '../../../src/api/types'; +import type { ShlinkState } from '../../../src/container/types'; import { formatIsoDate } from '../../../src/utils/helpers/date'; import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; import { rangeOf } from '../../../src/utils/utils'; diff --git a/test/visits/reducers/shortUrlVisits.test.ts b/test/visits/reducers/shortUrlVisits.test.ts index 4bfcd4b1..1286ebf0 100644 --- a/test/visits/reducers/shortUrlVisits.test.ts +++ b/test/visits/reducers/shortUrlVisits.test.ts @@ -1,16 +1,16 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { addDays, formatISO, subDays } from 'date-fns'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkVisits } from '../../../src/api/types'; -import type { ShlinkState } from '../../../src/container/types'; import type { - ShortUrlVisits } from '../../../src/shlink-web-component/visits/reducers/shortUrlVisits'; + ShortUrlVisits } from '../../../shlink-web-component/visits/reducers/shortUrlVisits'; import { getShortUrlVisits as getShortUrlVisitsCreator, shortUrlVisitsReducerCreator, -} from '../../../src/shlink-web-component/visits/reducers/shortUrlVisits'; -import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; -import type { Visit } from '../../../src/shlink-web-component/visits/types'; +} from '../../../shlink-web-component/visits/reducers/shortUrlVisits'; +import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation'; +import type { Visit } from '../../../shlink-web-component/visits/types'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkVisits } from '../../../src/api/types'; +import type { ShlinkState } from '../../../src/container/types'; import { formatIsoDate } from '../../../src/utils/helpers/date'; import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; import { rangeOf } from '../../../src/utils/utils'; diff --git a/test/visits/reducers/tagVisits.test.ts b/test/visits/reducers/tagVisits.test.ts index 439f9119..0f982146 100644 --- a/test/visits/reducers/tagVisits.test.ts +++ b/test/visits/reducers/tagVisits.test.ts @@ -1,16 +1,16 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { addDays, formatISO, subDays } from 'date-fns'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkVisits } from '../../../src/api/types'; -import type { ShlinkState } from '../../../src/container/types'; import type { - TagVisits } from '../../../src/shlink-web-component/visits/reducers/tagVisits'; + TagVisits } from '../../../shlink-web-component/visits/reducers/tagVisits'; import { getTagVisits as getTagVisitsCreator, tagVisitsReducerCreator, -} from '../../../src/shlink-web-component/visits/reducers/tagVisits'; -import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; -import type { Visit } from '../../../src/shlink-web-component/visits/types'; +} from '../../../shlink-web-component/visits/reducers/tagVisits'; +import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation'; +import type { Visit } from '../../../shlink-web-component/visits/types'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkVisits } from '../../../src/api/types'; +import type { ShlinkState } from '../../../src/container/types'; import { formatIsoDate } from '../../../src/utils/helpers/date'; import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; import { rangeOf } from '../../../src/utils/utils'; diff --git a/test/visits/reducers/visitCreation.test.ts b/test/visits/reducers/visitCreation.test.ts index 50916b6b..0b217641 100644 --- a/test/visits/reducers/visitCreation.test.ts +++ b/test/visits/reducers/visitCreation.test.ts @@ -1,7 +1,7 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; -import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; -import type { Visit } from '../../../src/shlink-web-component/visits/types'; +import type { ShortUrl } from '../../../shlink-web-component/short-urls/data'; +import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation'; +import type { Visit } from '../../../shlink-web-component/visits/types'; describe('visitCreationReducer', () => { describe('createNewVisits', () => { diff --git a/test/visits/reducers/visitsOverview.test.ts b/test/visits/reducers/visitsOverview.test.ts index 5f31424a..8d37633e 100644 --- a/test/visits/reducers/visitsOverview.test.ts +++ b/test/visits/reducers/visitsOverview.test.ts @@ -1,17 +1,17 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkVisitsOverview } from '../../../src/api/types'; -import type { ShlinkState } from '../../../src/container/types'; -import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; +import { createNewVisits } from '../../../shlink-web-component/visits/reducers/visitCreation'; import type { PartialVisitsSummary, VisitsOverview, -} from '../../../src/shlink-web-component/visits/reducers/visitsOverview'; +} from '../../../shlink-web-component/visits/reducers/visitsOverview'; import { loadVisitsOverview as loadVisitsOverviewCreator, visitsOverviewReducerCreator, -} from '../../../src/shlink-web-component/visits/reducers/visitsOverview'; -import type { OrphanVisit } from '../../../src/shlink-web-component/visits/types'; +} from '../../../shlink-web-component/visits/reducers/visitsOverview'; +import type { OrphanVisit } from '../../../shlink-web-component/visits/types'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkVisitsOverview } from '../../../src/api/types'; +import type { ShlinkState } from '../../../src/container/types'; describe('visitsOverviewReducer', () => { const getVisitsOverview = vi.fn(); diff --git a/test/visits/services/VisitsParser.test.ts b/test/visits/services/VisitsParser.test.ts index 90eefc48..df1e265a 100644 --- a/test/visits/services/VisitsParser.test.ts +++ b/test/visits/services/VisitsParser.test.ts @@ -1,6 +1,6 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import { normalizeVisits, processStatsFromVisits } from '../../../src/shlink-web-component/visits/services/VisitsParser'; -import type { OrphanVisit, Visit, VisitsStats } from '../../../src/shlink-web-component/visits/types'; +import { normalizeVisits, processStatsFromVisits } from '../../../shlink-web-component/visits/services/VisitsParser'; +import type { OrphanVisit, Visit, VisitsStats } from '../../../shlink-web-component/visits/types'; describe('VisitsParser', () => { const visits: Visit[] = [ diff --git a/test/visits/types/helpers.test.ts b/test/visits/types/helpers.test.ts index 15dd1c61..af187125 100644 --- a/test/visits/types/helpers.test.ts +++ b/test/visits/types/helpers.test.ts @@ -1,8 +1,8 @@ import { fromPartial } from '@total-typescript/shoehorn'; +import type { CreateVisit, OrphanVisit, VisitsParams } from '../../../shlink-web-component/visits/types'; +import type { GroupedNewVisits } from '../../../shlink-web-component/visits/types/helpers'; +import { groupNewVisitsByType, toApiParams } from '../../../shlink-web-component/visits/types/helpers'; import type { ShlinkVisitsParams } from '../../../src/api/types'; -import type { CreateVisit, OrphanVisit, VisitsParams } from '../../../src/shlink-web-component/visits/types'; -import type { GroupedNewVisits } from '../../../src/shlink-web-component/visits/types/helpers'; -import { groupNewVisitsByType, toApiParams } from '../../../src/shlink-web-component/visits/types/helpers'; import { formatIsoDate, parseDate } from '../../../src/utils/helpers/date'; describe('visitsTypeHelpers', () => {