mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-03 06:47:29 +03:00
Update to JS coding standard v2.5.0
This commit is contained in:
parent
fa39302474
commit
b2908d2b1f
8 changed files with 1769 additions and 966 deletions
1
.github/dependabot.yml
vendored
1
.github/dependabot.yml
vendored
|
@ -16,6 +16,7 @@ updates:
|
||||||
patterns:
|
patterns:
|
||||||
- '@shlinkio/eslint-config-js-coding-standard'
|
- '@shlinkio/eslint-config-js-coding-standard'
|
||||||
- '@typescript-eslint/*'
|
- '@typescript-eslint/*'
|
||||||
|
- 'eslint-plugin-*'
|
||||||
- 'eslint'
|
- 'eslint'
|
||||||
shlink:
|
shlink:
|
||||||
patterns:
|
patterns:
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
shlink_web_client_node:
|
shlink_web_client_node:
|
||||||
user: 1000:1000
|
user: 1000:1000
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
shlink_web_client_node:
|
shlink_web_client_node:
|
||||||
container_name: shlink_web_client_node
|
container_name: shlink_web_client_node
|
||||||
|
|
2714
package-lock.json
generated
2714
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -57,7 +57,7 @@
|
||||||
"workbox-strategies": "^7.1.0"
|
"workbox-strategies": "^7.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@shlinkio/eslint-config-js-coding-standard": "~2.4.1",
|
"@shlinkio/eslint-config-js-coding-standard": "~2.5.0",
|
||||||
"@shlinkio/stylelint-config-css-coding-standard": "~1.1.1",
|
"@shlinkio/stylelint-config-css-coding-standard": "~1.1.1",
|
||||||
"@testing-library/jest-dom": "^6.4.5",
|
"@testing-library/jest-dom": "^6.4.5",
|
||||||
"@testing-library/react": "^15.0.7",
|
"@testing-library/react": "^15.0.7",
|
||||||
|
@ -74,6 +74,10 @@
|
||||||
"axe-core": "^4.9.1",
|
"axe-core": "^4.9.1",
|
||||||
"chalk": "^5.3.0",
|
"chalk": "^5.3.0",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||||
|
"eslint-plugin-react": "^7.34.2",
|
||||||
|
"eslint-plugin-react-hooks": "^4.6.2",
|
||||||
|
"eslint-plugin-simple-import-sort": "^12.1.0",
|
||||||
"history": "^5.3.0",
|
"history": "^5.3.0",
|
||||||
"jsdom": "^24.1.0",
|
"jsdom": "^24.1.0",
|
||||||
"sass": "^1.77.4",
|
"sass": "^1.77.4",
|
||||||
|
|
|
@ -44,4 +44,4 @@ export const isNotFoundServer = (server: SelectedServer): server is NotFoundServ
|
||||||
|
|
||||||
export const getServerId = (server: SelectedServer) => (isServerWithId(server) ? server.id : '');
|
export const getServerId = (server: SelectedServer) => (isServerWithId(server) ? server.id : '');
|
||||||
|
|
||||||
export const serverWithIdToServerData = ({ id, autoConnect, ...server }: ServerWithId): ServerData => server;
|
export const serverWithIdToServerData = ({ name, url, apiKey }: ServerWithId): ServerData => ({ name, url, apiKey });
|
||||||
|
|
|
@ -44,8 +44,8 @@ export const { actions, reducer } = createSlice({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
deleteServer: (state, { payload }) => {
|
deleteServer: (state, { payload }) => {
|
||||||
const { [payload.id]: deletedServer, ...rest } = state;
|
delete state[payload.id];
|
||||||
return rest;
|
return state;
|
||||||
},
|
},
|
||||||
setAutoConnect: {
|
setAutoConnect: {
|
||||||
prepare: ({ id: serverId }: ServerWithId, autoConnect: boolean) => ({
|
prepare: ({ id: serverId }: ServerWithId, autoConnect: boolean) => ({
|
||||||
|
|
|
@ -107,7 +107,9 @@ describe('serversReducer', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('generates an id for every provided server if they do not have it', () => {
|
it('generates an id for every provided server if they do not have it', () => {
|
||||||
const servers = Object.values(list).map(({ id, ...rest }) => rest);
|
const servers = Object.values(list).map(({ name, autoConnect, url, apiKey }) => (
|
||||||
|
{ name, autoConnect, url, apiKey }
|
||||||
|
));
|
||||||
const { payload } = createServers(servers);
|
const { payload } = createServers(servers);
|
||||||
|
|
||||||
expect(Object.values(payload).every(({ id }) => !!id)).toEqual(true);
|
expect(Object.values(payload).every(({ id }) => !!id)).toEqual(true);
|
||||||
|
|
Loading…
Reference in a new issue