Skip to content

Commit 9a798c2

Browse files
authored
Merge pull request #1329 from shlinkio/develop
Release 4.2.1
2 parents 9e1a803 + 45a9783 commit 9a798c2

File tree

7 files changed

+59
-13
lines changed

7 files changed

+59
-13
lines changed

CHANGELOG.md

+20
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org).
66

7+
## [4.2.1] - 2024-10-09
8+
### Added
9+
* *Nothing*
10+
11+
### Changed
12+
* *Nothing*
13+
14+
### Deprecated
15+
* *Nothing*
16+
17+
### Removed
18+
* *Nothing*
19+
20+
### Fixed
21+
* [#1325](https://github.com/shlinkio/shlink-web-client/issues/1325) Get dependency on `uuid` package back, as `crypto.randomUUID()` can only be used in [secure contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).
22+
* [shlink-web-component#461](https://github.com/shlinkio/shlink-web-component/issues/461) Ensure `shortUrlsList.confirmDeletion` setting is `true` in any case, except when explicitly set to `false`.
23+
* [shlink-web-component#237](https://github.com/shlinkio/shlink-web-component/issues/237) Set darker color for previous period in charts, when light theme is enabled.
24+
* [shlink-web-component#246](https://github.com/shlinkio/shlink-web-component/issues/246) Fix selected date range not reflected in visits comparison date range selector, when selecting it in the line chart via drag'n'drop.
25+
26+
727
## [4.2.0] - 2024-10-07
828
### Added
929
* [shlink-web-component#411](https://github.com/shlinkio/shlink-web-component/issues/411) Add support for `ip-address` redirect conditions when Shlink server is >=4.2

package-lock.json

+26-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@shlinkio/data-manipulation": "^1.0.3",
3636
"@shlinkio/shlink-frontend-kit": "^0.5.2",
3737
"@shlinkio/shlink-js-sdk": "^1.2.0",
38-
"@shlinkio/shlink-web-component": "^0.8.0",
38+
"@shlinkio/shlink-web-component": "^0.8.1",
3939
"bootstrap": "5.2.3",
4040
"bottlejs": "^2.0.1",
4141
"clsx": "^2.1.1",
@@ -49,6 +49,7 @@
4949
"react-router-dom": "^6.26.2",
5050
"reactstrap": "^9.2.3",
5151
"redux-localstorage-simple": "^2.5.1",
52+
"uuid": "^10.0.0",
5253
"workbox-core": "^7.1.0",
5354
"workbox-expiration": "^7.1.0",
5455
"workbox-precaching": "^7.1.0",

src/servers/CreateServer.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { NoMenuLayout } from '../common/NoMenuLayout';
88
import type { FCWithDeps } from '../container/utils';
99
import { componentFactory, useDependencies } from '../container/utils';
1010
import { useGoBack } from '../utils/helpers/hooks';
11+
import { randomUUID } from '../utils/utils';
1112
import type { ServerData, ServersMap, ServerWithId } from './data';
1213
import { DuplicatedServersModal } from './helpers/DuplicatedServersModal';
1314
import type { ImportServersBtnProps } from './helpers/ImportServersBtn';
@@ -44,7 +45,7 @@ const CreateServer: FCWithDeps<CreateServerProps, CreateServerDeps> = ({ servers
4445
const [isConfirmModalOpen, toggleConfirmModal] = useToggle();
4546
const [serverData, setServerData] = useState<ServerData>();
4647
const saveNewServer = useCallback((theServerData: ServerData) => {
47-
const id = crypto.randomUUID();
48+
const id = randomUUID();
4849

4950
createServers([{ ...theServerData, id }]);
5051
navigate(`/server/${id}`);

src/servers/reducers/servers.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { PayloadAction } from '@reduxjs/toolkit';
22
import { createSlice } from '@reduxjs/toolkit';
3+
import { randomUUID } from '../../utils/utils';
34
import type { ServerData, ServersMap, ServerWithId } from '../data';
45

56
interface EditServer {
@@ -19,7 +20,7 @@ const serverWithId = (server: ServerWithId | ServerData): ServerWithId => {
1920
return server;
2021
}
2122

22-
return { ...server, id: crypto.randomUUID() };
23+
return { ...server, id: randomUUID() };
2324
};
2425

2526
const serversListToMap = (servers: ServerWithId[]): ServersMap => servers.reduce<ServersMap>(

src/utils/utils.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import type { SyntheticEvent } from 'react';
2+
import { v4 } from 'uuid';
23

34
export const handleEventPreventingDefault = <T>(handler: () => T) => (e: SyntheticEvent) => {
45
e.preventDefault();
56
handler();
67
};
8+
9+
export const randomUUID = () => v4();

test/servers/reducers/selectedServer.test.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
selectedServerReducerCreator,
1010
selectServer as selectServerCreator,
1111
} from '../../../src/servers/reducers/selectedServer';
12+
import { randomUUID } from '../../../src/utils/utils';
1213

1314
describe('selectedServerReducer', () => {
1415
const dispatch = vi.fn();
@@ -40,7 +41,7 @@ describe('selectedServerReducer', () => {
4041
['latest', MAX_FALLBACK_VERSION, 'latest'],
4142
['%invalid_semver%', MIN_FALLBACK_VERSION, '%invalid_semver%'],
4243
])('dispatches proper actions', async (serverVersion, expectedVersion, expectedPrintableVersion) => {
43-
const id = crypto.randomUUID();
44+
const id = randomUUID();
4445
const getState = createGetStateMock(id);
4546
const expectedSelectedServer = {
4647
id,
@@ -59,7 +60,7 @@ describe('selectedServerReducer', () => {
5960
});
6061

6162
it('dispatches error when health endpoint fails', async () => {
62-
const id = crypto.randomUUID();
63+
const id = randomUUID();
6364
const getState = createGetStateMock(id);
6465
const expectedSelectedServer = fromPartial<NonReachableServer>({ id, serverNotReachable: true });
6566

@@ -72,7 +73,7 @@ describe('selectedServerReducer', () => {
7273
});
7374

7475
it('dispatches error when server is not found', async () => {
75-
const id = crypto.randomUUID();
76+
const id = randomUUID();
7677
const getState = vi.fn(() => fromPartial<ShlinkState>({ servers: {} }));
7778
const expectedSelectedServer: NotFoundServer = { serverNotFound: true };
7879

0 commit comments

Comments
 (0)