diff --git a/CHANGELOG.md b/CHANGELOG.md index 56e8a16b..8df47f8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] ### Added -* [#671](https://github.com/shlinkio/shlink-web-client/pull/671) Added proper color-scheme in root element based on selected theme. +* [#671](https://github.com/shlinkio/shlink-web-client/issues/671) Added proper color-scheme in root element based on selected theme. ### Changed -* [#688](https://github.com/shlinkio/shlink-web-client/pull/688) Finalized migration from enzyme to react-testing-library. +* [#688](https://github.com/shlinkio/shlink-web-client/issues/688) Finalized migration from enzyme to react-testing-library. ### Deprecated * *Nothing* @@ -18,7 +18,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * *Nothing* ### Fixed -* [#695](https://github.com/shlinkio/shlink-web-client/pull/695) Fixed some warnings in tests. +* [#695](https://github.com/shlinkio/shlink-web-client/issues/695) Fixed some warnings in tests. +* [#693](https://github.com/shlinkio/shlink-web-client/issues/693) Fixed tags, servers and domains search to make it case-insensitive. ## [3.7.1] - 2022-05-25 @@ -26,7 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * *Nothing* ### Changed -* [#648](https://github.com/shlinkio/shlink-web-client/pull/648) Migrated some scripts to ESM and updated to chalk 5. +* [#648](https://github.com/shlinkio/shlink-web-client/issues/648) Migrated some scripts to ESM and updated to chalk 5. ### Deprecated * *Nothing* @@ -35,30 +36,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * *Nothing* ### Fixed -* [#653](https://github.com/shlinkio/shlink-web-client/pull/653) Fixed rendering values greater than 1000 in charts, when the browser has certain locales configured. +* [#653](https://github.com/shlinkio/shlink-web-client/issues/653) Fixed rendering values greater than 1000 in charts, when the browser has certain locales configured. ## [3.7.0] - 2022-05-14 ### Added -* [#622](https://github.com/shlinkio/shlink-web-client/pull/622) Added support to load domain visits when consuming Shlink 3.1.0 or newer. -* [#582](https://github.com/shlinkio/shlink-web-client/pull/582) Improved filtering short URLs by tag. +* [#622](https://github.com/shlinkio/shlink-web-client/issues/622) Added support to load domain visits when consuming Shlink 3.1.0 or newer. +* [#582](https://github.com/shlinkio/shlink-web-client/issues/582) Improved filtering short URLs by tag. Now, a new full tags selector component is available, which allows selecting any of the existing tags and also composes a toggle to filter by "any" tag or "all" tags. ### Changed -* [#616](https://github.com/shlinkio/shlink-web-client/pull/616) Updated to React 18. -* [#595](https://github.com/shlinkio/shlink-web-client/pull/595) Updated to react-chartjs-2 v4.1.0. -* [#594](https://github.com/shlinkio/shlink-web-client/pull/594) Updated to a new coding standard. -* [#627](https://github.com/shlinkio/shlink-web-client/pull/627) Updated to Jest 28. -* [#603](https://github.com/shlinkio/shlink-web-client/pull/603) Migrated to new and maintained dependencies to parse CSV<->JSON. -* [#610](https://github.com/shlinkio/shlink-web-client/pull/610) Migrated to a maintained coding style for CSS. -* [#619](https://github.com/shlinkio/shlink-web-client/pull/619) Introduced react testing library, to progressively replace enzyme. +* [#616](https://github.com/shlinkio/shlink-web-client/issues/616) Updated to React 18. +* [#595](https://github.com/shlinkio/shlink-web-client/issues/595) Updated to react-chartjs-2 v4.1.0. +* [#594](https://github.com/shlinkio/shlink-web-client/issues/594) Updated to a new coding standard. +* [#627](https://github.com/shlinkio/shlink-web-client/issues/627) Updated to Jest 28. +* [#603](https://github.com/shlinkio/shlink-web-client/issues/603) Migrated to new and maintained dependencies to parse CSV<->JSON. +* [#610](https://github.com/shlinkio/shlink-web-client/issues/610) Migrated to a maintained coding style for CSS. +* [#619](https://github.com/shlinkio/shlink-web-client/issues/619) Introduced react testing library, to progressively replace enzyme. ### Deprecated * *Nothing* ### Removed -* [#623](https://github.com/shlinkio/shlink-web-client/pull/623) Dropped support for Shlink older than 2.6.0. +* [#623](https://github.com/shlinkio/shlink-web-client/issues/623) Dropped support for Shlink older than 2.6.0. ### Fixed * *Nothing* @@ -66,19 +67,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [3.6.0] - 2022-03-17 ### Added -* [#558](https://github.com/shlinkio/shlink-web-client/pull/558) Added dark text for tags where the generated background is too light, improving its legibility. -* [#570](https://github.com/shlinkio/shlink-web-client/pull/570) Added new section to load non-orphan visits all together when consuming Shlink 3.0.0. -* [#556](https://github.com/shlinkio/shlink-web-client/pull/556) Added support to filter short URLs list by "all" tags when consuming Shlink 3.0.0. -* [#549](https://github.com/shlinkio/shlink-web-client/pull/549) Allowed to export the list of short URLs as CSV. +* [#558](https://github.com/shlinkio/shlink-web-client/issues/558) Added dark text for tags where the generated background is too light, improving its legibility. +* [#570](https://github.com/shlinkio/shlink-web-client/issues/570) Added new section to load non-orphan visits all together when consuming Shlink 3.0.0. +* [#556](https://github.com/shlinkio/shlink-web-client/issues/556) Added support to filter short URLs list by "all" tags when consuming Shlink 3.0.0. +* [#549](https://github.com/shlinkio/shlink-web-client/issues/549) Allowed to export the list of short URLs as CSV. ### Changed -* [#543](https://github.com/shlinkio/shlink-web-client/pull/543) Redesigned settings section. -* [#567](https://github.com/shlinkio/shlink-web-client/pull/567) Improved Shlink 3.0.0 compatibility by checking the `INVALID_SHORT_URL_DELETION` error code when deleting short URLs. -* [#448](https://github.com/shlinkio/shlink-web-client/pull/448) Updated to bootstrap v5. -* [#524](https://github.com/shlinkio/shlink-web-client/pull/524) Updated to react-router v6. -* [#576](https://github.com/shlinkio/shlink-web-client/pull/576) Updated to fontawesome v6. -* [#579](https://github.com/shlinkio/shlink-web-client/pull/579) Replaced react-color with react-colorful. -* [#564](https://github.com/shlinkio/shlink-web-client/pull/564) Updated most of the dependencies. +* [#543](https://github.com/shlinkio/shlink-web-client/issues/543) Redesigned settings section. +* [#567](https://github.com/shlinkio/shlink-web-client/issues/567) Improved Shlink 3.0.0 compatibility by checking the `INVALID_SHORT_URL_DELETION` error code when deleting short URLs. +* [#448](https://github.com/shlinkio/shlink-web-client/issues/448) Updated to bootstrap v5. +* [#524](https://github.com/shlinkio/shlink-web-client/issues/524) Updated to react-router v6. +* [#576](https://github.com/shlinkio/shlink-web-client/issues/576) Updated to fontawesome v6. +* [#579](https://github.com/shlinkio/shlink-web-client/issues/579) Replaced react-color with react-colorful. +* [#564](https://github.com/shlinkio/shlink-web-client/issues/564) Updated most of the dependencies. ### Deprecated * *Nothing* @@ -87,7 +88,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * *Nothing* ### Fixed -* [#589](https://github.com/shlinkio/shlink-web-client/pull/589) Fixed alignment of shlink versions footer, by basing the logic on the presence of the sidebar instead of selected server. +* [#589](https://github.com/shlinkio/shlink-web-client/issues/589) Fixed alignment of shlink versions footer, by basing the logic on the presence of the sidebar instead of selected server. ## [3.5.1] - 2022-01-08 @@ -111,27 +112,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [3.5.0] - 2022-01-01 ### Added -* [#407](https://github.com/shlinkio/shlink-web-client/pull/407) Improved how visits (short URLs, tags and orphan) are loaded, to avoid ending up in a page with "There are no visits matching current filter". +* [#407](https://github.com/shlinkio/shlink-web-client/issues/407) Improved how visits (short URLs, tags and orphan) are loaded, to avoid ending up in a page with "There are no visits matching current filter". Now, the app will try to load visits for the configured default interval, and in parallel, it will load the latest visit. If the resulting list for that interval is empty, it will try to infer the closest interval with visits, based on the latest visit's date, and reload visits for that interval. -* [#547](https://github.com/shlinkio/shlink-web-client/pull/547) Improved domains page, to tell which of the domains are not properly configured. +* [#547](https://github.com/shlinkio/shlink-web-client/issues/547) Improved domains page, to tell which of the domains are not properly configured. Now, when this section is loaded, it tries to call the `GET /rest/health` endpoint for each one of the domains, and displays a warning icon on each one that failed. The warning includes a link to the documentation, explaining what are the steps to get it fixed. -* [#506](https://github.com/shlinkio/shlink-web-client/pull/506) Improved how servers are handled, displaying a warning when creating or importing servers that already exist. -* [#535](https://github.com/shlinkio/shlink-web-client/pull/535) Allowed editing default domain redirects when consuming Shlink 2.10 or newer. -* [#531](https://github.com/shlinkio/shlink-web-client/pull/531) Added custom slug field to the basic creation form in the Overview page. -* [#537](https://github.com/shlinkio/shlink-web-client/pull/537) Allowed to customize the ordering for every list in the app that supports it, being currently tags and short URLs. -* [#542](https://github.com/shlinkio/shlink-web-client/pull/542) Added ordering for short URLs to the query, so that it is consistent with the rest of the filtering params. +* [#506](https://github.com/shlinkio/shlink-web-client/issues/506) Improved how servers are handled, displaying a warning when creating or importing servers that already exist. +* [#535](https://github.com/shlinkio/shlink-web-client/issues/535) Allowed editing default domain redirects when consuming Shlink 2.10 or newer. +* [#531](https://github.com/shlinkio/shlink-web-client/issues/531) Added custom slug field to the basic creation form in the Overview page. +* [#537](https://github.com/shlinkio/shlink-web-client/issues/537) Allowed to customize the ordering for every list in the app that supports it, being currently tags and short URLs. +* [#542](https://github.com/shlinkio/shlink-web-client/issues/542) Added ordering for short URLs to the query, so that it is consistent with the rest of the filtering params. ### Changed -* [#534](https://github.com/shlinkio/shlink-web-client/pull/534) Updated axios. -* [#538](https://github.com/shlinkio/shlink-web-client/pull/538) Switched to the `-` notation in `orderBy` param for short URLs list, in preparation for Shlink v3.0.0 +* [#534](https://github.com/shlinkio/shlink-web-client/issues/534) Updated axios. +* [#538](https://github.com/shlinkio/shlink-web-client/issues/538) Switched to the `-` notation in `orderBy` param for short URLs list, in preparation for Shlink v3.0.0 ### Deprecated * *Nothing* diff --git a/src/domains/reducers/domainsList.ts b/src/domains/reducers/domainsList.ts index 1868c689..b2349810 100644 --- a/src/domains/reducers/domainsList.ts +++ b/src/domains/reducers/domainsList.ts @@ -65,7 +65,7 @@ export default buildReducer({ ({ ...initialState, domains, filteredDomains: domains, defaultRedirects }), [FILTER_DOMAINS]: (state, { searchTerm }) => ({ ...state, - filteredDomains: state.domains.filter(({ domain }) => domain.toLowerCase().match(searchTerm)), + filteredDomains: state.domains.filter(({ domain }) => domain.toLowerCase().match(searchTerm.toLowerCase())), }), [EDIT_DOMAIN_REDIRECTS]: (state, { domain, redirects }) => ({ ...state, diff --git a/src/servers/ManageServers.tsx b/src/servers/ManageServers.tsx index 71c859a8..80f91d61 100644 --- a/src/servers/ManageServers.tsx +++ b/src/servers/ManageServers.tsx @@ -28,7 +28,7 @@ export const ManageServers = ( const allServers = Object.values(servers); const [serversList, setServersList] = useState(allServers); const filterServers = (searchTerm: string) => setServersList( - allServers.filter(({ name, url }) => `${name} ${url}`.match(searchTerm)), + allServers.filter(({ name, url }) => `${name} ${url}`.toLowerCase().match(searchTerm.toLowerCase())), ); const hasAutoConnect = serversList.some(({ autoConnect }) => !!autoConnect); const [errorImporting, setErrorImporting] = useTimeoutToggle(false, SHOW_IMPORT_MSG_TIME); diff --git a/src/tags/reducers/tagsList.ts b/src/tags/reducers/tagsList.ts index afc6e620..de84c709 100644 --- a/src/tags/reducers/tagsList.ts +++ b/src/tags/reducers/tagsList.ts @@ -96,7 +96,7 @@ export default buildReducer({ }), [FILTER_TAGS]: (state, { searchTerm }) => ({ ...state, - filteredTags: state.tags.filter((tag) => tag.toLowerCase().match(searchTerm)), + filteredTags: state.tags.filter((tag) => tag.toLowerCase().match(searchTerm.toLowerCase())), }), [CREATE_VISITS]: (state, { createdVisits }) => ({ ...state, diff --git a/test/domains/reducers/domainsList.test.ts b/test/domains/reducers/domainsList.test.ts index d40a58b8..b00704bd 100644 --- a/test/domains/reducers/domainsList.test.ts +++ b/test/domains/reducers/domainsList.test.ts @@ -28,7 +28,7 @@ describe('domainsListReducer', () => { const buildShlinkApiClient = () => Mock.of({ listDomains, health }); const filteredDomains = [ Mock.of({ domain: 'foo', status: 'validating' }), - Mock.of({ domain: 'boo', status: 'validating' }), + Mock.of({ domain: 'Boo', status: 'validating' }), ]; const domains = [...filteredDomains, Mock.of({ domain: 'bar', status: 'validating' })]; @@ -58,7 +58,7 @@ describe('domainsListReducer', () => { }); it('filters domains on FILTER_DOMAINS', () => { - expect(reducer(Mock.of({ domains }), action(FILTER_DOMAINS, { searchTerm: 'oo' }))).toEqual( + expect(reducer(Mock.of({ domains }), action(FILTER_DOMAINS, { searchTerm: 'oO' }))).toEqual( { domains, filteredDomains }, ); }); diff --git a/test/servers/ManageServers.test.tsx b/test/servers/ManageServers.test.tsx index ddc32b53..f34ad465 100644 --- a/test/servers/ManageServers.test.tsx +++ b/test/servers/ManageServers.test.tsx @@ -43,7 +43,7 @@ describe('', () => { await waitFor(() => expect(screen.getAllByText(/^ManageServersRow/)).toHaveLength(1)); expect(screen.queryByText('No servers found.')).not.toBeInTheDocument(); - await search('ba'); + await search('Ba'); await waitFor(() => expect(screen.getAllByText(/^ManageServersRow/)).toHaveLength(2)); expect(screen.queryByText('No servers found.')).not.toBeInTheDocument(); diff --git a/test/tags/reducers/tagsList.test.ts b/test/tags/reducers/tagsList.test.ts index a0251203..767cdc3d 100644 --- a/test/tags/reducers/tagsList.test.ts +++ b/test/tags/reducers/tagsList.test.ts @@ -67,9 +67,9 @@ describe('tagsListReducer', () => { }); it('filters original list of tags by provided search term on FILTER_TAGS', () => { - const tags = ['foo', 'bar', 'baz', 'foo2', 'fo']; - const searchTerm = 'fo'; - const filteredTags = ['foo', 'foo2', 'fo']; + const tags = ['foo', 'bar', 'baz', 'Foo2', 'fo']; + const searchTerm = 'Fo'; + const filteredTags = ['foo', 'Foo2', 'fo']; expect(reducer(state({ tags }), { type: FILTER_TAGS, searchTerm } as any)).toEqual({ tags,