From 1f41f8da2372a44841e029b9ca83e7d870da4e43 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 18 Feb 2023 11:11:01 +0100 Subject: [PATCH] Ordered imports alphabetically --- src/api/ShlinkApiError.tsx | 2 +- src/api/services/ShlinkApiClient.ts | 20 ++++---- src/api/services/ShlinkApiClientBuilder.ts | 4 +- src/api/types/index.ts | 4 +- src/app/App.tsx | 6 +-- src/app/services/provideServices.ts | 4 +- src/common/AppUpdateBanner.tsx | 6 +-- src/common/AsideMenu.tsx | 14 +++--- src/common/Home.tsx | 10 ++-- src/common/MainHeader.tsx | 2 +- src/common/MenuLayout.tsx | 14 +++--- src/common/ShlinkVersions.tsx | 2 +- src/common/ShlinkVersionsContainer.tsx | 2 +- src/common/SimplePaginator.tsx | 6 +-- src/common/services/ReportExporter.ts | 4 +- src/common/services/provideServices.ts | 16 +++---- src/container/index.ts | 14 +++--- src/container/store.ts | 4 +- src/container/types.ts | 10 ++-- src/domains/DomainRow.tsx | 8 ++-- src/domains/DomainSelector.tsx | 6 +-- src/domains/ManageDomains.tsx | 10 ++-- src/domains/helpers/DomainDropdown.tsx | 18 +++---- src/domains/helpers/DomainStatusIcon.tsx | 14 +++--- .../helpers/EditDomainRedirectsModal.tsx | 2 +- src/domains/reducers/domainRedirects.ts | 2 +- src/domains/reducers/domainsList.ts | 14 +++--- src/domains/services/provideServices.ts | 4 +- src/index.tsx | 8 ++-- src/mercure/helpers/boundToMercureHub.tsx | 2 +- src/mercure/reducers/mercureInfo.ts | 4 +- src/mercure/services/provideServices.ts | 2 +- src/reducers/index.ts | 6 +-- src/servers/CreateServer.tsx | 10 ++-- src/servers/DeleteServerButton.tsx | 4 +- src/servers/DeleteServerModal.tsx | 2 +- src/servers/EditServer.tsx | 4 +- src/servers/ManageServers.tsx | 14 +++--- src/servers/ManageServersRow.tsx | 8 ++-- src/servers/ManageServersRowDropdown.tsx | 12 ++--- src/servers/Overview.tsx | 16 +++---- src/servers/ServersDropdown.tsx | 6 +-- src/servers/ServersListGroup.tsx | 10 ++-- src/servers/helpers/HighlightCard.tsx | 6 +-- src/servers/helpers/ImportServersBtn.tsx | 10 ++-- src/servers/helpers/ServerError.tsx | 6 +-- src/servers/helpers/ServerForm.tsx | 2 +- src/servers/helpers/withSelectedServer.tsx | 2 +- src/servers/reducers/remoteServers.ts | 4 +- src/servers/reducers/selectedServer.ts | 6 +-- src/servers/services/ServersExporter.ts | 4 +- src/servers/services/ServersImporter.ts | 2 +- src/servers/services/provideServices.ts | 24 +++++----- src/settings/RealTimeUpdatesSettings.tsx | 8 ++-- src/settings/Settings.tsx | 2 +- src/settings/ShortUrlCreationSettings.tsx | 4 +- src/settings/ShortUrlsListSettings.tsx | 4 +- src/settings/TagsSettings.tsx | 4 +- src/settings/UserInterfaceSettings.tsx | 6 +-- src/settings/VisitsSettings.tsx | 8 ++-- src/settings/reducers/settings.ts | 6 +-- src/settings/services/provideServices.ts | 10 ++-- src/short-urls/CreateShortUrl.tsx | 2 +- src/short-urls/EditShortUrl.tsx | 16 +++---- src/short-urls/Paginator.tsx | 6 +-- src/short-urls/ShortUrlForm.tsx | 18 +++---- src/short-urls/ShortUrlsFilteringBar.tsx | 18 +++---- src/short-urls/ShortUrlsList.tsx | 26 +++++----- src/short-urls/ShortUrlsTable.tsx | 8 ++-- src/short-urls/UseExistingIfFoundInfoIcon.tsx | 2 +- src/short-urls/data/index.ts | 2 +- .../helpers/CreateShortUrlResult.tsx | 4 +- .../helpers/DeleteShortUrlModal.tsx | 12 ++--- src/short-urls/helpers/ExportShortUrlsBtn.tsx | 6 +-- src/short-urls/helpers/QrCodeModal.tsx | 14 +++--- src/short-urls/helpers/ShortUrlStatus.tsx | 10 ++-- .../helpers/ShortUrlVisitsCount.tsx | 10 ++-- src/short-urls/helpers/ShortUrlsRow.tsx | 18 +++---- src/short-urls/helpers/ShortUrlsRowMenu.tsx | 8 ++-- src/short-urls/helpers/Tags.tsx | 2 +- src/short-urls/helpers/hooks.ts | 10 ++-- src/short-urls/helpers/index.ts | 4 +- src/short-urls/reducers/shortUrlCreation.ts | 6 +-- src/short-urls/reducers/shortUrlDeletion.ts | 4 +- src/short-urls/reducers/shortUrlDetail.ts | 8 ++-- src/short-urls/reducers/shortUrlEdition.ts | 6 +-- src/short-urls/reducers/shortUrlsList.ts | 12 ++--- src/short-urls/services/provideServices.ts | 28 +++++------ src/tags/TagsList.tsx | 18 +++---- src/tags/TagsTable.tsx | 6 +-- src/tags/TagsTableRow.tsx | 12 ++--- src/tags/helpers/DeleteTagConfirmModal.tsx | 6 +-- src/tags/helpers/EditTagModal.tsx | 14 +++--- src/tags/helpers/Tag.tsx | 2 +- src/tags/helpers/TagsSelector.tsx | 4 +- src/tags/reducers/tagDelete.ts | 4 +- src/tags/reducers/tagEdit.ts | 8 ++-- src/tags/reducers/tagsList.ts | 12 ++--- src/tags/services/provideServices.ts | 10 ++-- src/utils/BooleanControl.tsx | 2 +- src/utils/CopyToClipboardIcon.tsx | 4 +- src/utils/DropdownBtnMenu.tsx | 4 +- src/utils/ExportBtn.tsx | 4 +- src/utils/InfoTooltip.tsx | 6 +-- src/utils/Message.tsx | 6 +-- src/utils/NavPills.tsx | 2 +- src/utils/OrderingDropdown.tsx | 6 +-- src/utils/Result.tsx | 2 +- src/utils/SearchField.tsx | 4 +- src/utils/SimpleCard.tsx | 2 +- src/utils/dates/DateInput.tsx | 8 ++-- src/utils/dates/DateIntervalDropdownItems.tsx | 2 +- src/utils/dates/DateRangeRow.tsx | 2 +- src/utils/dates/DateRangeSelector.tsx | 10 ++-- src/utils/dates/DateTimeInput.tsx | 4 +- src/utils/dates/Time.tsx | 2 +- src/utils/forms/InputFormGroup.tsx | 2 +- src/utils/helpers/csvjson.ts | 2 +- src/utils/helpers/dateIntervals.ts | 4 +- src/utils/helpers/hooks.ts | 2 +- src/utils/helpers/leaflet.ts | 2 +- src/utils/helpers/visits.ts | 2 +- src/utils/services/provideServices.ts | 6 +-- src/utils/table/TableOrderIcon.tsx | 2 +- src/visits/DomainVisits.tsx | 8 ++-- src/visits/NonOrphanVisits.tsx | 6 +-- src/visits/OrphanVisits.tsx | 8 ++-- src/visits/ShortUrlVisits.tsx | 10 ++-- src/visits/ShortUrlVisitsHeader.tsx | 2 +- src/visits/TagVisits.tsx | 8 ++-- src/visits/TagVisitsHeader.tsx | 2 +- src/visits/VisitsHeader.tsx | 8 ++-- src/visits/VisitsStats.tsx | 46 +++++++++--------- src/visits/VisitsTable.tsx | 12 ++--- src/visits/charts/ChartCard.tsx | 2 +- src/visits/charts/DoughnutChart.tsx | 4 +- src/visits/charts/DoughnutChartCard.tsx | 2 +- src/visits/charts/DoughnutChartLegend.tsx | 2 +- src/visits/charts/HorizontalBarChart.tsx | 8 ++-- src/visits/charts/LineChartCard.tsx | 48 +++++++++---------- src/visits/charts/SortableBarChartCard.tsx | 8 ++-- src/visits/helpers/MapModal.tsx | 8 ++-- src/visits/helpers/OpenMapModalBtn.tsx | 4 +- src/visits/helpers/VisitsFilterDropdown.tsx | 2 +- src/visits/helpers/hooks.ts | 8 ++-- src/visits/reducers/common.ts | 10 ++-- src/visits/reducers/domainVisits.ts | 2 +- src/visits/reducers/orphanVisits.ts | 4 +- src/visits/reducers/shortUrlVisits.ts | 4 +- src/visits/reducers/types/index.ts | 2 +- src/visits/reducers/visitsOverview.ts | 2 +- src/visits/services/provideServices.ts | 18 +++---- src/visits/types/helpers.ts | 2 +- test/__helpers__/setUpTest.ts | 2 +- test/api/services/ShlinkApiClient.test.ts | 4 +- .../services/ShlinkApiClientBuilder.test.ts | 4 +- test/app/App.test.tsx | 4 +- test/app/reducers/appUpdates.test.ts | 2 +- test/common/AsideMenu.test.tsx | 2 +- test/common/Home.test.tsx | 2 +- test/common/MainHeader.test.tsx | 2 +- test/common/MenuLayout.test.tsx | 2 +- test/common/ShlinkVersionsContainer.test.tsx | 2 +- test/common/reducer/sidebar.test.ts | 2 +- test/common/services/ImageDownloader.test.ts | 2 +- test/common/services/ReportExporter.test.ts | 2 +- test/domains/DomainRow.test.tsx | 2 +- test/domains/DomainSelector.test.tsx | 2 +- test/domains/ManageDomains.test.tsx | 6 +-- test/domains/helpers/DomainDropdown.test.tsx | 4 +- test/domains/reducers/domainRedirects.test.ts | 2 +- test/domains/reducers/domainsList.test.ts | 14 +++--- test/mercure/helpers/index.test.tsx | 2 +- test/mercure/reducers/mercureInfo.test.ts | 2 +- test/servers/CreateServer.test.tsx | 2 +- test/servers/DeleteServerButton.test.tsx | 4 +- test/servers/DeleteServerModal.test.tsx | 4 +- test/servers/EditServer.test.tsx | 4 +- test/servers/ManageServers.test.tsx | 6 +-- test/servers/ManageServersRow.test.tsx | 2 +- .../servers/ManageServersRowDropdown.test.tsx | 2 +- test/servers/Overview.test.tsx | 10 ++-- test/servers/ServersDropdown.test.tsx | 4 +- test/servers/ServersListGroup.test.tsx | 4 +- .../helpers/DuplicatedServersModal.test.tsx | 2 +- .../servers/helpers/ImportServersBtn.test.tsx | 2 +- test/servers/helpers/ServerError.test.tsx | 2 +- test/servers/reducers/remoteServers.test.ts | 2 +- test/servers/reducers/selectedServer.test.ts | 20 ++++---- test/servers/reducers/servers.test.ts | 14 +++--- test/servers/services/ServersImporter.test.ts | 2 +- .../settings/RealTimeUpdatesSettings.test.tsx | 2 +- test/settings/Settings.test.tsx | 2 +- .../ShortUrlCreationSettings.test.tsx | 2 +- test/settings/helpers/index.test.ts | 2 +- test/settings/reducers/settings.test.ts | 8 ++-- test/short-urls/CreateShortUrl.test.tsx | 2 +- test/short-urls/EditShortUrl.test.tsx | 4 +- test/short-urls/Paginator.test.tsx | 4 +- test/short-urls/ShortUrlForm.test.tsx | 2 +- .../short-urls/ShortUrlsFilteringBar.test.tsx | 6 +-- test/short-urls/ShortUrlsList.test.tsx | 10 ++-- test/short-urls/ShortUrlsTable.test.tsx | 4 +- .../helpers/CreateShortUrlResult.test.tsx | 4 +- .../helpers/DeleteShortUrlModal.test.tsx | 8 ++-- .../helpers/ExportShortUrlsBtn.test.tsx | 4 +- test/short-urls/helpers/QrCodeModal.test.tsx | 8 ++-- .../helpers/ShortUrlDetailLink.test.tsx | 6 +-- .../helpers/ShortUrlStatus.test.tsx | 4 +- .../helpers/ShortUrlVisitsCount.test.tsx | 2 +- test/short-urls/helpers/ShortUrlsRow.test.tsx | 16 +++---- .../helpers/ShortUrlsRowMenu.test.tsx | 4 +- .../QrErrorCorrectionDropdown.test.tsx | 2 +- .../qr-codes/QrFormatDropdown.test.tsx | 2 +- .../reducers/shortUrlCreation.test.ts | 8 ++-- .../reducers/shortUrlDeletion.test.ts | 8 ++-- .../reducers/shortUrlDetail.test.ts | 6 +-- .../reducers/shortUrlEdition.test.ts | 8 ++-- .../short-urls/reducers/shortUrlsList.test.ts | 12 ++--- test/tags/TagsList.test.tsx | 6 +-- test/tags/TagsTable.test.tsx | 6 +-- test/tags/TagsTableRow.test.tsx | 4 +- test/tags/helpers/EditTagModal.test.tsx | 4 +- test/tags/helpers/Tag.test.tsx | 4 +- test/tags/helpers/TagsSelector.test.tsx | 2 +- test/tags/reducers/tagDelete.test.ts | 2 +- test/tags/reducers/tagEdit.test.ts | 6 +-- test/tags/reducers/tagsList.test.ts | 10 ++-- test/utils/InfoTooltip.test.tsx | 2 +- test/utils/OrderingDropdown.test.tsx | 2 +- test/utils/dates/DateInput.test.tsx | 2 +- .../dates/DateIntervalDropdownItems.test.tsx | 2 +- .../utils/dates/DateIntervalSelector.test.tsx | 2 +- test/utils/helpers/dateIntervals.test.ts | 2 +- test/utils/helpers/leaflet.test.ts | 2 +- test/utils/table/TableOrderIcon.test.tsx | 2 +- test/visits/DomainVisits.test.tsx | 6 +-- test/visits/NonOrphanVisits.test.tsx | 12 ++--- test/visits/OrphanVisits.test.tsx | 12 ++--- test/visits/ShortUrlVisits.test.tsx | 16 +++---- test/visits/ShortUrlVisitsHeader.test.tsx | 4 +- test/visits/TagVisits.test.tsx | 10 ++-- test/visits/TagVisitsHeader.test.tsx | 4 +- test/visits/VisitsHeader.test.tsx | 2 +- test/visits/VisitsStats.test.tsx | 10 ++-- test/visits/VisitsTable.test.tsx | 4 +- test/visits/charts/ChartCard.test.tsx | 2 +- .../charts/DoughnutChartLegend.test.tsx | 2 +- .../charts/SortableBarChartCard.test.tsx | 4 +- .../helpers/VisitsFilterDropdown.test.tsx | 2 +- test/visits/reducers/domainVisits.test.ts | 20 ++++---- test/visits/reducers/nonOrphanVisits.test.ts | 18 +++---- test/visits/reducers/orphanVisits.test.ts | 18 +++---- test/visits/reducers/shortUrlVisits.test.ts | 16 +++---- test/visits/reducers/tagVisits.test.ts | 16 +++---- test/visits/reducers/visitCreation.test.ts | 2 +- test/visits/reducers/visitsOverview.test.ts | 10 ++-- test/visits/services/VisitsParser.test.ts | 2 +- test/visits/types/helpers.test.ts | 6 +-- 259 files changed, 853 insertions(+), 853 deletions(-) diff --git a/src/api/ShlinkApiError.tsx b/src/api/ShlinkApiError.tsx index 2277165a..057641da 100644 --- a/src/api/ShlinkApiError.tsx +++ b/src/api/ShlinkApiError.tsx @@ -1,5 +1,5 @@ -import { isInvalidArgumentError } from './utils'; import type { ProblemDetailsError } from './types/errors'; +import { isInvalidArgumentError } from './utils'; export interface ShlinkApiErrorProps { errorData?: ProblemDetailsError; diff --git a/src/api/services/ShlinkApiClient.ts b/src/api/services/ShlinkApiClient.ts index 3d160d36..56f1f34b 100644 --- a/src/api/services/ShlinkApiClient.ts +++ b/src/api/services/ShlinkApiClient.ts @@ -1,26 +1,26 @@ import { isEmpty, isNil, reject } from 'ramda'; +import type { HttpClient } from '../../common/services/HttpClient'; import type { ShortUrl, ShortUrlData } from '../../short-urls/data'; +import { orderToString } from '../../utils/helpers/ordering'; +import { stringifyQuery } from '../../utils/helpers/query'; import type { OptionalString } from '../../utils/utils'; import type { + ShlinkDomainRedirects, + ShlinkDomainsResponse, + ShlinkEditDomainRedirects, ShlinkHealth, ShlinkMercureInfo, + ShlinkShortUrlData, + ShlinkShortUrlsListNormalizedParams, + ShlinkShortUrlsListParams, ShlinkShortUrlsResponse, ShlinkTags, ShlinkTagsResponse, ShlinkVisits, - ShlinkVisitsParams, - ShlinkShortUrlData, - ShlinkDomainsResponse, ShlinkVisitsOverview, - ShlinkEditDomainRedirects, - ShlinkDomainRedirects, - ShlinkShortUrlsListParams, - ShlinkShortUrlsListNormalizedParams, + ShlinkVisitsParams, } from '../types'; -import { orderToString } from '../../utils/helpers/ordering'; import { isRegularNotFound, parseApiError } from '../utils'; -import { stringifyQuery } from '../../utils/helpers/query'; -import type { HttpClient } from '../../common/services/HttpClient'; const buildShlinkBaseUrl = (url: string, version: 2 | 3) => `${url}/rest/v${version}`; const rejectNilProps = reject(isNil); diff --git a/src/api/services/ShlinkApiClientBuilder.ts b/src/api/services/ShlinkApiClientBuilder.ts index 0bc7c98f..d5cae053 100644 --- a/src/api/services/ShlinkApiClientBuilder.ts +++ b/src/api/services/ShlinkApiClientBuilder.ts @@ -1,8 +1,8 @@ +import type { HttpClient } from '../../common/services/HttpClient'; +import type { GetState } from '../../container/types'; import type { ServerWithId } from '../../servers/data'; import { hasServerData } from '../../servers/data'; -import type { GetState } from '../../container/types'; import { ShlinkApiClient } from './ShlinkApiClient'; -import type { HttpClient } from '../../common/services/HttpClient'; const apiClients: Record = {}; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index a1c8d028..ddd3cd97 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,7 +1,7 @@ -import type { Visit } from '../../visits/types'; -import type { OptionalString } from '../../utils/utils'; import type { ShortUrl, ShortUrlMeta } from '../../short-urls/data'; import type { Order } from '../../utils/helpers/ordering'; +import type { OptionalString } from '../../utils/utils'; +import type { Visit } from '../../visits/types'; export interface ShlinkShortUrlsResponse { data: ShortUrl[]; diff --git a/src/app/App.tsx b/src/app/App.tsx index c3f68a9e..40a14f41 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -1,13 +1,13 @@ +import classNames from 'classnames'; import type { FC } from 'react'; import { useEffect } from 'react'; import { Route, Routes, useLocation } from 'react-router-dom'; -import classNames from 'classnames'; +import { AppUpdateBanner } from '../common/AppUpdateBanner'; import { NotFound } from '../common/NotFound'; import type { ServersMap } from '../servers/data'; import type { Settings } from '../settings/reducers/settings'; -import { changeThemeInMarkup } from '../utils/theme'; -import { AppUpdateBanner } from '../common/AppUpdateBanner'; import { forceUpdate } from '../utils/helpers/sw'; +import { changeThemeInMarkup } from '../utils/theme'; import './App.scss'; interface AppProps { diff --git a/src/app/services/provideServices.ts b/src/app/services/provideServices.ts index f04b87b6..884e2a56 100644 --- a/src/app/services/provideServices.ts +++ b/src/app/services/provideServices.ts @@ -1,7 +1,7 @@ import type Bottle from 'bottlejs'; -import { appUpdateAvailable, resetAppUpdate } from '../reducers/appUpdates'; -import { App } from '../App'; import type { ConnectDecorator } from '../../container/types'; +import { App } from '../App'; +import { appUpdateAvailable, resetAppUpdate } from '../reducers/appUpdates'; const provideServices = (bottle: Bottle, connect: ConnectDecorator) => { // Components diff --git a/src/common/AppUpdateBanner.tsx b/src/common/AppUpdateBanner.tsx index 553e3d8d..cb97179c 100644 --- a/src/common/AppUpdateBanner.tsx +++ b/src/common/AppUpdateBanner.tsx @@ -1,9 +1,9 @@ +import { faSyncAlt as reloadIcon } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC, MouseEventHandler } from 'react'; import { Alert, Button } from 'reactstrap'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faSyncAlt as reloadIcon } from '@fortawesome/free-solid-svg-icons'; -import { SimpleCard } from '../utils/SimpleCard'; import { useToggle } from '../utils/helpers/hooks'; +import { SimpleCard } from '../utils/SimpleCard'; import './AppUpdateBanner.scss'; interface AppUpdateBannerProps { diff --git a/src/common/AsideMenu.tsx b/src/common/AsideMenu.tsx index 25a09418..9d6d1886 100644 --- a/src/common/AsideMenu.tsx +++ b/src/common/AsideMenu.tsx @@ -1,19 +1,19 @@ import { - faList as listIcon, - faLink as createIcon, - faTags as tagsIcon, - faPen as editIcon, - faHome as overviewIcon, faGlobe as domainsIcon, + faHome as overviewIcon, + faLink as createIcon, + faList as listIcon, + faPen as editIcon, + faTags as tagsIcon, } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import classNames from 'classnames'; import type { FC } from 'react'; import type { NavLinkProps } from 'react-router-dom'; import { NavLink, useLocation } from 'react-router-dom'; -import classNames from 'classnames'; -import type { DeleteServerButtonProps } from '../servers/DeleteServerButton'; import type { SelectedServer } from '../servers/data'; import { isServerWithId } from '../servers/data'; +import type { DeleteServerButtonProps } from '../servers/DeleteServerButton'; import './AsideMenu.scss'; export interface AsideMenuProps { diff --git a/src/common/Home.tsx b/src/common/Home.tsx index 74570e2a..4029e39b 100644 --- a/src/common/Home.tsx +++ b/src/common/Home.tsx @@ -1,12 +1,12 @@ -import { useEffect } from 'react'; +import { faExternalLinkAlt, faPlus } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { isEmpty, values } from 'ramda'; +import { useEffect } from 'react'; +import { ExternalLink } from 'react-external-link'; import { Link, useNavigate } from 'react-router-dom'; import { Card, Row } from 'reactstrap'; -import { ExternalLink } from 'react-external-link'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faExternalLinkAlt, faPlus } from '@fortawesome/free-solid-svg-icons'; -import { ServersListGroup } from '../servers/ServersListGroup'; import type { ServersMap } from '../servers/data'; +import { ServersListGroup } from '../servers/ServersListGroup'; import { ShlinkLogo } from './img/ShlinkLogo'; import './Home.scss'; diff --git a/src/common/MainHeader.tsx b/src/common/MainHeader.tsx index 1d07f698..3098d4ca 100644 --- a/src/common/MainHeader.tsx +++ b/src/common/MainHeader.tsx @@ -1,10 +1,10 @@ import { faChevronDown as arrowIcon, faCogs as cogsIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import classNames from 'classnames'; import type { FC } from 'react'; import { useEffect } from 'react'; import { Link, useLocation } from 'react-router-dom'; import { Collapse, Nav, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap'; -import classNames from 'classnames'; import { useToggle } from '../utils/helpers/hooks'; import { ShlinkLogo } from './img/ShlinkLogo'; import './MainHeader.scss'; diff --git a/src/common/MenuLayout.tsx b/src/common/MenuLayout.tsx index a1c441f5..f7c3b137 100644 --- a/src/common/MenuLayout.tsx +++ b/src/common/MenuLayout.tsx @@ -1,15 +1,15 @@ -import type { FC } from 'react'; -import { useEffect } from 'react'; -import { Navigate, Route, Routes, useLocation } from 'react-router-dom'; import { faBars as burgerIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import classNames from 'classnames'; -import { withSelectedServer } from '../servers/helpers/withSelectedServer'; -import { useSwipeable, useToggle } from '../utils/helpers/hooks'; -import { supportsDomainVisits, supportsNonOrphanVisits } from '../utils/helpers/features'; +import type { FC } from 'react'; +import { useEffect } from 'react'; +import { Navigate, Route, Routes, useLocation } from 'react-router-dom'; import { isReachableServer } from '../servers/data'; -import { NotFound } from './NotFound'; +import { withSelectedServer } from '../servers/helpers/withSelectedServer'; +import { supportsDomainVisits, supportsNonOrphanVisits } from '../utils/helpers/features'; +import { useSwipeable, useToggle } from '../utils/helpers/hooks'; import type { AsideMenuProps } from './AsideMenu'; +import { NotFound } from './NotFound'; import './MenuLayout.scss'; interface MenuLayoutProps { diff --git a/src/common/ShlinkVersions.tsx b/src/common/ShlinkVersions.tsx index 18c1a6c8..dad141d5 100644 --- a/src/common/ShlinkVersions.tsx +++ b/src/common/ShlinkVersions.tsx @@ -1,8 +1,8 @@ import { pipe } from 'ramda'; import { ExternalLink } from 'react-external-link'; -import { versionToPrintable, versionToSemVer } from '../utils/helpers/version'; import type { SelectedServer } from '../servers/data'; import { isReachableServer } from '../servers/data'; +import { versionToPrintable, versionToSemVer } from '../utils/helpers/version'; const SHLINK_WEB_CLIENT_VERSION = '%_VERSION_%'; const normalizeVersion = pipe(versionToSemVer(), versionToPrintable); diff --git a/src/common/ShlinkVersionsContainer.tsx b/src/common/ShlinkVersionsContainer.tsx index d6afcf45..cdce6c3a 100644 --- a/src/common/ShlinkVersionsContainer.tsx +++ b/src/common/ShlinkVersionsContainer.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import type { SelectedServer } from '../servers/data'; -import { ShlinkVersions } from './ShlinkVersions'; import type { Sidebar } from './reducers/sidebar'; +import { ShlinkVersions } from './ShlinkVersions'; import './ShlinkVersionsContainer.scss'; export interface ShlinkVersionsContainerProps { diff --git a/src/common/SimplePaginator.tsx b/src/common/SimplePaginator.tsx index 3c3cfeab..9271bdaa 100644 --- a/src/common/SimplePaginator.tsx +++ b/src/common/SimplePaginator.tsx @@ -1,13 +1,13 @@ -import type { FC } from 'react'; import classNames from 'classnames'; +import type { FC } from 'react'; import { Pagination, PaginationItem, PaginationLink } from 'reactstrap'; import type { NumberOrEllipsis } from '../utils/helpers/pagination'; import { - pageIsEllipsis, keyForPage, - progressivePagination, + pageIsEllipsis, prettifyPageNumber, + progressivePagination, } from '../utils/helpers/pagination'; import './SimplePaginator.scss'; diff --git a/src/common/services/ReportExporter.ts b/src/common/services/ReportExporter.ts index d929b8f7..2ea0cd11 100644 --- a/src/common/services/ReportExporter.ts +++ b/src/common/services/ReportExporter.ts @@ -1,7 +1,7 @@ -import type { NormalizedVisit } from '../../visits/types'; import type { ExportableShortUrl } from '../../short-urls/data'; -import { saveCsv } from '../../utils/helpers/files'; import type { JsonToCsv } from '../../utils/helpers/csvjson'; +import { saveCsv } from '../../utils/helpers/files'; +import type { NormalizedVisit } from '../../visits/types'; export class ReportExporter { public constructor(private readonly window: Window, private readonly jsonToCsv: JsonToCsv) {} diff --git a/src/common/services/provideServices.ts b/src/common/services/provideServices.ts index 918e080f..a687eaae 100644 --- a/src/common/services/provideServices.ts +++ b/src/common/services/provideServices.ts @@ -1,17 +1,17 @@ import type Bottle from 'bottlejs'; -import { ScrollToTop } from '../ScrollToTop'; -import { MainHeader } from '../MainHeader'; -import { Home } from '../Home'; -import { MenuLayout } from '../MenuLayout'; -import { AsideMenu } from '../AsideMenu'; -import { ErrorHandler } from '../ErrorHandler'; -import { ShlinkVersionsContainer } from '../ShlinkVersionsContainer'; import type { ConnectDecorator } from '../../container/types'; import { withoutSelectedServer } from '../../servers/helpers/withoutSelectedServer'; +import { AsideMenu } from '../AsideMenu'; +import { ErrorHandler } from '../ErrorHandler'; +import { Home } from '../Home'; +import { MainHeader } from '../MainHeader'; +import { MenuLayout } from '../MenuLayout'; import { sidebarNotPresent, sidebarPresent } from '../reducers/sidebar'; +import { ScrollToTop } from '../ScrollToTop'; +import { ShlinkVersionsContainer } from '../ShlinkVersionsContainer'; +import { HttpClient } from './HttpClient'; import { ImageDownloader } from './ImageDownloader'; import { ReportExporter } from './ReportExporter'; -import { HttpClient } from './HttpClient'; const provideServices = (bottle: Bottle, connect: ConnectDecorator) => { // Services diff --git a/src/container/index.ts b/src/container/index.ts index 86ea418e..a0b79398 100644 --- a/src/container/index.ts +++ b/src/container/index.ts @@ -1,18 +1,18 @@ import type { IContainer } from 'bottlejs'; import Bottle from 'bottlejs'; -import { connect as reduxConnect } from 'react-redux'; import { pick } from 'ramda'; +import { connect as reduxConnect } from 'react-redux'; import provideApiServices from '../api/services/provideServices'; +import provideAppServices from '../app/services/provideServices'; import provideCommonServices from '../common/services/provideServices'; -import provideShortUrlsServices from '../short-urls/services/provideServices'; +import provideDomainsServices from '../domains/services/provideServices'; +import provideMercureServices from '../mercure/services/provideServices'; import provideServersServices from '../servers/services/provideServices'; -import provideVisitsServices from '../visits/services/provideServices'; +import provideSettingsServices from '../settings/services/provideServices'; +import provideShortUrlsServices from '../short-urls/services/provideServices'; import provideTagsServices from '../tags/services/provideServices'; import provideUtilsServices from '../utils/services/provideServices'; -import provideMercureServices from '../mercure/services/provideServices'; -import provideSettingsServices from '../settings/services/provideServices'; -import provideDomainsServices from '../domains/services/provideServices'; -import provideAppServices from '../app/services/provideServices'; +import provideVisitsServices from '../visits/services/provideServices'; import type { ConnectDecorator } from './types'; type LazyActionMap = Record; diff --git a/src/container/store.ts b/src/container/store.ts index 1fab3d92..25c53f0f 100644 --- a/src/container/store.ts +++ b/src/container/store.ts @@ -1,7 +1,7 @@ +import { configureStore } from '@reduxjs/toolkit'; import type { IContainer } from 'bottlejs'; import type { RLSOptions } from 'redux-localstorage-simple'; -import { save, load } from 'redux-localstorage-simple'; -import { configureStore } from '@reduxjs/toolkit'; +import { load, save } from 'redux-localstorage-simple'; import reducer from '../reducers'; import { migrateDeprecatedSettings } from '../settings/helpers'; import type { ShlinkState } from './types'; diff --git a/src/container/types.ts b/src/container/types.ts index 8013b405..eca6e21d 100644 --- a/src/container/types.ts +++ b/src/container/types.ts @@ -1,21 +1,21 @@ +import type { Sidebar } from '../common/reducers/sidebar'; +import type { DomainsList } from '../domains/reducers/domainsList'; import type { MercureInfo } from '../mercure/reducers/mercureInfo'; import type { SelectedServer, ServersMap } from '../servers/data'; import type { Settings } from '../settings/reducers/settings'; import type { ShortUrlCreation } from '../short-urls/reducers/shortUrlCreation'; import type { ShortUrlDeletion } from '../short-urls/reducers/shortUrlDeletion'; +import type { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail'; import type { ShortUrlEdition } from '../short-urls/reducers/shortUrlEdition'; import type { ShortUrlsList } from '../short-urls/reducers/shortUrlsList'; import type { TagDeletion } from '../tags/reducers/tagDelete'; import type { TagEdition } from '../tags/reducers/tagEdit'; import type { TagsList } from '../tags/reducers/tagsList'; -import type { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail'; +import type { DomainVisits } from '../visits/reducers/domainVisits'; import type { ShortUrlVisits } from '../visits/reducers/shortUrlVisits'; import type { TagVisits } from '../visits/reducers/tagVisits'; -import type { DomainsList } from '../domains/reducers/domainsList'; -import type { VisitsOverview } from '../visits/reducers/visitsOverview'; -import type { Sidebar } from '../common/reducers/sidebar'; -import type { DomainVisits } from '../visits/reducers/domainVisits'; import type { VisitsInfo } from '../visits/reducers/types'; +import type { VisitsOverview } from '../visits/reducers/visitsOverview'; export interface ShlinkState { servers: ServersMap; diff --git a/src/domains/DomainRow.tsx b/src/domains/DomainRow.tsx index 429a4ee5..464676cc 100644 --- a/src/domains/DomainRow.tsx +++ b/src/domains/DomainRow.tsx @@ -1,14 +1,14 @@ +import { faDotCircle as defaultDomainIcon } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC } from 'react'; import { useEffect } from 'react'; import { UncontrolledTooltip } from 'reactstrap'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faDotCircle as defaultDomainIcon } from '@fortawesome/free-solid-svg-icons'; import type { ShlinkDomainRedirects } from '../api/types'; -import type { OptionalString } from '../utils/utils'; import type { SelectedServer } from '../servers/data'; +import type { OptionalString } from '../utils/utils'; import type { Domain } from './data'; -import { DomainStatusIcon } from './helpers/DomainStatusIcon'; import { DomainDropdown } from './helpers/DomainDropdown'; +import { DomainStatusIcon } from './helpers/DomainStatusIcon'; import type { EditDomainRedirects } from './reducers/domainRedirects'; interface DomainRowProps { diff --git a/src/domains/DomainSelector.tsx b/src/domains/DomainSelector.tsx index 14084a79..e25442c7 100644 --- a/src/domains/DomainSelector.tsx +++ b/src/domains/DomainSelector.tsx @@ -1,9 +1,9 @@ +import { faUndo } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { isEmpty, pipe } from 'ramda'; import { useEffect } from 'react'; import type { InputProps } from 'reactstrap'; import { Button, DropdownItem, Input, InputGroup, UncontrolledTooltip } from 'reactstrap'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faUndo } from '@fortawesome/free-solid-svg-icons'; -import { isEmpty, pipe } from 'ramda'; import { DropdownBtn } from '../utils/DropdownBtn'; import { useToggle } from '../utils/helpers/hooks'; import type { DomainsList } from './reducers/domainsList'; diff --git a/src/domains/ManageDomains.tsx b/src/domains/ManageDomains.tsx index de3f9e5e..3b54e22e 100644 --- a/src/domains/ManageDomains.tsx +++ b/src/domains/ManageDomains.tsx @@ -1,14 +1,14 @@ import type { FC } from 'react'; import { useEffect } from 'react'; +import { ShlinkApiError } from '../api/ShlinkApiError'; +import type { SelectedServer } from '../servers/data'; import { Message } from '../utils/Message'; import { Result } from '../utils/Result'; -import { ShlinkApiError } from '../api/ShlinkApiError'; -import { SimpleCard } from '../utils/SimpleCard'; import { SearchField } from '../utils/SearchField'; -import type { EditDomainRedirects } from './reducers/domainRedirects'; -import type { SelectedServer } from '../servers/data'; -import type { DomainsList } from './reducers/domainsList'; +import { SimpleCard } from '../utils/SimpleCard'; import { DomainRow } from './DomainRow'; +import type { EditDomainRedirects } from './reducers/domainRedirects'; +import type { DomainsList } from './reducers/domainsList'; interface ManageDomainsProps { listDomains: Function; diff --git a/src/domains/helpers/DomainDropdown.tsx b/src/domains/helpers/DomainDropdown.tsx index b6d101fe..15fda949 100644 --- a/src/domains/helpers/DomainDropdown.tsx +++ b/src/domains/helpers/DomainDropdown.tsx @@ -1,17 +1,17 @@ -import type { FC } from 'react'; -import { DropdownItem } from 'reactstrap'; -import { Link } from 'react-router-dom'; import { faChartPie as pieChartIcon, faEdit as editIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { useToggle } from '../../utils/helpers/hooks'; -import { DropdownBtnMenu } from '../../utils/DropdownBtnMenu'; -import { EditDomainRedirectsModal } from './EditDomainRedirectsModal'; -import type { Domain } from '../data'; -import type { EditDomainRedirects } from '../reducers/domainRedirects'; -import { supportsDefaultDomainRedirectsEdition, supportsDomainVisits } from '../../utils/helpers/features'; +import type { FC } from 'react'; +import { Link } from 'react-router-dom'; +import { DropdownItem } from 'reactstrap'; import type { SelectedServer } from '../../servers/data'; import { getServerId } from '../../servers/data'; +import { DropdownBtnMenu } from '../../utils/DropdownBtnMenu'; +import { supportsDefaultDomainRedirectsEdition, supportsDomainVisits } from '../../utils/helpers/features'; +import { useToggle } from '../../utils/helpers/hooks'; import { DEFAULT_DOMAIN } from '../../visits/reducers/domainVisits'; +import type { Domain } from '../data'; +import type { EditDomainRedirects } from '../reducers/domainRedirects'; +import { EditDomainRedirectsModal } from './EditDomainRedirectsModal'; interface DomainDropdownProps { domain: Domain; diff --git a/src/domains/helpers/DomainStatusIcon.tsx b/src/domains/helpers/DomainStatusIcon.tsx index 6dba2f6c..9d7c071c 100644 --- a/src/domains/helpers/DomainStatusIcon.tsx +++ b/src/domains/helpers/DomainStatusIcon.tsx @@ -1,16 +1,16 @@ -import type { FC } from 'react'; -import { useEffect, useState } from 'react'; -import { UncontrolledTooltip } from 'reactstrap'; -import { ExternalLink } from 'react-external-link'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { - faTimes as invalidIcon, faCheck as checkIcon, faCircleNotch as loadingStatusIcon, + faTimes as invalidIcon, } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +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 type { DomainStatus } from '../data'; -import { useElementRef } from '../../utils/helpers/hooks'; interface DomainStatusIconProps { status: DomainStatus; diff --git a/src/domains/helpers/EditDomainRedirectsModal.tsx b/src/domains/helpers/EditDomainRedirectsModal.tsx index 928acfb5..726407f3 100644 --- a/src/domains/helpers/EditDomainRedirectsModal.tsx +++ b/src/domains/helpers/EditDomainRedirectsModal.tsx @@ -4,8 +4,8 @@ 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 { handleEventPreventingDefault, nonEmptyValueOrNull } from '../../utils/utils'; import { InfoTooltip } from '../../utils/InfoTooltip'; +import { handleEventPreventingDefault, nonEmptyValueOrNull } from '../../utils/utils'; import type { EditDomainRedirects } from '../reducers/domainRedirects'; interface EditDomainRedirectsModalProps { diff --git a/src/domains/reducers/domainRedirects.ts b/src/domains/reducers/domainRedirects.ts index 6f9e7e1e..c0d41459 100644 --- a/src/domains/reducers/domainRedirects.ts +++ b/src/domains/reducers/domainRedirects.ts @@ -1,6 +1,6 @@ -import { createAsyncThunk } from '../../utils/helpers/redux'; import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import type { ShlinkDomainRedirects } from '../../api/types'; +import { createAsyncThunk } from '../../utils/helpers/redux'; const EDIT_DOMAIN_REDIRECTS = 'shlink/domainRedirects/EDIT_DOMAIN_REDIRECTS'; diff --git a/src/domains/reducers/domainsList.ts b/src/domains/reducers/domainsList.ts index a4eeaec3..1a9cdb6b 100644 --- a/src/domains/reducers/domainsList.ts +++ b/src/domains/reducers/domainsList.ts @@ -1,13 +1,13 @@ -import type { SliceCaseReducers, AsyncThunk } from '@reduxjs/toolkit'; -import { createSlice, createAction } from '@reduxjs/toolkit'; -import { createAsyncThunk } from '../../utils/helpers/redux'; -import type { ShlinkDomainRedirects } from '../../api/types'; +import type { AsyncThunk, SliceCaseReducers } from '@reduxjs/toolkit'; +import { createAction, createSlice } from '@reduxjs/toolkit'; import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import type { Domain, DomainStatus } from '../data'; -import { hasServerData } from '../../servers/data'; -import { replaceAuthorityFromUri } from '../../utils/helpers/uri'; +import type { ShlinkDomainRedirects } from '../../api/types'; import type { ProblemDetailsError } from '../../api/types/errors'; import { parseApiError } from '../../api/utils'; +import { hasServerData } from '../../servers/data'; +import { createAsyncThunk } from '../../utils/helpers/redux'; +import { replaceAuthorityFromUri } from '../../utils/helpers/uri'; +import type { Domain, DomainStatus } from '../data'; import type { EditDomainRedirects } from './domainRedirects'; const REDUCER_PREFIX = 'shlink/domainsList'; diff --git a/src/domains/services/provideServices.ts b/src/domains/services/provideServices.ts index 66dbc06a..0a0299d7 100644 --- a/src/domains/services/provideServices.ts +++ b/src/domains/services/provideServices.ts @@ -1,10 +1,10 @@ -import { prop } from 'ramda'; import type Bottle from 'bottlejs'; +import { prop } from 'ramda'; import type { ConnectDecorator } from '../../container/types'; -import { domainsListReducerCreator } from '../reducers/domainsList'; import { DomainSelector } from '../DomainSelector'; import { ManageDomains } from '../ManageDomains'; import { editDomainRedirects } from '../reducers/domainRedirects'; +import { domainsListReducerCreator } from '../reducers/domainsList'; const provideServices = (bottle: Bottle, connect: ConnectDecorator) => { // Components diff --git a/src/index.tsx b/src/index.tsx index e8d471c2..b22c7ac7 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,15 +1,15 @@ +import 'chart.js/auto'; // TODO Import specific ones to reduce bundle size https://react-chartjs-2.js.org/docs/migration-to-v4/#tree-shaking import { createRoot } from 'react-dom/client'; import { Provider } from 'react-redux'; import { BrowserRouter } from 'react-router-dom'; import pack from '../package.json'; import { container } from './container'; import { setUpStore } from './container/store'; -import { fixLeafletIcons } from './utils/helpers/leaflet'; import { register as registerServiceWorker } from './serviceWorkerRegistration'; -import 'chart.js/auto'; // TODO Import specific ones to reduce bundle size https://react-chartjs-2.js.org/docs/migration-to-v4/#tree-shaking -import 'react-datepicker/dist/react-datepicker.css'; -import 'leaflet/dist/leaflet.css'; +import { fixLeafletIcons } from './utils/helpers/leaflet'; import './index.scss'; +import 'leaflet/dist/leaflet.css'; +import 'react-datepicker/dist/react-datepicker.css'; // This overwrites icons used for leaflet maps, fixing some issues caused by webpack while processing the CSS fixLeafletIcons(); diff --git a/src/mercure/helpers/boundToMercureHub.tsx b/src/mercure/helpers/boundToMercureHub.tsx index 9334a754..854c9a4c 100644 --- a/src/mercure/helpers/boundToMercureHub.tsx +++ b/src/mercure/helpers/boundToMercureHub.tsx @@ -1,6 +1,6 @@ +import { pipe } from 'ramda'; import type { FC } from 'react'; import { useEffect } from 'react'; -import { pipe } from 'ramda'; import { useParams } from 'react-router-dom'; import type { CreateVisit } from '../../visits/types'; import type { MercureInfo } from '../reducers/mercureInfo'; diff --git a/src/mercure/reducers/mercureInfo.ts b/src/mercure/reducers/mercureInfo.ts index 6b704e79..6b3898fe 100644 --- a/src/mercure/reducers/mercureInfo.ts +++ b/src/mercure/reducers/mercureInfo.ts @@ -1,7 +1,7 @@ import { createSlice } from '@reduxjs/toolkit'; -import { createAsyncThunk } from '../../utils/helpers/redux'; -import type { ShlinkMercureInfo } from '../../api/types'; import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkMercureInfo } from '../../api/types'; +import { createAsyncThunk } from '../../utils/helpers/redux'; const REDUCER_PREFIX = 'shlink/mercure'; diff --git a/src/mercure/services/provideServices.ts b/src/mercure/services/provideServices.ts index 07e3c18f..f665dc31 100644 --- a/src/mercure/services/provideServices.ts +++ b/src/mercure/services/provideServices.ts @@ -1,5 +1,5 @@ -import { prop } from 'ramda'; import type Bottle from 'bottlejs'; +import { prop } from 'ramda'; import { mercureInfoReducerCreator } from '../reducers/mercureInfo'; const provideServices = (bottle: Bottle) => { diff --git a/src/reducers/index.ts b/src/reducers/index.ts index 23b9732c..be3cd0d6 100644 --- a/src/reducers/index.ts +++ b/src/reducers/index.ts @@ -1,10 +1,10 @@ -import type { IContainer } from 'bottlejs'; import { combineReducers } from '@reduxjs/toolkit'; -import { serversReducer } from '../servers/reducers/servers'; -import { settingsReducer } from '../settings/reducers/settings'; +import type { IContainer } from 'bottlejs'; import { appUpdatesReducer } from '../app/reducers/appUpdates'; import { sidebarReducer } from '../common/reducers/sidebar'; import type { ShlinkState } from '../container/types'; +import { serversReducer } from '../servers/reducers/servers'; +import { settingsReducer } from '../settings/reducers/settings'; export default (container: IContainer) => combineReducers({ servers: serversReducer, diff --git a/src/servers/CreateServer.tsx b/src/servers/CreateServer.tsx index 754cb6eb..9de1ab6f 100644 --- a/src/servers/CreateServer.tsx +++ b/src/servers/CreateServer.tsx @@ -1,16 +1,16 @@ import type { FC } from 'react'; import { useEffect, useState } from 'react'; -import { v4 as uuid } from 'uuid'; -import { Button } from 'reactstrap'; import { useNavigate } from 'react-router-dom'; -import { Result } from '../utils/Result'; +import { Button } from 'reactstrap'; +import { v4 as uuid } from 'uuid'; import { NoMenuLayout } from '../common/NoMenuLayout'; import type { TimeoutToggle } from '../utils/helpers/hooks'; import { useGoBack, useToggle } from '../utils/helpers/hooks'; -import { ServerForm } from './helpers/ServerForm'; -import type { ImportServersBtnProps } from './helpers/ImportServersBtn'; +import { Result } from '../utils/Result'; import type { ServerData, ServersMap, ServerWithId } from './data'; import { DuplicatedServersModal } from './helpers/DuplicatedServersModal'; +import type { ImportServersBtnProps } from './helpers/ImportServersBtn'; +import { ServerForm } from './helpers/ServerForm'; const SHOW_IMPORT_MSG_TIME = 4000; diff --git a/src/servers/DeleteServerButton.tsx b/src/servers/DeleteServerButton.tsx index 29b31ca6..6b931bad 100644 --- a/src/servers/DeleteServerButton.tsx +++ b/src/servers/DeleteServerButton.tsx @@ -1,9 +1,9 @@ -import type { FC, PropsWithChildren } from 'react'; import { faMinusCircle as deleteIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import type { FC, PropsWithChildren } from 'react'; import { useToggle } from '../utils/helpers/hooks'; -import type { DeleteServerModalProps } from './DeleteServerModal'; import type { ServerWithId } from './data'; +import type { DeleteServerModalProps } from './DeleteServerModal'; export type DeleteServerButtonProps = PropsWithChildren<{ server: ServerWithId; diff --git a/src/servers/DeleteServerModal.tsx b/src/servers/DeleteServerModal.tsx index 1ef0284c..e7bff9b3 100644 --- a/src/servers/DeleteServerModal.tsx +++ b/src/servers/DeleteServerModal.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import { useRef } from 'react'; -import { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; import { useNavigate } from 'react-router-dom'; +import { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; import type { ServerWithId } from './data'; export interface DeleteServerModalProps { diff --git a/src/servers/EditServer.tsx b/src/servers/EditServer.tsx index 4ce07501..b24a961e 100644 --- a/src/servers/EditServer.tsx +++ b/src/servers/EditServer.tsx @@ -2,10 +2,10 @@ import type { FC } from 'react'; import { Button } from 'reactstrap'; import { NoMenuLayout } from '../common/NoMenuLayout'; import { useGoBack, useParsedQuery } from '../utils/helpers/hooks'; -import { ServerForm } from './helpers/ServerForm'; -import { withSelectedServer } from './helpers/withSelectedServer'; import type { ServerData } from './data'; import { isServerWithId } from './data'; +import { ServerForm } from './helpers/ServerForm'; +import { withSelectedServer } from './helpers/withSelectedServer'; interface EditServerProps { editServer: (serverId: string, serverData: ServerData) => void; diff --git a/src/servers/ManageServers.tsx b/src/servers/ManageServers.tsx index 4c6c9c42..3afabfcd 100644 --- a/src/servers/ManageServers.tsx +++ b/src/servers/ManageServers.tsx @@ -1,16 +1,16 @@ -import type { FC } from 'react'; -import { useEffect, useState } from 'react'; -import { Button, Row } from 'reactstrap'; import { faFileDownload as exportIcon, faPlus as plusIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import type { FC } from 'react'; +import { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; +import { Button, Row } from 'reactstrap'; import { NoMenuLayout } from '../common/NoMenuLayout'; -import { SimpleCard } from '../utils/SimpleCard'; -import { SearchField } from '../utils/SearchField'; -import { Result } from '../utils/Result'; import type { TimeoutToggle } from '../utils/helpers/hooks'; -import type { ImportServersBtnProps } from './helpers/ImportServersBtn'; +import { Result } from '../utils/Result'; +import { SearchField } from '../utils/SearchField'; +import { SimpleCard } from '../utils/SimpleCard'; import type { ServersMap } from './data'; +import type { ImportServersBtnProps } from './helpers/ImportServersBtn'; import type { ManageServersRowProps } from './ManageServersRow'; import type ServersExporter from './services/ServersExporter'; diff --git a/src/servers/ManageServersRow.tsx b/src/servers/ManageServersRow.tsx index 913fb21f..89291a48 100644 --- a/src/servers/ManageServersRow.tsx +++ b/src/servers/ManageServersRow.tsx @@ -1,8 +1,8 @@ -import type { FC } from 'react'; -import { UncontrolledTooltip } from 'reactstrap'; -import { Link } from 'react-router-dom'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCheck as checkIcon } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import type { FC } from 'react'; +import { Link } from 'react-router-dom'; +import { UncontrolledTooltip } from 'reactstrap'; import type { ServerWithId } from './data'; import type { ManageServersRowDropdownProps } from './ManageServersRowDropdown'; diff --git a/src/servers/ManageServersRowDropdown.tsx b/src/servers/ManageServersRowDropdown.tsx index 0a4f7d0c..357c0126 100644 --- a/src/servers/ManageServersRowDropdown.tsx +++ b/src/servers/ManageServersRowDropdown.tsx @@ -1,18 +1,18 @@ -import type { FC } from 'react'; -import { DropdownItem } from 'reactstrap'; -import { Link } from 'react-router-dom'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faCircle as toggleOnIcon } from '@fortawesome/free-regular-svg-icons'; import { faBan as toggleOffIcon, faEdit as editIcon, faMinusCircle as deleteIcon, faPlug as connectIcon, } from '@fortawesome/free-solid-svg-icons'; -import { faCircle as toggleOnIcon } from '@fortawesome/free-regular-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import type { FC } from 'react'; +import { Link } from 'react-router-dom'; +import { DropdownItem } from 'reactstrap'; import { DropdownBtnMenu } from '../utils/DropdownBtnMenu'; import { useToggle } from '../utils/helpers/hooks'; -import type { DeleteServerModalProps } from './DeleteServerModal'; import type { ServerWithId } from './data'; +import type { DeleteServerModalProps } from './DeleteServerModal'; export interface ManageServersRowDropdownProps { server: ServerWithId; diff --git a/src/servers/Overview.tsx b/src/servers/Overview.tsx index d7c52b22..dfd39808 100644 --- a/src/servers/Overview.tsx +++ b/src/servers/Overview.tsx @@ -1,18 +1,18 @@ import type { FC } from 'react'; import { useEffect } from 'react'; -import { Card, CardBody, CardHeader, Row } from 'reactstrap'; import { Link, useNavigate } from 'react-router-dom'; +import { Card, CardBody, CardHeader, Row } from 'reactstrap'; +import type { ShlinkShortUrlsListParams } from '../api/types'; +import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; +import { Topics } from '../mercure/helpers/Topics'; +import type { CreateShortUrlProps } from '../short-urls/CreateShortUrl'; import type { ShortUrlsList as ShortUrlsListState } from '../short-urls/reducers/shortUrlsList'; import { ITEMS_IN_OVERVIEW_PAGE } from '../short-urls/reducers/shortUrlsList'; -import { prettify } from '../utils/helpers/numbers'; -import type { TagsList } from '../tags/reducers/tagsList'; import type { ShortUrlsTableType } from '../short-urls/ShortUrlsTable'; -import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; -import type { CreateShortUrlProps } from '../short-urls/CreateShortUrl'; -import type { VisitsOverview } from '../visits/reducers/visitsOverview'; -import { Topics } from '../mercure/helpers/Topics'; -import type { ShlinkShortUrlsListParams } from '../api/types'; +import type { TagsList } from '../tags/reducers/tagsList'; import { supportsNonOrphanVisits } from '../utils/helpers/features'; +import { prettify } from '../utils/helpers/numbers'; +import type { VisitsOverview } from '../visits/reducers/visitsOverview'; import type { SelectedServer } from './data'; import { getServerId } from './data'; import { HighlightCard } from './helpers/HighlightCard'; diff --git a/src/servers/ServersDropdown.tsx b/src/servers/ServersDropdown.tsx index b50e087f..934e8206 100644 --- a/src/servers/ServersDropdown.tsx +++ b/src/servers/ServersDropdown.tsx @@ -1,8 +1,8 @@ -import { isEmpty, values } from 'ramda'; -import { DropdownItem, DropdownMenu, DropdownToggle, UncontrolledDropdown } from 'reactstrap'; -import { Link } from 'react-router-dom'; import { faPlus as plusIcon, faServer as serverIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { isEmpty, values } from 'ramda'; +import { Link } from 'react-router-dom'; +import { DropdownItem, DropdownMenu, DropdownToggle, UncontrolledDropdown } from 'reactstrap'; import type { SelectedServer, ServersMap } from './data'; import { getServerId } from './data'; diff --git a/src/servers/ServersListGroup.tsx b/src/servers/ServersListGroup.tsx index 0e3944b4..b9fd3f41 100644 --- a/src/servers/ServersListGroup.tsx +++ b/src/servers/ServersListGroup.tsx @@ -1,9 +1,9 @@ -import type { FC, PropsWithChildren } from 'react'; -import { ListGroup, ListGroupItem } from 'reactstrap'; -import { Link } from 'react-router-dom'; -import classNames from 'classnames'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faChevronRight as chevronIcon } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import classNames from 'classnames'; +import type { FC, PropsWithChildren } from 'react'; +import { Link } from 'react-router-dom'; +import { ListGroup, ListGroupItem } from 'reactstrap'; import type { ServerWithId } from './data'; import './ServersListGroup.scss'; diff --git a/src/servers/helpers/HighlightCard.tsx b/src/servers/helpers/HighlightCard.tsx index ea6bf908..a272be9a 100644 --- a/src/servers/helpers/HighlightCard.tsx +++ b/src/servers/helpers/HighlightCard.tsx @@ -1,8 +1,8 @@ -import type { FC, PropsWithChildren } from 'react'; -import { Card, CardText, CardTitle } from 'reactstrap'; -import { Link } from 'react-router-dom'; import { faArrowAltCircleRight as linkIcon } from '@fortawesome/free-regular-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import type { FC, PropsWithChildren } from 'react'; +import { Link } from 'react-router-dom'; +import { Card, CardText, CardTitle } from 'reactstrap'; import './HighlightCard.scss'; export type HighlightCardProps = PropsWithChildren<{ diff --git a/src/servers/helpers/ImportServersBtn.tsx b/src/servers/helpers/ImportServersBtn.tsx index d163b6d3..b6b0cf41 100644 --- a/src/servers/helpers/ImportServersBtn.tsx +++ b/src/servers/helpers/ImportServersBtn.tsx @@ -1,12 +1,12 @@ -import type { ChangeEvent, FC, PropsWithChildren } from 'react'; -import { useState, useEffect } from 'react'; -import { Button, UncontrolledTooltip } from 'reactstrap'; -import { complement, pipe } from 'ramda'; import { faFileUpload as importIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { complement, pipe } from 'ramda'; +import type { ChangeEvent, FC, PropsWithChildren } from 'react'; +import { useEffect, useState } from 'react'; +import { Button, UncontrolledTooltip } from 'reactstrap'; import { useElementRef, useToggle } from '../../utils/helpers/hooks'; -import type { ServersImporter } from '../services/ServersImporter'; import type { ServerData, ServersMap } from '../data'; +import type { ServersImporter } from '../services/ServersImporter'; import { DuplicatedServersModal } from './DuplicatedServersModal'; import './ImportServersBtn.scss'; diff --git a/src/servers/helpers/ServerError.tsx b/src/servers/helpers/ServerError.tsx index 51ece6e1..15fc2493 100644 --- a/src/servers/helpers/ServerError.tsx +++ b/src/servers/helpers/ServerError.tsx @@ -1,11 +1,11 @@ import type { FC } from 'react'; import { Link } from 'react-router-dom'; +import { NoMenuLayout } from '../../common/NoMenuLayout'; import { Message } from '../../utils/Message'; -import { ServersListGroup } from '../ServersListGroup'; -import type { DeleteServerButtonProps } from '../DeleteServerButton'; import type { SelectedServer, ServersMap } from '../data'; import { isServerWithId } from '../data'; -import { NoMenuLayout } from '../../common/NoMenuLayout'; +import type { DeleteServerButtonProps } from '../DeleteServerButton'; +import { ServersListGroup } from '../ServersListGroup'; import './ServerError.scss'; interface ServerErrorProps { diff --git a/src/servers/helpers/ServerForm.tsx b/src/servers/helpers/ServerForm.tsx index 54376e86..f06dec56 100644 --- a/src/servers/helpers/ServerForm.tsx +++ b/src/servers/helpers/ServerForm.tsx @@ -1,9 +1,9 @@ import type { FC, PropsWithChildren, ReactNode } from 'react'; import { useEffect, useState } from 'react'; import { InputFormGroup } from '../../utils/forms/InputFormGroup'; +import { SimpleCard } from '../../utils/SimpleCard'; import { handleEventPreventingDefault } from '../../utils/utils'; import type { ServerData } from '../data'; -import { SimpleCard } from '../../utils/SimpleCard'; type ServerFormProps = PropsWithChildren<{ onSubmit: (server: ServerData) => void; diff --git a/src/servers/helpers/withSelectedServer.tsx b/src/servers/helpers/withSelectedServer.tsx index e5859e11..8f28b9bd 100644 --- a/src/servers/helpers/withSelectedServer.tsx +++ b/src/servers/helpers/withSelectedServer.tsx @@ -1,10 +1,10 @@ import type { FC } from 'react'; import { useEffect } from 'react'; import { useParams } from 'react-router-dom'; +import { NoMenuLayout } from '../../common/NoMenuLayout'; import { Message } from '../../utils/Message'; import type { SelectedServer } from '../data'; import { isNotFoundServer } from '../data'; -import { NoMenuLayout } from '../../common/NoMenuLayout'; interface WithSelectedServerProps { selectServer: (serverId: string) => void; diff --git a/src/servers/reducers/remoteServers.ts b/src/servers/reducers/remoteServers.ts index ec584527..a1995d71 100644 --- a/src/servers/reducers/remoteServers.ts +++ b/src/servers/reducers/remoteServers.ts @@ -1,9 +1,9 @@ import pack from '../../../package.json'; +import type { HttpClient } from '../../common/services/HttpClient'; +import { createAsyncThunk } from '../../utils/helpers/redux'; import type { ServerData } from '../data'; import { hasServerData } from '../data'; import { createServers } from './servers'; -import { createAsyncThunk } from '../../utils/helpers/redux'; -import type { HttpClient } from '../../common/services/HttpClient'; const responseToServersList = (data: any): ServerData[] => (Array.isArray(data) ? data.filter(hasServerData) : []); diff --git a/src/servers/reducers/selectedServer.ts b/src/servers/reducers/selectedServer.ts index 341b42a5..6469296b 100644 --- a/src/servers/reducers/selectedServer.ts +++ b/src/servers/reducers/selectedServer.ts @@ -1,12 +1,12 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createAction, createListenerMiddleware, createSlice } from '@reduxjs/toolkit'; import { memoizeWith, pipe } from 'ramda'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkHealth } from '../../api/types'; +import { createAsyncThunk } from '../../utils/helpers/redux'; import { versionToPrintable, versionToSemVer as toSemVer } from '../../utils/helpers/version'; import type { SelectedServer, ServerWithId } from '../data'; import { isReachableServer } from '../data'; -import type { ShlinkHealth } from '../../api/types'; -import { createAsyncThunk } from '../../utils/helpers/redux'; -import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; const REDUCER_PREFIX = 'shlink/selectedServer'; diff --git a/src/servers/services/ServersExporter.ts b/src/servers/services/ServersExporter.ts index e12ba7e0..5d64de66 100644 --- a/src/servers/services/ServersExporter.ts +++ b/src/servers/services/ServersExporter.ts @@ -1,9 +1,9 @@ import { values } from 'ramda'; +import type { JsonToCsv } from '../../utils/helpers/csvjson'; +import { saveCsv } from '../../utils/helpers/files'; import type { LocalStorage } from '../../utils/services/LocalStorage'; import type { ServersMap } from '../data'; import { serverWithIdToServerData } from '../data'; -import { saveCsv } from '../../utils/helpers/files'; -import type { JsonToCsv } from '../../utils/helpers/csvjson'; const SERVERS_FILENAME = 'shlink-servers.csv'; diff --git a/src/servers/services/ServersImporter.ts b/src/servers/services/ServersImporter.ts index 1705a89d..2d47b7b5 100644 --- a/src/servers/services/ServersImporter.ts +++ b/src/servers/services/ServersImporter.ts @@ -1,5 +1,5 @@ -import type { ServerData } from '../data'; import type { CsvToJson } from '../../utils/helpers/csvjson'; +import type { ServerData } from '../data'; const validateServer = (server: any): server is ServerData => typeof server.url === 'string' && typeof server.apiKey === 'string' && typeof server.name === 'string'; diff --git a/src/servers/services/provideServices.ts b/src/servers/services/provideServices.ts index b01905ba..8535a85b 100644 --- a/src/servers/services/provideServices.ts +++ b/src/servers/services/provideServices.ts @@ -1,11 +1,18 @@ -import { prop } from 'ramda'; import type Bottle from 'bottlejs'; +import { prop } from 'ramda'; +import type { ConnectDecorator } from '../../container/types'; import { CreateServer } from '../CreateServer'; -import { ServersDropdown } from '../ServersDropdown'; -import { DeleteServerModal } from '../DeleteServerModal'; import { DeleteServerButton } from '../DeleteServerButton'; +import { DeleteServerModal } from '../DeleteServerModal'; import { EditServer } from '../EditServer'; import { ImportServersBtn } from '../helpers/ImportServersBtn'; +import { ServerError } from '../helpers/ServerError'; +import { withoutSelectedServer } from '../helpers/withoutSelectedServer'; +import { ManageServers } from '../ManageServers'; +import { ManageServersRow } from '../ManageServersRow'; +import { ManageServersRowDropdown } from '../ManageServersRowDropdown'; +import { Overview } from '../Overview'; +import { fetchServers } from '../reducers/remoteServers'; import { resetSelectedServer, selectedServerReducerCreator, @@ -13,16 +20,9 @@ import { selectServerListener, } from '../reducers/selectedServer'; import { createServers, deleteServer, editServer, setAutoConnect } from '../reducers/servers'; -import { fetchServers } from '../reducers/remoteServers'; -import { ServerError } from '../helpers/ServerError'; -import type { ConnectDecorator } from '../../container/types'; -import { withoutSelectedServer } from '../helpers/withoutSelectedServer'; -import { Overview } from '../Overview'; -import { ManageServers } from '../ManageServers'; -import { ManageServersRow } from '../ManageServersRow'; -import { ManageServersRowDropdown } from '../ManageServersRowDropdown'; -import { ServersImporter } from './ServersImporter'; +import { ServersDropdown } from '../ServersDropdown'; import ServersExporter from './ServersExporter'; +import { ServersImporter } from './ServersImporter'; const provideServices = (bottle: Bottle, connect: ConnectDecorator) => { // Components diff --git a/src/settings/RealTimeUpdatesSettings.tsx b/src/settings/RealTimeUpdatesSettings.tsx index 20eacf3c..99be265f 100644 --- a/src/settings/RealTimeUpdatesSettings.tsx +++ b/src/settings/RealTimeUpdatesSettings.tsx @@ -1,11 +1,11 @@ -import { FormGroup, Input } from 'reactstrap'; import classNames from 'classnames'; -import { ToggleSwitch } from '../utils/ToggleSwitch'; -import { SimpleCard } from '../utils/SimpleCard'; +import { FormGroup, Input } from 'reactstrap'; import { FormText } from '../utils/forms/FormText'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; -import type { Settings } from './reducers/settings'; import { useDomId } from '../utils/helpers/hooks'; +import { SimpleCard } from '../utils/SimpleCard'; +import { ToggleSwitch } from '../utils/ToggleSwitch'; +import type { Settings } from './reducers/settings'; interface RealTimeUpdatesProps { settings: Settings; diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index d83428cc..cf39be3c 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -1,5 +1,5 @@ import type { FC, ReactNode } from 'react'; -import { Navigate, Routes, Route } from 'react-router-dom'; +import { Navigate, Route, Routes } from 'react-router-dom'; import { NoMenuLayout } from '../common/NoMenuLayout'; import { NavPillItem, NavPills } from '../utils/NavPills'; diff --git a/src/settings/ShortUrlCreationSettings.tsx b/src/settings/ShortUrlCreationSettings.tsx index 1fbffdcf..736c032a 100644 --- a/src/settings/ShortUrlCreationSettings.tsx +++ b/src/settings/ShortUrlCreationSettings.tsx @@ -1,10 +1,10 @@ import type { FC, ReactNode } from 'react'; import { DropdownItem, FormGroup } from 'reactstrap'; -import { SimpleCard } from '../utils/SimpleCard'; -import { ToggleSwitch } from '../utils/ToggleSwitch'; import { DropdownBtn } from '../utils/DropdownBtn'; import { FormText } from '../utils/forms/FormText'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; +import { SimpleCard } from '../utils/SimpleCard'; +import { ToggleSwitch } from '../utils/ToggleSwitch'; import type { Settings, ShortUrlCreationSettings as ShortUrlsSettings, TagFilteringMode } from './reducers/settings'; interface ShortUrlCreationProps { diff --git a/src/settings/ShortUrlsListSettings.tsx b/src/settings/ShortUrlsListSettings.tsx index 57ef8751..802d26cd 100644 --- a/src/settings/ShortUrlsListSettings.tsx +++ b/src/settings/ShortUrlsListSettings.tsx @@ -1,8 +1,8 @@ import type { FC } from 'react'; -import { OrderingDropdown } from '../utils/OrderingDropdown'; import { SHORT_URLS_ORDERABLE_FIELDS } from '../short-urls/data'; -import { SimpleCard } from '../utils/SimpleCard'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; +import { OrderingDropdown } from '../utils/OrderingDropdown'; +import { SimpleCard } from '../utils/SimpleCard'; import type { Settings, ShortUrlsListSettings as ShortUrlsSettings } from './reducers/settings'; import { DEFAULT_SHORT_URLS_ORDERING } from './reducers/settings'; diff --git a/src/settings/TagsSettings.tsx b/src/settings/TagsSettings.tsx index 46dd5fc3..ae3f395b 100644 --- a/src/settings/TagsSettings.tsx +++ b/src/settings/TagsSettings.tsx @@ -1,8 +1,8 @@ import type { FC } from 'react'; -import { SimpleCard } from '../utils/SimpleCard'; -import { OrderingDropdown } from '../utils/OrderingDropdown'; import { TAGS_ORDERABLE_FIELDS } from '../tags/data/TagsListChildrenProps'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; +import { OrderingDropdown } from '../utils/OrderingDropdown'; +import { SimpleCard } from '../utils/SimpleCard'; import type { Settings, TagsSettings as TagsSettingsOptions } from './reducers/settings'; interface TagsProps { diff --git a/src/settings/UserInterfaceSettings.tsx b/src/settings/UserInterfaceSettings.tsx index 93ceb9bd..a2be2fdc 100644 --- a/src/settings/UserInterfaceSettings.tsx +++ b/src/settings/UserInterfaceSettings.tsx @@ -1,10 +1,10 @@ -import type { FC } from 'react'; +import { faMoon, faSun } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faSun, faMoon } from '@fortawesome/free-solid-svg-icons'; +import type { FC } from 'react'; import { SimpleCard } from '../utils/SimpleCard'; -import { ToggleSwitch } from '../utils/ToggleSwitch'; import type { Theme } from '../utils/theme'; import { changeThemeInMarkup } from '../utils/theme'; +import { ToggleSwitch } from '../utils/ToggleSwitch'; import type { Settings, UiSettings } from './reducers/settings'; import './UserInterfaceSettings.scss'; diff --git a/src/settings/VisitsSettings.tsx b/src/settings/VisitsSettings.tsx index 3d1cc951..10dcba71 100644 --- a/src/settings/VisitsSettings.tsx +++ b/src/settings/VisitsSettings.tsx @@ -1,12 +1,12 @@ import type { FC } from 'react'; import { FormGroup } from 'reactstrap'; -import { SimpleCard } from '../utils/SimpleCard'; import { DateIntervalSelector } from '../utils/dates/DateIntervalSelector'; -import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; -import type { Settings, VisitsSettings as VisitsSettingsConfig } from './reducers/settings'; -import { ToggleSwitch } from '../utils/ToggleSwitch'; import { FormText } from '../utils/forms/FormText'; +import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; import type { DateInterval } from '../utils/helpers/dateIntervals'; +import { SimpleCard } from '../utils/SimpleCard'; +import { ToggleSwitch } from '../utils/ToggleSwitch'; +import type { Settings, VisitsSettings as VisitsSettingsConfig } from './reducers/settings'; interface VisitsProps { settings: Settings; diff --git a/src/settings/reducers/settings.ts b/src/settings/reducers/settings.ts index 35d0ee72..fac7e151 100644 --- a/src/settings/reducers/settings.ts +++ b/src/settings/reducers/settings.ts @@ -1,10 +1,10 @@ import type { PayloadAction, PrepareAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; import { mergeDeepRight } from 'ramda'; -import type { Theme } from '../../utils/theme'; -import type { DateInterval } from '../../utils/helpers/dateIntervals'; -import type { TagsOrder } from '../../tags/data/TagsListChildrenProps'; import type { ShortUrlsOrder } from '../../short-urls/data'; +import type { TagsOrder } from '../../tags/data/TagsListChildrenProps'; +import type { DateInterval } from '../../utils/helpers/dateIntervals'; +import type { Theme } from '../../utils/theme'; export const DEFAULT_SHORT_URLS_ORDERING: ShortUrlsOrder = { field: 'dateCreated', diff --git a/src/settings/services/provideServices.ts b/src/settings/services/provideServices.ts index 723ca573..7448a2f9 100644 --- a/src/settings/services/provideServices.ts +++ b/src/settings/services/provideServices.ts @@ -1,6 +1,7 @@ import type Bottle from 'bottlejs'; +import type { ConnectDecorator } from '../../container/types'; +import { withoutSelectedServer } from '../../servers/helpers/withoutSelectedServer'; import { RealTimeUpdatesSettings } from '../RealTimeUpdatesSettings'; -import { Settings } from '../Settings'; import { setRealTimeUpdatesInterval, setShortUrlCreationSettings, @@ -10,13 +11,12 @@ import { setVisitsSettings, toggleRealTimeUpdates, } from '../reducers/settings'; -import type { ConnectDecorator } from '../../container/types'; -import { withoutSelectedServer } from '../../servers/helpers/withoutSelectedServer'; +import { Settings } from '../Settings'; import { ShortUrlCreationSettings } from '../ShortUrlCreationSettings'; +import { ShortUrlsListSettings } from '../ShortUrlsListSettings'; +import { TagsSettings } from '../TagsSettings'; import { UserInterfaceSettings } from '../UserInterfaceSettings'; import { VisitsSettings } from '../VisitsSettings'; -import { TagsSettings } from '../TagsSettings'; -import { ShortUrlsListSettings } from '../ShortUrlsListSettings'; const provideServices = (bottle: Bottle, connect: ConnectDecorator) => { // Components diff --git a/src/short-urls/CreateShortUrl.tsx b/src/short-urls/CreateShortUrl.tsx index a863d429..66ed0754 100644 --- a/src/short-urls/CreateShortUrl.tsx +++ b/src/short-urls/CreateShortUrl.tsx @@ -3,8 +3,8 @@ import { useMemo } from 'react'; import type { SelectedServer } from '../servers/data'; import type { Settings, ShortUrlCreationSettings } from '../settings/reducers/settings'; import type { ShortUrlData } from './data'; -import type { ShortUrlCreation } from './reducers/shortUrlCreation'; import type { CreateShortUrlResultProps } from './helpers/CreateShortUrlResult'; +import type { ShortUrlCreation } from './reducers/shortUrlCreation'; import type { ShortUrlFormProps } from './ShortUrlForm'; export interface CreateShortUrlProps { diff --git a/src/short-urls/EditShortUrl.tsx b/src/short-urls/EditShortUrl.tsx index 32477347..0af479cc 100644 --- a/src/short-urls/EditShortUrl.tsx +++ b/src/short-urls/EditShortUrl.tsx @@ -1,22 +1,22 @@ +import { faArrowLeft } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC } from 'react'; import { useEffect, useMemo } from 'react'; -import { Button, Card } from 'reactstrap'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faArrowLeft } from '@fortawesome/free-solid-svg-icons'; import { ExternalLink } from 'react-external-link'; import { useLocation, useParams } from 'react-router-dom'; +import { Button, Card } from 'reactstrap'; +import { ShlinkApiError } from '../api/ShlinkApiError'; import type { SelectedServer } from '../servers/data'; import type { Settings } from '../settings/reducers/settings'; -import type { ShortUrlIdentifier } from './data'; +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 '../api/ShlinkApiError'; -import { useGoBack } from '../utils/helpers/hooks'; -import type { ShortUrlFormProps } from './ShortUrlForm'; +import type { ShortUrlIdentifier } from './data'; +import { shortUrlDataFromShortUrl, urlDecodeShortCode } from './helpers'; import type { ShortUrlDetail } from './reducers/shortUrlDetail'; import type { EditShortUrl as EditShortUrlInfo, ShortUrlEdition } from './reducers/shortUrlEdition'; -import { shortUrlDataFromShortUrl, urlDecodeShortCode } from './helpers'; +import type { ShortUrlFormProps } from './ShortUrlForm'; interface EditShortUrlConnectProps { settings: Settings; diff --git a/src/short-urls/Paginator.tsx b/src/short-urls/Paginator.tsx index 49187440..6fb098b9 100644 --- a/src/short-urls/Paginator.tsx +++ b/src/short-urls/Paginator.tsx @@ -1,14 +1,14 @@ import { Link } from 'react-router-dom'; import { Pagination, PaginationItem, PaginationLink } from 'reactstrap'; +import type { ShlinkPaginator } from '../api/types'; import type { NumberOrEllipsis } from '../utils/helpers/pagination'; import { - pageIsEllipsis, keyForPage, - progressivePagination, + pageIsEllipsis, prettifyPageNumber, + progressivePagination, } from '../utils/helpers/pagination'; -import type { ShlinkPaginator } from '../api/types'; interface PaginatorProps { paginator?: ShlinkPaginator; diff --git a/src/short-urls/ShortUrlForm.tsx b/src/short-urls/ShortUrlForm.tsx index 85a79c0e..1824ec99 100644 --- a/src/short-urls/ShortUrlForm.tsx +++ b/src/short-urls/ShortUrlForm.tsx @@ -1,23 +1,23 @@ +import { parseISO } from 'date-fns'; +import { cond, isEmpty, pipe, replace, T, trim } from 'ramda'; import type { FC } from 'react'; import { useEffect, useState } from 'react'; -import type { InputType } from 'reactstrap/types/lib/Input'; import { Button, FormGroup, Input, Row } from 'reactstrap'; -import { cond, isEmpty, pipe, replace, trim, T } from 'ramda'; -import { parseISO } from 'date-fns'; +import type { InputType } from 'reactstrap/types/lib/Input'; +import type { DomainSelectorProps } from '../domains/DomainSelector'; +import type { SelectedServer } from '../servers/data'; +import type { TagsSelectorProps } from '../tags/helpers/TagsSelector'; +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 { supportsForwardQuery } from '../utils/helpers/features'; import { SimpleCard } from '../utils/SimpleCard'; import type { OptionalString } from '../utils/utils'; import { handleEventPreventingDefault, hasValue } from '../utils/utils'; -import { Checkbox } from '../utils/Checkbox'; -import type { SelectedServer } from '../servers/data'; -import type { TagsSelectorProps } from '../tags/helpers/TagsSelector'; -import type { DomainSelectorProps } from '../domains/DomainSelector'; -import { formatIsoDate } from '../utils/helpers/date'; -import { UseExistingIfFoundInfoIcon } from './UseExistingIfFoundInfoIcon'; import type { ShortUrlData } from './data'; import { ShortUrlFormCheckboxGroup } from './helpers/ShortUrlFormCheckboxGroup'; +import { UseExistingIfFoundInfoIcon } from './UseExistingIfFoundInfoIcon'; import './ShortUrlForm.scss'; export type Mode = 'create' | 'create-basic' | 'edit'; diff --git a/src/short-urls/ShortUrlsFilteringBar.tsx b/src/short-urls/ShortUrlsFilteringBar.tsx index 785a36f0..9d01f500 100644 --- a/src/short-urls/ShortUrlsFilteringBar.tsx +++ b/src/short-urls/ShortUrlsFilteringBar.tsx @@ -1,25 +1,25 @@ -import type { FC } from 'react'; -import { isEmpty, pipe } from 'ramda'; -import { Button, InputGroup, Row, UncontrolledTooltip } from 'reactstrap'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faTag, faTags } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import classNames from 'classnames'; -import { SearchField } from '../utils/SearchField'; +import { isEmpty, pipe } from 'ramda'; +import type { FC } from 'react'; +import { Button, InputGroup, Row, UncontrolledTooltip } from 'reactstrap'; +import type { SelectedServer } from '../servers/data'; +import type { Settings } from '../settings/reducers/settings'; +import type { TagsSelectorProps } from '../tags/helpers/TagsSelector'; 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 { supportsAllTagsFiltering, supportsFilterDisabledUrls } from '../utils/helpers/features'; -import type { SelectedServer } from '../servers/data'; import type { OrderDir } from '../utils/helpers/ordering'; import { OrderingDropdown } from '../utils/OrderingDropdown'; -import { useShortUrlsQuery } from './helpers/hooks'; +import { SearchField } from '../utils/SearchField'; import type { ShortUrlsOrder, ShortUrlsOrderableFields } from './data'; import { SHORT_URLS_ORDERABLE_FIELDS } from './data'; import type { ExportShortUrlsBtnProps } from './helpers/ExportShortUrlsBtn'; -import type { TagsSelectorProps } from '../tags/helpers/TagsSelector'; +import { useShortUrlsQuery } from './helpers/hooks'; import { ShortUrlsFilterDropdown } from './helpers/ShortUrlsFilterDropdown'; -import type { Settings } from '../settings/reducers/settings'; import './ShortUrlsFilteringBar.scss'; interface ShortUrlsFilteringProps { diff --git a/src/short-urls/ShortUrlsList.tsx b/src/short-urls/ShortUrlsList.tsx index c8b27bbc..a5afaf7e 100644 --- a/src/short-urls/ShortUrlsList.tsx +++ b/src/short-urls/ShortUrlsList.tsx @@ -1,24 +1,24 @@ import { pipe } from 'ramda'; import { useEffect, useState } from 'react'; -import { Card } from 'reactstrap'; import { useLocation, useParams } from 'react-router-dom'; -import type { OrderDir } from '../utils/helpers/ordering'; -import { determineOrderDir } from '../utils/helpers/ordering'; -import type { SelectedServer } from '../servers/data'; -import { getServerId } from '../servers/data'; +import { Card } from 'reactstrap'; +import type { ShlinkShortUrlsListParams, ShlinkShortUrlsOrder } from '../api/types'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; -import { TableOrderIcon } from '../utils/table/TableOrderIcon'; -import type { ShlinkShortUrlsListParams, ShlinkShortUrlsOrder } from '../api/types'; +import type { SelectedServer } from '../servers/data'; +import { getServerId } from '../servers/data'; import type { Settings } from '../settings/reducers/settings'; import { DEFAULT_SHORT_URLS_ORDERING } from '../settings/reducers/settings'; -import type { ShortUrlsList as ShortUrlsListState } from './reducers/shortUrlsList'; -import type { ShortUrlsTableType } from './ShortUrlsTable'; -import { Paginator } from './Paginator'; -import { useShortUrlsQuery } from './helpers/hooks'; -import type { ShortUrlsOrder, ShortUrlsOrderableFields } from './data'; -import type { ShortUrlsFilteringBarType } from './ShortUrlsFilteringBar'; import { supportsExcludeBotsOnShortUrls } from '../utils/helpers/features'; +import type { OrderDir } from '../utils/helpers/ordering'; +import { determineOrderDir } from '../utils/helpers/ordering'; +import { TableOrderIcon } from '../utils/table/TableOrderIcon'; +import type { ShortUrlsOrder, ShortUrlsOrderableFields } from './data'; +import { useShortUrlsQuery } from './helpers/hooks'; +import { Paginator } from './Paginator'; +import type { ShortUrlsList as ShortUrlsListState } from './reducers/shortUrlsList'; +import type { ShortUrlsFilteringBarType } from './ShortUrlsFilteringBar'; +import type { ShortUrlsTableType } from './ShortUrlsTable'; interface ShortUrlsListProps { selectedServer: SelectedServer; diff --git a/src/short-urls/ShortUrlsTable.tsx b/src/short-urls/ShortUrlsTable.tsx index e38ccfc0..5851a58a 100644 --- a/src/short-urls/ShortUrlsTable.tsx +++ b/src/short-urls/ShortUrlsTable.tsx @@ -1,10 +1,10 @@ -import type { ReactNode } from 'react'; -import { isEmpty } from 'ramda'; import classNames from 'classnames'; +import { isEmpty } from 'ramda'; +import type { ReactNode } from 'react'; import type { SelectedServer } from '../servers/data'; -import type { ShortUrlsList as ShortUrlsListState } from './reducers/shortUrlsList'; -import type { ShortUrlsRowType } from './helpers/ShortUrlsRow'; import type { ShortUrlsOrderableFields } from './data'; +import type { ShortUrlsRowType } from './helpers/ShortUrlsRow'; +import type { ShortUrlsList as ShortUrlsListState } from './reducers/shortUrlsList'; import './ShortUrlsTable.scss'; interface ShortUrlsTableProps { diff --git a/src/short-urls/UseExistingIfFoundInfoIcon.tsx b/src/short-urls/UseExistingIfFoundInfoIcon.tsx index 2732247e..32c8d130 100644 --- a/src/short-urls/UseExistingIfFoundInfoIcon.tsx +++ b/src/short-urls/UseExistingIfFoundInfoIcon.tsx @@ -1,5 +1,5 @@ -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; 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 './UseExistingIfFoundInfoIcon.scss'; diff --git a/src/short-urls/data/index.ts b/src/short-urls/data/index.ts index e3b7bac5..78a59318 100644 --- a/src/short-urls/data/index.ts +++ b/src/short-urls/data/index.ts @@ -1,5 +1,5 @@ -import type { Nullable, OptionalString } from '../../utils/utils'; import type { Order } from '../../utils/helpers/ordering'; +import type { Nullable, OptionalString } from '../../utils/utils'; export interface EditShortUrlData { longUrl?: string; diff --git a/src/short-urls/helpers/CreateShortUrlResult.tsx b/src/short-urls/helpers/CreateShortUrlResult.tsx index 09939d2d..d5abd35d 100644 --- a/src/short-urls/helpers/CreateShortUrlResult.tsx +++ b/src/short-urls/helpers/CreateShortUrlResult.tsx @@ -4,11 +4,11 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useEffect } from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; import { Tooltip } from 'reactstrap'; -import type { ShortUrlCreation } from '../reducers/shortUrlCreation'; +import { ShlinkApiError } from '../../api/ShlinkApiError'; import type { TimeoutToggle } from '../../utils/helpers/hooks'; import { Result } from '../../utils/Result'; +import type { ShortUrlCreation } from '../reducers/shortUrlCreation'; import './CreateShortUrlResult.scss'; -import { ShlinkApiError } from '../../api/ShlinkApiError'; export interface CreateShortUrlResultProps { creation: ShortUrlCreation; diff --git a/src/short-urls/helpers/DeleteShortUrlModal.tsx b/src/short-urls/helpers/DeleteShortUrlModal.tsx index 2f77d403..205680ce 100644 --- a/src/short-urls/helpers/DeleteShortUrlModal.tsx +++ b/src/short-urls/helpers/DeleteShortUrlModal.tsx @@ -1,12 +1,12 @@ +import { pipe } from 'ramda'; import { useEffect, useState } from 'react'; import { Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; -import { pipe } from 'ramda'; -import type { ShortUrlDeletion } from '../reducers/shortUrlDeletion'; -import type { ShortUrlIdentifier, ShortUrlModalProps } from '../data'; -import { handleEventPreventingDefault } from '../../utils/utils'; -import { Result } from '../../utils/Result'; -import { isInvalidDeletionError } from '../../api/utils'; import { ShlinkApiError } from '../../api/ShlinkApiError'; +import { isInvalidDeletionError } from '../../api/utils'; +import { Result } from '../../utils/Result'; +import { handleEventPreventingDefault } from '../../utils/utils'; +import type { ShortUrlIdentifier, ShortUrlModalProps } from '../data'; +import type { ShortUrlDeletion } from '../reducers/shortUrlDeletion'; interface DeleteShortUrlModalConnectProps extends ShortUrlModalProps { shortUrlDeletion: ShortUrlDeletion; diff --git a/src/short-urls/helpers/ExportShortUrlsBtn.tsx b/src/short-urls/helpers/ExportShortUrlsBtn.tsx index e38f026c..88f502e7 100644 --- a/src/short-urls/helpers/ExportShortUrlsBtn.tsx +++ b/src/short-urls/helpers/ExportShortUrlsBtn.tsx @@ -1,11 +1,11 @@ import type { FC } from 'react'; -import { ExportBtn } from '../../utils/ExportBtn'; -import { useToggle } from '../../utils/helpers/hooks'; import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ReportExporter } from '../../common/services/ReportExporter'; import type { SelectedServer } from '../../servers/data'; import { isServerWithId } from '../../servers/data'; +import { ExportBtn } from '../../utils/ExportBtn'; +import { useToggle } from '../../utils/helpers/hooks'; import type { ShortUrl } from '../data'; -import type { ReportExporter } from '../../common/services/ReportExporter'; import { useShortUrlsQuery } from './hooks'; export interface ExportShortUrlsBtnProps { diff --git a/src/short-urls/helpers/QrCodeModal.tsx b/src/short-urls/helpers/QrCodeModal.tsx index 682d3263..e0bdb25b 100644 --- a/src/short-urls/helpers/QrCodeModal.tsx +++ b/src/short-urls/helpers/QrCodeModal.tsx @@ -1,17 +1,17 @@ -import { useMemo, useState } from 'react'; -import { Modal, FormGroup, ModalBody, ModalHeader, Row, Button } from 'reactstrap'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faFileDownload as downloadIcon } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { useMemo, useState } from 'react'; import { ExternalLink } from 'react-external-link'; -import type { ShortUrlModalProps } from '../data'; +import { Button, FormGroup, Modal, ModalBody, ModalHeader, Row } from 'reactstrap'; +import type { ImageDownloader } from '../../common/services/ImageDownloader'; import type { SelectedServer } from '../../servers/data'; import { CopyToClipboardIcon } from '../../utils/CopyToClipboardIcon'; +import { supportsNonRestCors } from '../../utils/helpers/features'; import type { QrCodeFormat, QrErrorCorrection } from '../../utils/helpers/qrCodes'; import { buildQrCodeUrl } from '../../utils/helpers/qrCodes'; -import { supportsNonRestCors } from '../../utils/helpers/features'; -import type { ImageDownloader } from '../../common/services/ImageDownloader'; -import { QrFormatDropdown } from './qr-codes/QrFormatDropdown'; +import type { ShortUrlModalProps } from '../data'; import { QrErrorCorrectionDropdown } from './qr-codes/QrErrorCorrectionDropdown'; +import { QrFormatDropdown } from './qr-codes/QrFormatDropdown'; import './QrCodeModal.scss'; interface QrCodeModalConnectProps extends ShortUrlModalProps { diff --git a/src/short-urls/helpers/ShortUrlStatus.tsx b/src/short-urls/helpers/ShortUrlStatus.tsx index 3f02fb6b..ec490b01 100644 --- a/src/short-urls/helpers/ShortUrlStatus.tsx +++ b/src/short-urls/helpers/ShortUrlStatus.tsx @@ -1,12 +1,12 @@ -import type { FC, ReactNode } from 'react'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { IconDefinition } from '@fortawesome/fontawesome-common-types'; -import { faLinkSlash, faCalendarXmark, faCheck } from '@fortawesome/free-solid-svg-icons'; -import { UncontrolledTooltip } from 'reactstrap'; +import { faCalendarXmark, faCheck, faLinkSlash } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { isBefore } from 'date-fns'; -import type { ShortUrl } from '../data'; +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 type { ShortUrl } from '../data'; interface ShortUrlStatusProps { shortUrl: ShortUrl; diff --git a/src/short-urls/helpers/ShortUrlVisitsCount.tsx b/src/short-urls/helpers/ShortUrlVisitsCount.tsx index a1e63be5..0dd53396 100644 --- a/src/short-urls/helpers/ShortUrlVisitsCount.tsx +++ b/src/short-urls/helpers/ShortUrlVisitsCount.tsx @@ -1,13 +1,13 @@ -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons'; -import { UncontrolledTooltip } from 'reactstrap'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import classNames from 'classnames'; -import { prettify } from '../../utils/helpers/numbers'; -import type { ShortUrl } from '../data'; +import { UncontrolledTooltip } from 'reactstrap'; import type { SelectedServer } from '../../servers/data'; -import { ShortUrlDetailLink } from './ShortUrlDetailLink'; import { formatHumanFriendly, parseISO } from '../../utils/helpers/date'; import { useElementRef } from '../../utils/helpers/hooks'; +import { prettify } from '../../utils/helpers/numbers'; +import type { ShortUrl } from '../data'; +import { ShortUrlDetailLink } from './ShortUrlDetailLink'; import './ShortUrlVisitsCount.scss'; interface ShortUrlVisitsCountProps { diff --git a/src/short-urls/helpers/ShortUrlsRow.tsx b/src/short-urls/helpers/ShortUrlsRow.tsx index bbb4104b..5e3d4748 100644 --- a/src/short-urls/helpers/ShortUrlsRow.tsx +++ b/src/short-urls/helpers/ShortUrlsRow.tsx @@ -1,18 +1,18 @@ import type { FC } from 'react'; import { useEffect, useRef } from 'react'; import { ExternalLink } from 'react-external-link'; -import type { ColorGenerator } from '../../utils/services/ColorGenerator'; -import type { TimeoutToggle } from '../../utils/helpers/hooks'; import type { SelectedServer } from '../../servers/data'; -import { CopyToClipboardIcon } from '../../utils/CopyToClipboardIcon'; -import type { ShortUrl } from '../data'; -import { Time } from '../../utils/dates/Time'; import type { Settings } from '../../settings/reducers/settings'; -import { ShortUrlVisitsCount } from './ShortUrlVisitsCount'; -import type { ShortUrlsRowMenuType } from './ShortUrlsRowMenu'; -import { Tags } from './Tags'; -import { ShortUrlStatus } from './ShortUrlStatus'; +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 type { ShortUrl } from '../data'; import { useShortUrlsQuery } from './hooks'; +import type { ShortUrlsRowMenuType } from './ShortUrlsRowMenu'; +import { ShortUrlStatus } from './ShortUrlStatus'; +import { ShortUrlVisitsCount } from './ShortUrlVisitsCount'; +import { Tags } from './Tags'; import './ShortUrlsRow.scss'; interface ShortUrlsRowProps { diff --git a/src/short-urls/helpers/ShortUrlsRowMenu.tsx b/src/short-urls/helpers/ShortUrlsRowMenu.tsx index b05351fe..7b08fe89 100644 --- a/src/short-urls/helpers/ShortUrlsRowMenu.tsx +++ b/src/short-urls/helpers/ShortUrlsRowMenu.tsx @@ -1,16 +1,16 @@ import { faChartPie as pieChartIcon, - faQrcode as qrIcon, - faMinusCircle as deleteIcon, faEdit as editIcon, + faMinusCircle as deleteIcon, + faQrcode as qrIcon, } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC } from 'react'; import { DropdownItem } from 'reactstrap'; -import { useToggle } from '../../utils/helpers/hooks'; -import type { ShortUrl, ShortUrlModalProps } from '../data'; import type { SelectedServer } from '../../servers/data'; import { DropdownBtnMenu } from '../../utils/DropdownBtnMenu'; +import { useToggle } from '../../utils/helpers/hooks'; +import type { ShortUrl, ShortUrlModalProps } from '../data'; import { ShortUrlDetailLink } from './ShortUrlDetailLink'; interface ShortUrlsRowMenuProps { diff --git a/src/short-urls/helpers/Tags.tsx b/src/short-urls/helpers/Tags.tsx index 71f43316..b6bd6067 100644 --- a/src/short-urls/helpers/Tags.tsx +++ b/src/short-urls/helpers/Tags.tsx @@ -1,5 +1,5 @@ -import type { FC } from 'react'; import { isEmpty } from 'ramda'; +import type { FC } from 'react'; import { Tag } from '../../tags/helpers/Tag'; import type { ColorGenerator } from '../../utils/services/ColorGenerator'; diff --git a/src/short-urls/helpers/hooks.ts b/src/short-urls/helpers/hooks.ts index c2dfcdbb..054d5d49 100644 --- a/src/short-urls/helpers/hooks.ts +++ b/src/short-urls/helpers/hooks.ts @@ -1,12 +1,12 @@ -import { useParams, useLocation, useNavigate } from 'react-router-dom'; -import { useMemo } from 'react'; import { isEmpty, pipe } from 'ramda'; -import { parseQuery, stringifyQuery } from '../../utils/helpers/query'; -import type { ShortUrlsOrder, ShortUrlsOrderableFields } from '../data'; -import { orderToString, stringToOrder } from '../../utils/helpers/ordering'; +import { useMemo } from 'react'; +import { useLocation, useNavigate, useParams } from 'react-router-dom'; import type { TagsFilteringMode } from '../../api/types'; +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 type { ShortUrlsOrder, ShortUrlsOrderableFields } from '../data'; interface ShortUrlsQueryCommon { search?: string; diff --git a/src/short-urls/helpers/index.ts b/src/short-urls/helpers/index.ts index 4fcfb676..a5042608 100644 --- a/src/short-urls/helpers/index.ts +++ b/src/short-urls/helpers/index.ts @@ -1,8 +1,8 @@ import { isNil } from 'ramda'; -import type { ShortUrl, ShortUrlData } from '../data'; +import type { ShortUrlCreationSettings } from '../../settings/reducers/settings'; import type { OptionalString } from '../../utils/utils'; import { DEFAULT_DOMAIN } from '../../visits/reducers/domainVisits'; -import type { ShortUrlCreationSettings } from '../../settings/reducers/settings'; +import type { ShortUrl, ShortUrlData } from '../data'; export const shortUrlMatches = (shortUrl: ShortUrl, shortCode: string, domain: OptionalString): boolean => { if (isNil(domain)) { diff --git a/src/short-urls/reducers/shortUrlCreation.ts b/src/short-urls/reducers/shortUrlCreation.ts index a6185983..c68c3a28 100644 --- a/src/short-urls/reducers/shortUrlCreation.ts +++ b/src/short-urls/reducers/shortUrlCreation.ts @@ -1,10 +1,10 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; -import type { ShortUrl, ShortUrlData } from '../data'; -import { createAsyncThunk } from '../../utils/helpers/redux'; import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { parseApiError } from '../../api/utils'; import type { ProblemDetailsError } from '../../api/types/errors'; +import { parseApiError } from '../../api/utils'; +import { createAsyncThunk } from '../../utils/helpers/redux'; +import type { ShortUrl, ShortUrlData } from '../data'; const REDUCER_PREFIX = 'shlink/shortUrlCreation'; diff --git a/src/short-urls/reducers/shortUrlDeletion.ts b/src/short-urls/reducers/shortUrlDeletion.ts index f619d442..7d4837f1 100644 --- a/src/short-urls/reducers/shortUrlDeletion.ts +++ b/src/short-urls/reducers/shortUrlDeletion.ts @@ -1,8 +1,8 @@ import { createAction, createSlice } from '@reduxjs/toolkit'; -import { createAsyncThunk } from '../../utils/helpers/redux'; import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { parseApiError } from '../../api/utils'; import type { ProblemDetailsError } from '../../api/types/errors'; +import { parseApiError } from '../../api/utils'; +import { createAsyncThunk } from '../../utils/helpers/redux'; import type { ShortUrl, ShortUrlIdentifier } from '../data'; const REDUCER_PREFIX = 'shlink/shortUrlDeletion'; diff --git a/src/short-urls/reducers/shortUrlDetail.ts b/src/short-urls/reducers/shortUrlDetail.ts index cc54ab2c..932d3dfc 100644 --- a/src/short-urls/reducers/shortUrlDetail.ts +++ b/src/short-urls/reducers/shortUrlDetail.ts @@ -1,11 +1,11 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; -import type { ShortUrl, ShortUrlIdentifier } from '../data'; -import { createAsyncThunk } from '../../utils/helpers/redux'; import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { shortUrlMatches } from '../helpers'; -import { parseApiError } from '../../api/utils'; import type { ProblemDetailsError } from '../../api/types/errors'; +import { parseApiError } from '../../api/utils'; +import { createAsyncThunk } from '../../utils/helpers/redux'; +import type { ShortUrl, ShortUrlIdentifier } from '../data'; +import { shortUrlMatches } from '../helpers'; const REDUCER_PREFIX = 'shlink/shortUrlDetail'; diff --git a/src/short-urls/reducers/shortUrlEdition.ts b/src/short-urls/reducers/shortUrlEdition.ts index da707cc9..103e6449 100644 --- a/src/short-urls/reducers/shortUrlEdition.ts +++ b/src/short-urls/reducers/shortUrlEdition.ts @@ -1,10 +1,10 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ProblemDetailsError } from '../../api/types/errors'; +import { parseApiError } from '../../api/utils'; import { createAsyncThunk } from '../../utils/helpers/redux'; import type { EditShortUrlData, ShortUrl, ShortUrlIdentifier } from '../data'; -import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { parseApiError } from '../../api/utils'; -import type { ProblemDetailsError } from '../../api/types/errors'; const REDUCER_PREFIX = 'shlink/shortUrlEdition'; diff --git a/src/short-urls/reducers/shortUrlsList.ts b/src/short-urls/reducers/shortUrlsList.ts index 220776e0..b2920ba4 100644 --- a/src/short-urls/reducers/shortUrlsList.ts +++ b/src/short-urls/reducers/shortUrlsList.ts @@ -1,14 +1,14 @@ import { createSlice } from '@reduxjs/toolkit'; import { assocPath, last, pipe, reject } from 'ramda'; -import { shortUrlMatches } from '../helpers'; -import { createNewVisits } from '../../visits/reducers/visitCreation'; -import { createAsyncThunk } from '../../utils/helpers/redux'; import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; import type { ShlinkShortUrlsListParams, ShlinkShortUrlsResponse } from '../../api/types'; -import { shortUrlDeleted } from './shortUrlDeletion'; -import type { createShortUrl } from './shortUrlCreation'; -import type { editShortUrl } from './shortUrlEdition'; +import { createAsyncThunk } from '../../utils/helpers/redux'; +import { createNewVisits } from '../../visits/reducers/visitCreation'; import type { ShortUrl } from '../data'; +import { shortUrlMatches } from '../helpers'; +import type { createShortUrl } from './shortUrlCreation'; +import { shortUrlDeleted } from './shortUrlDeletion'; +import type { editShortUrl } from './shortUrlEdition'; const REDUCER_PREFIX = 'shlink/shortUrlsList'; export const ITEMS_IN_OVERVIEW_PAGE = 5; diff --git a/src/short-urls/services/provideServices.ts b/src/short-urls/services/provideServices.ts index 054753d3..db03ad28 100644 --- a/src/short-urls/services/provideServices.ts +++ b/src/short-urls/services/provideServices.ts @@ -1,23 +1,23 @@ import type Bottle from 'bottlejs'; import { prop } from 'ramda'; -import { ShortUrlsFilteringBar } from '../ShortUrlsFilteringBar'; -import { ShortUrlsList } from '../ShortUrlsList'; +import type { ConnectDecorator } from '../../container/types'; +import { CreateShortUrl } from '../CreateShortUrl'; +import { EditShortUrl } from '../EditShortUrl'; +import { CreateShortUrlResult } from '../helpers/CreateShortUrlResult'; +import { DeleteShortUrlModal } from '../helpers/DeleteShortUrlModal'; +import { ExportShortUrlsBtn } from '../helpers/ExportShortUrlsBtn'; +import { QrCodeModal } from '../helpers/QrCodeModal'; import { ShortUrlsRow } from '../helpers/ShortUrlsRow'; import { ShortUrlsRowMenu } from '../helpers/ShortUrlsRowMenu'; -import { CreateShortUrl } from '../CreateShortUrl'; -import { DeleteShortUrlModal } from '../helpers/DeleteShortUrlModal'; -import { CreateShortUrlResult } from '../helpers/CreateShortUrlResult'; -import { listShortUrls, shortUrlsListReducerCreator } from '../reducers/shortUrlsList'; -import { shortUrlCreationReducerCreator, createShortUrl } from '../reducers/shortUrlCreation'; -import { shortUrlDeletionReducerCreator, deleteShortUrl, shortUrlDeleted } from '../reducers/shortUrlDeletion'; -import { editShortUrl, shortUrlEditionReducerCreator } from '../reducers/shortUrlEdition'; +import { createShortUrl, shortUrlCreationReducerCreator } from '../reducers/shortUrlCreation'; +import { deleteShortUrl, shortUrlDeleted, shortUrlDeletionReducerCreator } from '../reducers/shortUrlDeletion'; import { shortUrlDetailReducerCreator } from '../reducers/shortUrlDetail'; -import type { ConnectDecorator } from '../../container/types'; -import { ShortUrlsTable } from '../ShortUrlsTable'; +import { editShortUrl, shortUrlEditionReducerCreator } from '../reducers/shortUrlEdition'; +import { listShortUrls, shortUrlsListReducerCreator } from '../reducers/shortUrlsList'; import { ShortUrlForm } from '../ShortUrlForm'; -import { EditShortUrl } from '../EditShortUrl'; -import { QrCodeModal } from '../helpers/QrCodeModal'; -import { ExportShortUrlsBtn } from '../helpers/ExportShortUrlsBtn'; +import { ShortUrlsFilteringBar } from '../ShortUrlsFilteringBar'; +import { ShortUrlsList } from '../ShortUrlsList'; +import { ShortUrlsTable } from '../ShortUrlsTable'; const provideServices = (bottle: Bottle, connect: ConnectDecorator) => { // Components diff --git a/src/tags/TagsList.tsx b/src/tags/TagsList.tsx index 55b46844..a2e35501 100644 --- a/src/tags/TagsList.tsx +++ b/src/tags/TagsList.tsx @@ -1,21 +1,21 @@ +import { pipe } from 'ramda'; import type { FC } from 'react'; import { useEffect, useState } from 'react'; import { Row } from 'reactstrap'; -import { pipe } from 'ramda'; -import { Message } from '../utils/Message'; -import { SearchField } from '../utils/SearchField'; -import type { SelectedServer } from '../servers/data'; -import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; -import { Result } from '../utils/Result'; import { ShlinkApiError } from '../api/ShlinkApiError'; +import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; +import type { SelectedServer } from '../servers/data'; import type { Settings } from '../settings/reducers/settings'; import { determineOrderDir, sortList } from '../utils/helpers/ordering'; +import { Message } from '../utils/Message'; import { OrderingDropdown } from '../utils/OrderingDropdown'; -import type { TagsList as TagsListState } from './reducers/tagsList'; -import type { TagsOrderableFields, TagsOrder } from './data/TagsListChildrenProps'; -import { TAGS_ORDERABLE_FIELDS } from './data/TagsListChildrenProps'; +import { Result } from '../utils/Result'; +import { SearchField } from '../utils/SearchField'; import type { NormalizedTag } from './data'; +import type { TagsOrder, TagsOrderableFields } from './data/TagsListChildrenProps'; +import { TAGS_ORDERABLE_FIELDS } from './data/TagsListChildrenProps'; +import type { TagsList as TagsListState } from './reducers/tagsList'; import type { TagsTableProps } from './TagsTable'; export interface TagsListProps { diff --git a/src/tags/TagsTable.tsx b/src/tags/TagsTable.tsx index 71952f32..3898c623 100644 --- a/src/tags/TagsTable.tsx +++ b/src/tags/TagsTable.tsx @@ -1,13 +1,13 @@ +import { splitEvery } from 'ramda'; import type { FC } from 'react'; import { useEffect, useRef } from 'react'; -import { splitEvery } from 'ramda'; import { useLocation } from 'react-router-dom'; -import { SimpleCard } from '../utils/SimpleCard'; 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 type { TagsOrderableFields, TagsListChildrenProps, TagsOrder } from './data/TagsListChildrenProps'; +import type { TagsListChildrenProps, TagsOrder, TagsOrderableFields } from './data/TagsListChildrenProps'; import type { TagsTableRowProps } from './TagsTableRow'; import './TagsTable.scss'; diff --git a/src/tags/TagsTableRow.tsx b/src/tags/TagsTableRow.tsx index c3e100b2..aa8ea5a5 100644 --- a/src/tags/TagsTableRow.tsx +++ b/src/tags/TagsTableRow.tsx @@ -1,16 +1,16 @@ +import { faPencilAlt as editIcon, faTrash as deleteIcon } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC } from 'react'; import { Link } from 'react-router-dom'; import { DropdownItem } from 'reactstrap'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faTrash as deleteIcon, faPencilAlt as editIcon } from '@fortawesome/free-solid-svg-icons'; import type { SelectedServer } from '../servers/data'; import { getServerId } from '../servers/data'; -import type { ColorGenerator } from '../utils/services/ColorGenerator'; -import { prettify } from '../utils/helpers/numbers'; -import { useToggle } from '../utils/helpers/hooks'; import { DropdownBtnMenu } from '../utils/DropdownBtnMenu'; -import { TagBullet } from './helpers/TagBullet'; +import { useToggle } from '../utils/helpers/hooks'; +import { prettify } from '../utils/helpers/numbers'; +import type { ColorGenerator } from '../utils/services/ColorGenerator'; import type { NormalizedTag, TagModalProps } from './data'; +import { TagBullet } from './helpers/TagBullet'; export interface TagsTableRowProps { tag: NormalizedTag; diff --git a/src/tags/helpers/DeleteTagConfirmModal.tsx b/src/tags/helpers/DeleteTagConfirmModal.tsx index 5ac400a3..2d0742b8 100644 --- a/src/tags/helpers/DeleteTagConfirmModal.tsx +++ b/src/tags/helpers/DeleteTagConfirmModal.tsx @@ -1,8 +1,8 @@ import { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; -import type { TagDeletion } from '../reducers/tagDelete'; -import type { TagModalProps } from '../data'; -import { Result } from '../../utils/Result'; import { ShlinkApiError } from '../../api/ShlinkApiError'; +import { Result } from '../../utils/Result'; +import type { TagModalProps } from '../data'; +import type { TagDeletion } from '../reducers/tagDelete'; interface DeleteTagConfirmModalProps extends TagModalProps { deleteTag: (tag: string) => Promise; diff --git a/src/tags/helpers/EditTagModal.tsx b/src/tags/helpers/EditTagModal.tsx index 3dedd963..8c5da75a 100644 --- a/src/tags/helpers/EditTagModal.tsx +++ b/src/tags/helpers/EditTagModal.tsx @@ -1,16 +1,16 @@ -import { pipe } from 'ramda'; -import { useState } from 'react'; -import { Button, Input, Modal, ModalBody, ModalFooter, ModalHeader, Popover, InputGroup } from 'reactstrap'; -import { HexColorPicker } from 'react-colorful'; import { faPalette as colorIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +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 { handleEventPreventingDefault } from '../../utils/utils'; +import { Result } from '../../utils/Result'; import type { ColorGenerator } from '../../utils/services/ColorGenerator'; +import { handleEventPreventingDefault } from '../../utils/utils'; import type { TagModalProps } from '../data'; import type { EditTag, TagEdition } from '../reducers/tagEdit'; -import { Result } from '../../utils/Result'; -import { ShlinkApiError } from '../../api/ShlinkApiError'; import './EditTagModal.scss'; interface EditTagModalProps extends TagModalProps { diff --git a/src/tags/helpers/Tag.tsx b/src/tags/helpers/Tag.tsx index 771ecbd9..4e9f33f8 100644 --- a/src/tags/helpers/Tag.tsx +++ b/src/tags/helpers/Tag.tsx @@ -1,5 +1,5 @@ -import type { FC, MouseEventHandler, PropsWithChildren } from 'react'; import classNames from 'classnames'; +import type { FC, MouseEventHandler, PropsWithChildren } from 'react'; import type { ColorGenerator } from '../../utils/services/ColorGenerator'; import './Tag.scss'; diff --git a/src/tags/helpers/TagsSelector.tsx b/src/tags/helpers/TagsSelector.tsx index b1a929d4..15eb7926 100644 --- a/src/tags/helpers/TagsSelector.tsx +++ b/src/tags/helpers/TagsSelector.tsx @@ -1,11 +1,11 @@ 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 { Settings } from '../../settings/reducers/settings'; +import type { ColorGenerator } from '../../utils/services/ColorGenerator'; import type { TagsList } from '../reducers/tagsList'; -import { TagBullet } from './TagBullet'; import { Tag } from './Tag'; +import { TagBullet } from './TagBullet'; export interface TagsSelectorProps { selectedTags: string[]; diff --git a/src/tags/reducers/tagDelete.ts b/src/tags/reducers/tagDelete.ts index 4a7a3e90..68be3b53 100644 --- a/src/tags/reducers/tagDelete.ts +++ b/src/tags/reducers/tagDelete.ts @@ -1,8 +1,8 @@ import { createAction, createSlice } from '@reduxjs/toolkit'; -import { createAsyncThunk } from '../../utils/helpers/redux'; import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { parseApiError } from '../../api/utils'; import type { ProblemDetailsError } from '../../api/types/errors'; +import { parseApiError } from '../../api/utils'; +import { createAsyncThunk } from '../../utils/helpers/redux'; const REDUCER_PREFIX = 'shlink/tagDelete'; diff --git a/src/tags/reducers/tagEdit.ts b/src/tags/reducers/tagEdit.ts index 13ee61f6..20d8e74b 100644 --- a/src/tags/reducers/tagEdit.ts +++ b/src/tags/reducers/tagEdit.ts @@ -1,11 +1,11 @@ -import { pick } from 'ramda'; import type { PayloadAction } from '@reduxjs/toolkit'; import { createAction, createSlice } from '@reduxjs/toolkit'; +import { pick } from 'ramda'; +import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ProblemDetailsError } from '../../api/types/errors'; +import { parseApiError } from '../../api/utils'; import { createAsyncThunk } from '../../utils/helpers/redux'; import type { ColorGenerator } from '../../utils/services/ColorGenerator'; -import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { parseApiError } from '../../api/utils'; -import type { ProblemDetailsError } from '../../api/types/errors'; const REDUCER_PREFIX = 'shlink/tagEdit'; diff --git a/src/tags/reducers/tagsList.ts b/src/tags/reducers/tagsList.ts index 4dea9d2f..d6726817 100644 --- a/src/tags/reducers/tagsList.ts +++ b/src/tags/reducers/tagsList.ts @@ -1,16 +1,16 @@ import { createAction, createSlice } from '@reduxjs/toolkit'; import { isEmpty, reject } from 'ramda'; -import { createNewVisits } from '../../visits/reducers/visitCreation'; -import { createAsyncThunk } from '../../utils/helpers/redux'; -import type { ShlinkTags } from '../../api/types'; import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import type { CreateVisit, Stats } from '../../visits/types'; +import type { ShlinkTags } from '../../api/types'; +import type { ProblemDetailsError } from '../../api/types/errors'; import { parseApiError } from '../../api/utils'; -import type { TagStats } from '../data'; import type { createShortUrl } from '../../short-urls/reducers/shortUrlCreation'; +import { createAsyncThunk } from '../../utils/helpers/redux'; +import { createNewVisits } from '../../visits/reducers/visitCreation'; +import type { CreateVisit, Stats } from '../../visits/types'; +import type { TagStats } from '../data'; import { tagDeleted } from './tagDelete'; import { tagEdited } from './tagEdit'; -import type { ProblemDetailsError } from '../../api/types/errors'; const REDUCER_PREFIX = 'shlink/tagsList'; diff --git a/src/tags/services/provideServices.ts b/src/tags/services/provideServices.ts index 7fa9cc83..7b228478 100644 --- a/src/tags/services/provideServices.ts +++ b/src/tags/services/provideServices.ts @@ -1,14 +1,14 @@ -import { prop } from 'ramda'; import type { IContainer } from 'bottlejs'; import type Bottle from 'bottlejs'; -import { TagsSelector } from '../helpers/TagsSelector'; +import { prop } from 'ramda'; +import type { ConnectDecorator } from '../../container/types'; import { DeleteTagConfirmModal } from '../helpers/DeleteTagConfirmModal'; import { EditTagModal } from '../helpers/EditTagModal'; -import { TagsList } from '../TagsList'; -import { filterTags, listTags, tagsListReducerCreator } from '../reducers/tagsList'; +import { TagsSelector } from '../helpers/TagsSelector'; import { tagDeleted, tagDeleteReducerCreator } from '../reducers/tagDelete'; import { editTag, tagEdited, tagEditReducerCreator } from '../reducers/tagEdit'; -import type { ConnectDecorator } from '../../container/types'; +import { filterTags, listTags, tagsListReducerCreator } from '../reducers/tagsList'; +import { TagsList } from '../TagsList'; import { TagsTable } from '../TagsTable'; import { TagsTableRow } from '../TagsTableRow'; diff --git a/src/utils/BooleanControl.tsx b/src/utils/BooleanControl.tsx index e66418cc..e99dfbe1 100644 --- a/src/utils/BooleanControl.tsx +++ b/src/utils/BooleanControl.tsx @@ -1,6 +1,6 @@ -import type { ChangeEvent, FC, PropsWithChildren } from 'react'; import classNames from 'classnames'; import { identity } from 'ramda'; +import type { ChangeEvent, FC, PropsWithChildren } from 'react'; import { useDomId } from './helpers/hooks'; export type BooleanControlProps = PropsWithChildren<{ diff --git a/src/utils/CopyToClipboardIcon.tsx b/src/utils/CopyToClipboardIcon.tsx index 314af944..c2f159d2 100644 --- a/src/utils/CopyToClipboardIcon.tsx +++ b/src/utils/CopyToClipboardIcon.tsx @@ -1,6 +1,6 @@ -import type { FC } from 'react'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCopy as copyIcon } from '@fortawesome/free-regular-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import type { FC } from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; import './CopyToClipboardIcon.scss'; diff --git a/src/utils/DropdownBtnMenu.tsx b/src/utils/DropdownBtnMenu.tsx index cd62f0b5..330c5434 100644 --- a/src/utils/DropdownBtnMenu.tsx +++ b/src/utils/DropdownBtnMenu.tsx @@ -1,7 +1,7 @@ +import { faEllipsisV as menuIcon } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC, PropsWithChildren } from 'react'; import { ButtonDropdown, DropdownMenu, DropdownToggle } from 'reactstrap'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faEllipsisV as menuIcon } from '@fortawesome/free-solid-svg-icons'; import './DropdownBtnMenu.scss'; export type DropdownBtnMenuProps = PropsWithChildren<{ diff --git a/src/utils/ExportBtn.tsx b/src/utils/ExportBtn.tsx index 42af9e57..351083c1 100644 --- a/src/utils/ExportBtn.tsx +++ b/src/utils/ExportBtn.tsx @@ -1,8 +1,8 @@ +import { faFileCsv } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC } from 'react'; import type { ButtonProps } from 'reactstrap'; import { Button } from 'reactstrap'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faFileCsv } from '@fortawesome/free-solid-svg-icons'; import { prettify } from './helpers/numbers'; interface ExportBtnProps extends Omit { diff --git a/src/utils/InfoTooltip.tsx b/src/utils/InfoTooltip.tsx index 9e8103c4..4fb281d5 100644 --- a/src/utils/InfoTooltip.tsx +++ b/src/utils/InfoTooltip.tsx @@ -1,8 +1,8 @@ -import type { FC, PropsWithChildren } from 'react'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons'; -import { UncontrolledTooltip } from 'reactstrap'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { Placement } from '@popperjs/core'; +import type { FC, PropsWithChildren } from 'react'; +import { UncontrolledTooltip } from 'reactstrap'; import { useElementRef } from './helpers/hooks'; export type InfoTooltipProps = PropsWithChildren<{ diff --git a/src/utils/Message.tsx b/src/utils/Message.tsx index 2c166752..2d9d9928 100644 --- a/src/utils/Message.tsx +++ b/src/utils/Message.tsx @@ -1,8 +1,8 @@ -import type { FC, PropsWithChildren } from 'react'; -import { Card, Row } from 'reactstrap'; -import classNames from 'classnames'; import { faCircleNotch as preloader } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import classNames from 'classnames'; +import type { FC, PropsWithChildren } from 'react'; +import { Card, Row } from 'reactstrap'; type MessageType = 'default' | 'error'; diff --git a/src/utils/NavPills.tsx b/src/utils/NavPills.tsx index e08b6469..52e197bf 100644 --- a/src/utils/NavPills.tsx +++ b/src/utils/NavPills.tsx @@ -1,7 +1,7 @@ import type { FC, PropsWithChildren } from 'react'; import { Children, isValidElement } from 'react'; -import { Card, Nav, NavLink } from 'reactstrap'; import { NavLink as RouterNavLink } from 'react-router-dom'; +import { Card, Nav, NavLink } from 'reactstrap'; import './NavPills.scss'; type NavPillsProps = PropsWithChildren<{ diff --git a/src/utils/OrderingDropdown.tsx b/src/utils/OrderingDropdown.tsx index 254dcd4a..f2d73d2e 100644 --- a/src/utils/OrderingDropdown.tsx +++ b/src/utils/OrderingDropdown.tsx @@ -1,8 +1,8 @@ -import { UncontrolledDropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap'; -import { toPairs } from 'ramda'; +import { faSortAmountDown as sortDescIcon, faSortAmountUp as sortAscIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faSortAmountUp as sortAscIcon, faSortAmountDown as sortDescIcon } from '@fortawesome/free-solid-svg-icons'; import classNames from 'classnames'; +import { toPairs } from 'ramda'; +import { DropdownItem, DropdownMenu, DropdownToggle, UncontrolledDropdown } from 'reactstrap'; import type { Order, OrderDir } from './helpers/ordering'; import { determineOrderDir } from './helpers/ordering'; import './OrderingDropdown.scss'; diff --git a/src/utils/Result.tsx b/src/utils/Result.tsx index fe7a7564..12c380a1 100644 --- a/src/utils/Result.tsx +++ b/src/utils/Result.tsx @@ -1,6 +1,6 @@ +import classNames from 'classnames'; import type { FC, PropsWithChildren } from 'react'; import { Row } from 'reactstrap'; -import classNames from 'classnames'; import { SimpleCard } from './SimpleCard'; export type ResultType = 'success' | 'error' | 'warning'; diff --git a/src/utils/SearchField.tsx b/src/utils/SearchField.tsx index a05576ba..4c8a742b 100644 --- a/src/utils/SearchField.tsx +++ b/src/utils/SearchField.tsx @@ -1,7 +1,7 @@ -import { useState } from 'react'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faSearch as searchIcon } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import classNames from 'classnames'; +import { useState } from 'react'; import './SearchField.scss'; const DEFAULT_SEARCH_INTERVAL = 500; diff --git a/src/utils/SimpleCard.tsx b/src/utils/SimpleCard.tsx index 12061c4c..20d85d89 100644 --- a/src/utils/SimpleCard.tsx +++ b/src/utils/SimpleCard.tsx @@ -1,6 +1,6 @@ +import type { ReactNode } from 'react'; import type { CardProps } from 'reactstrap'; import { Card, CardBody, CardHeader } from 'reactstrap'; -import type { ReactNode } from 'react'; interface SimpleCardProps extends Omit { title?: ReactNode; diff --git a/src/utils/dates/DateInput.tsx b/src/utils/dates/DateInput.tsx index 9bc653ea..07fd96cc 100644 --- a/src/utils/dates/DateInput.tsx +++ b/src/utils/dates/DateInput.tsx @@ -1,10 +1,10 @@ -import { useRef } from 'react'; +import { faCalendarAlt as calendarIcon } from '@fortawesome/free-regular-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import classNames from 'classnames'; import { isNil } from 'ramda'; +import { useRef } from 'react'; import type { ReactDatePickerProps } from 'react-datepicker'; import DatePicker from 'react-datepicker'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faCalendarAlt as calendarIcon } from '@fortawesome/free-regular-svg-icons'; -import classNames from 'classnames'; import { STANDARD_DATE_FORMAT } from '../helpers/date'; import './DateInput.scss'; diff --git a/src/utils/dates/DateIntervalDropdownItems.tsx b/src/utils/dates/DateIntervalDropdownItems.tsx index 0e3d59cd..3b8e585b 100644 --- a/src/utils/dates/DateIntervalDropdownItems.tsx +++ b/src/utils/dates/DateIntervalDropdownItems.tsx @@ -1,5 +1,5 @@ -import { DropdownItem } from 'reactstrap'; import type { FC } from 'react'; +import { DropdownItem } from 'reactstrap'; import type { DateInterval } from '../helpers/dateIntervals'; import { DATE_INTERVALS, rangeOrIntervalToString } from '../helpers/dateIntervals'; diff --git a/src/utils/dates/DateRangeRow.tsx b/src/utils/dates/DateRangeRow.tsx index c469d561..f5fe1d7f 100644 --- a/src/utils/dates/DateRangeRow.tsx +++ b/src/utils/dates/DateRangeRow.tsx @@ -1,6 +1,6 @@ import { endOfDay } from 'date-fns'; -import { DateInput } from './DateInput'; import type { DateRange } from '../helpers/dateIntervals'; +import { DateInput } from './DateInput'; interface DateRangeRowProps extends DateRange { onStartDateChange: (date: Date | null) => void; diff --git a/src/utils/dates/DateRangeSelector.tsx b/src/utils/dates/DateRangeSelector.tsx index 93195420..dd254a6a 100644 --- a/src/utils/dates/DateRangeSelector.tsx +++ b/src/utils/dates/DateRangeSelector.tsx @@ -1,19 +1,19 @@ import { useState } from 'react'; import { DropdownItem } from 'reactstrap'; import { DropdownBtn } from '../DropdownBtn'; -import { useEffectExceptFirstTime } from '../helpers/hooks'; import type { DateInterval, DateRange } from '../helpers/dateIntervals'; import { - rangeOrIntervalToString, + ALL, + dateRangeIsEmpty, intervalToDateRange, rangeIsInterval, - dateRangeIsEmpty, - ALL, + rangeOrIntervalToString, } from '../helpers/dateIntervals'; -import { DateRangeRow } from './DateRangeRow'; +import { useEffectExceptFirstTime } from '../helpers/hooks'; import { DateIntervalDropdownItems } from './DateIntervalDropdownItems'; +import { DateRangeRow } from './DateRangeRow'; export interface DateRangeSelectorProps { initialDateRange?: DateInterval | DateRange; diff --git a/src/utils/dates/DateTimeInput.tsx b/src/utils/dates/DateTimeInput.tsx index 3b787909..236f1f0a 100644 --- a/src/utils/dates/DateTimeInput.tsx +++ b/src/utils/dates/DateTimeInput.tsx @@ -1,7 +1,7 @@ -import type { ReactDatePickerProps } from 'react-datepicker'; import type { FC } from 'react'; -import { DateInput } from './DateInput'; +import type { ReactDatePickerProps } from 'react-datepicker'; import { STANDARD_DATE_AND_TIME_FORMAT } from '../helpers/date'; +import { DateInput } from './DateInput'; export type DateTimeInputProps = Omit; diff --git a/src/utils/dates/Time.tsx b/src/utils/dates/Time.tsx index e2418659..8245d031 100644 --- a/src/utils/dates/Time.tsx +++ b/src/utils/dates/Time.tsx @@ -1,4 +1,4 @@ -import { parseISO, format as formatDate, getUnixTime, formatDistance } from 'date-fns'; +import { format as formatDate, formatDistance, getUnixTime, parseISO } from 'date-fns'; import { isDateObject, now, STANDARD_DATE_AND_TIME_FORMAT } from '../helpers/date'; export interface TimeProps { diff --git a/src/utils/forms/InputFormGroup.tsx b/src/utils/forms/InputFormGroup.tsx index 6fda7b60..97e6ccdf 100644 --- a/src/utils/forms/InputFormGroup.tsx +++ b/src/utils/forms/InputFormGroup.tsx @@ -1,7 +1,7 @@ import type { FC, PropsWithChildren } from 'react'; import type { InputType } from 'reactstrap/types/lib/Input'; -import { LabeledFormGroup } from './LabeledFormGroup'; import { useDomId } from '../helpers/hooks'; +import { LabeledFormGroup } from './LabeledFormGroup'; export type InputFormGroupProps = PropsWithChildren<{ value: string; diff --git a/src/utils/helpers/csvjson.ts b/src/utils/helpers/csvjson.ts index 8fe34feb..83411c51 100644 --- a/src/utils/helpers/csvjson.ts +++ b/src/utils/helpers/csvjson.ts @@ -1,5 +1,5 @@ -import csv from 'csvtojson'; import { Parser } from '@json2csv/plainjs'; +import csv from 'csvtojson'; export const csvToJson = (csvContent: string) => new Promise((resolve) => { csv().fromString(csvContent).then(resolve); diff --git a/src/utils/helpers/dateIntervals.ts b/src/utils/helpers/dateIntervals.ts index 462feb87..be5d7dd5 100644 --- a/src/utils/helpers/dateIntervals.ts +++ b/src/utils/helpers/dateIntervals.ts @@ -1,8 +1,8 @@ -import { subDays, startOfDay, endOfDay } from 'date-fns'; +import { endOfDay, startOfDay, subDays } from 'date-fns'; import { cond, filter, isEmpty, T } from 'ramda'; +import { equals } from '../utils'; import type { DateOrString } from './date'; import { dateOrNull, formatInternational, isBeforeOrEqual, now, parseISO } from './date'; -import { equals } from '../utils'; export interface DateRange { startDate?: Date | null; diff --git a/src/utils/helpers/hooks.ts b/src/utils/helpers/hooks.ts index 020428a9..d51cb13a 100644 --- a/src/utils/helpers/hooks.ts +++ b/src/utils/helpers/hooks.ts @@ -1,7 +1,7 @@ import type { DependencyList, EffectCallback } from 'react'; import { useEffect, useRef, useState } from 'react'; -import { useSwipeable as useReactSwipeable } from 'react-swipeable'; import { useLocation, useNavigate } from 'react-router-dom'; +import { useSwipeable as useReactSwipeable } from 'react-swipeable'; import { v4 as uuid } from 'uuid'; import { parseQuery, stringifyQuery } from './query'; diff --git a/src/utils/helpers/leaflet.ts b/src/utils/helpers/leaflet.ts index 809e1575..df56e3fe 100644 --- a/src/utils/helpers/leaflet.ts +++ b/src/utils/helpers/leaflet.ts @@ -1,6 +1,6 @@ import L from 'leaflet'; -import marker2x from 'leaflet/dist/images/marker-icon-2x.png'; import marker from 'leaflet/dist/images/marker-icon.png'; +import marker2x from 'leaflet/dist/images/marker-icon-2x.png'; import markerShadow from 'leaflet/dist/images/marker-shadow.png'; export const fixLeafletIcons = () => { diff --git a/src/utils/helpers/visits.ts b/src/utils/helpers/visits.ts index fb8f12c4..468d310a 100644 --- a/src/utils/helpers/visits.ts +++ b/src/utils/helpers/visits.ts @@ -1,8 +1,8 @@ import bowser from 'bowser'; import { zipObj } from 'ramda'; +import type { Stats, UserAgent } from '../../visits/types'; import type { Empty } from '../utils'; import { hasValue } from '../utils'; -import type { Stats, UserAgent } from '../../visits/types'; const DEFAULT = 'Others'; const BROWSERS_WHITELIST = [ diff --git a/src/utils/services/provideServices.ts b/src/utils/services/provideServices.ts index eeb3d326..4fd1f46c 100644 --- a/src/utils/services/provideServices.ts +++ b/src/utils/services/provideServices.ts @@ -1,8 +1,8 @@ import type Bottle from 'bottlejs'; -import { useTimeoutToggle } from '../helpers/hooks'; -import { LocalStorage } from './LocalStorage'; -import { ColorGenerator } from './ColorGenerator'; import { csvToJson, jsonToCsv } from '../helpers/csvjson'; +import { useTimeoutToggle } from '../helpers/hooks'; +import { ColorGenerator } from './ColorGenerator'; +import { LocalStorage } from './LocalStorage'; const provideServices = (bottle: Bottle) => { bottle.constant('localStorage', window.localStorage); diff --git a/src/utils/table/TableOrderIcon.tsx b/src/utils/table/TableOrderIcon.tsx index fbf7bd7a..4c8d8fae 100644 --- a/src/utils/table/TableOrderIcon.tsx +++ b/src/utils/table/TableOrderIcon.tsx @@ -1,5 +1,5 @@ -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCaretDown as caretDownIcon, faCaretUp as caretUpIcon } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { Order } from '../helpers/ordering'; interface TableOrderIconProps { diff --git a/src/visits/DomainVisits.tsx b/src/visits/DomainVisits.tsx index 8564f390..474da438 100644 --- a/src/visits/DomainVisits.tsx +++ b/src/visits/DomainVisits.tsx @@ -1,15 +1,15 @@ import { useParams } from 'react-router-dom'; -import type { CommonVisitsProps } from './types/CommonVisitsProps'; import type { ShlinkVisitsParams } from '../api/types'; -import type { DomainVisits as DomainVisitsState, LoadDomainVisits } from './reducers/domainVisits'; import type { ReportExporter } from '../common/services/ReportExporter'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; import { useGoBack } from '../utils/helpers/hooks'; -import { toApiParams } from './types/helpers'; +import type { DomainVisits as DomainVisitsState, LoadDomainVisits } from './reducers/domainVisits'; import type { NormalizedVisit } from './types'; -import { VisitsStats } from './VisitsStats'; +import type { CommonVisitsProps } from './types/CommonVisitsProps'; +import { toApiParams } from './types/helpers'; import { VisitsHeader } from './VisitsHeader'; +import { VisitsStats } from './VisitsStats'; export interface DomainVisitsProps extends CommonVisitsProps { getDomainVisits: (params: LoadDomainVisits) => void; diff --git a/src/visits/NonOrphanVisits.tsx b/src/visits/NonOrphanVisits.tsx index b7d64a81..79fd5fca 100644 --- a/src/visits/NonOrphanVisits.tsx +++ b/src/visits/NonOrphanVisits.tsx @@ -1,13 +1,13 @@ +import type { ReportExporter } from '../common/services/ReportExporter'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; import { useGoBack } from '../utils/helpers/hooks'; -import type { ReportExporter } from '../common/services/ReportExporter'; -import { VisitsStats } from './VisitsStats'; +import type { LoadVisits, VisitsInfo } from './reducers/types'; import type { NormalizedVisit, VisitsParams } from './types'; import type { CommonVisitsProps } from './types/CommonVisitsProps'; import { toApiParams } from './types/helpers'; import { VisitsHeader } from './VisitsHeader'; -import type { LoadVisits, VisitsInfo } from './reducers/types'; +import { VisitsStats } from './VisitsStats'; export interface NonOrphanVisitsProps extends CommonVisitsProps { getNonOrphanVisits: (params: LoadVisits) => void; diff --git a/src/visits/OrphanVisits.tsx b/src/visits/OrphanVisits.tsx index ba14d534..379b0ef8 100644 --- a/src/visits/OrphanVisits.tsx +++ b/src/visits/OrphanVisits.tsx @@ -1,14 +1,14 @@ +import type { ReportExporter } from '../common/services/ReportExporter'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; import { useGoBack } from '../utils/helpers/hooks'; -import type { ReportExporter } from '../common/services/ReportExporter'; -import { VisitsStats } from './VisitsStats'; +import type { LoadOrphanVisits } from './reducers/orphanVisits'; +import type { VisitsInfo } from './reducers/types'; import type { NormalizedVisit, VisitsParams } from './types'; import type { CommonVisitsProps } from './types/CommonVisitsProps'; import { toApiParams } from './types/helpers'; import { VisitsHeader } from './VisitsHeader'; -import type { VisitsInfo } from './reducers/types'; -import type { LoadOrphanVisits } from './reducers/orphanVisits'; +import { VisitsStats } from './VisitsStats'; export interface OrphanVisitsProps extends CommonVisitsProps { getOrphanVisits: (params: LoadOrphanVisits) => void; diff --git a/src/visits/ShortUrlVisits.tsx b/src/visits/ShortUrlVisits.tsx index 03154895..d3a28e55 100644 --- a/src/visits/ShortUrlVisits.tsx +++ b/src/visits/ShortUrlVisits.tsx @@ -1,19 +1,19 @@ import { useEffect } from 'react'; import { useLocation, useParams } from 'react-router-dom'; +import type { ReportExporter } from '../common/services/ReportExporter'; import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; -import { parseQuery } from '../utils/helpers/query'; import { Topics } from '../mercure/helpers/Topics'; +import type { ShortUrlIdentifier } from '../short-urls/data'; +import { urlDecodeShortCode } from '../short-urls/helpers'; import type { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail'; import { useGoBack } from '../utils/helpers/hooks'; -import type { ReportExporter } from '../common/services/ReportExporter'; +import { parseQuery } from '../utils/helpers/query'; import type { LoadShortUrlVisits, ShortUrlVisits as ShortUrlVisitsState } from './reducers/shortUrlVisits'; import { ShortUrlVisitsHeader } from './ShortUrlVisitsHeader'; -import { VisitsStats } from './VisitsStats'; import type { NormalizedVisit, VisitsParams } from './types'; import type { CommonVisitsProps } from './types/CommonVisitsProps'; import { toApiParams } from './types/helpers'; -import { urlDecodeShortCode } from '../short-urls/helpers'; -import type { ShortUrlIdentifier } from '../short-urls/data'; +import { VisitsStats } from './VisitsStats'; export interface ShortUrlVisitsProps extends CommonVisitsProps { getShortUrlVisits: (params: LoadShortUrlVisits) => void; diff --git a/src/visits/ShortUrlVisitsHeader.tsx b/src/visits/ShortUrlVisitsHeader.tsx index 52088dfd..b40b4293 100644 --- a/src/visits/ShortUrlVisitsHeader.tsx +++ b/src/visits/ShortUrlVisitsHeader.tsx @@ -1,5 +1,5 @@ -import { UncontrolledTooltip } from 'reactstrap'; import { ExternalLink } from 'react-external-link'; +import { UncontrolledTooltip } from 'reactstrap'; import type { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail'; import { Time } from '../utils/dates/Time'; import type { ShortUrlVisits } from './reducers/shortUrlVisits'; diff --git a/src/visits/TagVisits.tsx b/src/visits/TagVisits.tsx index 85738cf3..dcbcdbb1 100644 --- a/src/visits/TagVisits.tsx +++ b/src/visits/TagVisits.tsx @@ -1,16 +1,16 @@ import { useParams } from 'react-router-dom'; -import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; -import type { ColorGenerator } from '../utils/services/ColorGenerator'; import type { ShlinkVisitsParams } from '../api/types'; +import type { ReportExporter } from '../common/services/ReportExporter'; +import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub'; import { Topics } from '../mercure/helpers/Topics'; import { useGoBack } from '../utils/helpers/hooks'; -import type { ReportExporter } from '../common/services/ReportExporter'; +import type { ColorGenerator } from '../utils/services/ColorGenerator'; import type { LoadTagVisits, TagVisits as TagVisitsState } from './reducers/tagVisits'; import { TagVisitsHeader } from './TagVisitsHeader'; -import { VisitsStats } from './VisitsStats'; import type { NormalizedVisit } from './types'; import type { CommonVisitsProps } from './types/CommonVisitsProps'; import { toApiParams } from './types/helpers'; +import { VisitsStats } from './VisitsStats'; export interface TagVisitsProps extends CommonVisitsProps { getTagVisits: (params: LoadTagVisits) => void; diff --git a/src/visits/TagVisitsHeader.tsx b/src/visits/TagVisitsHeader.tsx index 6a3970cf..341b0bad 100644 --- a/src/visits/TagVisitsHeader.tsx +++ b/src/visits/TagVisitsHeader.tsx @@ -1,7 +1,7 @@ import { Tag } from '../tags/helpers/Tag'; import type { ColorGenerator } from '../utils/services/ColorGenerator'; -import { VisitsHeader } from './VisitsHeader'; import type { TagVisits } from './reducers/tagVisits'; +import { VisitsHeader } from './VisitsHeader'; import './ShortUrlVisitsHeader.scss'; interface TagVisitsHeaderProps { diff --git a/src/visits/VisitsHeader.tsx b/src/visits/VisitsHeader.tsx index e42a8b82..56584e83 100644 --- a/src/visits/VisitsHeader.tsx +++ b/src/visits/VisitsHeader.tsx @@ -1,9 +1,9 @@ -import { Button, Card } from 'reactstrap'; -import type { FC, PropsWithChildren, ReactNode } from 'react'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faArrowLeft } from '@fortawesome/free-solid-svg-icons'; -import { ShortUrlVisitsCount } from '../short-urls/helpers/ShortUrlVisitsCount'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import type { FC, PropsWithChildren, ReactNode } from 'react'; +import { Button, Card } from 'reactstrap'; import type { ShortUrl } from '../short-urls/data'; +import { ShortUrlVisitsCount } from '../short-urls/helpers/ShortUrlVisitsCount'; import type { Visit } from './types'; type VisitsHeaderProps = PropsWithChildren<{ diff --git a/src/visits/VisitsStats.tsx b/src/visits/VisitsStats.tsx index 72f618a2..638d0cff 100644 --- a/src/visits/VisitsStats.tsx +++ b/src/visits/VisitsStats.tsx @@ -1,34 +1,34 @@ +import type { IconDefinition } from '@fortawesome/fontawesome-common-types'; +import { faCalendarAlt, faChartPie, faList, faMapMarkedAlt } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import classNames from 'classnames'; import { isEmpty, pipe, propEq, values } from 'ramda'; import type { FC, PropsWithChildren } from 'react'; -import { useState, useEffect, useMemo, useRef } 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 { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faCalendarAlt, faMapMarkedAlt, faList, faChartPie } from '@fortawesome/free-solid-svg-icons'; -import type { IconDefinition } from '@fortawesome/fontawesome-common-types'; -import { Route, Routes, Navigate, useLocation } from 'react-router-dom'; -import classNames from 'classnames'; -import { DateRangeSelector } from '../utils/dates/DateRangeSelector'; -import { Message } from '../utils/Message'; -import { Result } from '../utils/Result'; import { ShlinkApiError } from '../api/ShlinkApiError'; import type { Settings } from '../settings/reducers/settings'; -import { prettify } from '../utils/helpers/numbers'; -import { NavPillItem, NavPills } from '../utils/NavPills'; +import { DateRangeSelector } from '../utils/dates/DateRangeSelector'; import { ExportBtn } from '../utils/ExportBtn'; -import { LineChartCard } from './charts/LineChartCard'; -import { VisitsTable } from './VisitsTable'; -import type { NormalizedOrphanVisit, NormalizedVisit, VisitsParams } from './types'; -import { OpenMapModalBtn } from './helpers/OpenMapModalBtn'; -import { normalizeVisits, processStatsFromVisits } from './services/VisitsParser'; -import { VisitsFilterDropdown } from './helpers/VisitsFilterDropdown'; -import type { HighlightableProps } from './types/helpers'; -import { highlightedVisitsToStats } from './types/helpers'; -import { DoughnutChartCard } from './charts/DoughnutChartCard'; -import { SortableBarChartCard } from './charts/SortableBarChartCard'; -import type { VisitsInfo } from './reducers/types'; -import { useVisitsQuery } from './helpers/hooks'; 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 { DoughnutChartCard } from './charts/DoughnutChartCard'; +import { LineChartCard } from './charts/LineChartCard'; +import { SortableBarChartCard } from './charts/SortableBarChartCard'; +import { useVisitsQuery } from './helpers/hooks'; +import { OpenMapModalBtn } from './helpers/OpenMapModalBtn'; +import { VisitsFilterDropdown } from './helpers/VisitsFilterDropdown'; +import type { VisitsInfo } from './reducers/types'; +import { normalizeVisits, processStatsFromVisits } from './services/VisitsParser'; +import type { NormalizedOrphanVisit, NormalizedVisit, VisitsParams } from './types'; +import type { HighlightableProps } from './types/helpers'; +import { highlightedVisitsToStats } from './types/helpers'; +import { VisitsTable } from './VisitsTable'; export type VisitsStatsProps = PropsWithChildren<{ getVisits: (params: VisitsParams, doIntervalFallback?: boolean) => void; diff --git a/src/visits/VisitsTable.tsx b/src/visits/VisitsTable.tsx index 0990e426..44c395f4 100644 --- a/src/visits/VisitsTable.tsx +++ b/src/visits/VisitsTable.tsx @@ -1,15 +1,15 @@ -import { useEffect, useMemo, useState, useRef } from 'react'; -import classNames from 'classnames'; -import { min, splitEvery } from 'ramda'; import { faCheck as checkIcon, faRobot as botIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +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 { SearchField } from '../utils/SearchField'; +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 { prettify } from '../utils/helpers/numbers'; -import { Time } from '../utils/dates/Time'; +import { SearchField } from '../utils/SearchField'; import { TableOrderIcon } from '../utils/table/TableOrderIcon'; import type { MediaMatcher } from '../utils/types'; import type { NormalizedOrphanVisit, NormalizedVisit } from './types'; diff --git a/src/visits/charts/ChartCard.tsx b/src/visits/charts/ChartCard.tsx index 8f74f1d1..ed2f0be6 100644 --- a/src/visits/charts/ChartCard.tsx +++ b/src/visits/charts/ChartCard.tsx @@ -1,5 +1,5 @@ -import { Card, CardHeader, CardBody, CardFooter } from 'reactstrap'; import type { FC, PropsWithChildren, ReactNode } from 'react'; +import { Card, CardBody, CardFooter, CardHeader } from 'reactstrap'; import './ChartCard.scss'; type ChartCardProps = PropsWithChildren<{ diff --git a/src/visits/charts/DoughnutChart.tsx b/src/visits/charts/DoughnutChart.tsx index f41337aa..ff721c14 100644 --- a/src/visits/charts/DoughnutChart.tsx +++ b/src/visits/charts/DoughnutChart.tsx @@ -1,7 +1,7 @@ -import type { FC } from 'react'; -import { useState, memo } from 'react'; import type { Chart, ChartData, ChartDataset, ChartOptions } from 'chart.js'; 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'; diff --git a/src/visits/charts/DoughnutChartCard.tsx b/src/visits/charts/DoughnutChartCard.tsx index fc3c2425..176f84e4 100644 --- a/src/visits/charts/DoughnutChartCard.tsx +++ b/src/visits/charts/DoughnutChartCard.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import type { Stats } from '../types'; -import { DoughnutChart } from './DoughnutChart'; import { ChartCard } from './ChartCard'; +import { DoughnutChart } from './DoughnutChart'; interface DoughnutChartCardProps { title: string; diff --git a/src/visits/charts/DoughnutChartLegend.tsx b/src/visits/charts/DoughnutChartLegend.tsx index d075492c..aa70f47a 100644 --- a/src/visits/charts/DoughnutChartLegend.tsx +++ b/src/visits/charts/DoughnutChartLegend.tsx @@ -1,5 +1,5 @@ -import type { FC } from 'react'; import type { Chart } from 'chart.js'; +import type { FC } from 'react'; import './DoughnutChartLegend.scss'; interface DoughnutChartLegendProps { diff --git a/src/visits/charts/HorizontalBarChart.tsx b/src/visits/charts/HorizontalBarChart.tsx index 5de8885e..1aac6903 100644 --- a/src/visits/charts/HorizontalBarChart.tsx +++ b/src/visits/charts/HorizontalBarChart.tsx @@ -1,13 +1,13 @@ -import type { FC, MutableRefObject } from 'react'; -import { useRef } from 'react'; import type { ChartData, ChartDataset, ChartOptions, InteractionItem } from 'chart.js'; import { keys, values } from 'ramda'; +import type { FC, MutableRefObject } from 'react'; +import { useRef } from 'react'; import { Bar, getElementAtEvent } from 'react-chartjs-2'; -import { fillTheGaps } from '../../utils/helpers/visits'; import { pointerOnHover, renderChartLabel } from '../../utils/helpers/charts'; import { prettify } from '../../utils/helpers/numbers'; -import type { Stats } from '../types'; +import { fillTheGaps } from '../../utils/helpers/visits'; import { HIGHLIGHTED_COLOR, HIGHLIGHTED_COLOR_ALPHA, MAIN_COLOR, MAIN_COLOR_ALPHA } from '../../utils/theme'; +import type { Stats } from '../types'; export interface HorizontalBarChartProps { stats: Stats; diff --git a/src/visits/charts/LineChartCard.tsx b/src/visits/charts/LineChartCard.tsx index b44de862..59cb9bba 100644 --- a/src/visits/charts/LineChartCard.tsx +++ b/src/visits/charts/LineChartCard.tsx @@ -1,37 +1,37 @@ -import type { MutableRefObject } from 'react'; -import { useState, useMemo, useRef } from 'react'; -import { - Card, - CardHeader, - CardBody, - UncontrolledDropdown, - DropdownToggle, - DropdownMenu, - DropdownItem, -} from 'reactstrap'; -import { getElementAtEvent, Line } from 'react-chartjs-2'; -import { always, cond, countBy, reverse } from 'ramda'; +import type { ChartData, ChartDataset, ChartOptions, InteractionItem } from 'chart.js'; import { add, differenceInDays, differenceInHours, differenceInMonths, differenceInWeeks, - parseISO, - format, - startOfISOWeek, endOfISOWeek, + format, + parseISO, + startOfISOWeek, } from 'date-fns'; -import type { ChartData, ChartDataset, ChartOptions, InteractionItem } from 'chart.js'; -import type { NormalizedVisit, Stats } from '../types'; -import { fillTheGaps } from '../../utils/helpers/visits'; -import { useToggle } from '../../utils/helpers/hooks'; -import { rangeOf } from '../../utils/utils'; -import { ToggleSwitch } from '../../utils/ToggleSwitch'; -import { prettify } from '../../utils/helpers/numbers'; +import { always, cond, countBy, reverse } from 'ramda'; +import type { MutableRefObject } from 'react'; +import { useMemo, useRef, useState } from 'react'; +import { getElementAtEvent, Line } from 'react-chartjs-2'; +import { + Card, + CardBody, + CardHeader, + DropdownItem, + DropdownMenu, + DropdownToggle, + UncontrolledDropdown, +} from 'reactstrap'; import { pointerOnHover, renderChartLabel } from '../../utils/helpers/charts'; -import { HIGHLIGHTED_COLOR, MAIN_COLOR } from '../../utils/theme'; import { STANDARD_DATE_FORMAT } from '../../utils/helpers/date'; +import { useToggle } from '../../utils/helpers/hooks'; +import { prettify } from '../../utils/helpers/numbers'; +import { fillTheGaps } from '../../utils/helpers/visits'; +import { HIGHLIGHTED_COLOR, MAIN_COLOR } from '../../utils/theme'; +import { ToggleSwitch } from '../../utils/ToggleSwitch'; +import { rangeOf } from '../../utils/utils'; +import type { NormalizedVisit, Stats } from '../types'; import './LineChartCard.scss'; interface LineChartCardProps { diff --git a/src/visits/charts/SortableBarChartCard.tsx b/src/visits/charts/SortableBarChartCard.tsx index a1ee4c37..7ee08900 100644 --- a/src/visits/charts/SortableBarChartCard.tsx +++ b/src/visits/charts/SortableBarChartCard.tsx @@ -1,16 +1,16 @@ +import { fromPairs, pipe, reverse, sortBy, splitEvery, toLower, toPairs, type, zipObj } from 'ramda'; import type { FC, ReactNode } from 'react'; import { useState } from 'react'; -import { fromPairs, pipe, reverse, sortBy, splitEvery, toLower, toPairs, type, zipObj } from 'ramda'; -import { rangeOf } from '../../utils/utils'; -import type { Order } from '../../utils/helpers/ordering'; 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 type { Stats, StatsRow } from '../types'; +import { ChartCard } from './ChartCard'; import type { HorizontalBarChartProps } from './HorizontalBarChart'; import { HorizontalBarChart } from './HorizontalBarChart'; -import { ChartCard } from './ChartCard'; interface SortableBarChartCardProps extends Omit { title: Function | string; diff --git a/src/visits/helpers/MapModal.tsx b/src/visits/helpers/MapModal.tsx index cfb69ffc..bc0a1bd9 100644 --- a/src/visits/helpers/MapModal.tsx +++ b/src/visits/helpers/MapModal.tsx @@ -1,8 +1,8 @@ -import type { FC } from 'react'; -import { Modal, ModalBody } from 'reactstrap'; -import type { MapContainerProps } from 'react-leaflet'; -import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet'; import { prop } from 'ramda'; +import type { FC } from 'react'; +import type { MapContainerProps } from 'react-leaflet'; +import { MapContainer, Marker, Popup, TileLayer } from 'react-leaflet'; +import { Modal, ModalBody } from 'reactstrap'; import type { CityStats } from '../types'; import './MapModal.scss'; diff --git a/src/visits/helpers/OpenMapModalBtn.tsx b/src/visits/helpers/OpenMapModalBtn.tsx index 589ff55e..b36a2ce9 100644 --- a/src/visits/helpers/OpenMapModalBtn.tsx +++ b/src/visits/helpers/OpenMapModalBtn.tsx @@ -1,6 +1,6 @@ -import { useState } from 'react'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; 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 type { CityStats } from '../types'; diff --git a/src/visits/helpers/VisitsFilterDropdown.tsx b/src/visits/helpers/VisitsFilterDropdown.tsx index a1aca0ac..195acba6 100644 --- a/src/visits/helpers/VisitsFilterDropdown.tsx +++ b/src/visits/helpers/VisitsFilterDropdown.tsx @@ -1,8 +1,8 @@ import type { DropdownItemProps } from 'reactstrap'; import { DropdownItem } from 'reactstrap'; -import type { OrphanVisitType, VisitsFilter } from '../types'; import { DropdownBtn } from '../../utils/DropdownBtn'; import { hasValue } from '../../utils/utils'; +import type { OrphanVisitType, VisitsFilter } from '../types'; interface VisitsFilterDropdownProps { onChange: (filters: VisitsFilter) => void; diff --git a/src/visits/helpers/hooks.ts b/src/visits/helpers/hooks.ts index e8b6d072..42798bc7 100644 --- a/src/visits/helpers/hooks.ts +++ b/src/visits/helpers/hooks.ts @@ -1,14 +1,14 @@ import type { DeepPartial } from '@reduxjs/toolkit'; -import { useLocation, useNavigate } from 'react-router-dom'; -import { useMemo } from 'react'; 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 type { OrphanVisitType, VisitsFilter } from '../types'; import { parseQuery, stringifyQuery } from '../../utils/helpers/query'; -import { formatIsoDate } from '../../utils/helpers/date'; import type { BooleanString } from '../../utils/utils'; import { parseBooleanToString } from '../../utils/utils'; +import type { OrphanVisitType, VisitsFilter } from '../types'; interface VisitsQuery { startDate?: string; diff --git a/src/visits/reducers/common.ts b/src/visits/reducers/common.ts index 108a2e56..fe7183ac 100644 --- a/src/visits/reducers/common.ts +++ b/src/visits/reducers/common.ts @@ -1,13 +1,13 @@ -import { flatten, prop, range, splitEvery } from 'ramda'; import { createAction, createSlice } from '@reduxjs/toolkit'; +import { flatten, prop, range, splitEvery } from 'ramda'; import type { ShlinkPaginator, ShlinkVisits, ShlinkVisitsParams } from '../../api/types'; -import type { CreateVisit, Visit } from '../types'; +import { parseApiError } from '../../api/utils'; +import type { ShlinkState } from '../../container/types'; import type { DateInterval } from '../../utils/helpers/dateIntervals'; import { dateToMatchingInterval } from '../../utils/helpers/dateIntervals'; -import type { LoadVisits, VisitsInfo, VisitsLoaded } from './types'; import { createAsyncThunk } from '../../utils/helpers/redux'; -import type { ShlinkState } from '../../container/types'; -import { parseApiError } from '../../api/utils'; +import type { CreateVisit, Visit } from '../types'; +import type { LoadVisits, VisitsInfo, VisitsLoaded } from './types'; import { createNewVisits } from './visitCreation'; const ITEMS_PER_PAGE = 5000; diff --git a/src/visits/reducers/domainVisits.ts b/src/visits/reducers/domainVisits.ts index 24018445..cfb08322 100644 --- a/src/visits/reducers/domainVisits.ts +++ b/src/visits/reducers/domainVisits.ts @@ -1,7 +1,7 @@ import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import { domainMatches } from '../../short-urls/helpers'; import { isBetween } from '../../utils/helpers/date'; import { createVisitsAsyncThunk, createVisitsReducer, lastVisitLoaderForLoader } from './common'; -import { domainMatches } from '../../short-urls/helpers'; import type { LoadVisits, VisitsInfo } from './types'; const REDUCER_PREFIX = 'shlink/domainVisits'; diff --git a/src/visits/reducers/orphanVisits.ts b/src/visits/reducers/orphanVisits.ts index 48292265..1bb5c55d 100644 --- a/src/visits/reducers/orphanVisits.ts +++ b/src/visits/reducers/orphanVisits.ts @@ -1,7 +1,7 @@ -import type { OrphanVisit, OrphanVisitType } from '../types'; import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { isOrphanVisit } from '../types/helpers'; import { isBetween } from '../../utils/helpers/date'; +import type { OrphanVisit, OrphanVisitType } from '../types'; +import { isOrphanVisit } from '../types/helpers'; import { createVisitsAsyncThunk, createVisitsReducer, lastVisitLoaderForLoader } from './common'; import type { LoadVisits, VisitsInfo } from './types'; diff --git a/src/visits/reducers/shortUrlVisits.ts b/src/visits/reducers/shortUrlVisits.ts index 2e37b176..5b7d432e 100644 --- a/src/visits/reducers/shortUrlVisits.ts +++ b/src/visits/reducers/shortUrlVisits.ts @@ -1,6 +1,6 @@ -import { shortUrlMatches } from '../../short-urls/helpers'; -import type { ShortUrlIdentifier } from '../../short-urls/data'; import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShortUrlIdentifier } from '../../short-urls/data'; +import { shortUrlMatches } from '../../short-urls/helpers'; import { isBetween } from '../../utils/helpers/date'; import { createVisitsAsyncThunk, createVisitsReducer, lastVisitLoaderForLoader } from './common'; import type { LoadVisits, VisitsInfo } from './types'; diff --git a/src/visits/reducers/types/index.ts b/src/visits/reducers/types/index.ts index f61be0a9..1ab70627 100644 --- a/src/visits/reducers/types/index.ts +++ b/src/visits/reducers/types/index.ts @@ -1,6 +1,6 @@ import type { ShlinkVisitsParams } from '../../../api/types'; -import type { DateInterval } from '../../../utils/helpers/dateIntervals'; import type { ProblemDetailsError } from '../../../api/types/errors'; +import type { DateInterval } from '../../../utils/helpers/dateIntervals'; import type { Visit } from '../../types'; export interface VisitsInfo { diff --git a/src/visits/reducers/visitsOverview.ts b/src/visits/reducers/visitsOverview.ts index b1f6417e..bab2b58b 100644 --- a/src/visits/reducers/visitsOverview.ts +++ b/src/visits/reducers/visitsOverview.ts @@ -1,7 +1,7 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; -import type { ShlinkVisitsOverview } from '../../api/types'; import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkVisitsOverview } from '../../api/types'; import { createAsyncThunk } from '../../utils/helpers/redux'; import { groupNewVisitsByType } from '../types/helpers'; import { createNewVisits } from './visitCreation'; diff --git a/src/visits/services/provideServices.ts b/src/visits/services/provideServices.ts index 569ae852..beaf6de5 100644 --- a/src/visits/services/provideServices.ts +++ b/src/visits/services/provideServices.ts @@ -1,20 +1,20 @@ import type Bottle from 'bottlejs'; import { prop } from 'ramda'; +import type { ConnectDecorator } from '../../container/types'; +import { DomainVisits } from '../DomainVisits'; import { MapModal } from '../helpers/MapModal'; -import { createNewVisits } from '../reducers/visitCreation'; -import { ShortUrlVisits } from '../ShortUrlVisits'; -import { TagVisits } from '../TagVisits'; -import { OrphanVisits } from '../OrphanVisits'; import { NonOrphanVisits } from '../NonOrphanVisits'; +import { OrphanVisits } from '../OrphanVisits'; +import { domainVisitsReducerCreator, getDomainVisits } from '../reducers/domainVisits'; +import { getNonOrphanVisits, nonOrphanVisitsReducerCreator } from '../reducers/nonOrphanVisits'; +import { getOrphanVisits, orphanVisitsReducerCreator } from '../reducers/orphanVisits'; import { getShortUrlVisits, shortUrlVisitsReducerCreator } from '../reducers/shortUrlVisits'; import { getTagVisits, tagVisitsReducerCreator } from '../reducers/tagVisits'; -import { getDomainVisits, domainVisitsReducerCreator } from '../reducers/domainVisits'; -import { getOrphanVisits, orphanVisitsReducerCreator } from '../reducers/orphanVisits'; -import { getNonOrphanVisits, nonOrphanVisitsReducerCreator } from '../reducers/nonOrphanVisits'; -import type { ConnectDecorator } from '../../container/types'; +import { createNewVisits } from '../reducers/visitCreation'; import { loadVisitsOverview, visitsOverviewReducerCreator } from '../reducers/visitsOverview'; +import { ShortUrlVisits } from '../ShortUrlVisits'; +import { TagVisits } from '../TagVisits'; import * as visitsParser from './VisitsParser'; -import { DomainVisits } from '../DomainVisits'; const provideServices = (bottle: Bottle, connect: ConnectDecorator) => { // Components diff --git a/src/visits/types/helpers.ts b/src/visits/types/helpers.ts index 226a2514..77714262 100644 --- a/src/visits/types/helpers.ts +++ b/src/visits/types/helpers.ts @@ -1,6 +1,6 @@ import { countBy, groupBy, pipe, prop } from 'ramda'; -import { formatIsoDate } from '../../utils/helpers/date'; import type { ShlinkVisitsParams } from '../../api/types'; +import { formatIsoDate } from '../../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/test/__helpers__/setUpTest.ts b/test/__helpers__/setUpTest.ts index 424d177a..ffaf7376 100644 --- a/test/__helpers__/setUpTest.ts +++ b/test/__helpers__/setUpTest.ts @@ -1,6 +1,6 @@ -import type { ReactElement } from 'react'; import { render } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import type { ReactElement } from 'react'; export const setUpCanvas = (element: ReactElement) => { const result = render(element); diff --git a/test/api/services/ShlinkApiClient.test.ts b/test/api/services/ShlinkApiClient.test.ts index ac8bdd98..4215e088 100644 --- a/test/api/services/ShlinkApiClient.test.ts +++ b/test/api/services/ShlinkApiClient.test.ts @@ -1,10 +1,10 @@ import { Mock } from 'ts-mockery'; import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { OptionalString } from '../../../src/utils/utils'; import type { ShlinkDomain, ShlinkVisits, ShlinkVisitsOverview } from '../../../src/api/types'; -import type { ShortUrl, ShortUrlsOrder } from '../../../src/short-urls/data'; import { ErrorTypeV2, ErrorTypeV3 } from '../../../src/api/types/errors'; import type { HttpClient } from '../../../src/common/services/HttpClient'; +import type { ShortUrl, ShortUrlsOrder } from '../../../src/short-urls/data'; +import type { OptionalString } from '../../../src/utils/utils'; describe('ShlinkApiClient', () => { const fetchJson = jest.fn().mockResolvedValue({}); diff --git a/test/api/services/ShlinkApiClientBuilder.test.ts b/test/api/services/ShlinkApiClientBuilder.test.ts index f6dc44be..3729bf07 100644 --- a/test/api/services/ShlinkApiClientBuilder.test.ts +++ b/test/api/services/ShlinkApiClientBuilder.test.ts @@ -1,8 +1,8 @@ import { Mock } from 'ts-mockery'; import { buildShlinkApiClient } from '../../../src/api/services/ShlinkApiClientBuilder'; -import type { ReachableServer, SelectedServer } from '../../../src/servers/data'; -import type { ShlinkState } from '../../../src/container/types'; import type { HttpClient } from '../../../src/common/services/HttpClient'; +import type { ShlinkState } from '../../../src/container/types'; +import type { ReachableServer, SelectedServer } from '../../../src/servers/data'; describe('ShlinkApiClientBuilder', () => { const server = (data: Partial) => Mock.of(data); diff --git a/test/app/App.test.tsx b/test/app/App.test.tsx index 234fd86f..345ce5d6 100644 --- a/test/app/App.test.tsx +++ b/test/app/App.test.tsx @@ -1,9 +1,9 @@ import { render, screen } from '@testing-library/react'; -import { Router } from 'react-router-dom'; import { createMemoryHistory } from 'history'; +import { Router } from 'react-router-dom'; import { Mock } from 'ts-mockery'; -import type { Settings } from '../../src/settings/reducers/settings'; import { App as createApp } from '../../src/app/App'; +import type { Settings } from '../../src/settings/reducers/settings'; describe('', () => { const App = createApp( diff --git a/test/app/reducers/appUpdates.test.ts b/test/app/reducers/appUpdates.test.ts index 32070612..1289132f 100644 --- a/test/app/reducers/appUpdates.test.ts +++ b/test/app/reducers/appUpdates.test.ts @@ -1,4 +1,4 @@ -import { appUpdatesReducer, appUpdateAvailable, resetAppUpdate } from '../../../src/app/reducers/appUpdates'; +import { appUpdateAvailable, appUpdatesReducer, resetAppUpdate } from '../../../src/app/reducers/appUpdates'; describe('appUpdatesReducer', () => { describe('reducer', () => { diff --git a/test/common/AsideMenu.test.tsx b/test/common/AsideMenu.test.tsx index 0efe448d..7e149e15 100644 --- a/test/common/AsideMenu.test.tsx +++ b/test/common/AsideMenu.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; +import { Mock } from 'ts-mockery'; import { AsideMenu as createAsideMenu } from '../../src/common/AsideMenu'; import type { ReachableServer } from '../../src/servers/data'; diff --git a/test/common/Home.test.tsx b/test/common/Home.test.tsx index 6308eb9a..9f389c83 100644 --- a/test/common/Home.test.tsx +++ b/test/common/Home.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; +import { Mock } from 'ts-mockery'; import { Home } from '../../src/common/Home'; import type { ServersMap, ServerWithId } from '../../src/servers/data'; diff --git a/test/common/MainHeader.test.tsx b/test/common/MainHeader.test.tsx index e3187c7e..678df1f8 100644 --- a/test/common/MainHeader.test.tsx +++ b/test/common/MainHeader.test.tsx @@ -1,6 +1,6 @@ import { screen, waitFor } from '@testing-library/react'; -import { Router } from 'react-router-dom'; import { createMemoryHistory } from 'history'; +import { Router } from 'react-router-dom'; import { MainHeader as createMainHeader } from '../../src/common/MainHeader'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/common/MenuLayout.test.tsx b/test/common/MenuLayout.test.tsx index ca2b9948..644235f6 100644 --- a/test/common/MenuLayout.test.tsx +++ b/test/common/MenuLayout.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; -import { Router, useParams } from 'react-router-dom'; import { createMemoryHistory } from 'history'; +import { Router, useParams } from 'react-router-dom'; import { Mock } from 'ts-mockery'; import { MenuLayout as createMenuLayout } from '../../src/common/MenuLayout'; import type { NonReachableServer, NotFoundServer, ReachableServer, SelectedServer } from '../../src/servers/data'; diff --git a/test/common/ShlinkVersionsContainer.test.tsx b/test/common/ShlinkVersionsContainer.test.tsx index db3e7c9e..75f3143a 100644 --- a/test/common/ShlinkVersionsContainer.test.tsx +++ b/test/common/ShlinkVersionsContainer.test.tsx @@ -1,8 +1,8 @@ import { render } from '@testing-library/react'; import { Mock } from 'ts-mockery'; +import type { Sidebar } from '../../src/common/reducers/sidebar'; import { ShlinkVersionsContainer } from '../../src/common/ShlinkVersionsContainer'; import type { SelectedServer } from '../../src/servers/data'; -import type { Sidebar } from '../../src/common/reducers/sidebar'; describe('', () => { const setUp = (sidebar: Sidebar) => render( diff --git a/test/common/reducer/sidebar.test.ts b/test/common/reducer/sidebar.test.ts index db59f510..146529c5 100644 --- a/test/common/reducer/sidebar.test.ts +++ b/test/common/reducer/sidebar.test.ts @@ -1,4 +1,4 @@ -import { sidebarReducer, sidebarNotPresent, sidebarPresent } from '../../../src/common/reducers/sidebar'; +import { sidebarNotPresent, sidebarPresent, sidebarReducer } from '../../../src/common/reducers/sidebar'; describe('sidebarReducer', () => { describe('reducer', () => { diff --git a/test/common/services/ImageDownloader.test.ts b/test/common/services/ImageDownloader.test.ts index a1047c27..498b9e60 100644 --- a/test/common/services/ImageDownloader.test.ts +++ b/test/common/services/ImageDownloader.test.ts @@ -1,6 +1,6 @@ import { Mock } from 'ts-mockery'; -import { ImageDownloader } from '../../../src/common/services/ImageDownloader'; import type { HttpClient } from '../../../src/common/services/HttpClient'; +import { ImageDownloader } from '../../../src/common/services/ImageDownloader'; import { windowMock } from '../../__mocks__/Window.mock'; describe('ImageDownloader', () => { diff --git a/test/common/services/ReportExporter.test.ts b/test/common/services/ReportExporter.test.ts index 45f7b2a6..3d786787 100644 --- a/test/common/services/ReportExporter.test.ts +++ b/test/common/services/ReportExporter.test.ts @@ -1,7 +1,7 @@ import { ReportExporter } from '../../../src/common/services/ReportExporter'; +import type { ExportableShortUrl } from '../../../src/short-urls/data'; import type { NormalizedVisit } from '../../../src/visits/types'; import { windowMock } from '../../__mocks__/Window.mock'; -import type { ExportableShortUrl } from '../../../src/short-urls/data'; describe('ReportExporter', () => { const jsonToCsv = jest.fn(); diff --git a/test/domains/DomainRow.test.tsx b/test/domains/DomainRow.test.tsx index 1c26a18b..2fd4f26d 100644 --- a/test/domains/DomainRow.test.tsx +++ b/test/domains/DomainRow.test.tsx @@ -1,9 +1,9 @@ import { render, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import type { ShlinkDomainRedirects } from '../../src/api/types'; +import type { Domain } from '../../src/domains/data'; import { DomainRow } from '../../src/domains/DomainRow'; import type { SelectedServer } from '../../src/servers/data'; -import type { Domain } from '../../src/domains/data'; describe('', () => { const redirectsCombinations = [ diff --git a/test/domains/DomainSelector.test.tsx b/test/domains/DomainSelector.test.tsx index 97fd4e4d..065201bc 100644 --- a/test/domains/DomainSelector.test.tsx +++ b/test/domains/DomainSelector.test.tsx @@ -1,8 +1,8 @@ import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; +import type { ShlinkDomain } from '../../src/api/types'; import { DomainSelector } from '../../src/domains/DomainSelector'; import type { DomainsList } from '../../src/domains/reducers/domainsList'; -import type { ShlinkDomain } from '../../src/api/types'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/domains/ManageDomains.test.tsx b/test/domains/ManageDomains.test.tsx index 0003e088..fc3c295d 100644 --- a/test/domains/ManageDomains.test.tsx +++ b/test/domains/ManageDomains.test.tsx @@ -1,11 +1,11 @@ import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import type { DomainsList } from '../../src/domains/reducers/domainsList'; -import { ManageDomains } from '../../src/domains/ManageDomains'; import type { ShlinkDomain } from '../../src/api/types'; +import type { ProblemDetailsError } from '../../src/api/types/errors'; +import { ManageDomains } from '../../src/domains/ManageDomains'; +import type { DomainsList } from '../../src/domains/reducers/domainsList'; import type { SelectedServer } from '../../src/servers/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; -import type { ProblemDetailsError } from '../../src/api/types/errors'; describe('', () => { const listDomains = jest.fn(); diff --git a/test/domains/helpers/DomainDropdown.test.tsx b/test/domains/helpers/DomainDropdown.test.tsx index efcf1a8d..6acd0b9b 100644 --- a/test/domains/helpers/DomainDropdown.test.tsx +++ b/test/domains/helpers/DomainDropdown.test.tsx @@ -1,8 +1,8 @@ import { screen, waitForElementToBeRemoved } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; -import { DomainDropdown } from '../../../src/domains/helpers/DomainDropdown'; +import { Mock } from 'ts-mockery'; import type { Domain } from '../../../src/domains/data'; +import { DomainDropdown } from '../../../src/domains/helpers/DomainDropdown'; import type { ReachableServer, SelectedServer } from '../../../src/servers/data'; import type { SemVer } from '../../../src/utils/helpers/version'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/domains/reducers/domainRedirects.test.ts b/test/domains/reducers/domainRedirects.test.ts index b061e7e7..c33af060 100644 --- a/test/domains/reducers/domainRedirects.test.ts +++ b/test/domains/reducers/domainRedirects.test.ts @@ -1,8 +1,8 @@ import { Mock } from 'ts-mockery'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkDomainRedirects } from '../../../src/api/types'; import type { EditDomainRedirects } from '../../../src/domains/reducers/domainRedirects'; import { editDomainRedirects } from '../../../src/domains/reducers/domainRedirects'; -import type { ShlinkDomainRedirects } from '../../../src/api/types'; describe('domainRedirectsReducer', () => { beforeEach(jest.clearAllMocks); diff --git a/test/domains/reducers/domainsList.test.ts b/test/domains/reducers/domainsList.test.ts index 7f2772c3..ba880183 100644 --- a/test/domains/reducers/domainsList.test.ts +++ b/test/domains/reducers/domainsList.test.ts @@ -1,18 +1,18 @@ import { Mock } from 'ts-mockery'; +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/domains/data'; +import { editDomainRedirects } from '../../../src/domains/reducers/domainRedirects'; import type { DomainsList } from '../../../src/domains/reducers/domainsList'; import { + domainsListReducerCreator, replaceRedirectsOnDomain, replaceStatusOnDomain, - domainsListReducerCreator, } from '../../../src/domains/reducers/domainsList'; -import { editDomainRedirects } from '../../../src/domains/reducers/domainRedirects'; -import type { ShlinkDomainRedirects } from '../../../src/api/types'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { Domain } from '../../../src/domains/data'; -import type { ShlinkState } from '../../../src/container/types'; import type { SelectedServer, ServerData } from '../../../src/servers/data'; -import { parseApiError } from '../../../src/api/utils'; describe('domainsListReducer', () => { const dispatch = jest.fn(); diff --git a/test/mercure/helpers/index.test.tsx b/test/mercure/helpers/index.test.tsx index 90a235da..335cd79c 100644 --- a/test/mercure/helpers/index.test.tsx +++ b/test/mercure/helpers/index.test.tsx @@ -1,6 +1,6 @@ import { EventSourcePolyfill } from 'event-source-polyfill'; -import { Mock } from 'ts-mockery'; import { identity } from 'ramda'; +import { Mock } from 'ts-mockery'; import { bindToMercureTopic } from '../../../src/mercure/helpers'; import type { MercureInfo } from '../../../src/mercure/reducers/mercureInfo'; diff --git a/test/mercure/reducers/mercureInfo.test.ts b/test/mercure/reducers/mercureInfo.test.ts index 928137c2..f76c5f99 100644 --- a/test/mercure/reducers/mercureInfo.test.ts +++ b/test/mercure/reducers/mercureInfo.test.ts @@ -1,7 +1,7 @@ import { Mock } from 'ts-mockery'; -import { mercureInfoReducerCreator } from '../../../src/mercure/reducers/mercureInfo'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { GetState } from '../../../src/container/types'; +import { mercureInfoReducerCreator } from '../../../src/mercure/reducers/mercureInfo'; describe('mercureInfoReducer', () => { const mercureInfo = { diff --git a/test/servers/CreateServer.test.tsx b/test/servers/CreateServer.test.tsx index 7e063569..4930d9f7 100644 --- a/test/servers/CreateServer.test.tsx +++ b/test/servers/CreateServer.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { useNavigate } from 'react-router-dom'; +import { Mock } from 'ts-mockery'; import { CreateServer as createCreateServer } from '../../src/servers/CreateServer'; import type { ServerWithId } from '../../src/servers/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/servers/DeleteServerButton.test.tsx b/test/servers/DeleteServerButton.test.tsx index 36b8f621..4b17fcb0 100644 --- a/test/servers/DeleteServerButton.test.tsx +++ b/test/servers/DeleteServerButton.test.tsx @@ -1,8 +1,8 @@ -import type { ReactNode } from 'react'; import { screen, waitFor } from '@testing-library/react'; +import type { ReactNode } from 'react'; import { Mock } from 'ts-mockery'; -import { DeleteServerButton as createDeleteServerButton } from '../../src/servers/DeleteServerButton'; import type { ServerWithId } from '../../src/servers/data'; +import { DeleteServerButton as createDeleteServerButton } from '../../src/servers/DeleteServerButton'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/servers/DeleteServerModal.test.tsx b/test/servers/DeleteServerModal.test.tsx index 19b4916f..3df5a2e5 100644 --- a/test/servers/DeleteServerModal.test.tsx +++ b/test/servers/DeleteServerModal.test.tsx @@ -1,8 +1,8 @@ import { screen, waitFor } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { useNavigate } from 'react-router-dom'; -import { DeleteServerModal } from '../../src/servers/DeleteServerModal'; +import { Mock } from 'ts-mockery'; import type { ServerWithId } from '../../src/servers/data'; +import { DeleteServerModal } from '../../src/servers/DeleteServerModal'; import { renderWithEvents } from '../__helpers__/setUpTest'; import { TestModalWrapper } from '../__helpers__/TestModalWrapper'; diff --git a/test/servers/EditServer.test.tsx b/test/servers/EditServer.test.tsx index 17ac44f4..f38b2e64 100644 --- a/test/servers/EditServer.test.tsx +++ b/test/servers/EditServer.test.tsx @@ -1,8 +1,8 @@ import { fireEvent, screen } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { MemoryRouter, useNavigate } from 'react-router-dom'; -import { EditServer as editServerConstruct } from '../../src/servers/EditServer'; +import { Mock } from 'ts-mockery'; import type { ReachableServer, SelectedServer } from '../../src/servers/data'; +import { EditServer as editServerConstruct } from '../../src/servers/EditServer'; import { renderWithEvents } from '../__helpers__/setUpTest'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), useNavigate: jest.fn() })); diff --git a/test/servers/ManageServers.test.tsx b/test/servers/ManageServers.test.tsx index 375db005..763dc889 100644 --- a/test/servers/ManageServers.test.tsx +++ b/test/servers/ManageServers.test.tsx @@ -1,9 +1,9 @@ -import { Mock } from 'ts-mockery'; import { screen, waitFor } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; -import type ServersExporter from '../../src/servers/services/ServersExporter'; -import { ManageServers as createManageServers } from '../../src/servers/ManageServers'; +import { Mock } from 'ts-mockery'; import type { ServersMap, ServerWithId } from '../../src/servers/data'; +import { ManageServers as createManageServers } from '../../src/servers/ManageServers'; +import type ServersExporter from '../../src/servers/services/ServersExporter'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/servers/ManageServersRow.test.tsx b/test/servers/ManageServersRow.test.tsx index d7a91aec..25a27d65 100644 --- a/test/servers/ManageServersRow.test.tsx +++ b/test/servers/ManageServersRow.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; -import { ManageServersRow as createManageServersRow } from '../../src/servers/ManageServersRow'; import type { ServerWithId } from '../../src/servers/data'; +import { ManageServersRow as createManageServersRow } from '../../src/servers/ManageServersRow'; describe('', () => { const ManageServersRow = createManageServersRow(() => ManageServersRowDropdown); diff --git a/test/servers/ManageServersRowDropdown.test.tsx b/test/servers/ManageServersRowDropdown.test.tsx index d6da6dc8..df8c0946 100644 --- a/test/servers/ManageServersRowDropdown.test.tsx +++ b/test/servers/ManageServersRowDropdown.test.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; +import { Mock } from 'ts-mockery'; import type { ServerWithId } from '../../src/servers/data'; import { ManageServersRowDropdown as createManageServersRowDropdown } from '../../src/servers/ManageServersRowDropdown'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/servers/Overview.test.tsx b/test/servers/Overview.test.tsx index dc931bdc..4b20e3a1 100644 --- a/test/servers/Overview.test.tsx +++ b/test/servers/Overview.test.tsx @@ -1,13 +1,13 @@ import { render, screen } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; -import type { ShortUrlsList as ShortUrlsListState } from '../../src/short-urls/reducers/shortUrlsList'; -import { Overview as overviewCreator } from '../../src/servers/Overview'; -import type { TagsList } from '../../src/tags/reducers/tagsList'; -import type { VisitsOverview } from '../../src/visits/reducers/visitsOverview'; +import { Mock } from 'ts-mockery'; import type { MercureInfo } from '../../src/mercure/reducers/mercureInfo'; import type { ReachableServer } from '../../src/servers/data'; +import { Overview as overviewCreator } from '../../src/servers/Overview'; +import type { ShortUrlsList as ShortUrlsListState } from '../../src/short-urls/reducers/shortUrlsList'; +import type { TagsList } from '../../src/tags/reducers/tagsList'; import { prettify } from '../../src/utils/helpers/numbers'; +import type { VisitsOverview } from '../../src/visits/reducers/visitsOverview'; describe('', () => { const ShortUrlsTable = () => <>ShortUrlsTable; diff --git a/test/servers/ServersDropdown.test.tsx b/test/servers/ServersDropdown.test.tsx index ae281bd4..b22ceb24 100644 --- a/test/servers/ServersDropdown.test.tsx +++ b/test/servers/ServersDropdown.test.tsx @@ -1,9 +1,9 @@ import { screen } from '@testing-library/react'; import { values } from 'ramda'; -import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; -import { ServersDropdown } from '../../src/servers/ServersDropdown'; +import { Mock } from 'ts-mockery'; import type { ServersMap, ServerWithId } from '../../src/servers/data'; +import { ServersDropdown } from '../../src/servers/ServersDropdown'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/servers/ServersListGroup.test.tsx b/test/servers/ServersListGroup.test.tsx index 3e716d46..5c0e45a5 100644 --- a/test/servers/ServersListGroup.test.tsx +++ b/test/servers/ServersListGroup.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; -import { ServersListGroup } from '../../src/servers/ServersListGroup'; +import { Mock } from 'ts-mockery'; import type { ServerWithId } from '../../src/servers/data'; +import { ServersListGroup } from '../../src/servers/ServersListGroup'; describe('', () => { const servers = [ diff --git a/test/servers/helpers/DuplicatedServersModal.test.tsx b/test/servers/helpers/DuplicatedServersModal.test.tsx index 9172e801..81ef52d3 100644 --- a/test/servers/helpers/DuplicatedServersModal.test.tsx +++ b/test/servers/helpers/DuplicatedServersModal.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { DuplicatedServersModal } from '../../../src/servers/helpers/DuplicatedServersModal'; import type { ServerData } from '../../../src/servers/data'; +import { DuplicatedServersModal } from '../../../src/servers/helpers/DuplicatedServersModal'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/servers/helpers/ImportServersBtn.test.tsx b/test/servers/helpers/ImportServersBtn.test.tsx index c1d96fad..2abc105f 100644 --- a/test/servers/helpers/ImportServersBtn.test.tsx +++ b/test/servers/helpers/ImportServersBtn.test.tsx @@ -1,12 +1,12 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; +import type { ServersMap, ServerWithId } from '../../../src/servers/data'; import type { ImportServersBtnProps } from '../../../src/servers/helpers/ImportServersBtn'; import { ImportServersBtn as createImportServersBtn, } from '../../../src/servers/helpers/ImportServersBtn'; import type { ServersImporter } from '../../../src/servers/services/ServersImporter'; -import type { ServersMap, ServerWithId } from '../../../src/servers/data'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/servers/helpers/ServerError.test.tsx b/test/servers/helpers/ServerError.test.tsx index 2b7b6bb5..be428ccf 100644 --- a/test/servers/helpers/ServerError.test.tsx +++ b/test/servers/helpers/ServerError.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; import { Mock } from 'ts-mockery'; -import { ServerError as createServerError } from '../../../src/servers/helpers/ServerError'; import type { NonReachableServer, NotFoundServer } from '../../../src/servers/data'; +import { ServerError as createServerError } from '../../../src/servers/helpers/ServerError'; describe('', () => { const ServerError = createServerError(() => null); diff --git a/test/servers/reducers/remoteServers.test.ts b/test/servers/reducers/remoteServers.test.ts index 60905535..54dd80a4 100644 --- a/test/servers/reducers/remoteServers.test.ts +++ b/test/servers/reducers/remoteServers.test.ts @@ -1,7 +1,7 @@ import { Mock } from 'ts-mockery'; +import type { HttpClient } from '../../../src/common/services/HttpClient'; import { fetchServers } from '../../../src/servers/reducers/remoteServers'; import { createServers } from '../../../src/servers/reducers/servers'; -import type { HttpClient } from '../../../src/common/services/HttpClient'; describe('remoteServersReducer', () => { afterEach(jest.clearAllMocks); diff --git a/test/servers/reducers/selectedServer.test.ts b/test/servers/reducers/selectedServer.test.ts index e6fe50b7..0a4796d2 100644 --- a/test/servers/reducers/selectedServer.test.ts +++ b/test/servers/reducers/selectedServer.test.ts @@ -1,16 +1,16 @@ -import { v4 as uuid } from 'uuid'; import { Mock } from 'ts-mockery'; -import { - selectServer as selectServerCreator, - resetSelectedServer, - selectedServerReducerCreator, - selectServerListener, - MAX_FALLBACK_VERSION, - MIN_FALLBACK_VERSION, -} from '../../../src/servers/reducers/selectedServer'; +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 { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import { + MAX_FALLBACK_VERSION, + MIN_FALLBACK_VERSION, + resetSelectedServer, + selectedServerReducerCreator, + selectServer as selectServerCreator, + selectServerListener, +} from '../../../src/servers/reducers/selectedServer'; describe('selectedServerReducer', () => { const dispatch = jest.fn(); diff --git a/test/servers/reducers/servers.test.ts b/test/servers/reducers/servers.test.ts index 10c41c80..188f0678 100644 --- a/test/servers/reducers/servers.test.ts +++ b/test/servers/reducers/servers.test.ts @@ -1,13 +1,13 @@ import { dissoc, values } from 'ramda'; import { Mock } from 'ts-mockery'; -import { - deleteServer, - createServers, - editServer, - setAutoConnect, - serversReducer, -} from '../../../src/servers/reducers/servers'; import type { RegularServer } from '../../../src/servers/data'; +import { + createServers, + deleteServer, + editServer, + serversReducer, + setAutoConnect, +} from '../../../src/servers/reducers/servers'; describe('serversReducer', () => { const list = { diff --git a/test/servers/services/ServersImporter.test.ts b/test/servers/services/ServersImporter.test.ts index f57b1d73..be0a12dc 100644 --- a/test/servers/services/ServersImporter.test.ts +++ b/test/servers/services/ServersImporter.test.ts @@ -1,6 +1,6 @@ import { Mock } from 'ts-mockery'; -import { ServersImporter } from '../../../src/servers/services/ServersImporter'; import type { RegularServer } from '../../../src/servers/data'; +import { ServersImporter } from '../../../src/servers/services/ServersImporter'; describe('ServersImporter', () => { const servers: RegularServer[] = [Mock.all(), Mock.all()]; diff --git a/test/settings/RealTimeUpdatesSettings.test.tsx b/test/settings/RealTimeUpdatesSettings.test.tsx index 602012b6..98586dda 100644 --- a/test/settings/RealTimeUpdatesSettings.test.tsx +++ b/test/settings/RealTimeUpdatesSettings.test.tsx @@ -1,10 +1,10 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; +import { RealTimeUpdatesSettings } from '../../src/settings/RealTimeUpdatesSettings'; import type { RealTimeUpdatesSettings as RealTimeUpdatesSettingsOptions, Settings, } from '../../src/settings/reducers/settings'; -import { RealTimeUpdatesSettings } from '../../src/settings/RealTimeUpdatesSettings'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/settings/Settings.test.tsx b/test/settings/Settings.test.tsx index 593dd943..bef4d26b 100644 --- a/test/settings/Settings.test.tsx +++ b/test/settings/Settings.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; -import { Router } from 'react-router-dom'; import { createMemoryHistory } from 'history'; +import { Router } from 'react-router-dom'; import { Settings as createSettings } from '../../src/settings/Settings'; describe('', () => { diff --git a/test/settings/ShortUrlCreationSettings.test.tsx b/test/settings/ShortUrlCreationSettings.test.tsx index ea04b93f..220ff554 100644 --- a/test/settings/ShortUrlCreationSettings.test.tsx +++ b/test/settings/ShortUrlCreationSettings.test.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import type { ShortUrlCreationSettings as ShortUrlsSettings, Settings } from '../../src/settings/reducers/settings'; +import type { Settings, ShortUrlCreationSettings as ShortUrlsSettings } from '../../src/settings/reducers/settings'; import { ShortUrlCreationSettings } from '../../src/settings/ShortUrlCreationSettings'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/settings/helpers/index.test.ts b/test/settings/helpers/index.test.ts index 96fa27b8..6b7c188f 100644 --- a/test/settings/helpers/index.test.ts +++ b/test/settings/helpers/index.test.ts @@ -1,6 +1,6 @@ import { Mock } from 'ts-mockery'; -import { migrateDeprecatedSettings } from '../../../src/settings/helpers'; import type { ShlinkState } from '../../../src/container/types'; +import { migrateDeprecatedSettings } from '../../../src/settings/helpers'; describe('settings-helpers', () => { describe('migrateDeprecatedSettings', () => { diff --git a/test/settings/reducers/settings.test.ts b/test/settings/reducers/settings.test.ts index 50d31ac1..6199b7ce 100644 --- a/test/settings/reducers/settings.test.ts +++ b/test/settings/reducers/settings.test.ts @@ -1,13 +1,13 @@ import { DEFAULT_SHORT_URLS_ORDERING, - settingsReducer, - toggleRealTimeUpdates, setRealTimeUpdatesInterval, setShortUrlCreationSettings, + setShortUrlsListSettings, + setTagsSettings, + settingsReducer, setUiSettings, setVisitsSettings, - setTagsSettings, - setShortUrlsListSettings, + toggleRealTimeUpdates, } from '../../../src/settings/reducers/settings'; describe('settingsReducer', () => { diff --git a/test/short-urls/CreateShortUrl.test.tsx b/test/short-urls/CreateShortUrl.test.tsx index 208d9cd8..68a3dbbc 100644 --- a/test/short-urls/CreateShortUrl.test.tsx +++ b/test/short-urls/CreateShortUrl.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; +import type { Settings } from '../../src/settings/reducers/settings'; import { CreateShortUrl as createShortUrlsCreator } from '../../src/short-urls/CreateShortUrl'; import type { ShortUrlCreation } from '../../src/short-urls/reducers/shortUrlCreation'; -import type { Settings } from '../../src/settings/reducers/settings'; describe('', () => { const ShortUrlForm = () => ShortUrlForm; diff --git a/test/short-urls/EditShortUrl.test.tsx b/test/short-urls/EditShortUrl.test.tsx index e262f2ed..77767c47 100644 --- a/test/short-urls/EditShortUrl.test.tsx +++ b/test/short-urls/EditShortUrl.test.tsx @@ -1,11 +1,11 @@ import { render, screen } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; import { Mock } from 'ts-mockery'; -import { EditShortUrl as createEditShortUrl } from '../../src/short-urls/EditShortUrl'; import type { Settings } from '../../src/settings/reducers/settings'; +import type { ShortUrl } from '../../src/short-urls/data'; +import { EditShortUrl as createEditShortUrl } from '../../src/short-urls/EditShortUrl'; import type { ShortUrlDetail } from '../../src/short-urls/reducers/shortUrlDetail'; import type { ShortUrlEdition } from '../../src/short-urls/reducers/shortUrlEdition'; -import type { ShortUrl } from '../../src/short-urls/data'; describe('', () => { const shortUrlCreation = { validateUrls: true }; diff --git a/test/short-urls/Paginator.test.tsx b/test/short-urls/Paginator.test.tsx index 22a8f017..36f215f8 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 { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; -import { Paginator } from '../../src/short-urls/Paginator'; +import { Mock } from 'ts-mockery'; import type { ShlinkPaginator } from '../../src/api/types'; +import { Paginator } from '../../src/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 5083a7b0..03be97e2 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 { formatISO } from 'date-fns'; import { Mock } from 'ts-mockery'; +import type { ReachableServer, SelectedServer } from '../../src/servers/data'; import type { Mode } from '../../src/short-urls/ShortUrlForm'; import { ShortUrlForm as createShortUrlForm } from '../../src/short-urls/ShortUrlForm'; -import type { ReachableServer, SelectedServer } from '../../src/servers/data'; 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 e60440c8..3c89587f 100644 --- a/test/short-urls/ShortUrlsFilteringBar.test.tsx +++ b/test/short-urls/ShortUrlsFilteringBar.test.tsx @@ -1,12 +1,12 @@ import { screen, waitFor } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { endOfDay, formatISO, startOfDay } from 'date-fns'; import { MemoryRouter, useLocation, useNavigate } from 'react-router-dom'; -import { ShortUrlsFilteringBar as filteringBarCreator } from '../../src/short-urls/ShortUrlsFilteringBar'; +import { Mock } from 'ts-mockery'; import type { ReachableServer, SelectedServer } from '../../src/servers/data'; import type { Settings } from '../../src/settings/reducers/settings'; -import type { DateRange } from '../../src/utils/helpers/dateIntervals'; +import { ShortUrlsFilteringBar as filteringBarCreator } from '../../src/short-urls/ShortUrlsFilteringBar'; import { formatDate } from '../../src/utils/helpers/date'; +import type { DateRange } from '../../src/utils/helpers/dateIntervals'; import { renderWithEvents } from '../__helpers__/setUpTest'; jest.mock('react-router-dom', () => ({ diff --git a/test/short-urls/ShortUrlsList.test.tsx b/test/short-urls/ShortUrlsList.test.tsx index b62c32a0..38ddef0e 100644 --- a/test/short-urls/ShortUrlsList.test.tsx +++ b/test/short-urls/ShortUrlsList.test.tsx @@ -1,15 +1,15 @@ import { screen } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { MemoryRouter, useNavigate } from 'react-router-dom'; -import { ShortUrlsList as createShortUrlsList } from '../../src/short-urls/ShortUrlsList'; -import type { ShortUrl, ShortUrlsOrder } from '../../src/short-urls/data'; +import { Mock } from 'ts-mockery'; import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -import type { ShortUrlsList as ShortUrlsListModel } from '../../src/short-urls/reducers/shortUrlsList'; import type { ReachableServer } from '../../src/servers/data'; import type { Settings } from '../../src/settings/reducers/settings'; +import type { ShortUrl, ShortUrlsOrder } from '../../src/short-urls/data'; +import type { ShortUrlsList as ShortUrlsListModel } from '../../src/short-urls/reducers/shortUrlsList'; +import { ShortUrlsList as createShortUrlsList } from '../../src/short-urls/ShortUrlsList'; import type { ShortUrlsTableType } from '../../src/short-urls/ShortUrlsTable'; -import { renderWithEvents } from '../__helpers__/setUpTest'; import type { SemVer } from '../../src/utils/helpers/version'; +import { renderWithEvents } from '../__helpers__/setUpTest'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), diff --git a/test/short-urls/ShortUrlsTable.test.tsx b/test/short-urls/ShortUrlsTable.test.tsx index fc50625b..e083d71a 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 { Mock } from 'ts-mockery'; -import { ShortUrlsTable as shortUrlsTableCreator } from '../../src/short-urls/ShortUrlsTable'; -import type { ShortUrlsList } from '../../src/short-urls/reducers/shortUrlsList'; import type { ReachableServer, SelectedServer } from '../../src/servers/data'; import type { ShortUrlsOrderableFields } from '../../src/short-urls/data'; import { SHORT_URLS_ORDERABLE_FIELDS } from '../../src/short-urls/data'; +import type { ShortUrlsList } from '../../src/short-urls/reducers/shortUrlsList'; +import { ShortUrlsTable as shortUrlsTableCreator } from '../../src/short-urls/ShortUrlsTable'; 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 4d5839fb..0c07b109 100644 --- a/test/short-urls/helpers/CreateShortUrlResult.test.tsx +++ b/test/short-urls/helpers/CreateShortUrlResult.test.tsx @@ -1,10 +1,10 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { CreateShortUrlResult as createResult } from '../../../src/short-urls/helpers/CreateShortUrlResult'; import type { ShortUrl } from '../../../src/short-urls/data'; +import { CreateShortUrlResult as createResult } from '../../../src/short-urls/helpers/CreateShortUrlResult'; +import type { ShortUrlCreation } from '../../../src/short-urls/reducers/shortUrlCreation'; import type { TimeoutToggle } from '../../../src/utils/helpers/hooks'; import { renderWithEvents } from '../../__helpers__/setUpTest'; -import type { ShortUrlCreation } from '../../../src/short-urls/reducers/shortUrlCreation'; describe('', () => { const copyToClipboard = jest.fn(); diff --git a/test/short-urls/helpers/DeleteShortUrlModal.test.tsx b/test/short-urls/helpers/DeleteShortUrlModal.test.tsx index 14ed94a8..fbff806c 100644 --- a/test/short-urls/helpers/DeleteShortUrlModal.test.tsx +++ b/test/short-urls/helpers/DeleteShortUrlModal.test.tsx @@ -1,11 +1,11 @@ import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { DeleteShortUrlModal } from '../../../src/short-urls/helpers/DeleteShortUrlModal'; -import type { ShortUrl } from '../../../src/short-urls/data'; -import type { ShortUrlDeletion } from '../../../src/short-urls/reducers/shortUrlDeletion'; -import { renderWithEvents } from '../../__helpers__/setUpTest'; import type { InvalidShortUrlDeletion, ProblemDetailsError } from '../../../src/api/types/errors'; import { ErrorTypeV2, ErrorTypeV3 } from '../../../src/api/types/errors'; +import type { ShortUrl } from '../../../src/short-urls/data'; +import { DeleteShortUrlModal } from '../../../src/short-urls/helpers/DeleteShortUrlModal'; +import type { ShortUrlDeletion } from '../../../src/short-urls/reducers/shortUrlDeletion'; +import { renderWithEvents } from '../../__helpers__/setUpTest'; import { TestModalWrapper } from '../../__helpers__/TestModalWrapper'; describe('', () => { diff --git a/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx b/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx index ab35d1e9..6f335c62 100644 --- a/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx +++ b/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx @@ -1,9 +1,9 @@ -import { Mock } from 'ts-mockery'; import { screen } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; +import { Mock } from 'ts-mockery'; import type { ReportExporter } from '../../../src/common/services/ReportExporter'; -import { ExportShortUrlsBtn as createExportShortUrlsBtn } from '../../../src/short-urls/helpers/ExportShortUrlsBtn'; import type { NotFoundServer, ReachableServer, SelectedServer } from '../../../src/servers/data'; +import { ExportShortUrlsBtn as createExportShortUrlsBtn } from '../../../src/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 51c2566a..9dc25726 100644 --- a/test/short-urls/helpers/QrCodeModal.test.tsx +++ b/test/short-urls/helpers/QrCodeModal.test.tsx @@ -1,10 +1,10 @@ import { fireEvent, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { QrCodeModal as createQrCodeModal } from '../../../src/short-urls/helpers/QrCodeModal'; -import type { ShortUrl } from '../../../src/short-urls/data'; -import type { ReachableServer } from '../../../src/servers/data'; -import type { SemVer } from '../../../src/utils/helpers/version'; import type { ImageDownloader } from '../../../src/common/services/ImageDownloader'; +import type { ReachableServer } from '../../../src/servers/data'; +import type { ShortUrl } from '../../../src/short-urls/data'; +import { QrCodeModal as createQrCodeModal } from '../../../src/short-urls/helpers/QrCodeModal'; +import type { SemVer } from '../../../src/utils/helpers/version'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/ShortUrlDetailLink.test.tsx b/test/short-urls/helpers/ShortUrlDetailLink.test.tsx index 7c8a91ce..04187148 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 { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; -import type { LinkSuffix } from '../../../src/short-urls/helpers/ShortUrlDetailLink'; -import { ShortUrlDetailLink } from '../../../src/short-urls/helpers/ShortUrlDetailLink'; +import { Mock } from 'ts-mockery'; import type { NotFoundServer, ReachableServer } from '../../../src/servers/data'; import type { ShortUrl } from '../../../src/short-urls/data'; +import type { LinkSuffix } from '../../../src/short-urls/helpers/ShortUrlDetailLink'; +import { ShortUrlDetailLink } from '../../../src/short-urls/helpers/ShortUrlDetailLink'; describe('', () => { it.each([ diff --git a/test/short-urls/helpers/ShortUrlStatus.test.tsx b/test/short-urls/helpers/ShortUrlStatus.test.tsx index 5935aa78..4f373503 100644 --- a/test/short-urls/helpers/ShortUrlStatus.test.tsx +++ b/test/short-urls/helpers/ShortUrlStatus.test.tsx @@ -1,8 +1,8 @@ -import userEvent from '@testing-library/user-event'; import { render, screen, waitFor } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; import { Mock } from 'ts-mockery'; -import { ShortUrlStatus } from '../../../src/short-urls/helpers/ShortUrlStatus'; import type { ShortUrl, ShortUrlMeta, ShortUrlVisitsSummary } from '../../../src/short-urls/data'; +import { ShortUrlStatus } from '../../../src/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 0dd502a8..8fa8141c 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 { Mock } from 'ts-mockery'; -import { ShortUrlVisitsCount } from '../../../src/short-urls/helpers/ShortUrlVisitsCount'; import type { ShortUrl } from '../../../src/short-urls/data'; +import { ShortUrlVisitsCount } from '../../../src/short-urls/helpers/ShortUrlVisitsCount'; describe('', () => { const setUp = (visitsCount: number, shortUrl: ShortUrl) => ({ diff --git a/test/short-urls/helpers/ShortUrlsRow.test.tsx b/test/short-urls/helpers/ShortUrlsRow.test.tsx index d6210e47..f4482422 100644 --- a/test/short-urls/helpers/ShortUrlsRow.test.tsx +++ b/test/short-urls/helpers/ShortUrlsRow.test.tsx @@ -1,16 +1,16 @@ import { screen } from '@testing-library/react'; -import { last } from 'ramda'; -import { Mock } from 'ts-mockery'; import { addDays, formatISO, subDays } from 'date-fns'; +import { last } from 'ramda'; import { MemoryRouter, useLocation } from 'react-router-dom'; -import { ShortUrlsRow as createShortUrlsRow } from '../../../src/short-urls/helpers/ShortUrlsRow'; -import type { TimeoutToggle } from '../../../src/utils/helpers/hooks'; -import type { ShortUrl, ShortUrlMeta } from '../../../src/short-urls/data'; -import type { Settings } from '../../../src/settings/reducers/settings'; +import { Mock } from 'ts-mockery'; import type { ReachableServer } from '../../../src/servers/data'; -import { parseDate, now } from '../../../src/utils/helpers/date'; -import { renderWithEvents } from '../../__helpers__/setUpTest'; +import type { Settings } from '../../../src/settings/reducers/settings'; +import type { ShortUrl, ShortUrlMeta } from '../../../src/short-urls/data'; +import { ShortUrlsRow as createShortUrlsRow } from '../../../src/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'; +import { renderWithEvents } from '../../__helpers__/setUpTest'; import { colorGeneratorMock } from '../../utils/services/__mocks__/ColorGenerator.mock'; interface SetUpOptions { diff --git a/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx b/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx index 8a879d16..ba64ff51 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 { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; -import { ShortUrlsRowMenu as createShortUrlsRowMenu } from '../../../src/short-urls/helpers/ShortUrlsRowMenu'; +import { Mock } from 'ts-mockery'; import type { ReachableServer } from '../../../src/servers/data'; import type { ShortUrl } from '../../../src/short-urls/data'; +import { ShortUrlsRowMenu as createShortUrlsRowMenu } from '../../../src/short-urls/helpers/ShortUrlsRowMenu'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx b/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx index 432e3c66..a5a1d06d 100644 --- a/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx +++ b/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; -import type { QrErrorCorrection } from '../../../../src/utils/helpers/qrCodes'; import { QrErrorCorrectionDropdown } from '../../../../src/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown'; +import type { QrErrorCorrection } from '../../../../src/utils/helpers/qrCodes'; import { renderWithEvents } from '../../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx b/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx index eccfbcfb..41cb3975 100644 --- a/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx +++ b/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; -import type { QrCodeFormat } from '../../../../src/utils/helpers/qrCodes'; import { QrFormatDropdown } from '../../../../src/short-urls/helpers/qr-codes/QrFormatDropdown'; +import type { QrCodeFormat } from '../../../../src/utils/helpers/qrCodes'; import { renderWithEvents } from '../../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/reducers/shortUrlCreation.test.ts b/test/short-urls/reducers/shortUrlCreation.test.ts index e231f7fb..1f8cf99b 100644 --- a/test/short-urls/reducers/shortUrlCreation.test.ts +++ b/test/short-urls/reducers/shortUrlCreation.test.ts @@ -1,13 +1,13 @@ import { Mock } from 'ts-mockery'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkState } from '../../../src/container/types'; +import type { ShortUrl } from '../../../src/short-urls/data'; import type { CreateShortUrlAction } from '../../../src/short-urls/reducers/shortUrlCreation'; import { - shortUrlCreationReducerCreator, createShortUrl as createShortUrlCreator, + shortUrlCreationReducerCreator, } from '../../../src/short-urls/reducers/shortUrlCreation'; -import type { ShortUrl } from '../../../src/short-urls/data'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkState } from '../../../src/container/types'; describe('shortUrlCreationReducer', () => { const shortUrl = Mock.of(); diff --git a/test/short-urls/reducers/shortUrlDeletion.test.ts b/test/short-urls/reducers/shortUrlDeletion.test.ts index 4b8eda22..d91476f3 100644 --- a/test/short-urls/reducers/shortUrlDeletion.test.ts +++ b/test/short-urls/reducers/shortUrlDeletion.test.ts @@ -1,10 +1,10 @@ import { Mock } from 'ts-mockery'; -import { - shortUrlDeletionReducerCreator, - deleteShortUrl as deleteShortUrlCretor, -} from '../../../src/short-urls/reducers/shortUrlDeletion'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ProblemDetailsError } from '../../../src/api/types/errors'; +import { + deleteShortUrl as deleteShortUrlCretor, + shortUrlDeletionReducerCreator, +} from '../../../src/short-urls/reducers/shortUrlDeletion'; describe('shortUrlDeletionReducer', () => { const deleteShortUrlCall = jest.fn(); diff --git a/test/short-urls/reducers/shortUrlDetail.test.ts b/test/short-urls/reducers/shortUrlDetail.test.ts index faa2ae2f..2080c437 100644 --- a/test/short-urls/reducers/shortUrlDetail.test.ts +++ b/test/short-urls/reducers/shortUrlDetail.test.ts @@ -1,9 +1,9 @@ import { Mock } from 'ts-mockery'; -import type { ShortUrlDetailAction } from '../../../src/short-urls/reducers/shortUrlDetail'; -import { shortUrlDetailReducerCreator } from '../../../src/short-urls/reducers/shortUrlDetail'; -import type { ShortUrl } from '../../../src/short-urls/data'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkState } from '../../../src/container/types'; +import type { ShortUrl } from '../../../src/short-urls/data'; +import type { ShortUrlDetailAction } from '../../../src/short-urls/reducers/shortUrlDetail'; +import { shortUrlDetailReducerCreator } from '../../../src/short-urls/reducers/shortUrlDetail'; import type { ShortUrlsList } from '../../../src/short-urls/reducers/shortUrlsList'; describe('shortUrlDetailReducer', () => { diff --git a/test/short-urls/reducers/shortUrlEdition.test.ts b/test/short-urls/reducers/shortUrlEdition.test.ts index 37deb5e5..fad29937 100644 --- a/test/short-urls/reducers/shortUrlEdition.test.ts +++ b/test/short-urls/reducers/shortUrlEdition.test.ts @@ -1,13 +1,13 @@ import { Mock } from 'ts-mockery'; +import type { ShlinkState } from '../../../src/container/types'; +import type { SelectedServer } from '../../../src/servers/data'; +import type { ShortUrl } from '../../../src/short-urls/data'; import type { ShortUrlEditedAction } from '../../../src/short-urls/reducers/shortUrlEdition'; import { - shortUrlEditionReducerCreator, editShortUrl as editShortUrlCreator, + shortUrlEditionReducerCreator, } from '../../../src/short-urls/reducers/shortUrlEdition'; -import type { ShlinkState } from '../../../src/container/types'; -import type { ShortUrl } from '../../../src/short-urls/data'; -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 4e0dd32a..095cd137 100644 --- a/test/short-urls/reducers/shortUrlsList.test.ts +++ b/test/short-urls/reducers/shortUrlsList.test.ts @@ -1,15 +1,15 @@ import { Mock } from 'ts-mockery'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkPaginator, ShlinkShortUrlsResponse } from '../../../src/api/types'; +import type { ShortUrl } from '../../../src/short-urls/data'; +import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation'; +import { shortUrlDeleted } from '../../../src/short-urls/reducers/shortUrlDeletion'; +import { editShortUrl as editShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlEdition'; import { listShortUrls as listShortUrlsCreator, shortUrlsListReducerCreator, } from '../../../src/short-urls/reducers/shortUrlsList'; -import { shortUrlDeleted } from '../../../src/short-urls/reducers/shortUrlDeletion'; -import type { ShlinkPaginator, ShlinkShortUrlsResponse } from '../../../src/api/types'; -import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation'; -import { editShortUrl as editShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlEdition'; import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; -import type { ShortUrl } from '../../../src/short-urls/data'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; describe('shortUrlsListReducer', () => { const shortCode = 'abc123'; diff --git a/test/tags/TagsList.test.tsx b/test/tags/TagsList.test.tsx index fe659c55..b20a8115 100644 --- a/test/tags/TagsList.test.tsx +++ b/test/tags/TagsList.test.tsx @@ -1,11 +1,11 @@ import { screen, waitFor } from '@testing-library/react'; import { identity } from 'ramda'; import { Mock } from 'ts-mockery'; -import type { TagsListProps } from '../../src/tags/TagsList'; -import { TagsList as createTagsList } from '../../src/tags/TagsList'; -import type { TagsList } from '../../src/tags/reducers/tagsList'; import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; import type { Settings } from '../../src/settings/reducers/settings'; +import type { TagsList } from '../../src/tags/reducers/tagsList'; +import type { TagsListProps } from '../../src/tags/TagsList'; +import { TagsList as createTagsList } from '../../src/tags/TagsList'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/tags/TagsTable.test.tsx b/test/tags/TagsTable.test.tsx index 7c9d7da0..4c212cf0 100644 --- a/test/tags/TagsTable.test.tsx +++ b/test/tags/TagsTable.test.tsx @@ -1,10 +1,10 @@ import { screen } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { useLocation } from 'react-router-dom'; -import { TagsTable as createTagsTable } from '../../src/tags/TagsTable'; +import { Mock } from 'ts-mockery'; import type { SelectedServer } from '../../src/servers/data'; -import { rangeOf } from '../../src/utils/utils'; import type { NormalizedTag } from '../../src/tags/data'; +import { TagsTable as createTagsTable } from '../../src/tags/TagsTable'; +import { rangeOf } from '../../src/utils/utils'; import { renderWithEvents } from '../__helpers__/setUpTest'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), useLocation: jest.fn() })); diff --git a/test/tags/TagsTableRow.test.tsx b/test/tags/TagsTableRow.test.tsx index 94c39a81..4f3a133a 100644 --- a/test/tags/TagsTableRow.test.tsx +++ b/test/tags/TagsTableRow.test.tsx @@ -1,8 +1,8 @@ import { screen } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { MemoryRouter } from 'react-router-dom'; -import { TagsTableRow as createTagsTableRow } from '../../src/tags/TagsTableRow'; +import { Mock } from 'ts-mockery'; import type { ReachableServer } from '../../src/servers/data'; +import { TagsTableRow as createTagsTableRow } from '../../src/tags/TagsTableRow'; import { renderWithEvents } from '../__helpers__/setUpTest'; import { colorGeneratorMock } from '../utils/services/__mocks__/ColorGenerator.mock'; diff --git a/test/tags/helpers/EditTagModal.test.tsx b/test/tags/helpers/EditTagModal.test.tsx index 3ffbcd54..0b6a96b7 100644 --- a/test/tags/helpers/EditTagModal.test.tsx +++ b/test/tags/helpers/EditTagModal.test.tsx @@ -1,10 +1,10 @@ import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import type { TagEdition } from '../../../src/tags/reducers/tagEdit'; +import type { ProblemDetailsError } from '../../../src/api/types/errors'; import { EditTagModal as createEditTagModal } from '../../../src/tags/helpers/EditTagModal'; +import type { TagEdition } from '../../../src/tags/reducers/tagEdit'; import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; import { renderWithEvents } from '../../__helpers__/setUpTest'; -import type { ProblemDetailsError } from '../../../src/api/types/errors'; describe('', () => { const EditTagModal = createEditTagModal(Mock.of({ getColorForKey: jest.fn(() => 'green') })); diff --git a/test/tags/helpers/Tag.test.tsx b/test/tags/helpers/Tag.test.tsx index c45b3003..46f224e7 100644 --- a/test/tags/helpers/Tag.test.tsx +++ b/test/tags/helpers/Tag.test.tsx @@ -1,9 +1,9 @@ import { screen } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import type { ReactNode } from 'react'; +import { Mock } from 'ts-mockery'; +import { Tag } from '../../../src/tags/helpers/Tag'; import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; import { MAIN_COLOR } from '../../../src/utils/theme'; -import { Tag } from '../../../src/tags/helpers/Tag'; import { renderWithEvents } from '../../__helpers__/setUpTest'; const hexToRgb = (hex: string) => { diff --git a/test/tags/helpers/TagsSelector.test.tsx b/test/tags/helpers/TagsSelector.test.tsx index 2553e413..398a0e93 100644 --- a/test/tags/helpers/TagsSelector.test.tsx +++ b/test/tags/helpers/TagsSelector.test.tsx @@ -1,8 +1,8 @@ import { screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; +import type { Settings } from '../../../src/settings/reducers/settings'; import { TagsSelector as createTagsSelector } from '../../../src/tags/helpers/TagsSelector'; import type { TagsList } from '../../../src/tags/reducers/tagsList'; -import type { Settings } from '../../../src/settings/reducers/settings'; 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 8519a6b0..9b0b161b 100644 --- a/test/tags/reducers/tagDelete.test.ts +++ b/test/tags/reducers/tagDelete.test.ts @@ -1,7 +1,7 @@ import { Mock } from 'ts-mockery'; -import { tagDeleted, tagDeleteReducerCreator } from '../../../src/tags/reducers/tagDelete'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkState } from '../../../src/container/types'; +import { tagDeleted, tagDeleteReducerCreator } from '../../../src/tags/reducers/tagDelete'; describe('tagDeleteReducer', () => { const deleteTagsCall = jest.fn(); diff --git a/test/tags/reducers/tagEdit.test.ts b/test/tags/reducers/tagEdit.test.ts index 93b9c3da..deab5355 100644 --- a/test/tags/reducers/tagEdit.test.ts +++ b/test/tags/reducers/tagEdit.test.ts @@ -1,9 +1,9 @@ import { Mock } from 'ts-mockery'; -import type { EditTagAction } from '../../../src/tags/reducers/tagEdit'; -import { tagEdited, editTag as editTagCreator, tagEditReducerCreator } from '../../../src/tags/reducers/tagEdit'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; import type { ShlinkState } from '../../../src/container/types'; +import type { EditTagAction } from '../../../src/tags/reducers/tagEdit'; +import { editTag as editTagCreator, tagEdited, tagEditReducerCreator } from '../../../src/tags/reducers/tagEdit'; +import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; describe('tagEditReducer', () => { const oldName = 'foo'; diff --git a/test/tags/reducers/tagsList.test.ts b/test/tags/reducers/tagsList.test.ts index d088c2e5..d69b8645 100644 --- a/test/tags/reducers/tagsList.test.ts +++ b/test/tags/reducers/tagsList.test.ts @@ -1,4 +1,9 @@ import { Mock } from 'ts-mockery'; +import type { ShlinkState } from '../../../src/container/types'; +import type { ShortUrl } from '../../../src/short-urls/data'; +import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation'; +import { tagDeleted } from '../../../src/tags/reducers/tagDelete'; +import { tagEdited } from '../../../src/tags/reducers/tagEdit'; import type { TagsList } from '../../../src/tags/reducers/tagsList'; import { @@ -6,11 +11,6 @@ import { listTags as listTagsCreator, tagsListReducerCreator, } from '../../../src/tags/reducers/tagsList'; -import type { ShlinkState } from '../../../src/container/types'; -import type { ShortUrl } from '../../../src/short-urls/data'; -import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation'; -import { tagEdited } from '../../../src/tags/reducers/tagEdit'; -import { tagDeleted } from '../../../src/tags/reducers/tagDelete'; describe('tagsListReducer', () => { const state = (props: Partial) => Mock.of(props); diff --git a/test/utils/InfoTooltip.test.tsx b/test/utils/InfoTooltip.test.tsx index 69d18203..388c279c 100644 --- a/test/utils/InfoTooltip.test.tsx +++ b/test/utils/InfoTooltip.test.tsx @@ -1,5 +1,5 @@ -import { screen, waitFor } from '@testing-library/react'; import type { Placement } from '@popperjs/core'; +import { screen, waitFor } from '@testing-library/react'; import type { InfoTooltipProps } from '../../src/utils/InfoTooltip'; import { InfoTooltip } from '../../src/utils/InfoTooltip'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/utils/OrderingDropdown.test.tsx b/test/utils/OrderingDropdown.test.tsx index 1a35a31c..71660353 100644 --- a/test/utils/OrderingDropdown.test.tsx +++ b/test/utils/OrderingDropdown.test.tsx @@ -1,8 +1,8 @@ import { screen } from '@testing-library/react'; import { values } from 'ramda'; +import type { OrderDir } from '../../src/utils/helpers/ordering'; import type { OrderingDropdownProps } from '../../src/utils/OrderingDropdown'; import { OrderingDropdown } from '../../src/utils/OrderingDropdown'; -import type { OrderDir } from '../../src/utils/helpers/ordering'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/utils/dates/DateInput.test.tsx b/test/utils/dates/DateInput.test.tsx index e7389f50..1e648089 100644 --- a/test/utils/dates/DateInput.test.tsx +++ b/test/utils/dates/DateInput.test.tsx @@ -1,6 +1,6 @@ import { screen, waitFor } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import { parseISO } from 'date-fns'; +import { Mock } from 'ts-mockery'; import type { DateInputProps } from '../../../src/utils/dates/DateInput'; import { DateInput } from '../../../src/utils/dates/DateInput'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/utils/dates/DateIntervalDropdownItems.test.tsx b/test/utils/dates/DateIntervalDropdownItems.test.tsx index ac04b70d..7b56930d 100644 --- a/test/utils/dates/DateIntervalDropdownItems.test.tsx +++ b/test/utils/dates/DateIntervalDropdownItems.test.tsx @@ -1,8 +1,8 @@ import { screen, waitFor } from '@testing-library/react'; import { DateIntervalDropdownItems } from '../../../src/utils/dates/DateIntervalDropdownItems'; +import { DropdownBtn } from '../../../src/utils/DropdownBtn'; import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; import { DATE_INTERVALS, rangeOrIntervalToString } from '../../../src/utils/helpers/dateIntervals'; -import { DropdownBtn } from '../../../src/utils/DropdownBtn'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/utils/dates/DateIntervalSelector.test.tsx b/test/utils/dates/DateIntervalSelector.test.tsx index 3c56b9ce..75b995bb 100644 --- a/test/utils/dates/DateIntervalSelector.test.tsx +++ b/test/utils/dates/DateIntervalSelector.test.tsx @@ -1,7 +1,7 @@ import { screen, waitFor } from '@testing-library/react'; +import { DateIntervalSelector } from '../../../src/utils/dates/DateIntervalSelector'; import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; import { rangeOrIntervalToString } from '../../../src/utils/helpers/dateIntervals'; -import { DateIntervalSelector } from '../../../src/utils/dates/DateIntervalSelector'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/utils/helpers/dateIntervals.test.ts b/test/utils/helpers/dateIntervals.test.ts index dd782079..c562fb07 100644 --- a/test/utils/helpers/dateIntervals.test.ts +++ b/test/utils/helpers/dateIntervals.test.ts @@ -1,4 +1,5 @@ import { endOfDay, format, formatISO, startOfDay, subDays } from 'date-fns'; +import { now, parseDate } from '../../../src/utils/helpers/date'; import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; import { @@ -9,7 +10,6 @@ import { rangeOrIntervalToString, toDateRange, } from '../../../src/utils/helpers/dateIntervals'; -import { parseDate, now } from '../../../src/utils/helpers/date'; describe('date-types', () => { const daysBack = (days: number) => subDays(now(), days); diff --git a/test/utils/helpers/leaflet.test.ts b/test/utils/helpers/leaflet.test.ts index 9fc1a4d0..e9e37bd9 100644 --- a/test/utils/helpers/leaflet.test.ts +++ b/test/utils/helpers/leaflet.test.ts @@ -1,6 +1,6 @@ import L from 'leaflet'; -import marker2x from 'leaflet/dist/images/marker-icon-2x.png'; import marker from 'leaflet/dist/images/marker-icon.png'; +import marker2x from 'leaflet/dist/images/marker-icon-2x.png'; import markerShadow from 'leaflet/dist/images/marker-shadow.png'; import { fixLeafletIcons } from '../../../src/utils/helpers/leaflet'; diff --git a/test/utils/table/TableOrderIcon.test.tsx b/test/utils/table/TableOrderIcon.test.tsx index 9dd5b477..27a72d9c 100644 --- a/test/utils/table/TableOrderIcon.test.tsx +++ b/test/utils/table/TableOrderIcon.test.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react'; -import { TableOrderIcon } from '../../../src/utils/table/TableOrderIcon'; import type { OrderDir } from '../../../src/utils/helpers/ordering'; +import { TableOrderIcon } from '../../../src/utils/table/TableOrderIcon'; describe('', () => { const setUp = (field: string, currentDir?: OrderDir, className?: string) => render( diff --git a/test/visits/DomainVisits.test.tsx b/test/visits/DomainVisits.test.tsx index ac977d17..7cfa5b6d 100644 --- a/test/visits/DomainVisits.test.tsx +++ b/test/visits/DomainVisits.test.tsx @@ -1,12 +1,12 @@ import { screen } from '@testing-library/react'; +import { formatISO } from 'date-fns'; import { MemoryRouter } from 'react-router-dom'; import { Mock } from 'ts-mockery'; -import { formatISO } from 'date-fns'; -import { DomainVisits as createDomainVisits } from '../../src/visits/DomainVisits'; import type { ReportExporter } from '../../src/common/services/ReportExporter'; import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -import type { DomainVisits } from '../../src/visits/reducers/domainVisits'; import type { Settings } from '../../src/settings/reducers/settings'; +import { DomainVisits as createDomainVisits } from '../../src/visits/DomainVisits'; +import type { DomainVisits } from '../../src/visits/reducers/domainVisits'; import type { Visit } from '../../src/visits/types'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/visits/NonOrphanVisits.test.tsx b/test/visits/NonOrphanVisits.test.tsx index d2a1626d..413ea32f 100644 --- a/test/visits/NonOrphanVisits.test.tsx +++ b/test/visits/NonOrphanVisits.test.tsx @@ -1,14 +1,14 @@ import { screen } from '@testing-library/react'; +import { formatISO } from 'date-fns'; import { MemoryRouter } from 'react-router-dom'; import { Mock } from 'ts-mockery'; -import { formatISO } from 'date-fns'; -import { NonOrphanVisits as createNonOrphanVisits } from '../../src/visits/NonOrphanVisits'; -import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -import type { Visit } from '../../src/visits/types'; -import type { Settings } from '../../src/settings/reducers/settings'; import type { ReportExporter } from '../../src/common/services/ReportExporter'; -import { renderWithEvents } from '../__helpers__/setUpTest'; +import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; +import type { Settings } from '../../src/settings/reducers/settings'; +import { NonOrphanVisits as createNonOrphanVisits } from '../../src/visits/NonOrphanVisits'; import type { VisitsInfo } from '../../src/visits/reducers/types'; +import type { Visit } from '../../src/visits/types'; +import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { const exportVisits = jest.fn(); diff --git a/test/visits/OrphanVisits.test.tsx b/test/visits/OrphanVisits.test.tsx index 3e351205..a8a76cf7 100644 --- a/test/visits/OrphanVisits.test.tsx +++ b/test/visits/OrphanVisits.test.tsx @@ -1,14 +1,14 @@ import { screen } from '@testing-library/react'; +import { formatISO } from 'date-fns'; import { MemoryRouter } from 'react-router-dom'; import { Mock } from 'ts-mockery'; -import { formatISO } from 'date-fns'; -import { OrphanVisits as createOrphanVisits } from '../../src/visits/OrphanVisits'; -import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -import type { Visit } from '../../src/visits/types'; -import type { Settings } from '../../src/settings/reducers/settings'; import type { ReportExporter } from '../../src/common/services/ReportExporter'; -import { renderWithEvents } from '../__helpers__/setUpTest'; +import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; +import type { Settings } from '../../src/settings/reducers/settings'; +import { OrphanVisits as createOrphanVisits } from '../../src/visits/OrphanVisits'; import type { VisitsInfo } from '../../src/visits/reducers/types'; +import type { Visit } from '../../src/visits/types'; +import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { const getOrphanVisits = jest.fn(); diff --git a/test/visits/ShortUrlVisits.test.tsx b/test/visits/ShortUrlVisits.test.tsx index b5759190..8b34d951 100644 --- a/test/visits/ShortUrlVisits.test.tsx +++ b/test/visits/ShortUrlVisits.test.tsx @@ -1,16 +1,16 @@ import { screen } from '@testing-library/react'; -import { MemoryRouter } from 'react-router-dom'; -import { identity } from 'ramda'; -import { Mock } from 'ts-mockery'; import { formatISO } from 'date-fns'; +import { identity } from 'ramda'; +import { MemoryRouter } from 'react-router-dom'; +import { Mock } from 'ts-mockery'; +import type { ReportExporter } from '../../src/common/services/ReportExporter'; +import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; +import type { Settings } from '../../src/settings/reducers/settings'; +import type { ShortUrlDetail } from '../../src/short-urls/reducers/shortUrlDetail'; +import type { ShortUrlVisits as ShortUrlVisitsState } from '../../src/visits/reducers/shortUrlVisits'; import type { ShortUrlVisitsProps } from '../../src/visits/ShortUrlVisits'; import { ShortUrlVisits as createShortUrlVisits } from '../../src/visits/ShortUrlVisits'; -import type { ShortUrlVisits as ShortUrlVisitsState } from '../../src/visits/reducers/shortUrlVisits'; -import type { ShortUrlDetail } from '../../src/short-urls/reducers/shortUrlDetail'; -import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -import type { ReportExporter } from '../../src/common/services/ReportExporter'; import type { Visit } from '../../src/visits/types'; -import type { Settings } from '../../src/settings/reducers/settings'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/ShortUrlVisitsHeader.test.tsx b/test/visits/ShortUrlVisitsHeader.test.tsx index fab3d8d8..ff4cea75 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 { Mock } from 'ts-mockery'; import { formatDistance, parseISO } from 'date-fns'; -import { ShortUrlVisitsHeader } from '../../src/visits/ShortUrlVisitsHeader'; +import { Mock } from 'ts-mockery'; import type { ShortUrlDetail } from '../../src/short-urls/reducers/shortUrlDetail'; import type { ShortUrlVisits } from '../../src/visits/reducers/shortUrlVisits'; +import { ShortUrlVisitsHeader } from '../../src/visits/ShortUrlVisitsHeader'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/TagVisits.test.tsx b/test/visits/TagVisits.test.tsx index 768eab23..d08ce2c5 100644 --- a/test/visits/TagVisits.test.tsx +++ b/test/visits/TagVisits.test.tsx @@ -2,14 +2,14 @@ import { screen } from '@testing-library/react'; import { formatISO } from 'date-fns'; import { MemoryRouter } from 'react-router-dom'; import { Mock } from 'ts-mockery'; -import type { TagVisitsProps } from '../../src/visits/TagVisits'; -import { TagVisits as createTagVisits } from '../../src/visits/TagVisits'; +import type { ReportExporter } from '../../src/common/services/ReportExporter'; +import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; +import type { Settings } from '../../src/settings/reducers/settings'; import type { ColorGenerator } from '../../src/utils/services/ColorGenerator'; import type { TagVisits as TagVisitsStats } from '../../src/visits/reducers/tagVisits'; -import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -import type { ReportExporter } from '../../src/common/services/ReportExporter'; +import type { TagVisitsProps } from '../../src/visits/TagVisits'; +import { TagVisits as createTagVisits } from '../../src/visits/TagVisits'; import type { Visit } from '../../src/visits/types'; -import type { Settings } from '../../src/settings/reducers/settings'; import { renderWithEvents } from '../__helpers__/setUpTest'; jest.mock('react-router-dom', () => ({ diff --git a/test/visits/TagVisitsHeader.test.tsx b/test/visits/TagVisitsHeader.test.tsx index 19d1669e..1040dc50 100644 --- a/test/visits/TagVisitsHeader.test.tsx +++ b/test/visits/TagVisitsHeader.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import { TagVisitsHeader } from '../../src/visits/TagVisitsHeader'; -import type { TagVisits } from '../../src/visits/reducers/tagVisits'; import type { ColorGenerator } from '../../src/utils/services/ColorGenerator'; +import type { TagVisits } from '../../src/visits/reducers/tagVisits'; +import { TagVisitsHeader } from '../../src/visits/TagVisitsHeader'; describe('', () => { const tagVisits = Mock.of({ diff --git a/test/visits/VisitsHeader.test.tsx b/test/visits/VisitsHeader.test.tsx index d8ee7942..66da11c9 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 { Mock } from 'ts-mockery'; -import { VisitsHeader } from '../../src/visits/VisitsHeader'; import type { Visit } from '../../src/visits/types'; +import { VisitsHeader } from '../../src/visits/VisitsHeader'; describe('', () => { const visits = [Mock.all(), Mock.all(), Mock.all()]; diff --git a/test/visits/VisitsStats.test.tsx b/test/visits/VisitsStats.test.tsx index 859fadad..8afde4e9 100644 --- a/test/visits/VisitsStats.test.tsx +++ b/test/visits/VisitsStats.test.tsx @@ -1,13 +1,13 @@ import { screen, waitFor } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; -import { Router } from 'react-router-dom'; import { createMemoryHistory } from 'history'; -import { VisitsStats } from '../../src/visits/VisitsStats'; -import type { Visit } from '../../src/visits/types'; +import { Router } from 'react-router-dom'; +import { Mock } from 'ts-mockery'; import type { Settings } from '../../src/settings/reducers/settings'; -import { renderWithEvents } from '../__helpers__/setUpTest'; import { rangeOf } from '../../src/utils/utils'; import type { VisitsInfo } from '../../src/visits/reducers/types'; +import type { Visit } from '../../src/visits/types'; +import { VisitsStats } from '../../src/visits/VisitsStats'; +import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { const visits = rangeOf(3, () => Mock.of({ date: '2020-01-01' })); diff --git a/test/visits/VisitsTable.test.tsx b/test/visits/VisitsTable.test.tsx index 313a642a..e62da685 100644 --- a/test/visits/VisitsTable.test.tsx +++ b/test/visits/VisitsTable.test.tsx @@ -1,9 +1,9 @@ import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; -import type { VisitsTableProps } from '../../src/visits/VisitsTable'; -import { VisitsTable } from '../../src/visits/VisitsTable'; import { rangeOf } from '../../src/utils/utils'; import type { NormalizedVisit } from '../../src/visits/types'; +import type { VisitsTableProps } from '../../src/visits/VisitsTable'; +import { VisitsTable } from '../../src/visits/VisitsTable'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/charts/ChartCard.test.tsx b/test/visits/charts/ChartCard.test.tsx index 96cb8f22..185bd023 100644 --- a/test/visits/charts/ChartCard.test.tsx +++ b/test/visits/charts/ChartCard.test.tsx @@ -1,5 +1,5 @@ -import type { ReactNode } from 'react'; import { render, screen } from '@testing-library/react'; +import type { ReactNode } from 'react'; import { ChartCard } from '../../../src/visits/charts/ChartCard'; describe('', () => { diff --git a/test/visits/charts/DoughnutChartLegend.test.tsx b/test/visits/charts/DoughnutChartLegend.test.tsx index f1e9bd36..093bc161 100644 --- a/test/visits/charts/DoughnutChartLegend.test.tsx +++ b/test/visits/charts/DoughnutChartLegend.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; -import { Mock } from 'ts-mockery'; import type { Chart, ChartDataset } from 'chart.js'; +import { Mock } from 'ts-mockery'; import { DoughnutChartLegend } from '../../../src/visits/charts/DoughnutChartLegend'; describe('', () => { diff --git a/test/visits/charts/SortableBarChartCard.test.tsx b/test/visits/charts/SortableBarChartCard.test.tsx index 1995af34..b6bc0a6f 100644 --- a/test/visits/charts/SortableBarChartCard.test.tsx +++ b/test/visits/charts/SortableBarChartCard.test.tsx @@ -1,9 +1,9 @@ -import type { ReactNode } from 'react'; import { screen } from '@testing-library/react'; import { range } from 'ramda'; +import type { ReactNode } from 'react'; import { rangeOf } from '../../../src/utils/utils'; -import type { Stats } from '../../../src/visits/types'; import { SortableBarChartCard } from '../../../src/visits/charts/SortableBarChartCard'; +import type { Stats } from '../../../src/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 6c93f9ed..1008d80e 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 type { OrphanVisitType, VisitsFilter } from '../../../src/visits/types'; import { VisitsFilterDropdown } from '../../../src/visits/helpers/VisitsFilterDropdown'; +import type { OrphanVisitType, VisitsFilter } from '../../../src/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 0cb97b28..61859d6b 100644 --- a/test/visits/reducers/domainVisits.test.ts +++ b/test/visits/reducers/domainVisits.test.ts @@ -1,21 +1,21 @@ -import { Mock } from 'ts-mockery'; import { addDays, formatISO, subDays } from 'date-fns'; +import { Mock } from 'ts-mockery'; +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/short-urls/data'; +import { formatIsoDate } from '../../../src/utils/helpers/date'; +import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; +import { rangeOf } from '../../../src/utils/utils'; import type { DomainVisits } from '../../../src/visits/reducers/domainVisits'; import { - getDomainVisits as getDomainVisitsCreator, DEFAULT_DOMAIN, domainVisitsReducerCreator, + getDomainVisits as getDomainVisitsCreator, } from '../../../src/visits/reducers/domainVisits'; -import { rangeOf } from '../../../src/utils/utils'; -import type { Visit } from '../../../src/visits/types'; -import type { ShlinkVisits } from '../../../src/api/types'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkState } from '../../../src/container/types'; -import { formatIsoDate } from '../../../src/utils/helpers/date'; -import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; -import type { ShortUrl } from '../../../src/short-urls/data'; import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; +import type { Visit } from '../../../src/visits/types'; describe('domainVisitsReducer', () => { const now = new Date(); diff --git a/test/visits/reducers/nonOrphanVisits.test.ts b/test/visits/reducers/nonOrphanVisits.test.ts index fab7c87e..3dfafacd 100644 --- a/test/visits/reducers/nonOrphanVisits.test.ts +++ b/test/visits/reducers/nonOrphanVisits.test.ts @@ -1,18 +1,18 @@ -import { Mock } from 'ts-mockery'; import { addDays, formatISO, subDays } from 'date-fns'; +import { Mock } from 'ts-mockery'; +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'; import { getNonOrphanVisits as getNonOrphanVisitsCreator, nonOrphanVisitsReducerCreator, } from '../../../src/visits/reducers/nonOrphanVisits'; -import { rangeOf } from '../../../src/utils/utils'; -import type { Visit } from '../../../src/visits/types'; -import type { ShlinkVisits } from '../../../src/api/types'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkState } from '../../../src/container/types'; -import { formatIsoDate } from '../../../src/utils/helpers/date'; -import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; -import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; import type { VisitsInfo } from '../../../src/visits/reducers/types'; +import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; +import type { Visit } from '../../../src/visits/types'; describe('nonOrphanVisitsReducer', () => { const now = new Date(); diff --git a/test/visits/reducers/orphanVisits.test.ts b/test/visits/reducers/orphanVisits.test.ts index 1252023a..1d00955d 100644 --- a/test/visits/reducers/orphanVisits.test.ts +++ b/test/visits/reducers/orphanVisits.test.ts @@ -1,18 +1,18 @@ -import { Mock } from 'ts-mockery'; import { addDays, formatISO, subDays } from 'date-fns'; +import { Mock } from 'ts-mockery'; +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'; import { getOrphanVisits as getOrphanVisitsCreator, orphanVisitsReducerCreator, } from '../../../src/visits/reducers/orphanVisits'; -import { rangeOf } from '../../../src/utils/utils'; -import type { Visit } from '../../../src/visits/types'; -import type { ShlinkVisits } from '../../../src/api/types'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkState } from '../../../src/container/types'; -import { formatIsoDate } from '../../../src/utils/helpers/date'; -import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; -import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; import type { VisitsInfo } from '../../../src/visits/reducers/types'; +import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; +import type { Visit } from '../../../src/visits/types'; describe('orphanVisitsReducer', () => { const now = new Date(); diff --git a/test/visits/reducers/shortUrlVisits.test.ts b/test/visits/reducers/shortUrlVisits.test.ts index 9fa8fecb..ba0820dd 100644 --- a/test/visits/reducers/shortUrlVisits.test.ts +++ b/test/visits/reducers/shortUrlVisits.test.ts @@ -1,19 +1,19 @@ -import { Mock } from 'ts-mockery'; import { addDays, formatISO, subDays } from 'date-fns'; +import { Mock } from 'ts-mockery'; +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'; import type { ShortUrlVisits } from '../../../src/visits/reducers/shortUrlVisits'; import { getShortUrlVisits as getShortUrlVisitsCreator, shortUrlVisitsReducerCreator, } from '../../../src/visits/reducers/shortUrlVisits'; -import { rangeOf } from '../../../src/utils/utils'; -import type { Visit } from '../../../src/visits/types'; -import type { ShlinkVisits } from '../../../src/api/types'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkState } from '../../../src/container/types'; -import { formatIsoDate } from '../../../src/utils/helpers/date'; -import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; +import type { Visit } from '../../../src/visits/types'; describe('shortUrlVisitsReducer', () => { const now = new Date(); diff --git a/test/visits/reducers/tagVisits.test.ts b/test/visits/reducers/tagVisits.test.ts index 80906429..7f2e1bc3 100644 --- a/test/visits/reducers/tagVisits.test.ts +++ b/test/visits/reducers/tagVisits.test.ts @@ -1,19 +1,19 @@ -import { Mock } from 'ts-mockery'; import { addDays, formatISO, subDays } from 'date-fns'; +import { Mock } from 'ts-mockery'; +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'; import type { TagVisits } from '../../../src/visits/reducers/tagVisits'; import { getTagVisits as getTagVisitsCreator, tagVisitsReducerCreator, } from '../../../src/visits/reducers/tagVisits'; -import { rangeOf } from '../../../src/utils/utils'; -import type { Visit } from '../../../src/visits/types'; -import type { ShlinkVisits } from '../../../src/api/types'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkState } from '../../../src/container/types'; -import { formatIsoDate } from '../../../src/utils/helpers/date'; -import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; +import type { Visit } from '../../../src/visits/types'; describe('tagVisitsReducer', () => { const now = new Date(); diff --git a/test/visits/reducers/visitCreation.test.ts b/test/visits/reducers/visitCreation.test.ts index bd6010ad..2fc8b4ea 100644 --- a/test/visits/reducers/visitCreation.test.ts +++ b/test/visits/reducers/visitCreation.test.ts @@ -1,6 +1,6 @@ import { Mock } from 'ts-mockery'; -import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; import type { ShortUrl } from '../../../src/short-urls/data'; +import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; import type { Visit } from '../../../src/visits/types'; describe('visitCreationReducer', () => { diff --git a/test/visits/reducers/visitsOverview.test.ts b/test/visits/reducers/visitsOverview.test.ts index e24a05f2..4bf3568f 100644 --- a/test/visits/reducers/visitsOverview.test.ts +++ b/test/visits/reducers/visitsOverview.test.ts @@ -1,4 +1,9 @@ import { Mock } from 'ts-mockery'; +import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; +import type { ShlinkVisitsOverview } from '../../../src/api/types'; +import type { ShlinkState } from '../../../src/container/types'; +import type { CreateVisitsAction } from '../../../src/visits/reducers/visitCreation'; +import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; import type { GetVisitsOverviewAction, VisitsOverview } from '../../../src/visits/reducers/visitsOverview'; @@ -6,11 +11,6 @@ import { loadVisitsOverview as loadVisitsOverviewCreator, visitsOverviewReducerCreator, } from '../../../src/visits/reducers/visitsOverview'; -import type { CreateVisitsAction } from '../../../src/visits/reducers/visitCreation'; -import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; -import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; -import type { ShlinkVisitsOverview } from '../../../src/api/types'; -import type { ShlinkState } from '../../../src/container/types'; import type { CreateVisit, OrphanVisit, Visit } from '../../../src/visits/types'; describe('visitsOverviewReducer', () => { diff --git a/test/visits/services/VisitsParser.test.ts b/test/visits/services/VisitsParser.test.ts index 7d3ed3dd..25cd5d39 100644 --- a/test/visits/services/VisitsParser.test.ts +++ b/test/visits/services/VisitsParser.test.ts @@ -1,5 +1,5 @@ import { Mock } from 'ts-mockery'; -import { processStatsFromVisits, normalizeVisits } from '../../../src/visits/services/VisitsParser'; +import { normalizeVisits, processStatsFromVisits } from '../../../src/visits/services/VisitsParser'; import type { OrphanVisit, Visit, VisitsStats } from '../../../src/visits/types'; describe('VisitsParser', () => { diff --git a/test/visits/types/helpers.test.ts b/test/visits/types/helpers.test.ts index 03e488eb..de00bddd 100644 --- a/test/visits/types/helpers.test.ts +++ b/test/visits/types/helpers.test.ts @@ -1,9 +1,9 @@ import { Mock } from 'ts-mockery'; -import type { GroupedNewVisits } from '../../../src/visits/types/helpers'; -import { groupNewVisitsByType, toApiParams } from '../../../src/visits/types/helpers'; -import type { CreateVisit, OrphanVisit, Visit, VisitsParams } from '../../../src/visits/types'; import type { ShlinkVisitsParams } from '../../../src/api/types'; import { formatIsoDate, parseDate } from '../../../src/utils/helpers/date'; +import type { CreateVisit, OrphanVisit, Visit, VisitsParams } from '../../../src/visits/types'; +import type { GroupedNewVisits } from '../../../src/visits/types/helpers'; +import { groupNewVisitsByType, toApiParams } from '../../../src/visits/types/helpers'; describe('visitsTypeHelpers', () => { describe('groupNewVisitsByType', () => {