From 47a6e16ce1d5beb2ac951c40dd85092c5c1ceab3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 06:23:52 +0000 Subject: [PATCH 001/268] Bump word-wrap from 1.2.3 to 1.2.4 Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 77c6ad02c..308930dc1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10228,9 +10228,10 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -17165,7 +17166,9 @@ } }, "word-wrap": { - "version": "1.2.3", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true }, "workbox-background-sync": { From 49cf81c18b9e3d3b649458499f40bb64c37efe24 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 25 Jul 2023 08:53:14 +0200 Subject: [PATCH 002/268] Add forms for question reporting as discussion and bug issues --- .github/DISCUSSION_TEMPLATE/q-a.yml | 24 ++++++++++++++ .github/ISSUE_TEMPLATE/Bug.md | 36 -------------------- .github/ISSUE_TEMPLATE/Bug.yml | 38 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/Question_Support.md | 24 -------------- .github/ISSUE_TEMPLATE/config.yml | 5 +++ 5 files changed, 67 insertions(+), 60 deletions(-) create mode 100644 .github/DISCUSSION_TEMPLATE/q-a.yml delete mode 100644 .github/ISSUE_TEMPLATE/Bug.md create mode 100644 .github/ISSUE_TEMPLATE/Bug.yml delete mode 100644 .github/ISSUE_TEMPLATE/Question_Support.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/DISCUSSION_TEMPLATE/q-a.yml b/.github/DISCUSSION_TEMPLATE/q-a.yml new file mode 100644 index 000000000..db66577f9 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/q-a.yml @@ -0,0 +1,24 @@ +title: 'Q&A' +body: + - type: input + validations: + required: true + attributes: + label: shlink-web-client version + placeholder: x.y.z + - type: dropdown + validations: + required: true + attributes: + label: How do you use shlink-web-client + options: + - https://app.shlink.io + - Docker image + - Self-hosted + - Other (explain in summary) + - type: textarea + validations: + required: true + attributes: + label: Summary + value: '' diff --git a/.github/ISSUE_TEMPLATE/Bug.md b/.github/ISSUE_TEMPLATE/Bug.md deleted file mode 100644 index ccd19bf07..000000000 --- a/.github/ISSUE_TEMPLATE/Bug.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: Bug report -about: Something on shlink is broken or not working as documented? -labels: bug ---- - - - -#### Shlink web client version - -* Version: x.y.z -* How do you use shlink-web-client: app.shlink.io|Docker image|self-hosted - -#### Summary - - - -#### Current behavior - - - -#### Expected behavior - - - -#### How to reproduce - - diff --git a/.github/ISSUE_TEMPLATE/Bug.yml b/.github/ISSUE_TEMPLATE/Bug.yml new file mode 100644 index 000000000..a3f2a6d09 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Bug.yml @@ -0,0 +1,38 @@ +name: 'Q&A' +description: Something on shlink is broken or not working as documented? +labels: ['bug'] +body: + - type: input + validations: + required: true + attributes: + label: shlink-web-client version + placeholder: x.y.z + - type: dropdown + validations: + required: true + attributes: + label: How do you use shlink-web-client + options: + - https://app.shlink.io + - Docker image + - Self-hosted + - Other (explain in summary) + - type: textarea + validations: + required: true + attributes: + label: Current behavior + value: '' + - type: textarea + validations: + required: true + attributes: + label: Expected behavior + value: '' + - type: textarea + validations: + required: true + attributes: + label: How to reproduce + value: '' diff --git a/.github/ISSUE_TEMPLATE/Question_Support.md b/.github/ISSUE_TEMPLATE/Question_Support.md deleted file mode 100644 index d44aa5711..000000000 --- a/.github/ISSUE_TEMPLATE/Question_Support.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Question - Support -about: Do you have a problem setting up or using shlink? -labels: question ---- - - - -#### Shlink web client version - -* Version: x.y.z -* How do you use shlink-web-client: app.shlink.io|Docker image|self-hosted - -#### Summary - - diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..44c11cb8e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Question - Support + about: Do you need help setting up or using shlink-web-client? + url: https://github.com/shlinkio/shlink-web-client/discussions/new?category=q-a From 6fe5c4dc54dca102770190f6a21eb9ed7f76c02e Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 25 Jul 2023 08:55:12 +0200 Subject: [PATCH 003/268] Fix typo in Bug issue template --- .github/ISSUE_TEMPLATE/Bug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/Bug.yml b/.github/ISSUE_TEMPLATE/Bug.yml index a3f2a6d09..30f13a503 100644 --- a/.github/ISSUE_TEMPLATE/Bug.yml +++ b/.github/ISSUE_TEMPLATE/Bug.yml @@ -1,4 +1,4 @@ -name: 'Q&A' +name: 'Bug' description: Something on shlink is broken or not working as documented? labels: ['bug'] body: From deca5b31e1a5da6ace114312224d5dfd9d8f5ce6 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Thu, 3 Aug 2023 09:12:47 +0200 Subject: [PATCH 004/268] Add form config for Feature Request issues --- .github/ISSUE_TEMPLATE/Feature_Request.md | 19 ------------------- .github/ISSUE_TEMPLATE/Feature_Request.yml | 16 ++++++++++++++++ CONTRIBUTING.md | 4 ++-- indocker | 2 +- 4 files changed, 19 insertions(+), 22 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/Feature_Request.md create mode 100644 .github/ISSUE_TEMPLATE/Feature_Request.yml diff --git a/.github/ISSUE_TEMPLATE/Feature_Request.md b/.github/ISSUE_TEMPLATE/Feature_Request.md deleted file mode 100644 index 5f3210c0c..000000000 --- a/.github/ISSUE_TEMPLATE/Feature_Request.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Feature request -about: Do you find shlink is missing some important feature that would make it more useful? -labels: feature ---- - - - -#### Summary - - diff --git a/.github/ISSUE_TEMPLATE/Feature_Request.yml b/.github/ISSUE_TEMPLATE/Feature_Request.yml new file mode 100644 index 000000000..bbba68def --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Feature_Request.yml @@ -0,0 +1,16 @@ +name: Feature request +description: Do you find shlink-web-client is missing some important feature that would make it more useful? +labels: ['feature'] +body: + - type: textarea + validations: + required: true + attributes: + label: Summary + value: '' + - type: textarea + validations: + required: true + attributes: + label: Use case + value: '' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d6fa7bfff..a95888718 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ You will also see how to ensure the code fulfills the expected code checks, and ## System dependencies -The project can be run inside a docker container through provided docker-compose configuration. +The project can be run inside a docker container through provided `docker compose` configuration. Because of this, the only actual dependencies are [docker](https://docs.docker.com/get-docker/) and [docker-compose](https://docs.docker.com/compose/install/). @@ -17,7 +17,7 @@ The first thing you need to do is fork the repository, and clone it in your loca Then you will have to follow these steps: * Copy the file `docker-compose.override.yml.dist` by also removing the `dist` extension. -* Start-up the project by running `docker-compose up`. +* Start-up the project by running `docker compose up`. Once this is finished, you will have the project exposed in port `3000` (http://localhost:3000). diff --git a/indocker b/indocker index 811476415..bacfda745 100755 --- a/indocker +++ b/indocker @@ -2,7 +2,7 @@ # Run docker container if it's not up yet if ! [[ $(docker ps | grep shlink_web_client_node) ]]; then - docker-compose up -d + docker compose up -d fi docker exec -it shlink_web_client_node /bin/sh -c "cd /home/shlink/www && $*" From cbbb679dfced525d190aa67f242428d9f6a34a91 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 15 Jul 2023 13:14:49 +0200 Subject: [PATCH 005/268] Remove server-related items from side menu --- src/common/AsideMenu.scss | 18 ------------------ src/common/AsideMenu.tsx | 17 +---------------- src/common/MenuLayout.tsx | 3 +-- src/common/services/provideServices.ts | 4 ---- src/utils/theme/index.ts | 6 ++---- test/common/AsideMenu.test.tsx | 22 ++++------------------ test/common/MenuLayout.test.tsx | 10 ++++++---- 7 files changed, 14 insertions(+), 66 deletions(-) diff --git a/src/common/AsideMenu.scss b/src/common/AsideMenu.scss index 8f1f075e8..4e7e462d9 100644 --- a/src/common/AsideMenu.scss +++ b/src/common/AsideMenu.scss @@ -58,24 +58,6 @@ background-color: var(--brand-color); } -.aside-menu__item--divider { - border-bottom: 1px solid #eeeeee; - margin: 20px 0; -} - -.aside-menu__item--danger { - color: $dangerColor; -} - -.aside-menu__item--push { - margin-top: auto; -} - -.aside-menu__item--danger:hover { - color: #ffffff; - background-color: $dangerColor; -} - .aside-menu__item-text { margin-left: 8px; } diff --git a/src/common/AsideMenu.tsx b/src/common/AsideMenu.tsx index 9d6d18867..abd878661 100644 --- a/src/common/AsideMenu.tsx +++ b/src/common/AsideMenu.tsx @@ -3,7 +3,6 @@ import { 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'; @@ -13,7 +12,6 @@ import type { NavLinkProps } from 'react-router-dom'; import { NavLink, useLocation } from 'react-router-dom'; import type { SelectedServer } from '../servers/data'; import { isServerWithId } from '../servers/data'; -import type { DeleteServerButtonProps } from '../servers/DeleteServerButton'; import './AsideMenu.scss'; export interface AsideMenuProps { @@ -36,9 +34,7 @@ const AsideMenuItem: FC = ({ children, to, className, ...res ); -export const AsideMenu = (DeleteServerButton: FC) => ( - { selectedServer, showOnMobile = false }: AsideMenuProps, -) => { +export const AsideMenu: FC = ({ selectedServer, showOnMobile = false }) => { const hasId = isServerWithId(selectedServer); const serverId = hasId ? selectedServer.id : ''; const { pathname } = useLocation(); @@ -73,17 +69,6 @@ export const AsideMenu = (DeleteServerButton: FC) => ( Manage domains - - - Edit this server - - {hasId && ( - - )} ); diff --git a/src/common/MenuLayout.tsx b/src/common/MenuLayout.tsx index 092db5bbc..288abc963 100644 --- a/src/common/MenuLayout.tsx +++ b/src/common/MenuLayout.tsx @@ -8,7 +8,7 @@ import { isReachableServer } from '../servers/data'; import { withSelectedServer } from '../servers/helpers/withSelectedServer'; import { useFeature } from '../utils/helpers/features'; import { useSwipeable, useToggle } from '../utils/helpers/hooks'; -import type { AsideMenuProps } from './AsideMenu'; +import { AsideMenu } from './AsideMenu'; import { NotFound } from './NotFound'; import './MenuLayout.scss'; @@ -20,7 +20,6 @@ interface MenuLayoutProps { export const MenuLayout = ( TagsList: FC, ShortUrlsList: FC, - AsideMenu: FC, CreateShortUrl: FC, ShortUrlVisits: FC, TagVisits: FC, diff --git a/src/common/services/provideServices.ts b/src/common/services/provideServices.ts index 234396541..5711a4014 100644 --- a/src/common/services/provideServices.ts +++ b/src/common/services/provideServices.ts @@ -1,7 +1,6 @@ import type Bottle from 'bottlejs'; 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'; @@ -37,7 +36,6 @@ export const provideServices = (bottle: Bottle, connect: ConnectDecorator) => { MenuLayout, 'TagsList', 'ShortUrlsList', - 'AsideMenu', 'CreateShortUrl', 'ShortUrlVisits', 'TagVisits', @@ -51,8 +49,6 @@ export const provideServices = (bottle: Bottle, connect: ConnectDecorator) => { ); bottle.decorator('MenuLayout', connect(['selectedServer'], ['selectServer', 'sidebarPresent', 'sidebarNotPresent'])); - bottle.serviceFactory('AsideMenu', AsideMenu, 'DeleteServerButton'); - bottle.serviceFactory('ShlinkVersionsContainer', () => ShlinkVersionsContainer); bottle.decorator('ShlinkVersionsContainer', connect(['selectedServer', 'sidebar'])); diff --git a/src/utils/theme/index.ts b/src/utils/theme/index.ts index 39ebb02ae..970ef3981 100644 --- a/src/utils/theme/index.ts +++ b/src/utils/theme/index.ts @@ -12,8 +12,6 @@ export const PRIMARY_DARK_COLOR = '#161b22'; export type Theme = 'dark' | 'light'; -export const changeThemeInMarkup = (theme: Theme) => - document.getElementsByTagName('html')?.[0]?.setAttribute('data-theme', theme); +export const changeThemeInMarkup = (theme: Theme) => document.querySelector('html')?.setAttribute('data-theme', theme); -export const isDarkThemeEnabled = (): boolean => - document.getElementsByTagName('html')?.[0]?.getAttribute('data-theme') === 'dark'; +export const isDarkThemeEnabled = (): boolean => document.querySelector('html')?.getAttribute('data-theme') === 'dark'; diff --git a/test/common/AsideMenu.test.tsx b/test/common/AsideMenu.test.tsx index 9a4f7d252..fac3fe610 100644 --- a/test/common/AsideMenu.test.tsx +++ b/test/common/AsideMenu.test.tsx @@ -1,13 +1,12 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router'; -import { AsideMenu as createAsideMenu } from '../../src/common/AsideMenu'; +import { AsideMenu } from '../../src/common/AsideMenu'; describe('', () => { - const AsideMenu = createAsideMenu(() => <>DeleteServerButton); - const setUp = (id: string | false = 'abc123') => render( + const setUp = () => render( - + , ); @@ -17,20 +16,7 @@ describe('', () => { const links = screen.getAllByRole('link'); expect.assertions(links.length + 1); - expect(links).toHaveLength(6); + expect(links).toHaveLength(5); links.forEach((link) => expect(link.getAttribute('href')).toContain('abc123')); }); - - it.each([ - ['abc', true], - [false, false], - ])('contains a button to delete server if appropriate', (id, shouldHaveBtn) => { - setUp(id as string | false); - - if (shouldHaveBtn) { - expect(screen.getByText('DeleteServerButton')).toBeInTheDocument(); - } else { - expect(screen.queryByText('DeleteServerButton')).not.toBeInTheDocument(); - } - }); }); diff --git a/test/common/MenuLayout.test.tsx b/test/common/MenuLayout.test.tsx index a916c47d1..08c940e65 100644 --- a/test/common/MenuLayout.test.tsx +++ b/test/common/MenuLayout.test.tsx @@ -6,13 +6,15 @@ import { MenuLayout as createMenuLayout } from '../../src/common/MenuLayout'; import type { NonReachableServer, NotFoundServer, SelectedServer } from '../../src/servers/data'; import type { SemVer } from '../../src/utils/helpers/version'; -vi.mock('react-router-dom', async () => ({ ...(await vi.importActual('react-router-dom')), useParams: vi.fn() })); +vi.mock('react-router-dom', async () => ({ + ...(await vi.importActual('react-router-dom')), + useParams: vi.fn(), +})); describe('', () => { const MenuLayout = createMenuLayout( () => <>TagsList, () => <>ShortUrlsList, - () => <>AsideMenu, () => <>CreateShortUrl, () => <>ShortUrlVisits, () => <>TagVisits, @@ -20,7 +22,7 @@ describe('', () => { () => <>OrphanVisits, () => <>NonOrphanVisits, () => <>ServerError, - () => <>Overview, + () => <>OverviewRoute, () => <>EditShortUrl, () => <>ManageDomains, ); @@ -62,7 +64,7 @@ describe('', () => { }); it.each([ - ['3.0.0' as SemVer, '/overview', 'Overview'], + ['3.0.0' as SemVer, '/overview', 'OverviewRoute'], ['3.0.0' as SemVer, '/list-short-urls/1', 'ShortUrlsList'], ['3.0.0' as SemVer, '/create-short-url', 'CreateShortUrl'], ['3.0.0' as SemVer, '/short-code/abc123/visits/foo', 'ShortUrlVisits'], From d82c0dc75e2ef5a18ff234c2922505756e63c5e1 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 16 Jul 2023 08:47:10 +0200 Subject: [PATCH 006/268] Move stuff belonging to the component to shlink-web-component --- src/api/services/ShlinkApiClient.ts | 2 +- src/api/types/index.ts | 4 +-- src/common/services/ReportExporter.ts | 4 +-- src/container/index.ts | 8 +++--- src/container/types.ts | 28 +++++++++---------- src/mercure/helpers/boundToMercureHub.tsx | 2 +- src/reducers/index.ts | 13 ++++++--- src/servers/helpers/VisitsHighlightCard.tsx | 2 +- src/servers/services/provideServices.ts | 2 +- src/settings/ShortUrlsListSettings.tsx | 2 +- src/settings/TagsSettings.tsx | 2 +- src/settings/reducers/settings.ts | 4 +-- .../domains/DomainRow.tsx | 6 ++-- .../domains/DomainSelector.scss | 4 +-- .../domains/DomainSelector.tsx | 4 +-- .../domains/ManageDomains.tsx | 12 ++++---- .../domains/data/index.ts | 2 +- .../domains/helpers/DomainDropdown.tsx | 10 +++---- .../domains/helpers/DomainStatusIcon.tsx | 4 +-- .../helpers/EditDomainRedirectsModal.tsx | 10 +++---- .../domains/reducers/domainRedirects.ts | 6 ++-- .../domains/reducers/domainsList.ts | 14 +++++----- .../domains/services/provideServices.ts | 2 +- .../overview}/Overview.tsx | 20 ++++++------- .../short-urls/CreateShortUrl.tsx | 4 +-- .../short-urls/EditShortUrl.tsx | 14 +++++----- .../short-urls/Paginator.tsx | 6 ++-- .../short-urls/ShortUrlForm.scss | 2 +- .../short-urls/ShortUrlForm.tsx | 18 ++++++------ .../short-urls/ShortUrlsFilteringBar.scss | 0 .../short-urls/ShortUrlsFilteringBar.tsx | 20 ++++++------- .../short-urls/ShortUrlsList.tsx | 22 +++++++-------- .../short-urls/ShortUrlsTable.scss | 0 .../short-urls/ShortUrlsTable.tsx | 2 +- .../UseExistingIfFoundInfoIcon.scss | 0 .../short-urls/UseExistingIfFoundInfoIcon.tsx | 2 +- .../short-urls/data/index.ts | 6 ++-- .../helpers/CreateShortUrlResult.scss | 0 .../helpers/CreateShortUrlResult.tsx | 6 ++-- .../helpers/DeleteShortUrlModal.tsx | 8 +++--- .../short-urls/helpers/ExportShortUrlsBtn.tsx | 12 ++++---- .../short-urls/helpers/QrCodeModal.scss | 0 .../short-urls/helpers/QrCodeModal.tsx | 12 ++++---- .../short-urls/helpers/ShortUrlDetailLink.tsx | 4 +-- .../helpers/ShortUrlFormCheckboxGroup.tsx | 4 +-- .../short-urls/helpers/ShortUrlStatus.tsx | 4 +-- .../helpers/ShortUrlVisitsCount.scss | 0 .../helpers/ShortUrlVisitsCount.tsx | 8 +++--- .../helpers/ShortUrlsFilterDropdown.tsx | 4 +-- .../short-urls/helpers/ShortUrlsRow.scss | 6 ++-- .../short-urls/helpers/ShortUrlsRow.tsx | 12 ++++---- .../short-urls/helpers/ShortUrlsRowMenu.tsx | 6 ++-- .../short-urls/helpers/Tags.tsx | 2 +- .../short-urls/helpers/hooks.ts | 10 +++---- .../short-urls/helpers/index.ts | 4 +-- .../qr-codes/QrErrorCorrectionDropdown.tsx | 4 +-- .../helpers/qr-codes/QrFormatDropdown.tsx | 4 +-- .../short-urls/reducers/shortUrlCreation.ts | 8 +++--- .../short-urls/reducers/shortUrlDeletion.ts | 8 +++--- .../short-urls/reducers/shortUrlDetail.ts | 8 +++--- .../short-urls/reducers/shortUrlEdition.ts | 8 +++--- .../short-urls/reducers/shortUrlsList.ts | 6 ++-- .../short-urls/services/provideServices.ts | 2 +- .../tags/TagsList.tsx | 20 ++++++------- .../tags/TagsTable.scss | 4 +-- .../tags/TagsTable.tsx | 10 +++---- .../tags/TagsTableRow.tsx | 12 ++++---- .../tags/data/TagsListChildrenProps.ts | 4 +-- .../tags/data/index.ts | 2 +- .../tags/helpers/DeleteTagConfirmModal.tsx | 4 +-- .../tags/helpers/EditTagModal.scss | 0 .../tags/helpers/EditTagModal.tsx | 10 +++---- .../tags/helpers/Tag.scss | 0 .../tags/helpers/Tag.tsx | 2 +- .../tags/helpers/TagBullet.scss | 0 .../tags/helpers/TagBullet.tsx | 2 +- .../tags/helpers/TagsSelector.tsx | 4 +-- .../tags/reducers/tagDelete.ts | 8 +++--- .../tags/reducers/tagEdit.ts | 10 +++---- .../tags/reducers/tagsList.ts | 12 ++++---- .../tags/services/provideServices.ts | 2 +- .../visits/DomainVisits.tsx | 10 +++---- .../visits/NonOrphanVisits.tsx | 8 +++--- .../visits/OrphanVisits.tsx | 8 +++--- .../visits/ShortUrlVisits.tsx | 10 +++---- .../visits/ShortUrlVisitsHeader.scss | 0 .../visits/ShortUrlVisitsHeader.tsx | 2 +- .../visits/TagVisits.tsx | 12 ++++---- .../visits/TagVisitsHeader.tsx | 2 +- .../visits/VisitsHeader.tsx | 0 .../visits/VisitsStats.tsx | 20 ++++++------- .../visits/VisitsTable.scss | 4 +-- .../visits/VisitsTable.tsx | 16 +++++------ .../visits/charts/ChartCard.scss | 0 .../visits/charts/ChartCard.tsx | 0 .../visits/charts/DoughnutChart.tsx | 4 +-- .../visits/charts/DoughnutChartCard.tsx | 0 .../visits/charts/DoughnutChartLegend.scss | 2 +- .../visits/charts/DoughnutChartLegend.tsx | 0 .../visits/charts/HorizontalBarChart.tsx | 8 +++--- .../visits/charts/LineChartCard.scss | 2 +- .../visits/charts/LineChartCard.tsx | 16 +++++------ .../visits/charts/SortableBarChartCard.tsx | 12 ++++---- .../visits/helpers/MapModal.scss | 4 +-- .../visits/helpers/MapModal.tsx | 0 .../visits/helpers/OpenMapModalBtn.scss | 0 .../visits/helpers/OpenMapModalBtn.tsx | 2 +- .../visits/helpers/VisitsFilterDropdown.tsx | 4 +-- .../visits/helpers/hooks.ts | 12 ++++---- .../visits/reducers/common.ts | 12 ++++---- .../visits/reducers/domainVisits.ts | 4 +-- .../visits/reducers/nonOrphanVisits.ts | 4 +-- .../visits/reducers/orphanVisits.ts | 4 +-- .../visits/reducers/shortUrlVisits.ts | 4 +-- .../visits/reducers/tagVisits.ts | 4 +-- .../visits/reducers/types/index.ts | 6 ++-- .../visits/reducers/visitCreation.ts | 0 .../visits/reducers/visitsOverview.ts | 6 ++-- .../visits/services/VisitsParser.ts | 4 +-- .../visits/services/provideServices.ts | 2 +- .../visits/types/CommonVisitsProps.ts | 5 ++++ .../visits/types/helpers.ts | 4 +-- .../visits/types/index.ts | 2 +- .../visits/utils/index.ts} | 6 ++-- src/visits/types/CommonVisitsProps.ts | 5 ---- test/api/services/ShlinkApiClient.test.ts | 2 +- test/common/services/ReportExporter.test.ts | 4 +-- test/domains/DomainRow.test.tsx | 4 +-- test/domains/DomainSelector.test.tsx | 4 +-- test/domains/ManageDomains.test.tsx | 4 +-- test/domains/helpers/DomainDropdown.test.tsx | 4 +-- .../domains/helpers/DomainStatusIcon.test.tsx | 4 +-- .../helpers/EditDomainRedirectsModal.test.tsx | 2 +- test/domains/reducers/domainRedirects.test.ts | 2 +- test/domains/reducers/domainsList.test.ts | 8 +++--- test/servers/Overview.test.tsx | 2 +- test/settings/ShortUrlsListSettings.test.tsx | 2 +- test/settings/TagsSettings.test.tsx | 2 +- test/short-urls/CreateShortUrl.test.tsx | 4 +-- test/short-urls/EditShortUrl.test.tsx | 6 ++-- test/short-urls/Paginator.test.tsx | 2 +- test/short-urls/ShortUrlForm.test.tsx | 4 +-- .../short-urls/ShortUrlsFilteringBar.test.tsx | 2 +- test/short-urls/ShortUrlsList.test.tsx | 8 +++--- test/short-urls/ShortUrlsTable.test.tsx | 8 +++--- .../UseExistingIfFoundInfoIcon.test.tsx | 2 +- .../helpers/CreateShortUrlResult.test.tsx | 4 +-- .../helpers/DeleteShortUrlModal.test.tsx | 6 ++-- .../helpers/ExportShortUrlsBtn.test.tsx | 4 +-- test/short-urls/helpers/QrCodeModal.test.tsx | 2 +- .../helpers/ShortUrlDetailLink.test.tsx | 6 ++-- .../ShortUrlFormCheckboxGroup.test.tsx | 2 +- .../helpers/ShortUrlStatus.test.tsx | 4 +-- .../helpers/ShortUrlVisitsCount.test.tsx | 4 +-- .../helpers/ShortUrlsFilterDropdown.test.tsx | 2 +- test/short-urls/helpers/ShortUrlsRow.test.tsx | 4 +-- .../helpers/ShortUrlsRowMenu.test.tsx | 4 +-- test/short-urls/helpers/Tags.test.tsx | 2 +- test/short-urls/helpers/index.test.ts | 4 +-- .../QrErrorCorrectionDropdown.test.tsx | 2 +- .../qr-codes/QrFormatDropdown.test.tsx | 2 +- .../reducers/shortUrlCreation.test.ts | 4 +-- .../reducers/shortUrlDeletion.test.ts | 2 +- .../reducers/shortUrlDetail.test.ts | 6 ++-- .../reducers/shortUrlEdition.test.ts | 4 +-- .../short-urls/reducers/shortUrlsList.test.ts | 14 +++++----- test/tags/TagsList.test.tsx | 6 ++-- test/tags/TagsTable.test.tsx | 2 +- test/tags/TagsTableRow.test.tsx | 2 +- .../helpers/DeleteTagConfirmModal.test.tsx | 4 +-- test/tags/helpers/EditTagModal.test.tsx | 4 +-- test/tags/helpers/Tag.test.tsx | 2 +- test/tags/helpers/TagsSelector.test.tsx | 4 +-- test/tags/reducers/tagDelete.test.ts | 2 +- test/tags/reducers/tagEdit.test.ts | 2 +- test/tags/reducers/tagsList.test.ts | 16 +++++------ test/visits/DomainVisits.test.tsx | 4 +-- test/visits/NonOrphanVisits.test.tsx | 4 +-- test/visits/OrphanVisits.test.tsx | 4 +-- test/visits/ShortUrlVisits.test.tsx | 6 ++-- test/visits/ShortUrlVisitsHeader.test.tsx | 6 ++-- test/visits/TagVisits.test.tsx | 6 ++-- test/visits/TagVisitsHeader.test.tsx | 4 +-- test/visits/VisitsHeader.test.tsx | 4 +-- test/visits/VisitsStats.test.tsx | 6 ++-- test/visits/VisitsTable.test.tsx | 6 ++-- test/visits/charts/ChartCard.test.tsx | 2 +- test/visits/charts/DoughnutChart.test.tsx | 2 +- .../charts/DoughnutChartLegend.test.tsx | 2 +- .../visits/charts/HorizontalBarChart.test.tsx | 4 +-- test/visits/charts/LineChartCard.test.tsx | 4 +-- .../charts/SortableBarChartCard.test.tsx | 4 +-- test/visits/helpers/MapModal.test.tsx | 4 +-- test/visits/helpers/OpenMapModalBtn.test.tsx | 4 +-- .../helpers/VisitsFilterDropdown.test.tsx | 4 +-- test/visits/reducers/domainVisits.test.ts | 16 +++++------ test/visits/reducers/nonOrphanVisits.test.ts | 14 +++++----- test/visits/reducers/orphanVisits.test.ts | 14 +++++----- test/visits/reducers/shortUrlVisits.test.ts | 14 +++++----- test/visits/reducers/tagVisits.test.ts | 14 +++++----- test/visits/reducers/visitCreation.test.ts | 6 ++-- test/visits/reducers/visitsOverview.test.ts | 8 +++--- test/visits/services/VisitsParser.test.ts | 4 +-- test/visits/types/helpers.test.ts | 6 ++-- 204 files changed, 568 insertions(+), 563 deletions(-) rename src/{ => shlink-web-component}/domains/DomainRow.tsx (93%) rename src/{ => shlink-web-component}/domains/DomainSelector.scss (90%) rename src/{ => shlink-web-component}/domains/DomainSelector.tsx (95%) rename src/{ => shlink-web-component}/domains/ManageDomains.tsx (87%) rename src/{ => shlink-web-component}/domains/data/index.ts (71%) rename src/{ => shlink-web-component}/domains/helpers/DomainDropdown.tsx (85%) rename src/{ => shlink-web-component}/domains/helpers/DomainStatusIcon.tsx (94%) rename src/{ => shlink-web-component}/domains/helpers/EditDomainRedirectsModal.tsx (91%) rename src/{ => shlink-web-component}/domains/reducers/domainRedirects.ts (74%) rename src/{ => shlink-web-component}/domains/reducers/domainsList.ts (89%) rename src/{ => shlink-web-component}/domains/services/provideServices.ts (95%) rename src/{servers => shlink-web-component/overview}/Overview.tsx (86%) rename src/{ => shlink-web-component}/short-urls/CreateShortUrl.tsx (92%) rename src/{ => shlink-web-component}/short-urls/EditShortUrl.tsx (89%) rename src/{ => shlink-web-component}/short-urls/Paginator.tsx (91%) rename src/{ => shlink-web-component}/short-urls/ShortUrlForm.scss (77%) rename src/{ => shlink-web-component}/short-urls/ShortUrlForm.tsx (95%) rename src/{ => shlink-web-component}/short-urls/ShortUrlsFilteringBar.scss (100%) rename src/{ => shlink-web-component}/short-urls/ShortUrlsFilteringBar.tsx (87%) rename src/{ => shlink-web-component}/short-urls/ShortUrlsList.tsx (85%) rename src/{ => shlink-web-component}/short-urls/ShortUrlsTable.scss (100%) rename src/{ => shlink-web-component}/short-urls/ShortUrlsTable.tsx (98%) rename src/{ => shlink-web-component}/short-urls/UseExistingIfFoundInfoIcon.scss (100%) rename src/{ => shlink-web-component}/short-urls/UseExistingIfFoundInfoIcon.tsx (97%) rename src/{ => shlink-web-component}/short-urls/data/index.ts (91%) rename src/{ => shlink-web-component}/short-urls/helpers/CreateShortUrlResult.scss (100%) rename src/{ => shlink-web-component}/short-urls/helpers/CreateShortUrlResult.tsx (91%) rename src/{ => shlink-web-component}/short-urls/helpers/DeleteShortUrlModal.tsx (91%) rename src/{ => shlink-web-component}/short-urls/helpers/ExportShortUrlsBtn.tsx (83%) rename src/{ => shlink-web-component}/short-urls/helpers/QrCodeModal.scss (100%) rename src/{ => shlink-web-component}/short-urls/helpers/QrCodeModal.tsx (89%) rename src/{ => shlink-web-component}/short-urls/helpers/ShortUrlDetailLink.tsx (88%) rename src/{ => shlink-web-component}/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx (84%) rename src/{ => shlink-web-component}/short-urls/helpers/ShortUrlStatus.tsx (94%) rename src/{ => shlink-web-component}/short-urls/helpers/ShortUrlVisitsCount.scss (100%) rename src/{ => shlink-web-component}/short-urls/helpers/ShortUrlVisitsCount.tsx (90%) rename src/{ => shlink-web-component}/short-urls/helpers/ShortUrlsFilterDropdown.tsx (94%) rename src/{ => shlink-web-component}/short-urls/helpers/ShortUrlsRow.scss (85%) rename src/{ => shlink-web-component}/short-urls/helpers/ShortUrlsRow.tsx (90%) rename src/{ => shlink-web-component}/short-urls/helpers/ShortUrlsRowMenu.tsx (91%) rename src/{ => shlink-web-component}/short-urls/helpers/Tags.tsx (88%) rename src/{ => shlink-web-component}/short-urls/helpers/hooks.ts (88%) rename src/{ => shlink-web-component}/short-urls/helpers/index.ts (91%) rename src/{ => shlink-web-component}/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx (87%) rename src/{ => shlink-web-component}/short-urls/helpers/qr-codes/QrFormatDropdown.tsx (79%) rename src/{ => shlink-web-component}/short-urls/reducers/shortUrlCreation.ts (87%) rename src/{ => shlink-web-component}/short-urls/reducers/shortUrlDeletion.ts (87%) rename src/{ => shlink-web-component}/short-urls/reducers/shortUrlDetail.ts (85%) rename src/{ => shlink-web-component}/short-urls/reducers/shortUrlEdition.ts (85%) rename src/{ => shlink-web-component}/short-urls/reducers/shortUrlsList.ts (95%) rename src/{ => shlink-web-component}/short-urls/services/provideServices.ts (98%) rename src/{ => shlink-web-component}/tags/TagsList.tsx (81%) rename src/{ => shlink-web-component}/tags/TagsTable.scss (67%) rename src/{ => shlink-web-component}/tags/TagsTable.tsx (90%) rename src/{ => shlink-web-component}/tags/TagsTableRow.tsx (85%) rename src/{ => shlink-web-component}/tags/data/TagsListChildrenProps.ts (75%) rename src/{ => shlink-web-component}/tags/data/index.ts (80%) rename src/{ => shlink-web-component}/tags/helpers/DeleteTagConfirmModal.tsx (92%) rename src/{ => shlink-web-component}/tags/helpers/EditTagModal.scss (100%) rename src/{ => shlink-web-component}/tags/helpers/EditTagModal.tsx (90%) rename src/{ => shlink-web-component}/tags/helpers/Tag.scss (100%) rename src/{ => shlink-web-component}/tags/helpers/Tag.tsx (91%) rename src/{ => shlink-web-component}/tags/helpers/TagBullet.scss (100%) rename src/{ => shlink-web-component}/tags/helpers/TagBullet.tsx (78%) rename src/{ => shlink-web-component}/tags/helpers/TagsSelector.tsx (94%) rename src/{ => shlink-web-component}/tags/reducers/tagDelete.ts (82%) rename src/{ => shlink-web-component}/tags/reducers/tagEdit.ts (82%) rename src/{ => shlink-web-component}/tags/reducers/tagsList.ts (92%) rename src/{ => shlink-web-component}/tags/services/provideServices.ts (97%) rename src/{ => shlink-web-component}/visits/DomainVisits.tsx (82%) rename src/{ => shlink-web-component}/visits/NonOrphanVisits.tsx (83%) rename src/{ => shlink-web-component}/visits/OrphanVisits.tsx (84%) rename src/{ => shlink-web-component}/visits/ShortUrlVisits.tsx (88%) rename src/{ => shlink-web-component}/visits/ShortUrlVisitsHeader.scss (100%) rename src/{ => shlink-web-component}/visits/ShortUrlVisitsHeader.tsx (97%) rename src/{ => shlink-web-component}/visits/TagVisits.tsx (78%) rename src/{ => shlink-web-component}/visits/TagVisitsHeader.tsx (90%) rename src/{ => shlink-web-component}/visits/VisitsHeader.tsx (100%) rename src/{ => shlink-web-component}/visits/VisitsStats.tsx (95%) rename src/{ => shlink-web-component}/visits/VisitsTable.scss (89%) rename src/{ => shlink-web-component}/visits/VisitsTable.tsx (94%) rename src/{ => shlink-web-component}/visits/charts/ChartCard.scss (100%) rename src/{ => shlink-web-component}/visits/charts/ChartCard.tsx (100%) rename src/{ => shlink-web-component}/visits/charts/DoughnutChart.tsx (94%) rename src/{ => shlink-web-component}/visits/charts/DoughnutChartCard.tsx (100%) rename src/{ => shlink-web-component}/visits/charts/DoughnutChartLegend.scss (93%) rename src/{ => shlink-web-component}/visits/charts/DoughnutChartLegend.tsx (100%) rename src/{ => shlink-web-component}/visits/charts/HorizontalBarChart.tsx (94%) rename src/{ => shlink-web-component}/visits/charts/LineChartCard.scss (80%) rename src/{ => shlink-web-component}/visits/charts/LineChartCard.tsx (94%) rename src/{ => shlink-web-component}/visits/charts/SortableBarChartCard.tsx (92%) rename src/{ => shlink-web-component}/visits/helpers/MapModal.scss (91%) rename src/{ => shlink-web-component}/visits/helpers/MapModal.tsx (100%) rename src/{ => shlink-web-component}/visits/helpers/OpenMapModalBtn.scss (100%) rename src/{ => shlink-web-component}/visits/helpers/OpenMapModalBtn.tsx (96%) rename src/{ => shlink-web-component}/visits/helpers/VisitsFilterDropdown.tsx (94%) rename src/{ => shlink-web-component}/visits/helpers/hooks.ts (84%) rename src/{ => shlink-web-component}/visits/reducers/common.ts (94%) rename src/{ => shlink-web-component}/visits/reducers/domainVisits.ts (92%) rename src/{ => shlink-web-component}/visits/reducers/nonOrphanVisits.ts (90%) rename src/{ => shlink-web-component}/visits/reducers/orphanVisits.ts (93%) rename src/{ => shlink-web-component}/visits/reducers/shortUrlVisits.ts (93%) rename src/{ => shlink-web-component}/visits/reducers/tagVisits.ts (92%) rename src/{ => shlink-web-component}/visits/reducers/types/index.ts (69%) rename src/{ => shlink-web-component}/visits/reducers/visitCreation.ts (100%) rename src/{ => shlink-web-component}/visits/reducers/visitsOverview.ts (93%) rename src/{ => shlink-web-component}/visits/services/VisitsParser.ts (96%) rename src/{ => shlink-web-component}/visits/services/provideServices.ts (98%) create mode 100644 src/shlink-web-component/visits/types/CommonVisitsProps.ts rename src/{ => shlink-web-component}/visits/types/helpers.ts (93%) rename src/{ => shlink-web-component}/visits/types/index.ts (96%) rename src/{utils/helpers/visits.ts => shlink-web-component/visits/utils/index.ts} (86%) delete mode 100644 src/visits/types/CommonVisitsProps.ts diff --git a/src/api/services/ShlinkApiClient.ts b/src/api/services/ShlinkApiClient.ts index 97b6774a7..fcdc583e9 100644 --- a/src/api/services/ShlinkApiClient.ts +++ b/src/api/services/ShlinkApiClient.ts @@ -1,6 +1,6 @@ import { isEmpty, isNil, reject } from 'ramda'; import type { HttpClient } from '../../common/services/HttpClient'; -import type { ShortUrl, ShortUrlData } from '../../short-urls/data'; +import type { ShortUrl, ShortUrlData } from '../../shlink-web-component/short-urls/data'; import { orderToString } from '../../utils/helpers/ordering'; import { stringifyQuery } from '../../utils/helpers/query'; import type { OptionalString } from '../../utils/utils'; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 06473dffc..eb4a7be89 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,7 +1,7 @@ -import type { ShortUrl, ShortUrlMeta } from '../../short-urls/data'; +import type { ShortUrl, ShortUrlMeta } from '../../shlink-web-component/short-urls/data'; +import type { Visit } from '../../shlink-web-component/visits/types'; 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/common/services/ReportExporter.ts b/src/common/services/ReportExporter.ts index d23b3bfe5..51dc49c64 100644 --- a/src/common/services/ReportExporter.ts +++ b/src/common/services/ReportExporter.ts @@ -1,7 +1,7 @@ -import type { ExportableShortUrl } from '../../short-urls/data'; +import type { ExportableShortUrl } from '../../shlink-web-component/short-urls/data'; +import type { NormalizedVisit } from '../../shlink-web-component/visits/types'; import type { JsonToCsv } from '../../utils/helpers/csvjson'; import { saveCsv } from '../../utils/helpers/files'; -import type { NormalizedVisit } from '../../visits/types'; export class ReportExporter { public constructor(private readonly window: Window, private readonly jsonToCsv: JsonToCsv) {} diff --git a/src/container/index.ts b/src/container/index.ts index 207b5565c..5754f329d 100644 --- a/src/container/index.ts +++ b/src/container/index.ts @@ -5,14 +5,14 @@ import { connect as reduxConnect } from 'react-redux'; import { provideServices as provideApiServices } from '../api/services/provideServices'; import { provideServices as provideAppServices } from '../app/services/provideServices'; import { provideServices as provideCommonServices } from '../common/services/provideServices'; -import { provideServices as provideDomainsServices } from '../domains/services/provideServices'; import { provideServices as provideMercureServices } from '../mercure/services/provideServices'; import { provideServices as provideServersServices } from '../servers/services/provideServices'; import { provideServices as provideSettingsServices } from '../settings/services/provideServices'; -import { provideServices as provideShortUrlsServices } from '../short-urls/services/provideServices'; -import { provideServices as provideTagsServices } from '../tags/services/provideServices'; +import { provideServices as provideDomainsServices } from '../shlink-web-component/domains/services/provideServices'; +import { provideServices as provideShortUrlsServices } from '../shlink-web-component/short-urls/services/provideServices'; +import { provideServices as provideTagsServices } from '../shlink-web-component/tags/services/provideServices'; +import { provideServices as provideVisitsServices } from '../shlink-web-component/visits/services/provideServices'; import { provideServices as provideUtilsServices } from '../utils/services/provideServices'; -import { provideServices as provideVisitsServices } from '../visits/services/provideServices'; import type { ConnectDecorator } from './types'; type LazyActionMap = Record; diff --git a/src/container/types.ts b/src/container/types.ts index eca6e21dd..017e149a3 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 { DomainVisits } from '../visits/reducers/domainVisits'; -import type { ShortUrlVisits } from '../visits/reducers/shortUrlVisits'; -import type { TagVisits } from '../visits/reducers/tagVisits'; -import type { VisitsInfo } from '../visits/reducers/types'; -import type { VisitsOverview } from '../visits/reducers/visitsOverview'; +import type { DomainsList } from '../shlink-web-component/domains/reducers/domainsList'; +import type { ShortUrlCreation } from '../shlink-web-component/short-urls/reducers/shortUrlCreation'; +import type { ShortUrlDeletion } from '../shlink-web-component/short-urls/reducers/shortUrlDeletion'; +import type { ShortUrlDetail } from '../shlink-web-component/short-urls/reducers/shortUrlDetail'; +import type { ShortUrlEdition } from '../shlink-web-component/short-urls/reducers/shortUrlEdition'; +import type { ShortUrlsList } from '../shlink-web-component/short-urls/reducers/shortUrlsList'; +import type { TagDeletion } from '../shlink-web-component/tags/reducers/tagDelete'; +import type { TagEdition } from '../shlink-web-component/tags/reducers/tagEdit'; +import type { TagsList } from '../shlink-web-component/tags/reducers/tagsList'; +import type { DomainVisits } from '../shlink-web-component/visits/reducers/domainVisits'; +import type { ShortUrlVisits } from '../shlink-web-component/visits/reducers/shortUrlVisits'; +import type { TagVisits } from '../shlink-web-component/visits/reducers/tagVisits'; +import type { VisitsInfo } from '../shlink-web-component/visits/reducers/types'; +import type { VisitsOverview } from '../shlink-web-component/visits/reducers/visitsOverview'; export interface ShlinkState { servers: ServersMap; diff --git a/src/mercure/helpers/boundToMercureHub.tsx b/src/mercure/helpers/boundToMercureHub.tsx index 854c9a4cf..ff9592eb2 100644 --- a/src/mercure/helpers/boundToMercureHub.tsx +++ b/src/mercure/helpers/boundToMercureHub.tsx @@ -2,7 +2,7 @@ import { pipe } from 'ramda'; import type { FC } from 'react'; import { useEffect } from 'react'; import { useParams } from 'react-router-dom'; -import type { CreateVisit } from '../../visits/types'; +import type { CreateVisit } from '../../shlink-web-component/visits/types'; import type { MercureInfo } from '../reducers/mercureInfo'; import { bindToMercureTopic } from './index'; diff --git a/src/reducers/index.ts b/src/reducers/index.ts index d2d9ba821..99d2441e8 100644 --- a/src/reducers/index.ts +++ b/src/reducers/index.ts @@ -7,8 +7,17 @@ import { serversReducer } from '../servers/reducers/servers'; import { settingsReducer } from '../settings/reducers/settings'; export const initReducers = (container: IContainer) => combineReducers({ + // Main shlink-web-client reducers + appUpdated: appUpdatesReducer, servers: serversReducer, selectedServer: container.selectedServerReducer, + settings: settingsReducer, + sidebar: sidebarReducer, + + // TBD + mercureInfo: container.mercureInfoReducer, + + // Nested shlink-web-component reducers shortUrlsList: container.shortUrlsListReducer, shortUrlCreation: container.shortUrlCreationReducer, shortUrlDeletion: container.shortUrlDeletionReducer, @@ -22,10 +31,6 @@ export const initReducers = (container: IContainer) => combineReducers void }) => ( diff --git a/src/short-urls/data/index.ts b/src/shlink-web-component/short-urls/data/index.ts similarity index 91% rename from src/short-urls/data/index.ts rename to src/shlink-web-component/short-urls/data/index.ts index 282195832..d83ca981f 100644 --- a/src/short-urls/data/index.ts +++ b/src/shlink-web-component/short-urls/data/index.ts @@ -1,6 +1,6 @@ -import type { ShlinkVisitsSummary } from '../../api/types'; -import type { Order } from '../../utils/helpers/ordering'; -import type { Nullable, OptionalString } from '../../utils/utils'; +import type { ShlinkVisitsSummary } from '../../../api/types'; +import type { Order } from '../../../utils/helpers/ordering'; +import type { Nullable, OptionalString } from '../../../utils/utils'; export interface DeviceLongUrls { android?: OptionalString; diff --git a/src/short-urls/helpers/CreateShortUrlResult.scss b/src/shlink-web-component/short-urls/helpers/CreateShortUrlResult.scss similarity index 100% rename from src/short-urls/helpers/CreateShortUrlResult.scss rename to src/shlink-web-component/short-urls/helpers/CreateShortUrlResult.scss diff --git a/src/short-urls/helpers/CreateShortUrlResult.tsx b/src/shlink-web-component/short-urls/helpers/CreateShortUrlResult.tsx similarity index 91% rename from src/short-urls/helpers/CreateShortUrlResult.tsx rename to src/shlink-web-component/short-urls/helpers/CreateShortUrlResult.tsx index aa60e9067..06f86f13e 100644 --- a/src/short-urls/helpers/CreateShortUrlResult.tsx +++ b/src/shlink-web-component/short-urls/helpers/CreateShortUrlResult.tsx @@ -4,9 +4,9 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useEffect } from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; import { Tooltip } from 'reactstrap'; -import { ShlinkApiError } from '../../api/ShlinkApiError'; -import type { TimeoutToggle } from '../../utils/helpers/hooks'; -import { Result } from '../../utils/Result'; +import { ShlinkApiError } from '../../../api/ShlinkApiError'; +import type { TimeoutToggle } from '../../../utils/helpers/hooks'; +import { Result } from '../../../utils/Result'; import type { ShortUrlCreation } from '../reducers/shortUrlCreation'; import './CreateShortUrlResult.scss'; diff --git a/src/short-urls/helpers/DeleteShortUrlModal.tsx b/src/shlink-web-component/short-urls/helpers/DeleteShortUrlModal.tsx similarity index 91% rename from src/short-urls/helpers/DeleteShortUrlModal.tsx rename to src/shlink-web-component/short-urls/helpers/DeleteShortUrlModal.tsx index 205680ce8..916af0f5a 100644 --- a/src/short-urls/helpers/DeleteShortUrlModal.tsx +++ b/src/shlink-web-component/short-urls/helpers/DeleteShortUrlModal.tsx @@ -1,10 +1,10 @@ import { pipe } from 'ramda'; import { useEffect, useState } from 'react'; import { Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; -import { ShlinkApiError } from '../../api/ShlinkApiError'; -import { isInvalidDeletionError } from '../../api/utils'; -import { Result } from '../../utils/Result'; -import { handleEventPreventingDefault } from '../../utils/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'; diff --git a/src/short-urls/helpers/ExportShortUrlsBtn.tsx b/src/shlink-web-component/short-urls/helpers/ExportShortUrlsBtn.tsx similarity index 83% rename from src/short-urls/helpers/ExportShortUrlsBtn.tsx rename to src/shlink-web-component/short-urls/helpers/ExportShortUrlsBtn.tsx index 7fcc01ee3..e07bb021c 100644 --- a/src/short-urls/helpers/ExportShortUrlsBtn.tsx +++ b/src/shlink-web-component/short-urls/helpers/ExportShortUrlsBtn.tsx @@ -1,11 +1,11 @@ import type { FC } from 'react'; import { useCallback } from 'react'; -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 { 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 { useShortUrlsQuery } from './hooks'; diff --git a/src/short-urls/helpers/QrCodeModal.scss b/src/shlink-web-component/short-urls/helpers/QrCodeModal.scss similarity index 100% rename from src/short-urls/helpers/QrCodeModal.scss rename to src/shlink-web-component/short-urls/helpers/QrCodeModal.scss diff --git a/src/short-urls/helpers/QrCodeModal.tsx b/src/shlink-web-component/short-urls/helpers/QrCodeModal.tsx similarity index 89% rename from src/short-urls/helpers/QrCodeModal.tsx rename to src/shlink-web-component/short-urls/helpers/QrCodeModal.tsx index 6fe5a5621..cd46c76ad 100644 --- a/src/short-urls/helpers/QrCodeModal.tsx +++ b/src/shlink-web-component/short-urls/helpers/QrCodeModal.tsx @@ -3,12 +3,12 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useMemo, useState } from 'react'; import { ExternalLink } from 'react-external-link'; import { Button, FormGroup, Modal, ModalBody, ModalHeader, Row } from 'reactstrap'; -import type { ImageDownloader } from '../../common/services/ImageDownloader'; -import type { SelectedServer } from '../../servers/data'; -import { CopyToClipboardIcon } from '../../utils/CopyToClipboardIcon'; -import { useFeature } from '../../utils/helpers/features'; -import type { QrCodeFormat, QrErrorCorrection } from '../../utils/helpers/qrCodes'; -import { buildQrCodeUrl } from '../../utils/helpers/qrCodes'; +import type { ImageDownloader } from '../../../common/services/ImageDownloader'; +import type { SelectedServer } from '../../../servers/data'; +import { CopyToClipboardIcon } from '../../../utils/CopyToClipboardIcon'; +import { useFeature } from '../../../utils/helpers/features'; +import type { QrCodeFormat, QrErrorCorrection } from '../../../utils/helpers/qrCodes'; +import { buildQrCodeUrl } from '../../../utils/helpers/qrCodes'; import type { ShortUrlModalProps } from '../data'; import { QrErrorCorrectionDropdown } from './qr-codes/QrErrorCorrectionDropdown'; import { QrFormatDropdown } from './qr-codes/QrFormatDropdown'; diff --git a/src/short-urls/helpers/ShortUrlDetailLink.tsx b/src/shlink-web-component/short-urls/helpers/ShortUrlDetailLink.tsx similarity index 88% rename from src/short-urls/helpers/ShortUrlDetailLink.tsx rename to src/shlink-web-component/short-urls/helpers/ShortUrlDetailLink.tsx index 89a917265..bae544103 100644 --- a/src/short-urls/helpers/ShortUrlDetailLink.tsx +++ b/src/shlink-web-component/short-urls/helpers/ShortUrlDetailLink.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import { Link } from 'react-router-dom'; -import type { SelectedServer, ServerWithId } from '../../servers/data'; -import { isServerWithId } from '../../servers/data'; +import type { SelectedServer, ServerWithId } from '../../../servers/data'; +import { isServerWithId } from '../../../servers/data'; import type { ShortUrl } from '../data'; import { urlEncodeShortCode } from './index'; diff --git a/src/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx b/src/shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx similarity index 84% rename from src/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx rename to src/shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx index 67e17d799..911a6de56 100644 --- a/src/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx +++ b/src/shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx @@ -1,6 +1,6 @@ import type { ChangeEvent, FC, PropsWithChildren } from 'react'; -import { Checkbox } from '../../utils/Checkbox'; -import { InfoTooltip } from '../../utils/InfoTooltip'; +import { Checkbox } from '../../../utils/Checkbox'; +import { InfoTooltip } from '../../../utils/InfoTooltip'; type ShortUrlFormCheckboxGroupProps = PropsWithChildren<{ checked?: boolean; diff --git a/src/short-urls/helpers/ShortUrlStatus.tsx b/src/shlink-web-component/short-urls/helpers/ShortUrlStatus.tsx similarity index 94% rename from src/short-urls/helpers/ShortUrlStatus.tsx rename to src/shlink-web-component/short-urls/helpers/ShortUrlStatus.tsx index ec490b017..28df5d9c7 100644 --- a/src/short-urls/helpers/ShortUrlStatus.tsx +++ b/src/shlink-web-component/short-urls/helpers/ShortUrlStatus.tsx @@ -4,8 +4,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { isBefore } from 'date-fns'; import type { FC, ReactNode } from 'react'; import { UncontrolledTooltip } from 'reactstrap'; -import { formatHumanFriendly, now, parseISO } from '../../utils/helpers/date'; -import { useElementRef } from '../../utils/helpers/hooks'; +import { formatHumanFriendly, now, parseISO } from '../../../utils/helpers/date'; +import { useElementRef } from '../../../utils/helpers/hooks'; import type { ShortUrl } from '../data'; interface ShortUrlStatusProps { diff --git a/src/short-urls/helpers/ShortUrlVisitsCount.scss b/src/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.scss similarity index 100% rename from src/short-urls/helpers/ShortUrlVisitsCount.scss rename to src/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.scss diff --git a/src/short-urls/helpers/ShortUrlVisitsCount.tsx b/src/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.tsx similarity index 90% rename from src/short-urls/helpers/ShortUrlVisitsCount.tsx rename to src/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.tsx index 0dd533969..c0ed28ec0 100644 --- a/src/short-urls/helpers/ShortUrlVisitsCount.tsx +++ b/src/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount.tsx @@ -2,10 +2,10 @@ import { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import classNames from 'classnames'; import { UncontrolledTooltip } from 'reactstrap'; -import type { SelectedServer } from '../../servers/data'; -import { formatHumanFriendly, parseISO } from '../../utils/helpers/date'; -import { useElementRef } from '../../utils/helpers/hooks'; -import { prettify } from '../../utils/helpers/numbers'; +import type { SelectedServer } from '../../../servers/data'; +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'; diff --git a/src/short-urls/helpers/ShortUrlsFilterDropdown.tsx b/src/shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown.tsx similarity index 94% rename from src/short-urls/helpers/ShortUrlsFilterDropdown.tsx rename to src/shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown.tsx index 16e47395a..53de95efa 100644 --- a/src/short-urls/helpers/ShortUrlsFilterDropdown.tsx +++ b/src/shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown.tsx @@ -1,6 +1,6 @@ import { DropdownItem } from 'reactstrap'; -import { DropdownBtn } from '../../utils/DropdownBtn'; -import { hasValue } from '../../utils/utils'; +import { DropdownBtn } from '../../../utils/DropdownBtn'; +import { hasValue } from '../../../utils/utils'; import type { ShortUrlsFilter } from '../data'; interface ShortUrlsFilterDropdownProps { diff --git a/src/short-urls/helpers/ShortUrlsRow.scss b/src/shlink-web-component/short-urls/helpers/ShortUrlsRow.scss similarity index 85% rename from src/short-urls/helpers/ShortUrlsRow.scss rename to src/shlink-web-component/short-urls/helpers/ShortUrlsRow.scss index 64af7818e..dbe75f0a9 100644 --- a/src/short-urls/helpers/ShortUrlsRow.scss +++ b/src/shlink-web-component/short-urls/helpers/ShortUrlsRow.scss @@ -1,6 +1,6 @@ -@import '../../utils/base'; -@import '../../utils/mixins/text-ellipsis'; -@import '../../utils/mixins/vertical-align'; +@import '../../../utils/base'; +@import '../../../utils/mixins/text-ellipsis'; +@import '../../../utils/mixins/vertical-align'; .short-urls-row__cell.short-urls-row__cell { vertical-align: middle !important; diff --git a/src/short-urls/helpers/ShortUrlsRow.tsx b/src/shlink-web-component/short-urls/helpers/ShortUrlsRow.tsx similarity index 90% rename from src/short-urls/helpers/ShortUrlsRow.tsx rename to src/shlink-web-component/short-urls/helpers/ShortUrlsRow.tsx index ebc5a9687..36cbdd755 100644 --- a/src/short-urls/helpers/ShortUrlsRow.tsx +++ b/src/shlink-web-component/short-urls/helpers/ShortUrlsRow.tsx @@ -1,12 +1,12 @@ import type { FC } from 'react'; import { useEffect, useRef } from 'react'; import { ExternalLink } from 'react-external-link'; -import type { SelectedServer } from '../../servers/data'; -import type { Settings } from '../../settings/reducers/settings'; -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 { SelectedServer } from '../../../servers/data'; +import type { Settings } from '../../../settings/reducers/settings'; +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'; diff --git a/src/short-urls/helpers/ShortUrlsRowMenu.tsx b/src/shlink-web-component/short-urls/helpers/ShortUrlsRowMenu.tsx similarity index 91% rename from src/short-urls/helpers/ShortUrlsRowMenu.tsx rename to src/shlink-web-component/short-urls/helpers/ShortUrlsRowMenu.tsx index c7a20b356..3502ed263 100644 --- a/src/short-urls/helpers/ShortUrlsRowMenu.tsx +++ b/src/shlink-web-component/short-urls/helpers/ShortUrlsRowMenu.tsx @@ -7,9 +7,9 @@ import { import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC } from 'react'; import { DropdownItem } from 'reactstrap'; -import type { SelectedServer } from '../../servers/data'; -import { useToggle } from '../../utils/helpers/hooks'; -import { RowDropdownBtn } from '../../utils/RowDropdownBtn'; +import type { SelectedServer } from '../../../servers/data'; +import { useToggle } from '../../../utils/helpers/hooks'; +import { RowDropdownBtn } from '../../../utils/RowDropdownBtn'; import type { ShortUrl, ShortUrlModalProps } from '../data'; import { ShortUrlDetailLink } from './ShortUrlDetailLink'; diff --git a/src/short-urls/helpers/Tags.tsx b/src/shlink-web-component/short-urls/helpers/Tags.tsx similarity index 88% rename from src/short-urls/helpers/Tags.tsx rename to src/shlink-web-component/short-urls/helpers/Tags.tsx index b6bd60677..22be6e002 100644 --- a/src/short-urls/helpers/Tags.tsx +++ b/src/shlink-web-component/short-urls/helpers/Tags.tsx @@ -1,7 +1,7 @@ import { isEmpty } from 'ramda'; import type { FC } from 'react'; +import type { ColorGenerator } from '../../../utils/services/ColorGenerator'; import { Tag } from '../../tags/helpers/Tag'; -import type { ColorGenerator } from '../../utils/services/ColorGenerator'; interface TagsProps { tags: string[]; diff --git a/src/short-urls/helpers/hooks.ts b/src/shlink-web-component/short-urls/helpers/hooks.ts similarity index 88% rename from src/short-urls/helpers/hooks.ts rename to src/shlink-web-component/short-urls/helpers/hooks.ts index 054d5d494..c02a8a5f2 100644 --- a/src/short-urls/helpers/hooks.ts +++ b/src/shlink-web-component/short-urls/helpers/hooks.ts @@ -1,11 +1,11 @@ import { isEmpty, pipe } from 'ramda'; 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 { 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 { diff --git a/src/short-urls/helpers/index.ts b/src/shlink-web-component/short-urls/helpers/index.ts similarity index 91% rename from src/short-urls/helpers/index.ts rename to src/shlink-web-component/short-urls/helpers/index.ts index 771db963b..5d0b68505 100644 --- a/src/short-urls/helpers/index.ts +++ b/src/shlink-web-component/short-urls/helpers/index.ts @@ -1,6 +1,6 @@ import { isNil } from 'ramda'; -import type { ShortUrlCreationSettings } from '../../settings/reducers/settings'; -import type { OptionalString } from '../../utils/utils'; +import type { ShortUrlCreationSettings } from '../../../settings/reducers/settings'; +import type { OptionalString } from '../../../utils/utils'; import { DEFAULT_DOMAIN } from '../../visits/reducers/domainVisits'; import type { ShortUrl, ShortUrlData } from '../data'; diff --git a/src/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx b/src/shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx similarity index 87% rename from src/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx rename to src/shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx index 816732619..293127735 100644 --- a/src/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx +++ b/src/shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import { DropdownItem } from 'reactstrap'; -import { DropdownBtn } from '../../../utils/DropdownBtn'; -import type { QrErrorCorrection } from '../../../utils/helpers/qrCodes'; +import { DropdownBtn } from '../../../../utils/DropdownBtn'; +import type { QrErrorCorrection } from '../../../../utils/helpers/qrCodes'; interface QrErrorCorrectionDropdownProps { errorCorrection: QrErrorCorrection; diff --git a/src/short-urls/helpers/qr-codes/QrFormatDropdown.tsx b/src/shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown.tsx similarity index 79% rename from src/short-urls/helpers/qr-codes/QrFormatDropdown.tsx rename to src/shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown.tsx index c7170b9c1..c42c34ede 100644 --- a/src/short-urls/helpers/qr-codes/QrFormatDropdown.tsx +++ b/src/shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import { DropdownItem } from 'reactstrap'; -import { DropdownBtn } from '../../../utils/DropdownBtn'; -import type { QrCodeFormat } from '../../../utils/helpers/qrCodes'; +import { DropdownBtn } from '../../../../utils/DropdownBtn'; +import type { QrCodeFormat } from '../../../../utils/helpers/qrCodes'; interface QrFormatDropdownProps { format: QrCodeFormat; diff --git a/src/short-urls/reducers/shortUrlCreation.ts b/src/shlink-web-component/short-urls/reducers/shortUrlCreation.ts similarity index 87% rename from src/short-urls/reducers/shortUrlCreation.ts rename to src/shlink-web-component/short-urls/reducers/shortUrlCreation.ts index 2fa080ab3..001166246 100644 --- a/src/short-urls/reducers/shortUrlCreation.ts +++ b/src/shlink-web-component/short-urls/reducers/shortUrlCreation.ts @@ -1,9 +1,9 @@ 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 { 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 { ShortUrl, ShortUrlData } from '../data'; const REDUCER_PREFIX = 'shlink/shortUrlCreation'; diff --git a/src/short-urls/reducers/shortUrlDeletion.ts b/src/shlink-web-component/short-urls/reducers/shortUrlDeletion.ts similarity index 87% rename from src/short-urls/reducers/shortUrlDeletion.ts rename to src/shlink-web-component/short-urls/reducers/shortUrlDeletion.ts index 7d4837f18..3298e80b0 100644 --- a/src/short-urls/reducers/shortUrlDeletion.ts +++ b/src/shlink-web-component/short-urls/reducers/shortUrlDeletion.ts @@ -1,8 +1,8 @@ import { createAction, 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 { 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 { ShortUrl, ShortUrlIdentifier } from '../data'; const REDUCER_PREFIX = 'shlink/shortUrlDeletion'; diff --git a/src/short-urls/reducers/shortUrlDetail.ts b/src/shlink-web-component/short-urls/reducers/shortUrlDetail.ts similarity index 85% rename from src/short-urls/reducers/shortUrlDetail.ts rename to src/shlink-web-component/short-urls/reducers/shortUrlDetail.ts index 932d3dfc9..14c09decc 100644 --- a/src/short-urls/reducers/shortUrlDetail.ts +++ b/src/shlink-web-component/short-urls/reducers/shortUrlDetail.ts @@ -1,9 +1,9 @@ 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 { 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 { ShortUrl, ShortUrlIdentifier } from '../data'; import { shortUrlMatches } from '../helpers'; diff --git a/src/short-urls/reducers/shortUrlEdition.ts b/src/shlink-web-component/short-urls/reducers/shortUrlEdition.ts similarity index 85% rename from src/short-urls/reducers/shortUrlEdition.ts rename to src/shlink-web-component/short-urls/reducers/shortUrlEdition.ts index 103e6449c..50f147b47 100644 --- a/src/short-urls/reducers/shortUrlEdition.ts +++ b/src/shlink-web-component/short-urls/reducers/shortUrlEdition.ts @@ -1,9 +1,9 @@ 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 { 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'; const REDUCER_PREFIX = 'shlink/shortUrlEdition'; diff --git a/src/short-urls/reducers/shortUrlsList.ts b/src/shlink-web-component/short-urls/reducers/shortUrlsList.ts similarity index 95% rename from src/short-urls/reducers/shortUrlsList.ts rename to src/shlink-web-component/short-urls/reducers/shortUrlsList.ts index b2920ba42..f8a8500fd 100644 --- a/src/short-urls/reducers/shortUrlsList.ts +++ b/src/shlink-web-component/short-urls/reducers/shortUrlsList.ts @@ -1,8 +1,8 @@ import { createSlice } from '@reduxjs/toolkit'; import { assocPath, last, pipe, reject } from 'ramda'; -import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import type { ShlinkShortUrlsListParams, ShlinkShortUrlsResponse } from '../../api/types'; -import { createAsyncThunk } from '../../utils/helpers/redux'; +import type { ShlinkApiClientBuilder } from '../../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkShortUrlsListParams, ShlinkShortUrlsResponse } from '../../../api/types'; +import { createAsyncThunk } from '../../../utils/helpers/redux'; import { createNewVisits } from '../../visits/reducers/visitCreation'; import type { ShortUrl } from '../data'; import { shortUrlMatches } from '../helpers'; diff --git a/src/short-urls/services/provideServices.ts b/src/shlink-web-component/short-urls/services/provideServices.ts similarity index 98% rename from src/short-urls/services/provideServices.ts rename to src/shlink-web-component/short-urls/services/provideServices.ts index 1e5f79c89..b227e4c7d 100644 --- a/src/short-urls/services/provideServices.ts +++ b/src/shlink-web-component/short-urls/services/provideServices.ts @@ -1,6 +1,6 @@ import type Bottle from 'bottlejs'; import { prop } from 'ramda'; -import type { ConnectDecorator } from '../../container/types'; +import type { ConnectDecorator } from '../../../container/types'; import { CreateShortUrl } from '../CreateShortUrl'; import { EditShortUrl } from '../EditShortUrl'; import { CreateShortUrlResult } from '../helpers/CreateShortUrlResult'; diff --git a/src/tags/TagsList.tsx b/src/shlink-web-component/tags/TagsList.tsx similarity index 81% rename from src/tags/TagsList.tsx rename to src/shlink-web-component/tags/TagsList.tsx index 13aad995b..79056abd7 100644 --- a/src/tags/TagsList.tsx +++ b/src/shlink-web-component/tags/TagsList.tsx @@ -2,16 +2,16 @@ import { pipe } from 'ramda'; import type { FC } from 'react'; import { useEffect, useState } from 'react'; import { Row } from 'reactstrap'; -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 { Result } from '../utils/Result'; -import { SearchField } from '../utils/SearchField'; +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 { Result } from '../../utils/Result'; +import { SearchField } from '../../utils/SearchField'; import type { SimplifiedTag } from './data'; import type { TagsOrder, TagsOrderableFields } from './data/TagsListChildrenProps'; import { TAGS_ORDERABLE_FIELDS } from './data/TagsListChildrenProps'; diff --git a/src/tags/TagsTable.scss b/src/shlink-web-component/tags/TagsTable.scss similarity index 67% rename from src/tags/TagsTable.scss rename to src/shlink-web-component/tags/TagsTable.scss index a6e4dceb3..2e47f7e11 100644 --- a/src/tags/TagsTable.scss +++ b/src/shlink-web-component/tags/TagsTable.scss @@ -1,5 +1,5 @@ -@import '../utils/base'; -@import '../utils/mixins/sticky-cell'; +@import '../../utils/base'; +@import '../../utils/mixins/sticky-cell'; .tags-table__header-cell.tags-table__header-cell { @include sticky-cell(false); diff --git a/src/tags/TagsTable.tsx b/src/shlink-web-component/tags/TagsTable.tsx similarity index 90% rename from src/tags/TagsTable.tsx rename to src/shlink-web-component/tags/TagsTable.tsx index 3898c6235..4d6132260 100644 --- a/src/tags/TagsTable.tsx +++ b/src/shlink-web-component/tags/TagsTable.tsx @@ -2,11 +2,11 @@ import { splitEvery } from 'ramda'; import type { FC } from 'react'; import { useEffect, useRef } from 'react'; import { useLocation } from 'react-router-dom'; -import { SimplePaginator } from '../common/SimplePaginator'; -import { useQueryState } from '../utils/helpers/hooks'; -import { parseQuery } from '../utils/helpers/query'; -import { SimpleCard } from '../utils/SimpleCard'; -import { TableOrderIcon } from '../utils/table/TableOrderIcon'; +import { SimplePaginator } from '../../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 { TagsListChildrenProps, TagsOrder, TagsOrderableFields } from './data/TagsListChildrenProps'; import type { TagsTableRowProps } from './TagsTableRow'; import './TagsTable.scss'; diff --git a/src/tags/TagsTableRow.tsx b/src/shlink-web-component/tags/TagsTableRow.tsx similarity index 85% rename from src/tags/TagsTableRow.tsx rename to src/shlink-web-component/tags/TagsTableRow.tsx index b643a388e..cff7780a6 100644 --- a/src/tags/TagsTableRow.tsx +++ b/src/shlink-web-component/tags/TagsTableRow.tsx @@ -3,12 +3,12 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; 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 { useToggle } from '../utils/helpers/hooks'; -import { prettify } from '../utils/helpers/numbers'; -import { RowDropdownBtn } from '../utils/RowDropdownBtn'; -import type { ColorGenerator } from '../utils/services/ColorGenerator'; +import type { SelectedServer } from '../../servers/data'; +import { getServerId } from '../../servers/data'; +import { useToggle } from '../../utils/helpers/hooks'; +import { prettify } from '../../utils/helpers/numbers'; +import { RowDropdownBtn } from '../../utils/RowDropdownBtn'; +import type { ColorGenerator } from '../../utils/services/ColorGenerator'; import type { SimplifiedTag, TagModalProps } from './data'; import { TagBullet } from './helpers/TagBullet'; diff --git a/src/tags/data/TagsListChildrenProps.ts b/src/shlink-web-component/tags/data/TagsListChildrenProps.ts similarity index 75% rename from src/tags/data/TagsListChildrenProps.ts rename to src/shlink-web-component/tags/data/TagsListChildrenProps.ts index 3e2843eb2..646c7d557 100644 --- a/src/tags/data/TagsListChildrenProps.ts +++ b/src/shlink-web-component/tags/data/TagsListChildrenProps.ts @@ -1,5 +1,5 @@ -import type { SelectedServer } from '../../servers/data'; -import type { Order } from '../../utils/helpers/ordering'; +import type { SelectedServer } from '../../../servers/data'; +import type { Order } from '../../../utils/helpers/ordering'; import type { SimplifiedTag } from './index'; export const TAGS_ORDERABLE_FIELDS = { diff --git a/src/tags/data/index.ts b/src/shlink-web-component/tags/data/index.ts similarity index 80% rename from src/tags/data/index.ts rename to src/shlink-web-component/tags/data/index.ts index 744fcd479..14ec9adcc 100644 --- a/src/tags/data/index.ts +++ b/src/shlink-web-component/tags/data/index.ts @@ -1,4 +1,4 @@ -import type { ShlinkTagsStats } from '../../api/types'; +import type { ShlinkTagsStats } from '../../../api/types'; export type TagStats = Omit; diff --git a/src/tags/helpers/DeleteTagConfirmModal.tsx b/src/shlink-web-component/tags/helpers/DeleteTagConfirmModal.tsx similarity index 92% rename from src/tags/helpers/DeleteTagConfirmModal.tsx rename to src/shlink-web-component/tags/helpers/DeleteTagConfirmModal.tsx index 2d0742b8f..f0f4817ce 100644 --- a/src/tags/helpers/DeleteTagConfirmModal.tsx +++ b/src/shlink-web-component/tags/helpers/DeleteTagConfirmModal.tsx @@ -1,6 +1,6 @@ import { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; -import { ShlinkApiError } from '../../api/ShlinkApiError'; -import { Result } from '../../utils/Result'; +import { ShlinkApiError } from '../../../api/ShlinkApiError'; +import { Result } from '../../../utils/Result'; import type { TagModalProps } from '../data'; import type { TagDeletion } from '../reducers/tagDelete'; diff --git a/src/tags/helpers/EditTagModal.scss b/src/shlink-web-component/tags/helpers/EditTagModal.scss similarity index 100% rename from src/tags/helpers/EditTagModal.scss rename to src/shlink-web-component/tags/helpers/EditTagModal.scss diff --git a/src/tags/helpers/EditTagModal.tsx b/src/shlink-web-component/tags/helpers/EditTagModal.tsx similarity index 90% rename from src/tags/helpers/EditTagModal.tsx rename to src/shlink-web-component/tags/helpers/EditTagModal.tsx index 8c5da75ad..ff2a20466 100644 --- a/src/tags/helpers/EditTagModal.tsx +++ b/src/shlink-web-component/tags/helpers/EditTagModal.tsx @@ -4,11 +4,11 @@ import { pipe } from 'ramda'; import { useState } from 'react'; import { HexColorPicker } from 'react-colorful'; import { Button, Input, InputGroup, Modal, ModalBody, ModalFooter, ModalHeader, Popover } from 'reactstrap'; -import { ShlinkApiError } from '../../api/ShlinkApiError'; -import { useToggle } from '../../utils/helpers/hooks'; -import { Result } from '../../utils/Result'; -import type { ColorGenerator } from '../../utils/services/ColorGenerator'; -import { handleEventPreventingDefault } from '../../utils/utils'; +import { ShlinkApiError } from '../../../api/ShlinkApiError'; +import { useToggle } from '../../../utils/helpers/hooks'; +import { Result } from '../../../utils/Result'; +import type { ColorGenerator } from '../../../utils/services/ColorGenerator'; +import { handleEventPreventingDefault } from '../../../utils/utils'; import type { TagModalProps } from '../data'; import type { EditTag, TagEdition } from '../reducers/tagEdit'; import './EditTagModal.scss'; diff --git a/src/tags/helpers/Tag.scss b/src/shlink-web-component/tags/helpers/Tag.scss similarity index 100% rename from src/tags/helpers/Tag.scss rename to src/shlink-web-component/tags/helpers/Tag.scss diff --git a/src/tags/helpers/Tag.tsx b/src/shlink-web-component/tags/helpers/Tag.tsx similarity index 91% rename from src/tags/helpers/Tag.tsx rename to src/shlink-web-component/tags/helpers/Tag.tsx index 4e9f33f8e..f6ec0c38a 100644 --- a/src/tags/helpers/Tag.tsx +++ b/src/shlink-web-component/tags/helpers/Tag.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import type { FC, MouseEventHandler, PropsWithChildren } from 'react'; -import type { ColorGenerator } from '../../utils/services/ColorGenerator'; +import type { ColorGenerator } from '../../../utils/services/ColorGenerator'; import './Tag.scss'; type TagProps = PropsWithChildren<{ diff --git a/src/tags/helpers/TagBullet.scss b/src/shlink-web-component/tags/helpers/TagBullet.scss similarity index 100% rename from src/tags/helpers/TagBullet.scss rename to src/shlink-web-component/tags/helpers/TagBullet.scss diff --git a/src/tags/helpers/TagBullet.tsx b/src/shlink-web-component/tags/helpers/TagBullet.tsx similarity index 78% rename from src/tags/helpers/TagBullet.tsx rename to src/shlink-web-component/tags/helpers/TagBullet.tsx index 0c3035712..b92bfa3de 100644 --- a/src/tags/helpers/TagBullet.tsx +++ b/src/shlink-web-component/tags/helpers/TagBullet.tsx @@ -1,4 +1,4 @@ -import type { ColorGenerator } from '../../utils/services/ColorGenerator'; +import type { ColorGenerator } from '../../../utils/services/ColorGenerator'; import './TagBullet.scss'; interface TagBulletProps { diff --git a/src/tags/helpers/TagsSelector.tsx b/src/shlink-web-component/tags/helpers/TagsSelector.tsx similarity index 94% rename from src/tags/helpers/TagsSelector.tsx rename to src/shlink-web-component/tags/helpers/TagsSelector.tsx index 15eb79262..917bd8032 100644 --- a/src/tags/helpers/TagsSelector.tsx +++ b/src/shlink-web-component/tags/helpers/TagsSelector.tsx @@ -1,8 +1,8 @@ import { useEffect } from 'react'; import type { SuggestionComponentProps, TagComponentProps } from 'react-tag-autocomplete'; import ReactTags from 'react-tag-autocomplete'; -import type { Settings } from '../../settings/reducers/settings'; -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 { Tag } from './Tag'; import { TagBullet } from './TagBullet'; diff --git a/src/tags/reducers/tagDelete.ts b/src/shlink-web-component/tags/reducers/tagDelete.ts similarity index 82% rename from src/tags/reducers/tagDelete.ts rename to src/shlink-web-component/tags/reducers/tagDelete.ts index 68be3b534..8c86aaeaa 100644 --- a/src/tags/reducers/tagDelete.ts +++ b/src/shlink-web-component/tags/reducers/tagDelete.ts @@ -1,8 +1,8 @@ import { createAction, 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 { ShlinkApiClientBuilder } from '../../../api/services/ShlinkApiClientBuilder'; +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/shlink-web-component/tags/reducers/tagEdit.ts similarity index 82% rename from src/tags/reducers/tagEdit.ts rename to src/shlink-web-component/tags/reducers/tagEdit.ts index 20d8e74b3..b3ae6aadd 100644 --- a/src/tags/reducers/tagEdit.ts +++ b/src/shlink-web-component/tags/reducers/tagEdit.ts @@ -1,11 +1,11 @@ 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 type { ProblemDetailsError } from '../../../api/types/errors'; +import { parseApiError } from '../../../api/utils'; +import { createAsyncThunk } from '../../../utils/helpers/redux'; +import type { ColorGenerator } from '../../../utils/services/ColorGenerator'; const REDUCER_PREFIX = 'shlink/tagEdit'; diff --git a/src/tags/reducers/tagsList.ts b/src/shlink-web-component/tags/reducers/tagsList.ts similarity index 92% rename from src/tags/reducers/tagsList.ts rename to src/shlink-web-component/tags/reducers/tagsList.ts index e92cb5898..a2a0eec99 100644 --- a/src/tags/reducers/tagsList.ts +++ b/src/shlink-web-component/tags/reducers/tagsList.ts @@ -1,12 +1,12 @@ import { createAction, createSlice } from '@reduxjs/toolkit'; import { isEmpty, reject } from 'ramda'; -import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import type { ShlinkTags } from '../../api/types'; -import type { ProblemDetailsError } from '../../api/types/errors'; -import { parseApiError } from '../../api/utils'; +import type { ShlinkApiClientBuilder } from '../../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkTags } from '../../../api/types'; +import type { ProblemDetailsError } from '../../../api/types/errors'; +import { parseApiError } from '../../../api/utils'; +import { supportedFeatures } from '../../../utils/helpers/features'; +import { createAsyncThunk } from '../../../utils/helpers/redux'; import type { createShortUrl } from '../../short-urls/reducers/shortUrlCreation'; -import { supportedFeatures } from '../../utils/helpers/features'; -import { createAsyncThunk } from '../../utils/helpers/redux'; import { createNewVisits } from '../../visits/reducers/visitCreation'; import type { CreateVisit } from '../../visits/types'; import type { TagStats } from '../data'; diff --git a/src/tags/services/provideServices.ts b/src/shlink-web-component/tags/services/provideServices.ts similarity index 97% rename from src/tags/services/provideServices.ts rename to src/shlink-web-component/tags/services/provideServices.ts index 50d32e49d..bd63bdf54 100644 --- a/src/tags/services/provideServices.ts +++ b/src/shlink-web-component/tags/services/provideServices.ts @@ -1,7 +1,7 @@ import type { IContainer } from 'bottlejs'; import type Bottle from 'bottlejs'; import { prop } from 'ramda'; -import type { ConnectDecorator } from '../../container/types'; +import type { ConnectDecorator } from '../../../container/types'; import { DeleteTagConfirmModal } from '../helpers/DeleteTagConfirmModal'; import { EditTagModal } from '../helpers/EditTagModal'; import { TagsSelector } from '../helpers/TagsSelector'; diff --git a/src/visits/DomainVisits.tsx b/src/shlink-web-component/visits/DomainVisits.tsx similarity index 82% rename from src/visits/DomainVisits.tsx rename to src/shlink-web-component/visits/DomainVisits.tsx index 474da4380..9f1cdc59d 100644 --- a/src/visits/DomainVisits.tsx +++ b/src/shlink-web-component/visits/DomainVisits.tsx @@ -1,9 +1,9 @@ import { useParams } from 'react-router-dom'; -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 { 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 { DomainVisits as DomainVisitsState, LoadDomainVisits } from './reducers/domainVisits'; import type { NormalizedVisit } from './types'; import type { CommonVisitsProps } from './types/CommonVisitsProps'; diff --git a/src/visits/NonOrphanVisits.tsx b/src/shlink-web-component/visits/NonOrphanVisits.tsx similarity index 83% rename from src/visits/NonOrphanVisits.tsx rename to src/shlink-web-component/visits/NonOrphanVisits.tsx index 79fd5fca6..b7b6c9574 100644 --- a/src/visits/NonOrphanVisits.tsx +++ b/src/shlink-web-component/visits/NonOrphanVisits.tsx @@ -1,7 +1,7 @@ -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 { boundToMercureHub } from '../../mercure/helpers/boundToMercureHub'; +import { Topics } from '../../mercure/helpers/Topics'; +import { useGoBack } from '../../utils/helpers/hooks'; import type { LoadVisits, VisitsInfo } from './reducers/types'; import type { NormalizedVisit, VisitsParams } from './types'; import type { CommonVisitsProps } from './types/CommonVisitsProps'; diff --git a/src/visits/OrphanVisits.tsx b/src/shlink-web-component/visits/OrphanVisits.tsx similarity index 84% rename from src/visits/OrphanVisits.tsx rename to src/shlink-web-component/visits/OrphanVisits.tsx index 379b0ef87..0f3b91bdf 100644 --- a/src/visits/OrphanVisits.tsx +++ b/src/shlink-web-component/visits/OrphanVisits.tsx @@ -1,7 +1,7 @@ -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 { boundToMercureHub } from '../../mercure/helpers/boundToMercureHub'; +import { Topics } from '../../mercure/helpers/Topics'; +import { useGoBack } from '../../utils/helpers/hooks'; import type { LoadOrphanVisits } from './reducers/orphanVisits'; import type { VisitsInfo } from './reducers/types'; import type { NormalizedVisit, VisitsParams } from './types'; diff --git a/src/visits/ShortUrlVisits.tsx b/src/shlink-web-component/visits/ShortUrlVisits.tsx similarity index 88% rename from src/visits/ShortUrlVisits.tsx rename to src/shlink-web-component/visits/ShortUrlVisits.tsx index d3a28e550..08c754f3b 100644 --- a/src/visits/ShortUrlVisits.tsx +++ b/src/shlink-web-component/visits/ShortUrlVisits.tsx @@ -1,13 +1,13 @@ 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 { Topics } from '../mercure/helpers/Topics'; +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 { parseQuery } from '../../utils/helpers/query'; 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 { parseQuery } from '../utils/helpers/query'; import type { LoadShortUrlVisits, ShortUrlVisits as ShortUrlVisitsState } from './reducers/shortUrlVisits'; import { ShortUrlVisitsHeader } from './ShortUrlVisitsHeader'; import type { NormalizedVisit, VisitsParams } from './types'; diff --git a/src/visits/ShortUrlVisitsHeader.scss b/src/shlink-web-component/visits/ShortUrlVisitsHeader.scss similarity index 100% rename from src/visits/ShortUrlVisitsHeader.scss rename to src/shlink-web-component/visits/ShortUrlVisitsHeader.scss diff --git a/src/visits/ShortUrlVisitsHeader.tsx b/src/shlink-web-component/visits/ShortUrlVisitsHeader.tsx similarity index 97% rename from src/visits/ShortUrlVisitsHeader.tsx rename to src/shlink-web-component/visits/ShortUrlVisitsHeader.tsx index b40b42935..2a6237d4c 100644 --- a/src/visits/ShortUrlVisitsHeader.tsx +++ b/src/shlink-web-component/visits/ShortUrlVisitsHeader.tsx @@ -1,7 +1,7 @@ import { ExternalLink } from 'react-external-link'; import { UncontrolledTooltip } from 'reactstrap'; +import { Time } from '../../utils/dates/Time'; import type { ShortUrlDetail } from '../short-urls/reducers/shortUrlDetail'; -import { Time } from '../utils/dates/Time'; import type { ShortUrlVisits } from './reducers/shortUrlVisits'; import { VisitsHeader } from './VisitsHeader'; import './ShortUrlVisitsHeader.scss'; diff --git a/src/visits/TagVisits.tsx b/src/shlink-web-component/visits/TagVisits.tsx similarity index 78% rename from src/visits/TagVisits.tsx rename to src/shlink-web-component/visits/TagVisits.tsx index dcbcdbb15..105b216e6 100644 --- a/src/visits/TagVisits.tsx +++ b/src/shlink-web-component/visits/TagVisits.tsx @@ -1,10 +1,10 @@ import { useParams } from 'react-router-dom'; -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 { 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 { ColorGenerator } from '../../utils/services/ColorGenerator'; import type { LoadTagVisits, TagVisits as TagVisitsState } from './reducers/tagVisits'; import { TagVisitsHeader } from './TagVisitsHeader'; import type { NormalizedVisit } from './types'; diff --git a/src/visits/TagVisitsHeader.tsx b/src/shlink-web-component/visits/TagVisitsHeader.tsx similarity index 90% rename from src/visits/TagVisitsHeader.tsx rename to src/shlink-web-component/visits/TagVisitsHeader.tsx index 341b0bad3..730877ca3 100644 --- a/src/visits/TagVisitsHeader.tsx +++ b/src/shlink-web-component/visits/TagVisitsHeader.tsx @@ -1,5 +1,5 @@ +import type { ColorGenerator } from '../../utils/services/ColorGenerator'; import { Tag } from '../tags/helpers/Tag'; -import type { ColorGenerator } from '../utils/services/ColorGenerator'; import type { TagVisits } from './reducers/tagVisits'; import { VisitsHeader } from './VisitsHeader'; import './ShortUrlVisitsHeader.scss'; diff --git a/src/visits/VisitsHeader.tsx b/src/shlink-web-component/visits/VisitsHeader.tsx similarity index 100% rename from src/visits/VisitsHeader.tsx rename to src/shlink-web-component/visits/VisitsHeader.tsx diff --git a/src/visits/VisitsStats.tsx b/src/shlink-web-component/visits/VisitsStats.tsx similarity index 95% rename from src/visits/VisitsStats.tsx rename to src/shlink-web-component/visits/VisitsStats.tsx index 638d0cffe..022e1e778 100644 --- a/src/visits/VisitsStats.tsx +++ b/src/shlink-web-component/visits/VisitsStats.tsx @@ -7,16 +7,16 @@ import type { FC, PropsWithChildren } from 'react'; import { useEffect, useMemo, useRef, useState } from 'react'; import { Navigate, Route, Routes, useLocation } from 'react-router-dom'; import { Button, Progress, Row } from 'reactstrap'; -import { ShlinkApiError } from '../api/ShlinkApiError'; -import type { Settings } from '../settings/reducers/settings'; -import { DateRangeSelector } from '../utils/dates/DateRangeSelector'; -import { ExportBtn } from '../utils/ExportBtn'; -import type { DateInterval, DateRange } from '../utils/helpers/dateIntervals'; -import { toDateRange } from '../utils/helpers/dateIntervals'; -import { prettify } from '../utils/helpers/numbers'; -import { Message } from '../utils/Message'; -import { NavPillItem, NavPills } from '../utils/NavPills'; -import { Result } from '../utils/Result'; +import { ShlinkApiError } from '../../api/ShlinkApiError'; +import type { Settings } from '../../settings/reducers/settings'; +import { DateRangeSelector } from '../../utils/dates/DateRangeSelector'; +import { ExportBtn } from '../../utils/ExportBtn'; +import type { DateInterval, DateRange } from '../../utils/helpers/dateIntervals'; +import { toDateRange } from '../../utils/helpers/dateIntervals'; +import { prettify } from '../../utils/helpers/numbers'; +import { Message } from '../../utils/Message'; +import { NavPillItem, NavPills } from '../../utils/NavPills'; +import { Result } from '../../utils/Result'; import { DoughnutChartCard } from './charts/DoughnutChartCard'; import { LineChartCard } from './charts/LineChartCard'; import { SortableBarChartCard } from './charts/SortableBarChartCard'; diff --git a/src/visits/VisitsTable.scss b/src/shlink-web-component/visits/VisitsTable.scss similarity index 89% rename from src/visits/VisitsTable.scss rename to src/shlink-web-component/visits/VisitsTable.scss index 2b20f59c3..119270a4a 100644 --- a/src/visits/VisitsTable.scss +++ b/src/shlink-web-component/visits/VisitsTable.scss @@ -1,5 +1,5 @@ -@import '../utils/base'; -@import '../utils/mixins/sticky-cell'; +@import '../../utils/base'; +@import '../../utils/mixins/sticky-cell'; .visits-table { margin: 1.5rem 0 0; diff --git a/src/visits/VisitsTable.tsx b/src/shlink-web-component/visits/VisitsTable.tsx similarity index 94% rename from src/visits/VisitsTable.tsx rename to src/shlink-web-component/visits/VisitsTable.tsx index 44c395f4e..727fd5f8c 100644 --- a/src/visits/VisitsTable.tsx +++ b/src/shlink-web-component/visits/VisitsTable.tsx @@ -4,14 +4,14 @@ import classNames from 'classnames'; import { min, splitEvery } from 'ramda'; import { useEffect, useMemo, useRef, useState } from 'react'; import { UncontrolledTooltip } from 'reactstrap'; -import { SimplePaginator } from '../common/SimplePaginator'; -import { Time } from '../utils/dates/Time'; -import { prettify } from '../utils/helpers/numbers'; -import type { Order } from '../utils/helpers/ordering'; -import { determineOrderDir, sortList } from '../utils/helpers/ordering'; -import { SearchField } from '../utils/SearchField'; -import { TableOrderIcon } from '../utils/table/TableOrderIcon'; -import type { MediaMatcher } from '../utils/types'; +import { SimplePaginator } from '../../common/SimplePaginator'; +import { Time } from '../../utils/dates/Time'; +import { prettify } from '../../utils/helpers/numbers'; +import type { Order } from '../../utils/helpers/ordering'; +import { determineOrderDir, sortList } from '../../utils/helpers/ordering'; +import { SearchField } from '../../utils/SearchField'; +import { TableOrderIcon } from '../../utils/table/TableOrderIcon'; +import type { MediaMatcher } from '../../utils/types'; import type { NormalizedOrphanVisit, NormalizedVisit } from './types'; import './VisitsTable.scss'; diff --git a/src/visits/charts/ChartCard.scss b/src/shlink-web-component/visits/charts/ChartCard.scss similarity index 100% rename from src/visits/charts/ChartCard.scss rename to src/shlink-web-component/visits/charts/ChartCard.scss diff --git a/src/visits/charts/ChartCard.tsx b/src/shlink-web-component/visits/charts/ChartCard.tsx similarity index 100% rename from src/visits/charts/ChartCard.tsx rename to src/shlink-web-component/visits/charts/ChartCard.tsx diff --git a/src/visits/charts/DoughnutChart.tsx b/src/shlink-web-component/visits/charts/DoughnutChart.tsx similarity index 94% rename from src/visits/charts/DoughnutChart.tsx rename to src/shlink-web-component/visits/charts/DoughnutChart.tsx index ff721c14d..7d1115400 100644 --- a/src/visits/charts/DoughnutChart.tsx +++ b/src/shlink-web-component/visits/charts/DoughnutChart.tsx @@ -3,8 +3,8 @@ import { keys, values } from 'ramda'; import type { FC } from 'react'; import { memo, useState } from 'react'; import { Doughnut } from 'react-chartjs-2'; -import { renderPieChartLabel } from '../../utils/helpers/charts'; -import { isDarkThemeEnabled, PRIMARY_DARK_COLOR, PRIMARY_LIGHT_COLOR } from '../../utils/theme'; +import { renderPieChartLabel } from '../../../utils/helpers/charts'; +import { isDarkThemeEnabled, PRIMARY_DARK_COLOR, PRIMARY_LIGHT_COLOR } from '../../../utils/theme'; import type { Stats } from '../types'; import { DoughnutChartLegend } from './DoughnutChartLegend'; diff --git a/src/visits/charts/DoughnutChartCard.tsx b/src/shlink-web-component/visits/charts/DoughnutChartCard.tsx similarity index 100% rename from src/visits/charts/DoughnutChartCard.tsx rename to src/shlink-web-component/visits/charts/DoughnutChartCard.tsx diff --git a/src/visits/charts/DoughnutChartLegend.scss b/src/shlink-web-component/visits/charts/DoughnutChartLegend.scss similarity index 93% rename from src/visits/charts/DoughnutChartLegend.scss rename to src/shlink-web-component/visits/charts/DoughnutChartLegend.scss index 3dabac257..e2a354ea7 100644 --- a/src/visits/charts/DoughnutChartLegend.scss +++ b/src/shlink-web-component/visits/charts/DoughnutChartLegend.scss @@ -1,4 +1,4 @@ -@import '../../utils/base'; +@import '../../../utils/base'; .doughnut-chart-legend { list-style-type: none; diff --git a/src/visits/charts/DoughnutChartLegend.tsx b/src/shlink-web-component/visits/charts/DoughnutChartLegend.tsx similarity index 100% rename from src/visits/charts/DoughnutChartLegend.tsx rename to src/shlink-web-component/visits/charts/DoughnutChartLegend.tsx diff --git a/src/visits/charts/HorizontalBarChart.tsx b/src/shlink-web-component/visits/charts/HorizontalBarChart.tsx similarity index 94% rename from src/visits/charts/HorizontalBarChart.tsx rename to src/shlink-web-component/visits/charts/HorizontalBarChart.tsx index 1aac69036..7fef76990 100644 --- a/src/visits/charts/HorizontalBarChart.tsx +++ b/src/shlink-web-component/visits/charts/HorizontalBarChart.tsx @@ -3,11 +3,11 @@ import { keys, values } from 'ramda'; import type { FC, MutableRefObject } from 'react'; import { useRef } from 'react'; import { Bar, getElementAtEvent } from 'react-chartjs-2'; -import { pointerOnHover, renderChartLabel } from '../../utils/helpers/charts'; -import { prettify } from '../../utils/helpers/numbers'; -import { fillTheGaps } from '../../utils/helpers/visits'; -import { HIGHLIGHTED_COLOR, HIGHLIGHTED_COLOR_ALPHA, MAIN_COLOR, MAIN_COLOR_ALPHA } from '../../utils/theme'; +import { pointerOnHover, renderChartLabel } from '../../../utils/helpers/charts'; +import { prettify } from '../../../utils/helpers/numbers'; +import { HIGHLIGHTED_COLOR, HIGHLIGHTED_COLOR_ALPHA, MAIN_COLOR, MAIN_COLOR_ALPHA } from '../../../utils/theme'; import type { Stats } from '../types'; +import { fillTheGaps } from '../utils'; export interface HorizontalBarChartProps { stats: Stats; diff --git a/src/visits/charts/LineChartCard.scss b/src/shlink-web-component/visits/charts/LineChartCard.scss similarity index 80% rename from src/visits/charts/LineChartCard.scss rename to src/shlink-web-component/visits/charts/LineChartCard.scss index e834aecee..a9ee364d3 100644 --- a/src/visits/charts/LineChartCard.scss +++ b/src/shlink-web-component/visits/charts/LineChartCard.scss @@ -1,4 +1,4 @@ -@import '../../utils/base'; +@import '../../../utils/base'; .line-chart-card__body canvas { height: 300px !important; diff --git a/src/visits/charts/LineChartCard.tsx b/src/shlink-web-component/visits/charts/LineChartCard.tsx similarity index 94% rename from src/visits/charts/LineChartCard.tsx rename to src/shlink-web-component/visits/charts/LineChartCard.tsx index 59cb9bbaa..b13a4c760 100644 --- a/src/visits/charts/LineChartCard.tsx +++ b/src/shlink-web-component/visits/charts/LineChartCard.tsx @@ -23,15 +23,15 @@ import { DropdownToggle, UncontrolledDropdown, } from 'reactstrap'; -import { pointerOnHover, renderChartLabel } from '../../utils/helpers/charts'; -import { STANDARD_DATE_FORMAT } from '../../utils/helpers/date'; -import { useToggle } from '../../utils/helpers/hooks'; -import { prettify } from '../../utils/helpers/numbers'; -import { fillTheGaps } from '../../utils/helpers/visits'; -import { HIGHLIGHTED_COLOR, MAIN_COLOR } from '../../utils/theme'; -import { ToggleSwitch } from '../../utils/ToggleSwitch'; -import { rangeOf } from '../../utils/utils'; +import { pointerOnHover, renderChartLabel } from '../../../utils/helpers/charts'; +import { STANDARD_DATE_FORMAT } from '../../../utils/helpers/date'; +import { useToggle } from '../../../utils/helpers/hooks'; +import { prettify } from '../../../utils/helpers/numbers'; +import { HIGHLIGHTED_COLOR, MAIN_COLOR } from '../../../utils/theme'; +import { ToggleSwitch } from '../../../utils/ToggleSwitch'; +import { rangeOf } from '../../../utils/utils'; import type { NormalizedVisit, Stats } from '../types'; +import { fillTheGaps } from '../utils'; import './LineChartCard.scss'; interface LineChartCardProps { diff --git a/src/visits/charts/SortableBarChartCard.tsx b/src/shlink-web-component/visits/charts/SortableBarChartCard.tsx similarity index 92% rename from src/visits/charts/SortableBarChartCard.tsx rename to src/shlink-web-component/visits/charts/SortableBarChartCard.tsx index 7ee089002..7621da277 100644 --- a/src/visits/charts/SortableBarChartCard.tsx +++ b/src/shlink-web-component/visits/charts/SortableBarChartCard.tsx @@ -1,12 +1,12 @@ import { fromPairs, pipe, reverse, sortBy, splitEvery, toLower, toPairs, type, zipObj } from 'ramda'; import type { FC, ReactNode } from 'react'; import { useState } from 'react'; -import { SimplePaginator } from '../../common/SimplePaginator'; -import { roundTen } from '../../utils/helpers/numbers'; -import type { Order } from '../../utils/helpers/ordering'; -import { OrderingDropdown } from '../../utils/OrderingDropdown'; -import { PaginationDropdown } from '../../utils/PaginationDropdown'; -import { rangeOf } from '../../utils/utils'; +import { SimplePaginator } from '../../../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'; diff --git a/src/visits/helpers/MapModal.scss b/src/shlink-web-component/visits/helpers/MapModal.scss similarity index 91% rename from src/visits/helpers/MapModal.scss rename to src/shlink-web-component/visits/helpers/MapModal.scss index bcf0d9381..1e53af6eb 100644 --- a/src/visits/helpers/MapModal.scss +++ b/src/shlink-web-component/visits/helpers/MapModal.scss @@ -1,5 +1,5 @@ -@import '../../utils/base'; -@import '../../utils/mixins/fit-with-margin'; +@import '../../../utils/base'; +@import '../../../utils/mixins/fit-with-margin'; .map-modal__modal.map-modal__modal { @media (min-width: $mdMin) { diff --git a/src/visits/helpers/MapModal.tsx b/src/shlink-web-component/visits/helpers/MapModal.tsx similarity index 100% rename from src/visits/helpers/MapModal.tsx rename to src/shlink-web-component/visits/helpers/MapModal.tsx diff --git a/src/visits/helpers/OpenMapModalBtn.scss b/src/shlink-web-component/visits/helpers/OpenMapModalBtn.scss similarity index 100% rename from src/visits/helpers/OpenMapModalBtn.scss rename to src/shlink-web-component/visits/helpers/OpenMapModalBtn.scss diff --git a/src/visits/helpers/OpenMapModalBtn.tsx b/src/shlink-web-component/visits/helpers/OpenMapModalBtn.tsx similarity index 96% rename from src/visits/helpers/OpenMapModalBtn.tsx rename to src/shlink-web-component/visits/helpers/OpenMapModalBtn.tsx index b36a2ce95..ded059e6c 100644 --- a/src/visits/helpers/OpenMapModalBtn.tsx +++ b/src/shlink-web-component/visits/helpers/OpenMapModalBtn.tsx @@ -2,7 +2,7 @@ import { faMapMarkedAlt as mapIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useState } from 'react'; import { Button, Dropdown, DropdownItem, DropdownMenu, UncontrolledTooltip } from 'reactstrap'; -import { useDomId, useToggle } from '../../utils/helpers/hooks'; +import { useDomId, useToggle } from '../../../utils/helpers/hooks'; import type { CityStats } from '../types'; import { MapModal } from './MapModal'; import './OpenMapModalBtn.scss'; diff --git a/src/visits/helpers/VisitsFilterDropdown.tsx b/src/shlink-web-component/visits/helpers/VisitsFilterDropdown.tsx similarity index 94% rename from src/visits/helpers/VisitsFilterDropdown.tsx rename to src/shlink-web-component/visits/helpers/VisitsFilterDropdown.tsx index 7a9014217..cf7ff8e79 100644 --- a/src/visits/helpers/VisitsFilterDropdown.tsx +++ b/src/shlink-web-component/visits/helpers/VisitsFilterDropdown.tsx @@ -1,7 +1,7 @@ import type { DropdownItemProps } from 'reactstrap'; import { DropdownItem } from 'reactstrap'; -import { DropdownBtn } from '../../utils/DropdownBtn'; -import { hasValue } from '../../utils/utils'; +import { DropdownBtn } from '../../../utils/DropdownBtn'; +import { hasValue } from '../../../utils/utils'; import type { OrphanVisitType, VisitsFilter } from '../types'; interface VisitsFilterDropdownProps { diff --git a/src/visits/helpers/hooks.ts b/src/shlink-web-component/visits/helpers/hooks.ts similarity index 84% rename from src/visits/helpers/hooks.ts rename to src/shlink-web-component/visits/helpers/hooks.ts index 42798bc7f..ddbe7f70e 100644 --- a/src/visits/helpers/hooks.ts +++ b/src/shlink-web-component/visits/helpers/hooks.ts @@ -2,12 +2,12 @@ import type { DeepPartial } from '@reduxjs/toolkit'; import { isEmpty, isNil, mergeDeepRight, pipe } from 'ramda'; import { useMemo } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; -import { formatIsoDate } from '../../utils/helpers/date'; -import type { DateRange } from '../../utils/helpers/dateIntervals'; -import { datesToDateRange } from '../../utils/helpers/dateIntervals'; -import { parseQuery, stringifyQuery } from '../../utils/helpers/query'; -import type { BooleanString } from '../../utils/utils'; -import { parseBooleanToString } from '../../utils/utils'; +import { formatIsoDate } from '../../../utils/helpers/date'; +import type { DateRange } from '../../../utils/helpers/dateIntervals'; +import { datesToDateRange } from '../../../utils/helpers/dateIntervals'; +import { parseQuery, stringifyQuery } from '../../../utils/helpers/query'; +import type { BooleanString } from '../../../utils/utils'; +import { parseBooleanToString } from '../../../utils/utils'; import type { OrphanVisitType, VisitsFilter } from '../types'; interface VisitsQuery { diff --git a/src/visits/reducers/common.ts b/src/shlink-web-component/visits/reducers/common.ts similarity index 94% rename from src/visits/reducers/common.ts rename to src/shlink-web-component/visits/reducers/common.ts index de5f33dce..68e3d6a86 100644 --- a/src/visits/reducers/common.ts +++ b/src/shlink-web-component/visits/reducers/common.ts @@ -1,11 +1,11 @@ import { createAction, createSlice } from '@reduxjs/toolkit'; import { flatten, prop, range, splitEvery } from 'ramda'; -import type { ShlinkPaginator, ShlinkVisits, ShlinkVisitsParams } from '../../api/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 { createAsyncThunk } from '../../utils/helpers/redux'; +import type { ShlinkPaginator, ShlinkVisits, ShlinkVisitsParams } from '../../../api/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 { createAsyncThunk } from '../../../utils/helpers/redux'; import type { CreateVisit, Visit } from '../types'; import type { LoadVisits, VisitsInfo, VisitsLoaded } from './types'; import { createNewVisits } from './visitCreation'; diff --git a/src/visits/reducers/domainVisits.ts b/src/shlink-web-component/visits/reducers/domainVisits.ts similarity index 92% rename from src/visits/reducers/domainVisits.ts rename to src/shlink-web-component/visits/reducers/domainVisits.ts index cfb083225..97094be60 100644 --- a/src/visits/reducers/domainVisits.ts +++ b/src/shlink-web-component/visits/reducers/domainVisits.ts @@ -1,6 +1,6 @@ -import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkApiClientBuilder } from '../../../api/services/ShlinkApiClientBuilder'; +import { isBetween } from '../../../utils/helpers/date'; import { domainMatches } 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/nonOrphanVisits.ts b/src/shlink-web-component/visits/reducers/nonOrphanVisits.ts similarity index 90% rename from src/visits/reducers/nonOrphanVisits.ts rename to src/shlink-web-component/visits/reducers/nonOrphanVisits.ts index 6156cb749..ed89508c2 100644 --- a/src/visits/reducers/nonOrphanVisits.ts +++ b/src/shlink-web-component/visits/reducers/nonOrphanVisits.ts @@ -1,5 +1,5 @@ -import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { isBetween } from '../../utils/helpers/date'; +import type { ShlinkApiClientBuilder } from '../../../api/services/ShlinkApiClientBuilder'; +import { isBetween } from '../../../utils/helpers/date'; import { createVisitsAsyncThunk, createVisitsReducer, lastVisitLoaderForLoader } from './common'; import type { VisitsInfo } from './types'; diff --git a/src/visits/reducers/orphanVisits.ts b/src/shlink-web-component/visits/reducers/orphanVisits.ts similarity index 93% rename from src/visits/reducers/orphanVisits.ts rename to src/shlink-web-component/visits/reducers/orphanVisits.ts index 1bb5c55d3..22f7a1903 100644 --- a/src/visits/reducers/orphanVisits.ts +++ b/src/shlink-web-component/visits/reducers/orphanVisits.ts @@ -1,5 +1,5 @@ -import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { isBetween } from '../../utils/helpers/date'; +import type { ShlinkApiClientBuilder } from '../../../api/services/ShlinkApiClientBuilder'; +import { isBetween } from '../../../utils/helpers/date'; import type { OrphanVisit, OrphanVisitType } from '../types'; import { isOrphanVisit } from '../types/helpers'; import { createVisitsAsyncThunk, createVisitsReducer, lastVisitLoaderForLoader } from './common'; diff --git a/src/visits/reducers/shortUrlVisits.ts b/src/shlink-web-component/visits/reducers/shortUrlVisits.ts similarity index 93% rename from src/visits/reducers/shortUrlVisits.ts rename to src/shlink-web-component/visits/reducers/shortUrlVisits.ts index 5b7d432e1..60865b823 100644 --- a/src/visits/reducers/shortUrlVisits.ts +++ b/src/shlink-web-component/visits/reducers/shortUrlVisits.ts @@ -1,7 +1,7 @@ -import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkApiClientBuilder } from '../../../api/services/ShlinkApiClientBuilder'; +import { isBetween } from '../../../utils/helpers/date'; 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/tagVisits.ts b/src/shlink-web-component/visits/reducers/tagVisits.ts similarity index 92% rename from src/visits/reducers/tagVisits.ts rename to src/shlink-web-component/visits/reducers/tagVisits.ts index ff2b2374e..66ed36943 100644 --- a/src/visits/reducers/tagVisits.ts +++ b/src/shlink-web-component/visits/reducers/tagVisits.ts @@ -1,5 +1,5 @@ -import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import { isBetween } from '../../utils/helpers/date'; +import type { ShlinkApiClientBuilder } from '../../../api/services/ShlinkApiClientBuilder'; +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/shlink-web-component/visits/reducers/types/index.ts similarity index 69% rename from src/visits/reducers/types/index.ts rename to src/shlink-web-component/visits/reducers/types/index.ts index 1ab706278..a2af0e50b 100644 --- a/src/visits/reducers/types/index.ts +++ b/src/shlink-web-component/visits/reducers/types/index.ts @@ -1,6 +1,6 @@ -import type { ShlinkVisitsParams } from '../../../api/types'; -import type { ProblemDetailsError } from '../../../api/types/errors'; -import type { DateInterval } from '../../../utils/helpers/dateIntervals'; +import type { ShlinkVisitsParams } from '../../../../api/types'; +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/visitCreation.ts b/src/shlink-web-component/visits/reducers/visitCreation.ts similarity index 100% rename from src/visits/reducers/visitCreation.ts rename to src/shlink-web-component/visits/reducers/visitCreation.ts diff --git a/src/visits/reducers/visitsOverview.ts b/src/shlink-web-component/visits/reducers/visitsOverview.ts similarity index 93% rename from src/visits/reducers/visitsOverview.ts rename to src/shlink-web-component/visits/reducers/visitsOverview.ts index 073fa3d57..fb6c59ddb 100644 --- a/src/visits/reducers/visitsOverview.ts +++ b/src/shlink-web-component/visits/reducers/visitsOverview.ts @@ -1,8 +1,8 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; -import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; -import type { ShlinkVisitsOverview } from '../../api/types'; -import { createAsyncThunk } from '../../utils/helpers/redux'; +import type { ShlinkApiClientBuilder } from '../../../api/services/ShlinkApiClientBuilder'; +import type { ShlinkVisitsOverview } from '../../../api/types'; +import { createAsyncThunk } from '../../../utils/helpers/redux'; import type { CreateVisit } from '../types'; import { groupNewVisitsByType } from '../types/helpers'; import { createNewVisits } from './visitCreation'; diff --git a/src/visits/services/VisitsParser.ts b/src/shlink-web-component/visits/services/VisitsParser.ts similarity index 96% rename from src/visits/services/VisitsParser.ts rename to src/shlink-web-component/visits/services/VisitsParser.ts index 9d10e706c..d65f17957 100644 --- a/src/visits/services/VisitsParser.ts +++ b/src/shlink-web-component/visits/services/VisitsParser.ts @@ -1,8 +1,8 @@ import { isNil, map } from 'ramda'; -import { extractDomain, parseUserAgent } from '../../utils/helpers/visits'; -import { hasValue } from '../../utils/utils'; +import { hasValue } from '../../../utils/utils'; import type { CityStats, NormalizedVisit, Stats, Visit, VisitsStats } from '../types'; import { isNormalizedOrphanVisit, isOrphanVisit } from '../types/helpers'; +import { extractDomain, parseUserAgent } from '../utils'; /* eslint-disable no-param-reassign */ const visitHasProperty = (visit: NormalizedVisit, propertyName: keyof NormalizedVisit) => diff --git a/src/visits/services/provideServices.ts b/src/shlink-web-component/visits/services/provideServices.ts similarity index 98% rename from src/visits/services/provideServices.ts rename to src/shlink-web-component/visits/services/provideServices.ts index 0319bfc40..2da9abe10 100644 --- a/src/visits/services/provideServices.ts +++ b/src/shlink-web-component/visits/services/provideServices.ts @@ -1,6 +1,6 @@ import type Bottle from 'bottlejs'; import { prop } from 'ramda'; -import type { ConnectDecorator } from '../../container/types'; +import type { ConnectDecorator } from '../../../container/types'; import { DomainVisits } from '../DomainVisits'; import { MapModal } from '../helpers/MapModal'; import { NonOrphanVisits } from '../NonOrphanVisits'; diff --git a/src/shlink-web-component/visits/types/CommonVisitsProps.ts b/src/shlink-web-component/visits/types/CommonVisitsProps.ts new file mode 100644 index 000000000..1f569aaa4 --- /dev/null +++ b/src/shlink-web-component/visits/types/CommonVisitsProps.ts @@ -0,0 +1,5 @@ +import type { Settings } from '../../../settings/reducers/settings'; + +export interface CommonVisitsProps { + settings: Settings; +} diff --git a/src/visits/types/helpers.ts b/src/shlink-web-component/visits/types/helpers.ts similarity index 93% rename from src/visits/types/helpers.ts rename to src/shlink-web-component/visits/types/helpers.ts index 4cda7222c..2a61ac5c7 100644 --- a/src/visits/types/helpers.ts +++ b/src/shlink-web-component/visits/types/helpers.ts @@ -1,6 +1,6 @@ import { countBy, groupBy, pipe, prop } from 'ramda'; -import type { ShlinkVisitsParams } from '../../api/types'; -import { formatIsoDate } from '../../utils/helpers/date'; +import 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/src/visits/types/index.ts b/src/shlink-web-component/visits/types/index.ts similarity index 96% rename from src/visits/types/index.ts rename to src/shlink-web-component/visits/types/index.ts index 503f81700..05307be7b 100644 --- a/src/visits/types/index.ts +++ b/src/shlink-web-component/visits/types/index.ts @@ -1,5 +1,5 @@ +import type { DateRange } from '../../../utils/helpers/dateIntervals'; import type { ShortUrl } from '../../short-urls/data'; -import type { DateRange } from '../../utils/helpers/dateIntervals'; export type OrphanVisitType = 'base_url' | 'invalid_short_url' | 'regular_404'; diff --git a/src/utils/helpers/visits.ts b/src/shlink-web-component/visits/utils/index.ts similarity index 86% rename from src/utils/helpers/visits.ts rename to src/shlink-web-component/visits/utils/index.ts index 468d310a9..a8f7b2365 100644 --- a/src/utils/helpers/visits.ts +++ b/src/shlink-web-component/visits/utils/index.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 { Empty } from '../../../utils/utils'; +import { hasValue } from '../../../utils/utils'; +import type { Stats, UserAgent } from '../types'; const DEFAULT = 'Others'; const BROWSERS_WHITELIST = [ diff --git a/src/visits/types/CommonVisitsProps.ts b/src/visits/types/CommonVisitsProps.ts deleted file mode 100644 index 55ff817c8..000000000 --- a/src/visits/types/CommonVisitsProps.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Settings } from '../../settings/reducers/settings'; - -export interface CommonVisitsProps { - settings: Settings; -} diff --git a/test/api/services/ShlinkApiClient.test.ts b/test/api/services/ShlinkApiClient.test.ts index f78180656..286965771 100644 --- a/test/api/services/ShlinkApiClient.test.ts +++ b/test/api/services/ShlinkApiClient.test.ts @@ -3,7 +3,7 @@ import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkDomain, ShlinkVisits, ShlinkVisitsOverview } from '../../../src/api/types'; import { ErrorTypeV2, ErrorTypeV3 } from '../../../src/api/types/errors'; import type { HttpClient } from '../../../src/common/services/HttpClient'; -import type { ShortUrl, ShortUrlsOrder } from '../../../src/short-urls/data'; +import type { ShortUrl, ShortUrlsOrder } from '../../../src/shlink-web-component/short-urls/data'; import type { OptionalString } from '../../../src/utils/utils'; describe('ShlinkApiClient', () => { diff --git a/test/common/services/ReportExporter.test.ts b/test/common/services/ReportExporter.test.ts index 7da433130..214958412 100644 --- a/test/common/services/ReportExporter.test.ts +++ b/test/common/services/ReportExporter.test.ts @@ -1,6 +1,6 @@ import { ReportExporter } from '../../../src/common/services/ReportExporter'; -import type { ExportableShortUrl } from '../../../src/short-urls/data'; -import type { NormalizedVisit } from '../../../src/visits/types'; +import type { ExportableShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import type { NormalizedVisit } from '../../../src/shlink-web-component/visits/types'; import { windowMock } from '../../__mocks__/Window.mock'; describe('ReportExporter', () => { diff --git a/test/domains/DomainRow.test.tsx b/test/domains/DomainRow.test.tsx index f3d6bc3ee..21dfe35f9 100644 --- a/test/domains/DomainRow.test.tsx +++ b/test/domains/DomainRow.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import type { ShlinkDomainRedirects } from '../../src/api/types'; -import type { Domain } from '../../src/domains/data'; -import { DomainRow } from '../../src/domains/DomainRow'; +import type { Domain } from '../../src/shlink-web-component/domains/data'; +import { DomainRow } from '../../src/shlink-web-component/domains/DomainRow'; describe('', () => { const redirectsCombinations = [ diff --git a/test/domains/DomainSelector.test.tsx b/test/domains/DomainSelector.test.tsx index c683672da..1dfd5c582 100644 --- a/test/domains/DomainSelector.test.tsx +++ b/test/domains/DomainSelector.test.tsx @@ -1,7 +1,7 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { DomainSelector } from '../../src/domains/DomainSelector'; -import type { DomainsList } from '../../src/domains/reducers/domainsList'; +import { DomainSelector } from '../../src/shlink-web-component/domains/DomainSelector'; +import type { DomainsList } from '../../src/shlink-web-component/domains/reducers/domainsList'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/domains/ManageDomains.test.tsx b/test/domains/ManageDomains.test.tsx index 6eba6b798..eae2b2bcc 100644 --- a/test/domains/ManageDomains.test.tsx +++ b/test/domains/ManageDomains.test.tsx @@ -2,8 +2,8 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; 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 { ManageDomains } from '../../src/shlink-web-component/domains/ManageDomains'; +import type { DomainsList } from '../../src/shlink-web-component/domains/reducers/domainsList'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/domains/helpers/DomainDropdown.test.tsx b/test/domains/helpers/DomainDropdown.test.tsx index 85c72326f..8959e971d 100644 --- a/test/domains/helpers/DomainDropdown.test.tsx +++ b/test/domains/helpers/DomainDropdown.test.tsx @@ -1,9 +1,9 @@ import { screen, waitForElementToBeRemoved } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; -import type { Domain } from '../../../src/domains/data'; -import { DomainDropdown } from '../../../src/domains/helpers/DomainDropdown'; import type { SelectedServer } from '../../../src/servers/data'; +import type { Domain } from '../../../src/shlink-web-component/domains/data'; +import { DomainDropdown } from '../../../src/shlink-web-component/domains/helpers/DomainDropdown'; import type { SemVer } from '../../../src/utils/helpers/version'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/domains/helpers/DomainStatusIcon.test.tsx b/test/domains/helpers/DomainStatusIcon.test.tsx index 458f21300..bf802f7b7 100644 --- a/test/domains/helpers/DomainStatusIcon.test.tsx +++ b/test/domains/helpers/DomainStatusIcon.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import type { DomainStatus } from '../../../src/domains/data'; -import { DomainStatusIcon } from '../../../src/domains/helpers/DomainStatusIcon'; +import type { DomainStatus } from '../../../src/shlink-web-component/domains/data'; +import { DomainStatusIcon } from '../../../src/shlink-web-component/domains/helpers/DomainStatusIcon'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/domains/helpers/EditDomainRedirectsModal.test.tsx b/test/domains/helpers/EditDomainRedirectsModal.test.tsx index 8173a8cea..7c703831b 100644 --- a/test/domains/helpers/EditDomainRedirectsModal.test.tsx +++ b/test/domains/helpers/EditDomainRedirectsModal.test.tsx @@ -1,7 +1,7 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import type { ShlinkDomain } from '../../../src/api/types'; -import { EditDomainRedirectsModal } from '../../../src/domains/helpers/EditDomainRedirectsModal'; +import { EditDomainRedirectsModal } from '../../../src/shlink-web-component/domains/helpers/EditDomainRedirectsModal'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/domains/reducers/domainRedirects.test.ts b/test/domains/reducers/domainRedirects.test.ts index 996e8f4ac..c51229e66 100644 --- a/test/domains/reducers/domainRedirects.test.ts +++ b/test/domains/reducers/domainRedirects.test.ts @@ -1,7 +1,7 @@ import { fromPartial } from '@total-typescript/shoehorn'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkDomainRedirects } from '../../../src/api/types'; -import { editDomainRedirects } from '../../../src/domains/reducers/domainRedirects'; +import { editDomainRedirects } from '../../../src/shlink-web-component/domains/reducers/domainRedirects'; describe('domainRedirectsReducer', () => { describe('editDomainRedirects', () => { diff --git a/test/domains/reducers/domainsList.test.ts b/test/domains/reducers/domainsList.test.ts index 95d3de2de..4392a3f57 100644 --- a/test/domains/reducers/domainsList.test.ts +++ b/test/domains/reducers/domainsList.test.ts @@ -3,14 +3,14 @@ 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 type { EditDomainRedirects } from '../../../src/domains/reducers/domainRedirects'; -import { editDomainRedirects } from '../../../src/domains/reducers/domainRedirects'; +import type { Domain } from '../../../src/shlink-web-component/domains/data'; +import type { EditDomainRedirects } from '../../../src/shlink-web-component/domains/reducers/domainRedirects'; +import { editDomainRedirects } from '../../../src/shlink-web-component/domains/reducers/domainRedirects'; import { domainsListReducerCreator, replaceRedirectsOnDomain, replaceStatusOnDomain, -} from '../../../src/domains/reducers/domainsList'; +} from '../../../src/shlink-web-component/domains/reducers/domainsList'; describe('domainsListReducer', () => { const dispatch = vi.fn(); diff --git a/test/servers/Overview.test.tsx b/test/servers/Overview.test.tsx index 9a8002ebf..e28bbf181 100644 --- a/test/servers/Overview.test.tsx +++ b/test/servers/Overview.test.tsx @@ -2,7 +2,7 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; import type { MercureInfo } from '../../src/mercure/reducers/mercureInfo'; -import { Overview as overviewCreator } from '../../src/servers/Overview'; +import { Overview as overviewCreator } from '../../src/shlink-web-component/overview/Overview'; import { prettify } from '../../src/utils/helpers/numbers'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/settings/ShortUrlsListSettings.test.tsx b/test/settings/ShortUrlsListSettings.test.tsx index 3f0ef90b6..505089098 100644 --- a/test/settings/ShortUrlsListSettings.test.tsx +++ b/test/settings/ShortUrlsListSettings.test.tsx @@ -2,7 +2,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import type { ShortUrlsListSettings as ShortUrlsSettings } from '../../src/settings/reducers/settings'; import { ShortUrlsListSettings } from '../../src/settings/ShortUrlsListSettings'; -import type { ShortUrlsOrder } from '../../src/short-urls/data'; +import type { ShortUrlsOrder } from '../../src/shlink-web-component/short-urls/data'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/settings/TagsSettings.test.tsx b/test/settings/TagsSettings.test.tsx index 0f171d0b7..529dfc3a3 100644 --- a/test/settings/TagsSettings.test.tsx +++ b/test/settings/TagsSettings.test.tsx @@ -2,7 +2,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import type { TagsSettings as TagsSettingsOptions } from '../../src/settings/reducers/settings'; import { TagsSettings } from '../../src/settings/TagsSettings'; -import type { TagsOrder } from '../../src/tags/data/TagsListChildrenProps'; +import type { TagsOrder } from '../../src/shlink-web-component/tags/data/TagsListChildrenProps'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/CreateShortUrl.test.tsx b/test/short-urls/CreateShortUrl.test.tsx index 8027f3b3d..4fc9be853 100644 --- a/test/short-urls/CreateShortUrl.test.tsx +++ b/test/short-urls/CreateShortUrl.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { CreateShortUrl as createShortUrlsCreator } from '../../src/short-urls/CreateShortUrl'; -import type { ShortUrlCreation } from '../../src/short-urls/reducers/shortUrlCreation'; +import { CreateShortUrl as createShortUrlsCreator } from '../../src/shlink-web-component/short-urls/CreateShortUrl'; +import type { ShortUrlCreation } from '../../src/shlink-web-component/short-urls/reducers/shortUrlCreation'; describe('', () => { const ShortUrlForm = () => ShortUrlForm; diff --git a/test/short-urls/EditShortUrl.test.tsx b/test/short-urls/EditShortUrl.test.tsx index 560f110ea..1f25d8921 100644 --- a/test/short-urls/EditShortUrl.test.tsx +++ b/test/short-urls/EditShortUrl.test.tsx @@ -1,9 +1,9 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; -import { EditShortUrl as createEditShortUrl } from '../../src/short-urls/EditShortUrl'; -import type { ShortUrlDetail } from '../../src/short-urls/reducers/shortUrlDetail'; -import type { ShortUrlEdition } from '../../src/short-urls/reducers/shortUrlEdition'; +import { EditShortUrl as createEditShortUrl } from '../../src/shlink-web-component/short-urls/EditShortUrl'; +import type { ShortUrlDetail } from '../../src/shlink-web-component/short-urls/reducers/shortUrlDetail'; +import type { ShortUrlEdition } from '../../src/shlink-web-component/short-urls/reducers/shortUrlEdition'; describe('', () => { const shortUrlCreation = { validateUrls: true }; diff --git a/test/short-urls/Paginator.test.tsx b/test/short-urls/Paginator.test.tsx index cde9462c8..0b6d78056 100644 --- a/test/short-urls/Paginator.test.tsx +++ b/test/short-urls/Paginator.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; import type { ShlinkPaginator } from '../../src/api/types'; -import { Paginator } from '../../src/short-urls/Paginator'; +import { Paginator } from '../../src/shlink-web-component/short-urls/Paginator'; import { ELLIPSIS } from '../../src/utils/helpers/pagination'; describe('', () => { diff --git a/test/short-urls/ShortUrlForm.test.tsx b/test/short-urls/ShortUrlForm.test.tsx index 6fa942efa..b3efdcfea 100644 --- a/test/short-urls/ShortUrlForm.test.tsx +++ b/test/short-urls/ShortUrlForm.test.tsx @@ -3,8 +3,8 @@ import type { UserEvent } from '@testing-library/user-event/setup/setup'; import { fromPartial } from '@total-typescript/shoehorn'; import { formatISO } from 'date-fns'; 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 { Mode } from '../../src/shlink-web-component/short-urls/ShortUrlForm'; +import { ShortUrlForm as createShortUrlForm } from '../../src/shlink-web-component/short-urls/ShortUrlForm'; import { parseDate } from '../../src/utils/helpers/date'; import type { OptionalString } from '../../src/utils/utils'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/short-urls/ShortUrlsFilteringBar.test.tsx b/test/short-urls/ShortUrlsFilteringBar.test.tsx index cec24dc7b..5cc7bac34 100644 --- a/test/short-urls/ShortUrlsFilteringBar.test.tsx +++ b/test/short-urls/ShortUrlsFilteringBar.test.tsx @@ -3,7 +3,7 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { endOfDay, formatISO, startOfDay } from 'date-fns'; import { MemoryRouter, useLocation, useNavigate } from 'react-router-dom'; import type { ReachableServer, SelectedServer } from '../../src/servers/data'; -import { ShortUrlsFilteringBar as filteringBarCreator } from '../../src/short-urls/ShortUrlsFilteringBar'; +import { ShortUrlsFilteringBar as filteringBarCreator } from '../../src/shlink-web-component/short-urls/ShortUrlsFilteringBar'; import { formatDate } from '../../src/utils/helpers/date'; import type { DateRange } from '../../src/utils/helpers/dateIntervals'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/short-urls/ShortUrlsList.test.tsx b/test/short-urls/ShortUrlsList.test.tsx index dd543635e..42583d638 100644 --- a/test/short-urls/ShortUrlsList.test.tsx +++ b/test/short-urls/ShortUrlsList.test.tsx @@ -3,10 +3,10 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter, useNavigate } from 'react-router-dom'; import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; import type { Settings } from '../../src/settings/reducers/settings'; -import type { 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 type { ShortUrlsOrder } from '../../src/shlink-web-component/short-urls/data'; +import type { ShortUrlsList as ShortUrlsListModel } from '../../src/shlink-web-component/short-urls/reducers/shortUrlsList'; +import { ShortUrlsList as createShortUrlsList } from '../../src/shlink-web-component/short-urls/ShortUrlsList'; +import type { ShortUrlsTableType } from '../../src/shlink-web-component/short-urls/ShortUrlsTable'; import type { SemVer } from '../../src/utils/helpers/version'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/short-urls/ShortUrlsTable.test.tsx b/test/short-urls/ShortUrlsTable.test.tsx index 27a984c5b..67320cbaa 100644 --- a/test/short-urls/ShortUrlsTable.test.tsx +++ b/test/short-urls/ShortUrlsTable.test.tsx @@ -1,10 +1,10 @@ import { fireEvent, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import type { 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 type { ShortUrlsOrderableFields } from '../../src/shlink-web-component/short-urls/data'; +import { SHORT_URLS_ORDERABLE_FIELDS } from '../../src/shlink-web-component/short-urls/data'; +import type { ShortUrlsList } from '../../src/shlink-web-component/short-urls/reducers/shortUrlsList'; +import { ShortUrlsTable as shortUrlsTableCreator } from '../../src/shlink-web-component/short-urls/ShortUrlsTable'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/UseExistingIfFoundInfoIcon.test.tsx b/test/short-urls/UseExistingIfFoundInfoIcon.test.tsx index 43d2319a6..3990d03d6 100644 --- a/test/short-urls/UseExistingIfFoundInfoIcon.test.tsx +++ b/test/short-urls/UseExistingIfFoundInfoIcon.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react'; -import { UseExistingIfFoundInfoIcon } from '../../src/short-urls/UseExistingIfFoundInfoIcon'; +import { UseExistingIfFoundInfoIcon } from '../../src/shlink-web-component/short-urls/UseExistingIfFoundInfoIcon'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/CreateShortUrlResult.test.tsx b/test/short-urls/helpers/CreateShortUrlResult.test.tsx index d06c4e92e..1fa5be264 100644 --- a/test/short-urls/helpers/CreateShortUrlResult.test.tsx +++ b/test/short-urls/helpers/CreateShortUrlResult.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { CreateShortUrlResult as createResult } from '../../../src/short-urls/helpers/CreateShortUrlResult'; -import type { ShortUrlCreation } from '../../../src/short-urls/reducers/shortUrlCreation'; +import { CreateShortUrlResult as createResult } from '../../../src/shlink-web-component/short-urls/helpers/CreateShortUrlResult'; +import type { ShortUrlCreation } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlCreation'; import type { TimeoutToggle } from '../../../src/utils/helpers/hooks'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/short-urls/helpers/DeleteShortUrlModal.test.tsx b/test/short-urls/helpers/DeleteShortUrlModal.test.tsx index c93d094a6..8845ec8a8 100644 --- a/test/short-urls/helpers/DeleteShortUrlModal.test.tsx +++ b/test/short-urls/helpers/DeleteShortUrlModal.test.tsx @@ -2,9 +2,9 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import type { InvalidShortUrlDeletion } 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 type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import { DeleteShortUrlModal } from '../../../src/shlink-web-component/short-urls/helpers/DeleteShortUrlModal'; +import type { ShortUrlDeletion } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlDeletion'; import { renderWithEvents } from '../../__helpers__/setUpTest'; import { TestModalWrapper } from '../../__helpers__/TestModalWrapper'; diff --git a/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx b/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx index 66d74e813..48d34ca89 100644 --- a/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx +++ b/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx @@ -3,8 +3,8 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; import type { ReportExporter } from '../../../src/common/services/ReportExporter'; import type { NotFoundServer, SelectedServer } from '../../../src/servers/data'; -import type { ShortUrl } from '../../../src/short-urls/data'; -import { ExportShortUrlsBtn as createExportShortUrlsBtn } from '../../../src/short-urls/helpers/ExportShortUrlsBtn'; +import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import { ExportShortUrlsBtn as createExportShortUrlsBtn } from '../../../src/shlink-web-component/short-urls/helpers/ExportShortUrlsBtn'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/QrCodeModal.test.tsx b/test/short-urls/helpers/QrCodeModal.test.tsx index f80873a85..d636f2ed3 100644 --- a/test/short-urls/helpers/QrCodeModal.test.tsx +++ b/test/short-urls/helpers/QrCodeModal.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { QrCodeModal as createQrCodeModal } from '../../../src/short-urls/helpers/QrCodeModal'; +import { QrCodeModal as createQrCodeModal } from '../../../src/shlink-web-component/short-urls/helpers/QrCodeModal'; import type { SemVer } from '../../../src/utils/helpers/version'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/short-urls/helpers/ShortUrlDetailLink.test.tsx b/test/short-urls/helpers/ShortUrlDetailLink.test.tsx index 5a8bb352e..c5f4b799a 100644 --- a/test/short-urls/helpers/ShortUrlDetailLink.test.tsx +++ b/test/short-urls/helpers/ShortUrlDetailLink.test.tsx @@ -2,9 +2,9 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; 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'; +import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import type { LinkSuffix } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlDetailLink'; +import { ShortUrlDetailLink } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlDetailLink'; describe('', () => { it.each([ diff --git a/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx b/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx index ec3276d05..e9b25cbf4 100644 --- a/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx +++ b/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx @@ -1,5 +1,5 @@ import { render, screen } from '@testing-library/react'; -import { ShortUrlFormCheckboxGroup } from '../../../src/short-urls/helpers/ShortUrlFormCheckboxGroup'; +import { ShortUrlFormCheckboxGroup } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlFormCheckboxGroup'; describe('', () => { it.each([ diff --git a/test/short-urls/helpers/ShortUrlStatus.test.tsx b/test/short-urls/helpers/ShortUrlStatus.test.tsx index 7755bfc8d..c1e39a1f1 100644 --- a/test/short-urls/helpers/ShortUrlStatus.test.tsx +++ b/test/short-urls/helpers/ShortUrlStatus.test.tsx @@ -2,8 +2,8 @@ import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { fromPartial } from '@total-typescript/shoehorn'; import type { ShlinkVisitsSummary } from '../../../src/api/types'; -import type { ShortUrl, ShortUrlMeta } from '../../../src/short-urls/data'; -import { ShortUrlStatus } from '../../../src/short-urls/helpers/ShortUrlStatus'; +import type { ShortUrl, ShortUrlMeta } from '../../../src/shlink-web-component/short-urls/data'; +import { ShortUrlStatus } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlStatus'; describe('', () => { const setUp = (shortUrl: ShortUrl) => ({ diff --git a/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx b/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx index b810fa6e6..1516fd081 100644 --- a/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx +++ b/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx @@ -1,8 +1,8 @@ import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShortUrl } from '../../../src/short-urls/data'; -import { ShortUrlVisitsCount } from '../../../src/short-urls/helpers/ShortUrlVisitsCount'; +import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import { ShortUrlVisitsCount } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlVisitsCount'; describe('', () => { const setUp = (visitsCount: number, shortUrl: ShortUrl) => ({ diff --git a/test/short-urls/helpers/ShortUrlsFilterDropdown.test.tsx b/test/short-urls/helpers/ShortUrlsFilterDropdown.test.tsx index 5861b77a7..21aecff19 100644 --- a/test/short-urls/helpers/ShortUrlsFilterDropdown.test.tsx +++ b/test/short-urls/helpers/ShortUrlsFilterDropdown.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react'; -import { ShortUrlsFilterDropdown } from '../../../src/short-urls/helpers/ShortUrlsFilterDropdown'; +import { ShortUrlsFilterDropdown } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlsFilterDropdown'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/ShortUrlsRow.test.tsx b/test/short-urls/helpers/ShortUrlsRow.test.tsx index 5c9297a50..d92a2b04e 100644 --- a/test/short-urls/helpers/ShortUrlsRow.test.tsx +++ b/test/short-urls/helpers/ShortUrlsRow.test.tsx @@ -5,8 +5,8 @@ import { last } from 'ramda'; import { MemoryRouter, useLocation } from 'react-router-dom'; import type { ReachableServer } from '../../../src/servers/data'; 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 type { ShortUrl, ShortUrlMeta } from '../../../src/shlink-web-component/short-urls/data'; +import { ShortUrlsRow as createShortUrlsRow } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlsRow'; import { now, parseDate } from '../../../src/utils/helpers/date'; import type { TimeoutToggle } from '../../../src/utils/helpers/hooks'; import type { OptionalString } from '../../../src/utils/utils'; diff --git a/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx b/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx index c78ec61bc..532669b5e 100644 --- a/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx +++ b/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx @@ -2,8 +2,8 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; 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 type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import { ShortUrlsRowMenu as createShortUrlsRowMenu } from '../../../src/shlink-web-component/short-urls/helpers/ShortUrlsRowMenu'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/short-urls/helpers/Tags.test.tsx b/test/short-urls/helpers/Tags.test.tsx index f2edd3024..697dffe76 100644 --- a/test/short-urls/helpers/Tags.test.tsx +++ b/test/short-urls/helpers/Tags.test.tsx @@ -1,5 +1,5 @@ import { render, screen } from '@testing-library/react'; -import { Tags } from '../../../src/short-urls/helpers/Tags'; +import { Tags } from '../../../src/shlink-web-component/short-urls/helpers/Tags'; import { colorGeneratorMock } from '../../utils/services/__mocks__/ColorGenerator.mock'; describe('', () => { diff --git a/test/short-urls/helpers/index.test.ts b/test/short-urls/helpers/index.test.ts index 6f2529509..b88a9441f 100644 --- a/test/short-urls/helpers/index.test.ts +++ b/test/short-urls/helpers/index.test.ts @@ -1,6 +1,6 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShortUrl } from '../../../src/short-urls/data'; -import { shortUrlDataFromShortUrl, urlDecodeShortCode, urlEncodeShortCode } from '../../../src/short-urls/helpers'; +import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import { shortUrlDataFromShortUrl, urlDecodeShortCode, urlEncodeShortCode } from '../../../src/shlink-web-component/short-urls/helpers'; describe('helpers', () => { describe('shortUrlDataFromShortUrl', () => { diff --git a/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx b/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx index 5c5f39272..48ebe6bfb 100644 --- a/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx +++ b/test/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react'; -import { QrErrorCorrectionDropdown } from '../../../../src/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown'; +import { QrErrorCorrectionDropdown } from '../../../../src/shlink-web-component/short-urls/helpers/qr-codes/QrErrorCorrectionDropdown'; import type { QrErrorCorrection } from '../../../../src/utils/helpers/qrCodes'; import { renderWithEvents } from '../../../__helpers__/setUpTest'; diff --git a/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx b/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx index 840f24eac..007b257be 100644 --- a/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx +++ b/test/short-urls/helpers/qr-codes/QrFormatDropdown.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react'; -import { QrFormatDropdown } from '../../../../src/short-urls/helpers/qr-codes/QrFormatDropdown'; +import { QrFormatDropdown } from '../../../../src/shlink-web-component/short-urls/helpers/qr-codes/QrFormatDropdown'; import type { QrCodeFormat } from '../../../../src/utils/helpers/qrCodes'; import { renderWithEvents } from '../../../__helpers__/setUpTest'; diff --git a/test/short-urls/reducers/shortUrlCreation.test.ts b/test/short-urls/reducers/shortUrlCreation.test.ts index da9c38bf2..bc50287aa 100644 --- a/test/short-urls/reducers/shortUrlCreation.test.ts +++ b/test/short-urls/reducers/shortUrlCreation.test.ts @@ -1,11 +1,11 @@ import { fromPartial } from '@total-typescript/shoehorn'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkState } from '../../../src/container/types'; -import type { ShortUrl } from '../../../src/short-urls/data'; +import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; import { createShortUrl as createShortUrlCreator, shortUrlCreationReducerCreator, -} from '../../../src/short-urls/reducers/shortUrlCreation'; +} from '../../../src/shlink-web-component/short-urls/reducers/shortUrlCreation'; describe('shortUrlCreationReducer', () => { const shortUrl = fromPartial({}); diff --git a/test/short-urls/reducers/shortUrlDeletion.test.ts b/test/short-urls/reducers/shortUrlDeletion.test.ts index 3c957d256..522478f3d 100644 --- a/test/short-urls/reducers/shortUrlDeletion.test.ts +++ b/test/short-urls/reducers/shortUrlDeletion.test.ts @@ -4,7 +4,7 @@ import type { ProblemDetailsError } from '../../../src/api/types/errors'; import { deleteShortUrl as deleteShortUrlCreator, shortUrlDeletionReducerCreator, -} from '../../../src/short-urls/reducers/shortUrlDeletion'; +} from '../../../src/shlink-web-component/short-urls/reducers/shortUrlDeletion'; describe('shortUrlDeletionReducer', () => { const deleteShortUrlCall = vi.fn(); diff --git a/test/short-urls/reducers/shortUrlDetail.test.ts b/test/short-urls/reducers/shortUrlDetail.test.ts index 34817e5d7..a3d7e5cc2 100644 --- a/test/short-urls/reducers/shortUrlDetail.test.ts +++ b/test/short-urls/reducers/shortUrlDetail.test.ts @@ -1,9 +1,9 @@ import { fromPartial } from '@total-typescript/shoehorn'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkState } from '../../../src/container/types'; -import type { ShortUrl } from '../../../src/short-urls/data'; -import { shortUrlDetailReducerCreator } from '../../../src/short-urls/reducers/shortUrlDetail'; -import type { ShortUrlsList } from '../../../src/short-urls/reducers/shortUrlsList'; +import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import { shortUrlDetailReducerCreator } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlDetail'; +import type { ShortUrlsList } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlsList'; describe('shortUrlDetailReducer', () => { const getShortUrlCall = vi.fn(); diff --git a/test/short-urls/reducers/shortUrlEdition.test.ts b/test/short-urls/reducers/shortUrlEdition.test.ts index 7adcd813a..0f624de9e 100644 --- a/test/short-urls/reducers/shortUrlEdition.test.ts +++ b/test/short-urls/reducers/shortUrlEdition.test.ts @@ -1,11 +1,11 @@ import { fromPartial } from '@total-typescript/shoehorn'; import type { ShlinkState } from '../../../src/container/types'; import type { SelectedServer } from '../../../src/servers/data'; -import type { ShortUrl } from '../../../src/short-urls/data'; +import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; import { editShortUrl as editShortUrlCreator, shortUrlEditionReducerCreator, -} from '../../../src/short-urls/reducers/shortUrlEdition'; +} from '../../../src/shlink-web-component/short-urls/reducers/shortUrlEdition'; 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 abcac9ecf..f8e1f5e65 100644 --- a/test/short-urls/reducers/shortUrlsList.test.ts +++ b/test/short-urls/reducers/shortUrlsList.test.ts @@ -1,16 +1,16 @@ import { fromPartial } from '@total-typescript/shoehorn'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkShortUrlsResponse } from '../../../src/api/types'; -import type { ShortUrl } from '../../../src/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 type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import { createShortUrl as createShortUrlCreator } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlCreation'; +import { shortUrlDeleted } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlDeletion'; +import { editShortUrl as editShortUrlCreator } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlEdition'; import { listShortUrls as listShortUrlsCreator, shortUrlsListReducerCreator, -} from '../../../src/short-urls/reducers/shortUrlsList'; -import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; -import type { CreateVisit } from '../../../src/visits/types'; +} from '../../../src/shlink-web-component/short-urls/reducers/shortUrlsList'; +import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; +import type { CreateVisit } from '../../../src/shlink-web-component/visits/types'; describe('shortUrlsListReducer', () => { const shortCode = 'abc123'; diff --git a/test/tags/TagsList.test.tsx b/test/tags/TagsList.test.tsx index d53e52d46..254aa7b12 100644 --- a/test/tags/TagsList.test.tsx +++ b/test/tags/TagsList.test.tsx @@ -2,9 +2,9 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { identity } from 'ramda'; import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -import type { TagsList } from '../../src/tags/reducers/tagsList'; -import type { TagsListProps } from '../../src/tags/TagsList'; -import { TagsList as createTagsList } from '../../src/tags/TagsList'; +import type { TagsList } from '../../src/shlink-web-component/tags/reducers/tagsList'; +import type { TagsListProps } from '../../src/shlink-web-component/tags/TagsList'; +import { TagsList as createTagsList } from '../../src/shlink-web-component/tags/TagsList'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/tags/TagsTable.test.tsx b/test/tags/TagsTable.test.tsx index ee146aeb4..a65fc49ba 100644 --- a/test/tags/TagsTable.test.tsx +++ b/test/tags/TagsTable.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { useLocation } from 'react-router-dom'; -import { TagsTable as createTagsTable } from '../../src/tags/TagsTable'; +import { TagsTable as createTagsTable } from '../../src/shlink-web-component/tags/TagsTable'; import { rangeOf } from '../../src/utils/utils'; import { renderWithEvents } from '../__helpers__/setUpTest'; diff --git a/test/tags/TagsTableRow.test.tsx b/test/tags/TagsTableRow.test.tsx index ec2c4e8a8..abe1d65ca 100644 --- a/test/tags/TagsTableRow.test.tsx +++ b/test/tags/TagsTableRow.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; -import { TagsTableRow as createTagsTableRow } from '../../src/tags/TagsTableRow'; +import { TagsTableRow as createTagsTableRow } from '../../src/shlink-web-component/tags/TagsTableRow'; import { renderWithEvents } from '../__helpers__/setUpTest'; import { colorGeneratorMock } from '../utils/services/__mocks__/ColorGenerator.mock'; diff --git a/test/tags/helpers/DeleteTagConfirmModal.test.tsx b/test/tags/helpers/DeleteTagConfirmModal.test.tsx index 03dfd732c..fc7976ec4 100644 --- a/test/tags/helpers/DeleteTagConfirmModal.test.tsx +++ b/test/tags/helpers/DeleteTagConfirmModal.test.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; -import { DeleteTagConfirmModal } from '../../../src/tags/helpers/DeleteTagConfirmModal'; -import type { TagDeletion } from '../../../src/tags/reducers/tagDelete'; +import { DeleteTagConfirmModal } from '../../../src/shlink-web-component/tags/helpers/DeleteTagConfirmModal'; +import type { TagDeletion } from '../../../src/shlink-web-component/tags/reducers/tagDelete'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/tags/helpers/EditTagModal.test.tsx b/test/tags/helpers/EditTagModal.test.tsx index 91e574887..56f9605bb 100644 --- a/test/tags/helpers/EditTagModal.test.tsx +++ b/test/tags/helpers/EditTagModal.test.tsx @@ -1,7 +1,7 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { EditTagModal as createEditTagModal } from '../../../src/tags/helpers/EditTagModal'; -import type { TagEdition } from '../../../src/tags/reducers/tagEdit'; +import { EditTagModal as createEditTagModal } from '../../../src/shlink-web-component/tags/helpers/EditTagModal'; +import type { TagEdition } from '../../../src/shlink-web-component/tags/reducers/tagEdit'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/tags/helpers/Tag.test.tsx b/test/tags/helpers/Tag.test.tsx index a90888406..2adcbc428 100644 --- a/test/tags/helpers/Tag.test.tsx +++ b/test/tags/helpers/Tag.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import type { ReactNode } from 'react'; -import { Tag } from '../../../src/tags/helpers/Tag'; +import { Tag } from '../../../src/shlink-web-component/tags/helpers/Tag'; import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; import { MAIN_COLOR } from '../../../src/utils/theme'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/test/tags/helpers/TagsSelector.test.tsx b/test/tags/helpers/TagsSelector.test.tsx index 08bb3058f..822edf700 100644 --- a/test/tags/helpers/TagsSelector.test.tsx +++ b/test/tags/helpers/TagsSelector.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { TagsSelector as createTagsSelector } from '../../../src/tags/helpers/TagsSelector'; -import type { TagsList } from '../../../src/tags/reducers/tagsList'; +import { TagsSelector as createTagsSelector } from '../../../src/shlink-web-component/tags/helpers/TagsSelector'; +import type { TagsList } from '../../../src/shlink-web-component/tags/reducers/tagsList'; import { renderWithEvents } from '../../__helpers__/setUpTest'; import { colorGeneratorMock } from '../../utils/services/__mocks__/ColorGenerator.mock'; diff --git a/test/tags/reducers/tagDelete.test.ts b/test/tags/reducers/tagDelete.test.ts index eda74d294..a126bd1ef 100644 --- a/test/tags/reducers/tagDelete.test.ts +++ b/test/tags/reducers/tagDelete.test.ts @@ -1,7 +1,7 @@ import { fromPartial } from '@total-typescript/shoehorn'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkState } from '../../../src/container/types'; -import { tagDeleted, tagDeleteReducerCreator } from '../../../src/tags/reducers/tagDelete'; +import { tagDeleted, tagDeleteReducerCreator } from '../../../src/shlink-web-component/tags/reducers/tagDelete'; describe('tagDeleteReducer', () => { const deleteTagsCall = vi.fn(); diff --git a/test/tags/reducers/tagEdit.test.ts b/test/tags/reducers/tagEdit.test.ts index 8e901c4c2..25dd8ec85 100644 --- a/test/tags/reducers/tagEdit.test.ts +++ b/test/tags/reducers/tagEdit.test.ts @@ -1,7 +1,7 @@ import { fromPartial } from '@total-typescript/shoehorn'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkState } from '../../../src/container/types'; -import { editTag as editTagCreator, tagEdited, tagEditReducerCreator } from '../../../src/tags/reducers/tagEdit'; +import { editTag as editTagCreator, tagEdited, tagEditReducerCreator } from '../../../src/shlink-web-component/tags/reducers/tagEdit'; import type { ColorGenerator } from '../../../src/utils/services/ColorGenerator'; describe('tagEditReducer', () => { diff --git a/test/tags/reducers/tagsList.test.ts b/test/tags/reducers/tagsList.test.ts index 7e081e48b..be2af8233 100644 --- a/test/tags/reducers/tagsList.test.ts +++ b/test/tags/reducers/tagsList.test.ts @@ -1,18 +1,18 @@ import { fromPartial } from '@total-typescript/shoehorn'; import type { ShlinkState } from '../../../src/container/types'; -import type { ShortUrl } from '../../../src/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 { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import { createShortUrl as createShortUrlCreator } from '../../../src/shlink-web-component/short-urls/reducers/shortUrlCreation'; +import { tagDeleted } from '../../../src/shlink-web-component/tags/reducers/tagDelete'; +import { tagEdited } from '../../../src/shlink-web-component/tags/reducers/tagEdit'; import type { - TagsList } from '../../../src/tags/reducers/tagsList'; + TagsList } from '../../../src/shlink-web-component/tags/reducers/tagsList'; import { filterTags, listTags as listTagsCreator, tagsListReducerCreator, -} from '../../../src/tags/reducers/tagsList'; -import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; -import type { CreateVisit } from '../../../src/visits/types'; +} from '../../../src/shlink-web-component/tags/reducers/tagsList'; +import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; +import type { CreateVisit } from '../../../src/shlink-web-component/visits/types'; describe('tagsListReducer', () => { const state = (props: Partial) => fromPartial(props); diff --git a/test/visits/DomainVisits.test.tsx b/test/visits/DomainVisits.test.tsx index b87f29d66..e62ffbf83 100644 --- a/test/visits/DomainVisits.test.tsx +++ b/test/visits/DomainVisits.test.tsx @@ -3,8 +3,8 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { formatISO } from 'date-fns'; import { MemoryRouter } from 'react-router-dom'; import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -import { DomainVisits as createDomainVisits } from '../../src/visits/DomainVisits'; -import type { DomainVisits } from '../../src/visits/reducers/domainVisits'; +import { DomainVisits as createDomainVisits } from '../../src/shlink-web-component/visits/DomainVisits'; +import type { DomainVisits } from '../../src/shlink-web-component/visits/reducers/domainVisits'; import { renderWithEvents } from '../__helpers__/setUpTest'; vi.mock('react-router-dom', async () => ({ diff --git a/test/visits/NonOrphanVisits.test.tsx b/test/visits/NonOrphanVisits.test.tsx index fb024b521..91a5237d8 100644 --- a/test/visits/NonOrphanVisits.test.tsx +++ b/test/visits/NonOrphanVisits.test.tsx @@ -3,8 +3,8 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { formatISO } from 'date-fns'; import { MemoryRouter } from 'react-router-dom'; import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -import { NonOrphanVisits as createNonOrphanVisits } from '../../src/visits/NonOrphanVisits'; -import type { VisitsInfo } from '../../src/visits/reducers/types'; +import { NonOrphanVisits as createNonOrphanVisits } from '../../src/shlink-web-component/visits/NonOrphanVisits'; +import type { VisitsInfo } from '../../src/shlink-web-component/visits/reducers/types'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/OrphanVisits.test.tsx b/test/visits/OrphanVisits.test.tsx index 53bad3362..f1c8f6737 100644 --- a/test/visits/OrphanVisits.test.tsx +++ b/test/visits/OrphanVisits.test.tsx @@ -3,8 +3,8 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { formatISO } from 'date-fns'; import { MemoryRouter } from 'react-router-dom'; import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -import { OrphanVisits as createOrphanVisits } from '../../src/visits/OrphanVisits'; -import type { VisitsInfo } from '../../src/visits/reducers/types'; +import { OrphanVisits as createOrphanVisits } from '../../src/shlink-web-component/visits/OrphanVisits'; +import type { VisitsInfo } from '../../src/shlink-web-component/visits/reducers/types'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/ShortUrlVisits.test.tsx b/test/visits/ShortUrlVisits.test.tsx index cf6014a9a..6d6fc2f13 100644 --- a/test/visits/ShortUrlVisits.test.tsx +++ b/test/visits/ShortUrlVisits.test.tsx @@ -4,9 +4,9 @@ import { formatISO } from 'date-fns'; import { identity } from 'ramda'; import { MemoryRouter } from 'react-router-dom'; import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -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/shlink-web-component/visits/reducers/shortUrlVisits'; +import type { ShortUrlVisitsProps } from '../../src/shlink-web-component/visits/ShortUrlVisits'; +import { ShortUrlVisits as createShortUrlVisits } from '../../src/shlink-web-component/visits/ShortUrlVisits'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/ShortUrlVisitsHeader.test.tsx b/test/visits/ShortUrlVisitsHeader.test.tsx index 12863cee1..1bec8b2ab 100644 --- a/test/visits/ShortUrlVisitsHeader.test.tsx +++ b/test/visits/ShortUrlVisitsHeader.test.tsx @@ -1,9 +1,9 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { formatDistance, parseISO } from 'date-fns'; -import type { ShortUrlDetail } from '../../src/short-urls/reducers/shortUrlDetail'; -import type { ShortUrlVisits } from '../../src/visits/reducers/shortUrlVisits'; -import { ShortUrlVisitsHeader } from '../../src/visits/ShortUrlVisitsHeader'; +import type { ShortUrlDetail } from '../../src/shlink-web-component/short-urls/reducers/shortUrlDetail'; +import type { ShortUrlVisits } from '../../src/shlink-web-component/visits/reducers/shortUrlVisits'; +import { ShortUrlVisitsHeader } from '../../src/shlink-web-component/visits/ShortUrlVisitsHeader'; import { renderWithEvents } from '../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/TagVisits.test.tsx b/test/visits/TagVisits.test.tsx index 72b28df32..df153872c 100644 --- a/test/visits/TagVisits.test.tsx +++ b/test/visits/TagVisits.test.tsx @@ -3,9 +3,9 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { formatISO } from 'date-fns'; import { MemoryRouter } from 'react-router'; import type { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; -import type { TagVisits as TagVisitsStats } from '../../src/visits/reducers/tagVisits'; -import type { TagVisitsProps } from '../../src/visits/TagVisits'; -import { TagVisits as createTagVisits } from '../../src/visits/TagVisits'; +import type { TagVisits as TagVisitsStats } from '../../src/shlink-web-component/visits/reducers/tagVisits'; +import type { TagVisitsProps } from '../../src/shlink-web-component/visits/TagVisits'; +import { TagVisits as createTagVisits } from '../../src/shlink-web-component/visits/TagVisits'; import { renderWithEvents } from '../__helpers__/setUpTest'; vi.mock('react-router-dom', async () => ({ diff --git a/test/visits/TagVisitsHeader.test.tsx b/test/visits/TagVisitsHeader.test.tsx index 6c936c446..1835148d2 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 { fromPartial } from '@total-typescript/shoehorn'; +import type { TagVisits } from '../../src/shlink-web-component/visits/reducers/tagVisits'; +import { TagVisitsHeader } from '../../src/shlink-web-component/visits/TagVisitsHeader'; import type { ColorGenerator } from '../../src/utils/services/ColorGenerator'; -import type { TagVisits } from '../../src/visits/reducers/tagVisits'; -import { TagVisitsHeader } from '../../src/visits/TagVisitsHeader'; describe('', () => { const tagVisits = fromPartial({ diff --git a/test/visits/VisitsHeader.test.tsx b/test/visits/VisitsHeader.test.tsx index b2131af34..ae5951c50 100644 --- a/test/visits/VisitsHeader.test.tsx +++ b/test/visits/VisitsHeader.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import type { Visit } from '../../src/visits/types'; -import { VisitsHeader } from '../../src/visits/VisitsHeader'; +import type { Visit } from '../../src/shlink-web-component/visits/types'; +import { VisitsHeader } from '../../src/shlink-web-component/visits/VisitsHeader'; describe('', () => { const visits: Visit[] = [fromPartial({}), fromPartial({}), fromPartial({})]; diff --git a/test/visits/VisitsStats.test.tsx b/test/visits/VisitsStats.test.tsx index f5ce5702b..07d42df1d 100644 --- a/test/visits/VisitsStats.test.tsx +++ b/test/visits/VisitsStats.test.tsx @@ -2,10 +2,10 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { createMemoryHistory } from 'history'; import { Router } from 'react-router-dom'; +import type { VisitsInfo } from '../../src/shlink-web-component/visits/reducers/types'; +import type { Visit } from '../../src/shlink-web-component/visits/types'; +import { VisitsStats } from '../../src/shlink-web-component/visits/VisitsStats'; import { 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('', () => { diff --git a/test/visits/VisitsTable.test.tsx b/test/visits/VisitsTable.test.tsx index 902a87e99..003edef8d 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 { fromPartial } from '@total-typescript/shoehorn'; +import type { NormalizedVisit } from '../../src/shlink-web-component/visits/types'; +import type { VisitsTableProps } from '../../src/shlink-web-component/visits/VisitsTable'; +import { VisitsTable } from '../../src/shlink-web-component/visits/VisitsTable'; import { 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 185bd023e..d41c53ee8 100644 --- a/test/visits/charts/ChartCard.test.tsx +++ b/test/visits/charts/ChartCard.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; import type { ReactNode } from 'react'; -import { ChartCard } from '../../../src/visits/charts/ChartCard'; +import { ChartCard } from '../../../src/shlink-web-component/visits/charts/ChartCard'; describe('', () => { const setUp = (title: Function | string = '', footer?: ReactNode) => render( diff --git a/test/visits/charts/DoughnutChart.test.tsx b/test/visits/charts/DoughnutChart.test.tsx index 2dee81639..d428836e7 100644 --- a/test/visits/charts/DoughnutChart.test.tsx +++ b/test/visits/charts/DoughnutChart.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react'; -import { DoughnutChart } from '../../../src/visits/charts/DoughnutChart'; +import { DoughnutChart } from '../../../src/shlink-web-component/visits/charts/DoughnutChart'; import { setUpCanvas } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/charts/DoughnutChartLegend.test.tsx b/test/visits/charts/DoughnutChartLegend.test.tsx index 27cac2051..af126b90d 100644 --- a/test/visits/charts/DoughnutChartLegend.test.tsx +++ b/test/visits/charts/DoughnutChartLegend.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import type { Chart, ChartDataset } from 'chart.js'; -import { DoughnutChartLegend } from '../../../src/visits/charts/DoughnutChartLegend'; +import { DoughnutChartLegend } from '../../../src/shlink-web-component/visits/charts/DoughnutChartLegend'; describe('', () => { const labels = ['foo', 'bar', 'baz', 'foo2', 'bar2']; diff --git a/test/visits/charts/HorizontalBarChart.test.tsx b/test/visits/charts/HorizontalBarChart.test.tsx index 1ab151777..11328825b 100644 --- a/test/visits/charts/HorizontalBarChart.test.tsx +++ b/test/visits/charts/HorizontalBarChart.test.tsx @@ -1,5 +1,5 @@ -import type { HorizontalBarChartProps } from '../../../src/visits/charts/HorizontalBarChart'; -import { HorizontalBarChart } from '../../../src/visits/charts/HorizontalBarChart'; +import type { HorizontalBarChartProps } from '../../../src/shlink-web-component/visits/charts/HorizontalBarChart'; +import { HorizontalBarChart } from '../../../src/shlink-web-component/visits/charts/HorizontalBarChart'; import { setUpCanvas } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/charts/LineChartCard.test.tsx b/test/visits/charts/LineChartCard.test.tsx index 64f3af528..b78015176 100644 --- a/test/visits/charts/LineChartCard.test.tsx +++ b/test/visits/charts/LineChartCard.test.tsx @@ -2,8 +2,8 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { fromPartial } from '@total-typescript/shoehorn'; import { formatISO, subDays, subMonths, subYears } from 'date-fns'; -import { LineChartCard } from '../../../src/visits/charts/LineChartCard'; -import type { NormalizedVisit } from '../../../src/visits/types'; +import { LineChartCard } from '../../../src/shlink-web-component/visits/charts/LineChartCard'; +import type { NormalizedVisit } from '../../../src/shlink-web-component/visits/types'; import { setUpCanvas } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/charts/SortableBarChartCard.test.tsx b/test/visits/charts/SortableBarChartCard.test.tsx index b6bc0a6fc..fd51ae6e7 100644 --- a/test/visits/charts/SortableBarChartCard.test.tsx +++ b/test/visits/charts/SortableBarChartCard.test.tsx @@ -1,9 +1,9 @@ import { screen } from '@testing-library/react'; import { range } from 'ramda'; import type { ReactNode } from 'react'; +import { SortableBarChartCard } from '../../../src/shlink-web-component/visits/charts/SortableBarChartCard'; +import type { Stats } from '../../../src/shlink-web-component/visits/types'; import { rangeOf } from '../../../src/utils/utils'; -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/MapModal.test.tsx b/test/visits/helpers/MapModal.test.tsx index cad21269c..066dac6c8 100644 --- a/test/visits/helpers/MapModal.test.tsx +++ b/test/visits/helpers/MapModal.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; -import { MapModal } from '../../../src/visits/helpers/MapModal'; -import type { CityStats } from '../../../src/visits/types'; +import { MapModal } from '../../../src/shlink-web-component/visits/helpers/MapModal'; +import type { CityStats } from '../../../src/shlink-web-component/visits/types'; describe('', () => { const toggle = vi.fn(); diff --git a/test/visits/helpers/OpenMapModalBtn.test.tsx b/test/visits/helpers/OpenMapModalBtn.test.tsx index 91a69f7bb..ad9c00835 100644 --- a/test/visits/helpers/OpenMapModalBtn.test.tsx +++ b/test/visits/helpers/OpenMapModalBtn.test.tsx @@ -1,7 +1,7 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import { OpenMapModalBtn } from '../../../src/visits/helpers/OpenMapModalBtn'; -import type { CityStats } from '../../../src/visits/types'; +import { OpenMapModalBtn } from '../../../src/shlink-web-component/visits/helpers/OpenMapModalBtn'; +import type { CityStats } from '../../../src/shlink-web-component/visits/types'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/helpers/VisitsFilterDropdown.test.tsx b/test/visits/helpers/VisitsFilterDropdown.test.tsx index 113e0d666..380177f5b 100644 --- a/test/visits/helpers/VisitsFilterDropdown.test.tsx +++ b/test/visits/helpers/VisitsFilterDropdown.test.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; -import { VisitsFilterDropdown } from '../../../src/visits/helpers/VisitsFilterDropdown'; -import type { OrphanVisitType, VisitsFilter } from '../../../src/visits/types'; +import { VisitsFilterDropdown } from '../../../src/shlink-web-component/visits/helpers/VisitsFilterDropdown'; +import type { OrphanVisitType, VisitsFilter } from '../../../src/shlink-web-component/visits/types'; import { renderWithEvents } from '../../__helpers__/setUpTest'; describe('', () => { diff --git a/test/visits/reducers/domainVisits.test.ts b/test/visits/reducers/domainVisits.test.ts index 3c434bc64..dbf7e3d8f 100644 --- a/test/visits/reducers/domainVisits.test.ts +++ b/test/visits/reducers/domainVisits.test.ts @@ -3,20 +3,20 @@ import { addDays, formatISO, subDays } from 'date-fns'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkVisits } from '../../../src/api/types'; import type { ShlinkState } from '../../../src/container/types'; -import type { ShortUrl } from '../../../src/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 { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; import type { DomainVisits, LoadDomainVisits, -} from '../../../src/visits/reducers/domainVisits'; +} from '../../../src/shlink-web-component/visits/reducers/domainVisits'; import { DEFAULT_DOMAIN, domainVisitsReducerCreator, getDomainVisits as getDomainVisitsCreator, -} from '../../../src/visits/reducers/domainVisits'; -import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; -import type { Visit } from '../../../src/visits/types'; +} from '../../../src/shlink-web-component/visits/reducers/domainVisits'; +import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; +import type { Visit } from '../../../src/shlink-web-component/visits/types'; +import { formatIsoDate } from '../../../src/utils/helpers/date'; +import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; +import { rangeOf } from '../../../src/utils/utils'; describe('domainVisitsReducer', () => { const now = new Date(); diff --git a/test/visits/reducers/nonOrphanVisits.test.ts b/test/visits/reducers/nonOrphanVisits.test.ts index 82c43924a..462e25e6d 100644 --- a/test/visits/reducers/nonOrphanVisits.test.ts +++ b/test/visits/reducers/nonOrphanVisits.test.ts @@ -3,16 +3,16 @@ import { addDays, formatISO, subDays } from 'date-fns'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkVisits } from '../../../src/api/types'; import type { ShlinkState } from '../../../src/container/types'; -import { 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 type { VisitsInfo } from '../../../src/visits/reducers/types'; -import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; -import type { Visit } from '../../../src/visits/types'; +} from '../../../src/shlink-web-component/visits/reducers/nonOrphanVisits'; +import type { VisitsInfo } from '../../../src/shlink-web-component/visits/reducers/types'; +import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; +import type { Visit } from '../../../src/shlink-web-component/visits/types'; +import { formatIsoDate } from '../../../src/utils/helpers/date'; +import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; +import { rangeOf } from '../../../src/utils/utils'; describe('nonOrphanVisitsReducer', () => { const now = new Date(); diff --git a/test/visits/reducers/orphanVisits.test.ts b/test/visits/reducers/orphanVisits.test.ts index 9a8b5eec0..6dc989488 100644 --- a/test/visits/reducers/orphanVisits.test.ts +++ b/test/visits/reducers/orphanVisits.test.ts @@ -3,16 +3,16 @@ import { addDays, formatISO, subDays } from 'date-fns'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkVisits } from '../../../src/api/types'; import type { ShlinkState } from '../../../src/container/types'; -import { 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 type { VisitsInfo } from '../../../src/visits/reducers/types'; -import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; -import type { Visit } from '../../../src/visits/types'; +} from '../../../src/shlink-web-component/visits/reducers/orphanVisits'; +import type { VisitsInfo } from '../../../src/shlink-web-component/visits/reducers/types'; +import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; +import type { Visit } from '../../../src/shlink-web-component/visits/types'; +import { formatIsoDate } from '../../../src/utils/helpers/date'; +import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; +import { rangeOf } from '../../../src/utils/utils'; describe('orphanVisitsReducer', () => { const now = new Date(); diff --git a/test/visits/reducers/shortUrlVisits.test.ts b/test/visits/reducers/shortUrlVisits.test.ts index 0c87e5a3c..4bfcd4b15 100644 --- a/test/visits/reducers/shortUrlVisits.test.ts +++ b/test/visits/reducers/shortUrlVisits.test.ts @@ -3,17 +3,17 @@ import { addDays, formatISO, subDays } from 'date-fns'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkVisits } from '../../../src/api/types'; import type { ShlinkState } from '../../../src/container/types'; -import { 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'; + ShortUrlVisits } from '../../../src/shlink-web-component/visits/reducers/shortUrlVisits'; import { getShortUrlVisits as getShortUrlVisitsCreator, shortUrlVisitsReducerCreator, -} from '../../../src/visits/reducers/shortUrlVisits'; -import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; -import type { Visit } from '../../../src/visits/types'; +} from '../../../src/shlink-web-component/visits/reducers/shortUrlVisits'; +import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; +import type { Visit } from '../../../src/shlink-web-component/visits/types'; +import { formatIsoDate } from '../../../src/utils/helpers/date'; +import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; +import { rangeOf } from '../../../src/utils/utils'; describe('shortUrlVisitsReducer', () => { const now = new Date(); diff --git a/test/visits/reducers/tagVisits.test.ts b/test/visits/reducers/tagVisits.test.ts index a89804a6c..439f91199 100644 --- a/test/visits/reducers/tagVisits.test.ts +++ b/test/visits/reducers/tagVisits.test.ts @@ -3,17 +3,17 @@ import { addDays, formatISO, subDays } from 'date-fns'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkVisits } from '../../../src/api/types'; import type { ShlinkState } from '../../../src/container/types'; -import { 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'; + TagVisits } from '../../../src/shlink-web-component/visits/reducers/tagVisits'; import { getTagVisits as getTagVisitsCreator, tagVisitsReducerCreator, -} from '../../../src/visits/reducers/tagVisits'; -import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; -import type { Visit } from '../../../src/visits/types'; +} from '../../../src/shlink-web-component/visits/reducers/tagVisits'; +import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; +import type { Visit } from '../../../src/shlink-web-component/visits/types'; +import { formatIsoDate } from '../../../src/utils/helpers/date'; +import type { DateInterval } from '../../../src/utils/helpers/dateIntervals'; +import { rangeOf } from '../../../src/utils/utils'; describe('tagVisitsReducer', () => { const now = new Date(); diff --git a/test/visits/reducers/visitCreation.test.ts b/test/visits/reducers/visitCreation.test.ts index 30dbf7e71..50916b6b1 100644 --- a/test/visits/reducers/visitCreation.test.ts +++ b/test/visits/reducers/visitCreation.test.ts @@ -1,7 +1,7 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShortUrl } from '../../../src/short-urls/data'; -import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; -import type { Visit } from '../../../src/visits/types'; +import type { ShortUrl } from '../../../src/shlink-web-component/short-urls/data'; +import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; +import type { Visit } from '../../../src/shlink-web-component/visits/types'; describe('visitCreationReducer', () => { describe('createNewVisits', () => { diff --git a/test/visits/reducers/visitsOverview.test.ts b/test/visits/reducers/visitsOverview.test.ts index 29806a7f9..5f31424a3 100644 --- a/test/visits/reducers/visitsOverview.test.ts +++ b/test/visits/reducers/visitsOverview.test.ts @@ -2,16 +2,16 @@ import { fromPartial } from '@total-typescript/shoehorn'; import type { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { ShlinkVisitsOverview } from '../../../src/api/types'; import type { ShlinkState } from '../../../src/container/types'; -import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; +import { createNewVisits } from '../../../src/shlink-web-component/visits/reducers/visitCreation'; import type { PartialVisitsSummary, VisitsOverview, -} from '../../../src/visits/reducers/visitsOverview'; +} from '../../../src/shlink-web-component/visits/reducers/visitsOverview'; import { loadVisitsOverview as loadVisitsOverviewCreator, visitsOverviewReducerCreator, -} from '../../../src/visits/reducers/visitsOverview'; -import type { OrphanVisit } from '../../../src/visits/types'; +} from '../../../src/shlink-web-component/visits/reducers/visitsOverview'; +import type { OrphanVisit } from '../../../src/shlink-web-component/visits/types'; describe('visitsOverviewReducer', () => { const getVisitsOverview = vi.fn(); diff --git a/test/visits/services/VisitsParser.test.ts b/test/visits/services/VisitsParser.test.ts index 6797601ff..90eefc488 100644 --- a/test/visits/services/VisitsParser.test.ts +++ b/test/visits/services/VisitsParser.test.ts @@ -1,6 +1,6 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import { normalizeVisits, processStatsFromVisits } from '../../../src/visits/services/VisitsParser'; -import type { OrphanVisit, Visit, VisitsStats } from '../../../src/visits/types'; +import { normalizeVisits, processStatsFromVisits } from '../../../src/shlink-web-component/visits/services/VisitsParser'; +import type { OrphanVisit, Visit, VisitsStats } from '../../../src/shlink-web-component/visits/types'; describe('VisitsParser', () => { const visits: Visit[] = [ diff --git a/test/visits/types/helpers.test.ts b/test/visits/types/helpers.test.ts index 9d9aaf944..15dd1c614 100644 --- a/test/visits/types/helpers.test.ts +++ b/test/visits/types/helpers.test.ts @@ -1,9 +1,9 @@ import { fromPartial } from '@total-typescript/shoehorn'; import type { ShlinkVisitsParams } from '../../../src/api/types'; +import type { CreateVisit, OrphanVisit, VisitsParams } from '../../../src/shlink-web-component/visits/types'; +import type { GroupedNewVisits } from '../../../src/shlink-web-component/visits/types/helpers'; +import { groupNewVisitsByType, toApiParams } from '../../../src/shlink-web-component/visits/types/helpers'; import { formatIsoDate, parseDate } from '../../../src/utils/helpers/date'; -import type { CreateVisit, OrphanVisit, 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', () => { From 682de08204c75184df50ff1e5cbfad86edeb8086 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 16 Jul 2023 22:54:49 +0200 Subject: [PATCH 007/268] Extract initial Shlink logic to ShlinkWebComponent --- src/common/AsideMenu.tsx | 10 +-- src/common/MenuLayout.tsx | 64 ++------------- src/common/reducers/sidebar.ts | 4 + src/common/services/provideServices.ts | 17 +--- src/container/index.ts | 4 + .../ShlinkWebComponent.tsx | 78 +++++++++++++++++++ src/shlink-web-component/container/index.ts | 22 ++++++ .../domains/helpers/DomainDropdown.tsx | 6 +- src/shlink-web-component/index.ts | 1 + .../overview/Overview.tsx | 4 +- .../short-urls/CreateShortUrl.tsx | 4 - .../short-urls/EditShortUrl.tsx | 4 - .../short-urls/ShortUrlForm.tsx | 10 +-- .../short-urls/ShortUrlsFilteringBar.tsx | 10 +-- .../short-urls/ShortUrlsList.tsx | 5 +- .../short-urls/helpers/QrCodeModal.tsx | 17 ++-- .../short-urls/services/provideServices.ts | 6 +- .../tags/reducers/tagsList.ts | 7 +- src/shlink-web-component/utils/features.ts | 50 ++++++++++++ src/utils/helpers/features.ts | 31 -------- 20 files changed, 197 insertions(+), 157 deletions(-) create mode 100644 src/shlink-web-component/ShlinkWebComponent.tsx create mode 100644 src/shlink-web-component/container/index.ts create mode 100644 src/shlink-web-component/index.ts create mode 100644 src/shlink-web-component/utils/features.ts delete mode 100644 src/utils/helpers/features.ts diff --git a/src/common/AsideMenu.tsx b/src/common/AsideMenu.tsx index abd878661..bdbc3f14d 100644 --- a/src/common/AsideMenu.tsx +++ b/src/common/AsideMenu.tsx @@ -10,12 +10,10 @@ import classNames from 'classnames'; import type { FC } from 'react'; import type { NavLinkProps } from 'react-router-dom'; import { NavLink, useLocation } from 'react-router-dom'; -import type { SelectedServer } from '../servers/data'; -import { isServerWithId } from '../servers/data'; import './AsideMenu.scss'; export interface AsideMenuProps { - selectedServer: SelectedServer; + routePrefix: string; showOnMobile?: boolean; } @@ -34,14 +32,12 @@ const AsideMenuItem: FC = ({ children, to, className, ...res ); -export const AsideMenu: FC = ({ selectedServer, showOnMobile = false }) => { - const hasId = isServerWithId(selectedServer); - const serverId = hasId ? selectedServer.id : ''; +export const AsideMenu: FC = ({ routePrefix, showOnMobile = false }) => { const { pathname } = useLocation(); const asideClass = classNames('aside-menu', { 'aside-menu--hidden': !showOnMobile, }); - const buildPath = (suffix: string) => `/server/${serverId}${suffix}`; + const buildPath = (suffix: string) => `${routePrefix}${suffix}`; return (