From 946cb71700128ddf38a7abfdb9c60d549e7a6a0a Mon Sep 17 00:00:00 2001 From: dougfabris Date: Fri, 10 Jan 2025 12:24:52 -0300 Subject: [PATCH 1/8] chore: bump packages --- apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 8 +- apps/uikit-playground/package.json | 8 +- ee/packages/ui-theming/package.json | 6 +- packages/core-services/package.json | 2 +- packages/core-typings/package.json | 2 +- packages/fuselage-ui-kit/package.json | 6 +- packages/gazzodown/package.json | 2 +- packages/livechat/package.json | 4 +- packages/ui-avatar/package.json | 2 +- packages/ui-client/package.json | 6 +- packages/ui-composer/package.json | 4 +- packages/ui-contexts/package.json | 2 +- packages/ui-kit/package.json | 2 +- packages/ui-video-conf/package.json | 6 +- packages/ui-voip/package.json | 6 +- yarn.lock | 119 +++++++++++--------- 17 files changed, 100 insertions(+), 87 deletions(-) diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 1cd10b9ebdef..a9f030847256 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -48,7 +48,7 @@ "ws": "^8.18.0" }, "devDependencies": { - "@rocket.chat/icons": "~0.39.0", + "@rocket.chat/icons": "^0.40.0", "@types/cookie": "^0.5.4", "@types/cookie-parser": "^1.4.7", "@types/ejson": "^2.2.2", diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 9d97ab92379a..3937ffbf9291 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -248,22 +248,22 @@ "@rocket.chat/emitter": "~0.31.25", "@rocket.chat/favicon": "workspace:^", "@rocket.chat/freeswitch": "workspace:^", - "@rocket.chat/fuselage": "^0.60.0", - "@rocket.chat/fuselage-hooks": "^0.34.0", + "@rocket.chat/fuselage": "^0.60.1", + "@rocket.chat/fuselage-hooks": "^0.34.1", "@rocket.chat/fuselage-polyfills": "~0.31.25", "@rocket.chat/fuselage-toastbar": "^0.33.0", "@rocket.chat/fuselage-tokens": "^0.33.2", "@rocket.chat/fuselage-ui-kit": "workspace:^", "@rocket.chat/gazzodown": "workspace:^", "@rocket.chat/i18n": "workspace:^", - "@rocket.chat/icons": "~0.39.0", + "@rocket.chat/icons": "^0.40.0", "@rocket.chat/instance-status": "workspace:^", "@rocket.chat/jwt": "workspace:^", "@rocket.chat/layout": "~0.31.27", "@rocket.chat/license": "workspace:^", "@rocket.chat/log-format": "workspace:^", "@rocket.chat/logger": "workspace:^", - "@rocket.chat/logo": "^0.31.31", + "@rocket.chat/logo": "^0.31.32", "@rocket.chat/memo": "~0.31.25", "@rocket.chat/message-parser": "workspace:^", "@rocket.chat/model-typings": "workspace:^", diff --git a/apps/uikit-playground/package.json b/apps/uikit-playground/package.json index e3c60b2a032d..558c4562d32d 100644 --- a/apps/uikit-playground/package.json +++ b/apps/uikit-playground/package.json @@ -17,14 +17,14 @@ "@lezer/highlight": "^1.2.1", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/css-in-js": "~0.31.25", - "@rocket.chat/fuselage": "^0.60.0", - "@rocket.chat/fuselage-hooks": "^0.34.0", + "@rocket.chat/fuselage": "^0.60.1", + "@rocket.chat/fuselage-hooks": "^0.34.1", "@rocket.chat/fuselage-polyfills": "~0.31.25", "@rocket.chat/fuselage-toastbar": "^0.33.0", "@rocket.chat/fuselage-tokens": "^0.33.2", "@rocket.chat/fuselage-ui-kit": "workspace:~", - "@rocket.chat/icons": "~0.39.0", - "@rocket.chat/logo": "^0.31.31", + "@rocket.chat/icons": "^0.40.0", + "@rocket.chat/logo": "^0.31.32", "@rocket.chat/styled": "~0.31.25", "@rocket.chat/ui-avatar": "workspace:^", "@rocket.chat/ui-contexts": "workspace:~", diff --git a/ee/packages/ui-theming/package.json b/ee/packages/ui-theming/package.json index aa0c4c782124..5d9f647dd4cd 100644 --- a/ee/packages/ui-theming/package.json +++ b/ee/packages/ui-theming/package.json @@ -4,9 +4,9 @@ "private": true, "devDependencies": { "@rocket.chat/css-in-js": "~0.31.25", - "@rocket.chat/fuselage": "^0.60.0", - "@rocket.chat/fuselage-hooks": "^0.34.0", - "@rocket.chat/icons": "~0.39.0", + "@rocket.chat/fuselage": "^0.60.1", + "@rocket.chat/fuselage-hooks": "^0.34.1", + "@rocket.chat/icons": "^0.40.0", "@rocket.chat/ui-contexts": "workspace:~", "@types/react": "~17.0.83", "eslint": "~8.45.0", diff --git a/packages/core-services/package.json b/packages/core-services/package.json index c3b317351ca6..318bd4385a10 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -34,7 +34,7 @@ }, "dependencies": { "@rocket.chat/core-typings": "workspace:^", - "@rocket.chat/icons": "~0.39.0", + "@rocket.chat/icons": "^0.40.0", "@rocket.chat/message-parser": "workspace:^", "@rocket.chat/models": "workspace:^", "@rocket.chat/rest-typings": "workspace:^", diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index bbfa529fad52..59182158b195 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -24,7 +24,7 @@ "/dist" ], "dependencies": { - "@rocket.chat/icons": "~0.39.0", + "@rocket.chat/icons": "^0.40.0", "@rocket.chat/message-parser": "workspace:^", "@rocket.chat/ui-kit": "workspace:~", "@types/express": "^4.17.21" diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 25baef3334fc..6c177e552dee 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -52,10 +52,10 @@ "@rocket.chat/apps-engine": "workspace:^", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/eslint-config": "workspace:^", - "@rocket.chat/fuselage": "^0.60.0", - "@rocket.chat/fuselage-hooks": "^0.34.0", + "@rocket.chat/fuselage": "^0.60.1", + "@rocket.chat/fuselage-hooks": "^0.34.1", "@rocket.chat/fuselage-polyfills": "~0.31.25", - "@rocket.chat/icons": "~0.39.0", + "@rocket.chat/icons": "^0.40.0", "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/mock-providers": "workspace:^", "@rocket.chat/prettier-config": "~0.31.25", diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index e0651bca4041..bdb7cd416d8d 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -29,7 +29,7 @@ "@babel/core": "~7.26.0", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/css-in-js": "~0.31.25", - "@rocket.chat/fuselage": "^0.60.0", + "@rocket.chat/fuselage": "^0.60.1", "@rocket.chat/fuselage-tokens": "^0.33.2", "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/message-parser": "workspace:^", diff --git a/packages/livechat/package.json b/packages/livechat/package.json index 3094db7648f2..6f90c3cb3566 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -30,9 +30,9 @@ "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/ddp-client": "workspace:^", "@rocket.chat/eslint-config": "workspace:^", - "@rocket.chat/fuselage-hooks": "^0.34.0", + "@rocket.chat/fuselage-hooks": "^0.34.1", "@rocket.chat/fuselage-tokens": "^0.33.2", - "@rocket.chat/logo": "^0.31.31", + "@rocket.chat/logo": "^0.31.32", "@rocket.chat/ui-contexts": "workspace:^", "@storybook/addon-essentials": "^8.4.4", "@storybook/addon-styling-webpack": "~1.0.1", diff --git a/packages/ui-avatar/package.json b/packages/ui-avatar/package.json index 5358ba037e7c..ab595b84b4ed 100644 --- a/packages/ui-avatar/package.json +++ b/packages/ui-avatar/package.json @@ -4,7 +4,7 @@ "private": true, "devDependencies": { "@babel/core": "~7.26.0", - "@rocket.chat/fuselage": "^0.60.0", + "@rocket.chat/fuselage": "^0.60.1", "@rocket.chat/ui-contexts": "workspace:^", "@types/react": "~17.0.83", "@types/react-dom": "~17.0.26", diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index ef0602ab7e75..68b329fe7865 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -21,9 +21,9 @@ "@babel/core": "~7.26.0", "@react-aria/toolbar": "^3.0.0-nightly.5042", "@rocket.chat/css-in-js": "~0.31.25", - "@rocket.chat/fuselage": "^0.60.0", - "@rocket.chat/fuselage-hooks": "^0.34.0", - "@rocket.chat/icons": "~0.39.0", + "@rocket.chat/fuselage": "^0.60.1", + "@rocket.chat/fuselage-hooks": "^0.34.1", + "@rocket.chat/icons": "^0.40.0", "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/mock-providers": "workspace:^", "@rocket.chat/ui-avatar": "workspace:~", diff --git a/packages/ui-composer/package.json b/packages/ui-composer/package.json index 34b0fa5bc17f..77b91c51408f 100644 --- a/packages/ui-composer/package.json +++ b/packages/ui-composer/package.json @@ -21,8 +21,8 @@ "@babel/core": "~7.26.0", "@react-aria/toolbar": "^3.0.0-nightly.5042", "@rocket.chat/eslint-config": "workspace:^", - "@rocket.chat/fuselage": "^0.60.0", - "@rocket.chat/icons": "~0.39.0", + "@rocket.chat/fuselage": "^0.60.1", + "@rocket.chat/icons": "^0.40.0", "@storybook/addon-actions": "^8.4.4", "@storybook/addon-docs": "^8.4.4", "@storybook/addon-essentials": "^8.4.4", diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 8826c37982d5..74263d374eae 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -6,7 +6,7 @@ "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/ddp-client": "workspace:~", "@rocket.chat/emitter": "~0.31.25", - "@rocket.chat/fuselage-hooks": "^0.34.0", + "@rocket.chat/fuselage-hooks": "^0.34.1", "@rocket.chat/i18n": "workspace:~", "@rocket.chat/rest-typings": "workspace:^", "@types/react": "~17.0.83", diff --git a/packages/ui-kit/package.json b/packages/ui-kit/package.json index 655427584868..31e62196caec 100644 --- a/packages/ui-kit/package.json +++ b/packages/ui-kit/package.json @@ -40,7 +40,7 @@ "@babel/plugin-transform-runtime": "~7.25.9", "@babel/preset-env": "~7.26.0", "@rocket.chat/eslint-config": "workspace:~", - "@rocket.chat/icons": "~0.39.0", + "@rocket.chat/icons": "^0.40.0", "@rocket.chat/jest-presets": "workspace:~", "@types/jest": "~29.5.14", "babel-loader": "~9.2.1", diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index f116d1b9019c..d2d64bbc5aca 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -24,9 +24,9 @@ "@babel/core": "~7.26.0", "@rocket.chat/css-in-js": "~0.31.25", "@rocket.chat/eslint-config": "workspace:^", - "@rocket.chat/fuselage": "^0.60.0", - "@rocket.chat/fuselage-hooks": "^0.34.0", - "@rocket.chat/icons": "~0.39.0", + "@rocket.chat/fuselage": "^0.60.1", + "@rocket.chat/fuselage-hooks": "^0.34.1", + "@rocket.chat/icons": "^0.40.0", "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/styled": "~0.31.25", "@rocket.chat/ui-avatar": "workspace:^", diff --git a/packages/ui-voip/package.json b/packages/ui-voip/package.json index 1f0adad73206..9919aca0c0b1 100644 --- a/packages/ui-voip/package.json +++ b/packages/ui-voip/package.json @@ -29,9 +29,9 @@ "@react-spectrum/test-utils": "~1.0.0-alpha.2", "@rocket.chat/css-in-js": "~0.31.25", "@rocket.chat/eslint-config": "workspace:^", - "@rocket.chat/fuselage": "^0.60.0", - "@rocket.chat/fuselage-hooks": "^0.34.0", - "@rocket.chat/icons": "~0.39.0", + "@rocket.chat/fuselage": "^0.60.1", + "@rocket.chat/fuselage-hooks": "^0.34.1", + "@rocket.chat/icons": "^0.40.0", "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/mock-providers": "workspace:~", "@rocket.chat/styled": "~0.31.25", diff --git a/yarn.lock b/yarn.lock index 0b6b8888903d..614ca1d21115 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7602,7 +7602,7 @@ __metadata: "@rocket.chat/apps-engine": "workspace:^" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/icons": "npm:~0.39.0" + "@rocket.chat/icons": "npm:^0.40.0" "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/message-parser": "workspace:^" "@rocket.chat/models": "workspace:^" @@ -7625,7 +7625,7 @@ __metadata: dependencies: "@rocket.chat/apps-engine": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/icons": "npm:~0.39.0" + "@rocket.chat/icons": "npm:^0.40.0" "@rocket.chat/message-parser": "workspace:^" "@rocket.chat/ui-kit": "workspace:~" "@types/express": "npm:^4.17.21" @@ -7793,15 +7793,15 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/fuselage-hooks@npm:^0.34.0": - version: 0.34.0 - resolution: "@rocket.chat/fuselage-hooks@npm:0.34.0" +"@rocket.chat/fuselage-hooks@npm:^0.34.1": + version: 0.34.1 + resolution: "@rocket.chat/fuselage-hooks@npm:0.34.1" dependencies: - use-sync-external-store: "npm:~1.2.0" + use-sync-external-store: "npm:~1.4.0" peerDependencies: "@rocket.chat/fuselage-tokens": "*" react: ^17.0.2 - checksum: 10/bf73153ef9051430a069c5e4f5df792de123ad65f29c89f1c4a1da237842b64abb9977002bec1ba583a3496923802095a80129bb13768d7d2949678d48cb5a90 + checksum: 10/af20c99c354f75c43ea142d7c383eaec42549941d8a419014a313680b0db5c942d2f84a01415dbd8c21c5ec35bf9b933e487da1a582109fbe5207d2605ff4e2d languageName: node linkType: hard @@ -7853,11 +7853,11 @@ __metadata: "@rocket.chat/apps-engine": "workspace:^" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage": "npm:^0.60.0" - "@rocket.chat/fuselage-hooks": "npm:^0.34.0" + "@rocket.chat/fuselage": "npm:^0.60.1" + "@rocket.chat/fuselage-hooks": "npm:^0.34.1" "@rocket.chat/fuselage-polyfills": "npm:~0.31.25" "@rocket.chat/gazzodown": "workspace:^" - "@rocket.chat/icons": "npm:~0.39.0" + "@rocket.chat/icons": "npm:^0.40.0" "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/mock-providers": "workspace:^" "@rocket.chat/prettier-config": "npm:~0.31.25" @@ -7912,9 +7912,9 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/fuselage@npm:^0.60.0": - version: 0.60.0 - resolution: "@rocket.chat/fuselage@npm:0.60.0" +"@rocket.chat/fuselage@npm:^0.60.1": + version: 0.60.1 + resolution: "@rocket.chat/fuselage@npm:0.60.1" dependencies: "@rocket.chat/css-in-js": "npm:^0.31.25" "@rocket.chat/css-supports": "npm:^0.31.25" @@ -7932,7 +7932,7 @@ __metadata: react: ^17.0.2 react-dom: ^17.0.2 react-virtuoso: 1.2.4 - checksum: 10/53ea5b9cd535764b1c8e5e3d2e175f095f378ac9aea6d6dddb9aeef66acf74e50fb8ce5eea1806e8f40ed805e6def3ff58684343f301630e191934b2ba6d4178 + checksum: 10/336a77fc89763b550ff60bcf3de5f42a73e111b116d0b4357d56e60c710f783c5ac95836b75a113a54058d04171f403913030ebfe6e20df214038a546e0c5134 languageName: node linkType: hard @@ -7943,7 +7943,7 @@ __metadata: "@babel/core": "npm:~7.26.0" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/css-in-js": "npm:~0.31.25" - "@rocket.chat/fuselage": "npm:^0.60.0" + "@rocket.chat/fuselage": "npm:^0.60.1" "@rocket.chat/fuselage-tokens": "npm:^0.33.2" "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/message-parser": "workspace:^" @@ -8008,10 +8008,10 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/icons@npm:~0.39.0": - version: 0.39.0 - resolution: "@rocket.chat/icons@npm:0.39.0" - checksum: 10/b46bef7658ea90915aed10d3b021ddee0af64a98b463772289db7be9ec3013c8f4fa842b41abc57f0304171cbbf912bc3f5f8abfad8d29cf5c3dcd57c774b647 +"@rocket.chat/icons@npm:^0.40.0": + version: 0.40.0 + resolution: "@rocket.chat/icons@npm:0.40.0" + checksum: 10/9fb696db75919f3f0bacdb4637e226e0bb078ca620c1130ccb3b113144b140d040205dd232c69d0c951d5b26488b5d9295bedcbbe69c006feb1cc53eea370614 languageName: node linkType: hard @@ -8107,10 +8107,10 @@ __metadata: "@rocket.chat/ddp-client": "workspace:^" "@rocket.chat/emitter": "npm:~0.31.25" "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage-hooks": "npm:^0.34.0" + "@rocket.chat/fuselage-hooks": "npm:^0.34.1" "@rocket.chat/fuselage-tokens": "npm:^0.33.2" "@rocket.chat/gazzodown": "workspace:^" - "@rocket.chat/logo": "npm:^0.31.31" + "@rocket.chat/logo": "npm:^0.31.32" "@rocket.chat/message-parser": "workspace:^" "@rocket.chat/random": "workspace:~" "@rocket.chat/ui-contexts": "workspace:^" @@ -8215,16 +8215,16 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/logo@npm:^0.31.31": - version: 0.31.31 - resolution: "@rocket.chat/logo@npm:0.31.31" +"@rocket.chat/logo@npm:^0.31.32": + version: 0.31.32 + resolution: "@rocket.chat/logo@npm:0.31.32" dependencies: - "@rocket.chat/fuselage-hooks": "npm:^0.34.0" + "@rocket.chat/fuselage-hooks": "npm:^0.34.1" "@rocket.chat/styled": "npm:^0.31.25" peerDependencies: react: 17.0.2 react-dom: 17.0.2 - checksum: 10/79e74a42c3ae29aa10e8213e7e88bcc9ec935d105ba33d58bf02a95d79c54ff0798c9a4a99cda8e727f46ce6302c75376db7ea7dd6fa206dea495d1ed50b815e + checksum: 10/cc460ad831fc843377cba15d1f7c6174357c1b27c4f90151013984a3fa54a62879d0b8a77ffcce90c1489b70613110679e0ff5dc3315b80ec52c39235d3e9ef1 languageName: node linkType: hard @@ -8309,15 +8309,15 @@ __metadata: "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/favicon": "workspace:^" "@rocket.chat/freeswitch": "workspace:^" - "@rocket.chat/fuselage": "npm:^0.60.0" - "@rocket.chat/fuselage-hooks": "npm:^0.34.0" + "@rocket.chat/fuselage": "npm:^0.60.1" + "@rocket.chat/fuselage-hooks": "npm:^0.34.1" "@rocket.chat/fuselage-polyfills": "npm:~0.31.25" "@rocket.chat/fuselage-toastbar": "npm:^0.33.0" "@rocket.chat/fuselage-tokens": "npm:^0.33.2" "@rocket.chat/fuselage-ui-kit": "workspace:^" "@rocket.chat/gazzodown": "workspace:^" "@rocket.chat/i18n": "workspace:^" - "@rocket.chat/icons": "npm:~0.39.0" + "@rocket.chat/icons": "npm:^0.40.0" "@rocket.chat/instance-status": "workspace:^" "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/jwt": "workspace:^" @@ -8326,7 +8326,7 @@ __metadata: "@rocket.chat/livechat": "workspace:^" "@rocket.chat/log-format": "workspace:^" "@rocket.chat/logger": "workspace:^" - "@rocket.chat/logo": "npm:^0.31.31" + "@rocket.chat/logo": "npm:^0.31.32" "@rocket.chat/memo": "npm:~0.31.25" "@rocket.chat/message-parser": "workspace:^" "@rocket.chat/mock-providers": "workspace:^" @@ -9221,7 +9221,7 @@ __metadata: resolution: "@rocket.chat/ui-avatar@workspace:packages/ui-avatar" dependencies: "@babel/core": "npm:~7.26.0" - "@rocket.chat/fuselage": "npm:^0.60.0" + "@rocket.chat/fuselage": "npm:^0.60.1" "@rocket.chat/ui-contexts": "workspace:^" "@types/react": "npm:~17.0.83" "@types/react-dom": "npm:~17.0.26" @@ -9246,9 +9246,9 @@ __metadata: "@babel/core": "npm:~7.26.0" "@react-aria/toolbar": "npm:^3.0.0-nightly.5042" "@rocket.chat/css-in-js": "npm:~0.31.25" - "@rocket.chat/fuselage": "npm:^0.60.0" - "@rocket.chat/fuselage-hooks": "npm:^0.34.0" - "@rocket.chat/icons": "npm:~0.39.0" + "@rocket.chat/fuselage": "npm:^0.60.1" + "@rocket.chat/fuselage-hooks": "npm:^0.34.1" + "@rocket.chat/icons": "npm:^0.40.0" "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/mock-providers": "workspace:^" "@rocket.chat/ui-avatar": "workspace:~" @@ -9263,9 +9263,11 @@ __metadata: "@storybook/react": "npm:^8.4.4" "@storybook/react-webpack5": "npm:^8.4.4" "@testing-library/react": "npm:~16.0.1" + "@types/dompurify": "npm:^3.0.5" "@types/jest": "npm:~29.5.14" "@types/react": "npm:~17.0.83" "@types/react-dom": "npm:~17.0.26" + dompurify: "npm:^3.2.0" eslint: "npm:~8.45.0" eslint-plugin-anti-trojan-source: "npm:~1.1.1" eslint-plugin-react: "npm:~7.37.2" @@ -9298,8 +9300,8 @@ __metadata: "@babel/core": "npm:~7.26.0" "@react-aria/toolbar": "npm:^3.0.0-nightly.5042" "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage": "npm:^0.60.0" - "@rocket.chat/icons": "npm:~0.39.0" + "@rocket.chat/fuselage": "npm:^0.60.1" + "@rocket.chat/icons": "npm:^0.40.0" "@storybook/addon-actions": "npm:^8.4.4" "@storybook/addon-docs": "npm:^8.4.4" "@storybook/addon-essentials": "npm:^8.4.4" @@ -9333,7 +9335,7 @@ __metadata: "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/ddp-client": "workspace:~" "@rocket.chat/emitter": "npm:~0.31.25" - "@rocket.chat/fuselage-hooks": "npm:^0.34.0" + "@rocket.chat/fuselage-hooks": "npm:^0.34.1" "@rocket.chat/i18n": "workspace:~" "@rocket.chat/password-policies": "workspace:^" "@rocket.chat/rest-typings": "workspace:^" @@ -9367,7 +9369,7 @@ __metadata: "@babel/plugin-transform-runtime": "npm:~7.25.9" "@babel/preset-env": "npm:~7.26.0" "@rocket.chat/eslint-config": "workspace:~" - "@rocket.chat/icons": "npm:~0.39.0" + "@rocket.chat/icons": "npm:^0.40.0" "@rocket.chat/jest-presets": "workspace:~" "@types/jest": "npm:~29.5.14" babel-loader: "npm:~9.2.1" @@ -9392,9 +9394,9 @@ __metadata: resolution: "@rocket.chat/ui-theming@workspace:ee/packages/ui-theming" dependencies: "@rocket.chat/css-in-js": "npm:~0.31.25" - "@rocket.chat/fuselage": "npm:^0.60.0" - "@rocket.chat/fuselage-hooks": "npm:^0.34.0" - "@rocket.chat/icons": "npm:~0.39.0" + "@rocket.chat/fuselage": "npm:^0.60.1" + "@rocket.chat/fuselage-hooks": "npm:^0.34.1" + "@rocket.chat/icons": "npm:^0.40.0" "@rocket.chat/ui-contexts": "workspace:~" "@types/react": "npm:~17.0.83" eslint: "npm:~8.45.0" @@ -9422,9 +9424,9 @@ __metadata: "@rocket.chat/css-in-js": "npm:~0.31.25" "@rocket.chat/emitter": "npm:~0.31.25" "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage": "npm:^0.60.0" - "@rocket.chat/fuselage-hooks": "npm:^0.34.0" - "@rocket.chat/icons": "npm:~0.39.0" + "@rocket.chat/fuselage": "npm:^0.60.1" + "@rocket.chat/fuselage-hooks": "npm:^0.34.1" + "@rocket.chat/icons": "npm:^0.40.0" "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/styled": "npm:~0.31.25" "@rocket.chat/ui-avatar": "workspace:^" @@ -9472,9 +9474,9 @@ __metadata: "@rocket.chat/css-in-js": "npm:~0.31.25" "@rocket.chat/emitter": "npm:~0.31.25" "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage": "npm:^0.60.0" - "@rocket.chat/fuselage-hooks": "npm:^0.34.0" - "@rocket.chat/icons": "npm:~0.39.0" + "@rocket.chat/fuselage": "npm:^0.60.1" + "@rocket.chat/fuselage-hooks": "npm:^0.34.1" + "@rocket.chat/icons": "npm:^0.40.0" "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/mock-providers": "workspace:~" "@rocket.chat/styled": "npm:~0.31.25" @@ -9530,14 +9532,14 @@ __metadata: "@lezer/highlight": "npm:^1.2.1" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/css-in-js": "npm:~0.31.25" - "@rocket.chat/fuselage": "npm:^0.60.0" - "@rocket.chat/fuselage-hooks": "npm:^0.34.0" + "@rocket.chat/fuselage": "npm:^0.60.1" + "@rocket.chat/fuselage-hooks": "npm:^0.34.1" "@rocket.chat/fuselage-polyfills": "npm:~0.31.25" "@rocket.chat/fuselage-toastbar": "npm:^0.33.0" "@rocket.chat/fuselage-tokens": "npm:^0.33.2" "@rocket.chat/fuselage-ui-kit": "workspace:~" - "@rocket.chat/icons": "npm:~0.39.0" - "@rocket.chat/logo": "npm:^0.31.31" + "@rocket.chat/icons": "npm:^0.40.0" + "@rocket.chat/logo": "npm:^0.31.32" "@rocket.chat/styled": "npm:~0.31.25" "@rocket.chat/ui-avatar": "workspace:^" "@rocket.chat/ui-contexts": "workspace:~" @@ -9590,8 +9592,10 @@ __metadata: "@storybook/theming": "npm:^8.4.4" "@tanstack/react-query": "patch:@tanstack/react-query@npm%3A5.60.5#~/.yarn/patches/@tanstack-react-query-npm-5.60.5-04c500b172.patch" "@testing-library/react": "npm:~16.0.1" + "@types/dompurify": "npm:^3.0.5" "@types/react": "npm:~17.0.83" babel-loader: "npm:~9.2.1" + dompurify: "npm:^3.2.0" eslint: "npm:~8.45.0" react: "npm:~17.0.2" react-hook-form: "npm:~7.45.4" @@ -33339,7 +33343,7 @@ __metadata: "@rocket.chat/core-services": "workspace:^" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/emitter": "npm:~0.31.25" - "@rocket.chat/icons": "npm:~0.39.0" + "@rocket.chat/icons": "npm:^0.40.0" "@rocket.chat/message-parser": "workspace:^" "@rocket.chat/model-typings": "workspace:^" "@rocket.chat/models": "workspace:^" @@ -37779,7 +37783,7 @@ __metadata: languageName: node linkType: hard -"use-sync-external-store@npm:1.2.2, use-sync-external-store@npm:^1.2.2, use-sync-external-store@npm:~1.2.0, use-sync-external-store@npm:~1.2.2": +"use-sync-external-store@npm:1.2.2, use-sync-external-store@npm:^1.2.2, use-sync-external-store@npm:~1.2.2": version: 1.2.2 resolution: "use-sync-external-store@npm:1.2.2" peerDependencies: @@ -37788,6 +37792,15 @@ __metadata: languageName: node linkType: hard +"use-sync-external-store@npm:~1.4.0": + version: 1.4.0 + resolution: "use-sync-external-store@npm:1.4.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + checksum: 10/08bf581a8a2effaefc355e9d18ed025d436230f4cc973db2f593166df357cf63e47b9097b6e5089b594758bde322e1737754ad64905e030d70f8ff7ee671fd01 + languageName: node + linkType: hard + "use@npm:^3.1.0": version: 3.1.1 resolution: "use@npm:3.1.1" From 10916075accae85eba0f010cfecc00a83393a0c4 Mon Sep 17 00:00:00 2001 From: dougfabris Date: Fri, 10 Jan 2025 12:44:29 -0300 Subject: [PATCH 2/8] fix: types --- .../src/components/GenericMenu/hooks/useHandleMenuAction.tsx | 3 ++- packages/ui-contexts/src/hooks/useGoToRoom.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/ui-client/src/components/GenericMenu/hooks/useHandleMenuAction.tsx b/packages/ui-client/src/components/GenericMenu/hooks/useHandleMenuAction.tsx index fb423643b7c6..3edc2c67499f 100644 --- a/packages/ui-client/src/components/GenericMenu/hooks/useHandleMenuAction.tsx +++ b/packages/ui-client/src/components/GenericMenu/hooks/useHandleMenuAction.tsx @@ -1,9 +1,10 @@ import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; +import type { Key } from 'react'; import type { GenericMenuItemProps } from '../GenericMenuItem'; export const useHandleMenuAction = (items: GenericMenuItemProps[], callbackAction?: () => void) => - useEffectEvent((id) => { + useEffectEvent((id: Key) => { const item = items.find((item) => item.id === id && !!item.onClick); if (item) { item.onClick?.(); diff --git a/packages/ui-contexts/src/hooks/useGoToRoom.ts b/packages/ui-contexts/src/hooks/useGoToRoom.ts index e809a71e25bb..b94c7ff7051f 100644 --- a/packages/ui-contexts/src/hooks/useGoToRoom.ts +++ b/packages/ui-contexts/src/hooks/useGoToRoom.ts @@ -1,5 +1,6 @@ import type { IRoom } from '@rocket.chat/core-typings'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; +// import type { Key } from 'react'; import { useEndpoint } from './useEndpoint'; import { useRouter } from './useRouter'; @@ -8,7 +9,7 @@ export const useGoToRoom = ({ replace = false }: { replace?: boolean } = {}): (( const router = useRouter(); const getRoomById = useEndpoint('GET', '/v1/rooms.info'); - return useEffectEvent(async (roomId) => { + return useEffectEvent(async (roomId: string) => { const { room } = await getRoomById({ roomId }); if (!room) { From 9b1fa7676116b99cf942f6815f99ac65de4a47c5 Mon Sep 17 00:00:00 2001 From: Tasso Date: Fri, 10 Jan 2025 16:32:36 -0300 Subject: [PATCH 3/8] Short-cut fuselage-ui-kit type issues --- packages/fuselage-ui-kit/src/hooks/useUiKitState.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/fuselage-ui-kit/src/hooks/useUiKitState.ts b/packages/fuselage-ui-kit/src/hooks/useUiKitState.ts index a4c6ac63cf54..7c366b719641 100644 --- a/packages/fuselage-ui-kit/src/hooks/useUiKitState.ts +++ b/packages/fuselage-ui-kit/src/hooks/useUiKitState.ts @@ -66,7 +66,8 @@ export const useUiKitState = ( const [value, setValue] = useSafely(useState(_value)); const [loading, setLoading] = useSafely(useState(false)); - const actionFunction = useEffectEvent(async (e) => { + const actionFunction = useEffectEvent(async (e: any) => { + // FIXME: fix typings const { target: { value: elValue }, } = e; @@ -108,7 +109,8 @@ export const useUiKitState = ( // Used for triggering actions on text inputs. Removing the load state // makes the text input field remain focused after running the action - const noLoadStateActionFunction = useEffectEvent(async (e) => { + const noLoadStateActionFunction = useEffectEvent(async (e: any) => { + // FIXME: fix typings const { target: { value }, } = e; @@ -130,7 +132,8 @@ export const useUiKitState = ( ); }); - const stateFunction = useEffectEvent(async (e) => { + const stateFunction = useEffectEvent(async (e: any) => { + // FIXME: fix typings const { target: { value }, } = e; From d84195eec96e0861e5ee98ca84b8a20016da26d6 Mon Sep 17 00:00:00 2001 From: Tasso Date: Fri, 10 Jan 2025 16:33:01 -0300 Subject: [PATCH 4/8] Eliminate some implicit `any` parameters --- .../additionalForms/CurrentChatTags.tsx | 16 ++++- .../client/sidebarv2/Item/Condensed.tsx | 6 +- .../meteor/client/sidebarv2/Item/Extended.tsx | 6 +- apps/meteor/client/sidebarv2/Item/Medium.tsx | 6 +- .../integrations/AccountIntegrationsPage.tsx | 2 +- .../views/admin/emailInbox/EmailInboxForm.tsx | 64 +++++++++++++------ .../outgoing/history/HistoryItem.tsx | 3 +- .../moderation/ModerationConsoleTable.tsx | 3 +- .../UserReports/ModConsoleUsersTable.tsx | 3 +- .../moderation/helpers/DateRangePicker.tsx | 5 +- .../views/admin/permissions/EditRolePage.tsx | 4 +- .../PermissionsTableFilter.tsx | 4 +- .../UsersInRoleTable/UsersInRoleTable.tsx | 6 +- .../admin/permissions/hooks/useChangeRole.ts | 2 +- .../client/views/admin/rooms/EditRoom.tsx | 11 ++-- .../VoipGroupPage/AssignAgentButton.tsx | 3 +- .../groups/VoipGroupPage/AssignAgentModal.tsx | 5 +- .../VoipGroupPage/RemoveAgentButton.tsx | 3 +- .../admin/users/UsersTable/UsersTable.tsx | 4 +- .../components/forms/DateRangePicker.tsx | 6 +- .../views/e2e/EnterE2EPasswordModal.tsx | 4 +- .../views/modal/uikit/hooks/useValues.ts | 48 -------------- .../views/omnichannel/agents/AgentEdit.tsx | 16 ++++- .../agents/AgentsTable/AgentsTable.tsx | 2 +- .../omnichannel/analytics/DateRangePicker.tsx | 8 +-- .../analytics/InterchangeableChart.tsx | 60 +++++++++-------- .../omnichannel/appearance/AppearancePage.tsx | 4 +- .../currentChats/CurrentChatsRoute.tsx | 2 +- .../omnichannel/currentChats/FilterByText.tsx | 18 +++--- .../currentChats/RemoveChatButton.tsx | 3 +- .../customFields/CustomFieldsTable.tsx | 2 +- .../customFields/EditCustomFields.tsx | 2 +- .../customFields/useRemoveCustomField.tsx | 2 +- .../DepartmentAgentsTable/AddAgent.tsx | 2 +- .../RemoveAgentButton.tsx | 3 +- .../departments/DepartmentsPage.tsx | 12 ++-- .../RemoveDepartmentModal.tsx | 4 +- .../omnichannel/directory/calls/CallTable.tsx | 4 +- .../chats/ChatsTable/ChatsTableRow.tsx | 2 +- .../directory/contacts/ContactTableRow.tsx | 2 +- .../managers/RemoveManagerButton.tsx | 4 +- .../omnichannel/queueList/QueueListFilter.tsx | 10 +-- .../RealTimeMonitoringPage.tsx | 4 +- .../omnichannel/triggers/TriggersRow.tsx | 7 +- .../omnichannel/webhooks/WebhooksPage.tsx | 16 ++--- .../room/Header/RoomToolbox/RoomToolbox.tsx | 6 +- .../room/HeaderV2/RoomToolbox/RoomToolbox.tsx | 6 +- .../room/composer/messageBox/MessageBox.tsx | 6 +- .../hooks/useAudioMessageAction.ts | 2 +- .../hooks/useVideoMessageAction.ts | 2 +- .../views/room/contexts/RoomToolboxContext.ts | 2 +- .../AutoTranslate/AutoTranslateWithData.tsx | 6 +- .../Info/EditRoomInfo/EditRoomInfo.tsx | 7 +- .../EditRoomInfo/useEditRoomInitialValues.ts | 31 ++++++++- .../RoomFiles/hooks/useDeleteFile.tsx | 3 +- .../AddMatrixUsers/useAddMatrixUsers.tsx | 2 +- .../RoomMembers/AddUsers/AddUsers.tsx | 2 +- .../InviteUsers/InviteUsersWithData.tsx | 55 ++++++++++------ .../RoomMembers/RoomMembersWithData.tsx | 4 +- .../client/views/room/hooks/useGoToRoom.ts | 2 +- .../client/views/room/hooks/useGoToThread.ts | 8 +-- .../actions/useAddUserAction.tsx | 2 +- .../WebdavFilePickerModal.tsx | 2 +- .../providers/SetupWizardProvider.tsx | 36 ++++++----- .../contextualBar/channels/TeamsChannels.tsx | 2 +- .../info/DeleteTeam/DeleteTeamModal.tsx | 2 +- packages/rest-typings/src/v1/email-inbox.ts | 6 +- packages/rest-typings/src/v1/rooms.ts | 12 ++++ 68 files changed, 341 insertions(+), 268 deletions(-) delete mode 100644 apps/meteor/client/views/modal/uikit/hooks/useValues.ts diff --git a/apps/meteor/client/omnichannel/additionalForms/CurrentChatTags.tsx b/apps/meteor/client/omnichannel/additionalForms/CurrentChatTags.tsx index 7d2892e94014..08bb02b8fb0a 100644 --- a/apps/meteor/client/omnichannel/additionalForms/CurrentChatTags.tsx +++ b/apps/meteor/client/omnichannel/additionalForms/CurrentChatTags.tsx @@ -1,7 +1,12 @@ import { useHasLicenseModule } from '../../hooks/useHasLicenseModule'; import AutoCompleteTagsMultiple from '../tags/AutoCompleteTagsMultiple'; -type CurrentChatTagsProps = { value: Array<{ value: string; label: string }>; handler: any; department?: string; viewAll?: boolean }; +type CurrentChatTagsProps = { + value: Array<{ value: string; label: string }>; + handler: (value: { label: string; value: string }[]) => void; + department?: string; + viewAll?: boolean; +}; const CurrentChatTags = ({ value, handler, department, viewAll }: CurrentChatTagsProps) => { const hasLicense = useHasLicenseModule('livechat-enterprise'); @@ -10,7 +15,14 @@ const CurrentChatTags = ({ value, handler, department, viewAll }: CurrentChatTag return null; } - return ; + return ( + + ); }; export default CurrentChatTags; diff --git a/apps/meteor/client/sidebarv2/Item/Condensed.tsx b/apps/meteor/client/sidebarv2/Item/Condensed.tsx index b294fd81c4a2..ffdf0eb20807 100644 --- a/apps/meteor/client/sidebarv2/Item/Condensed.tsx +++ b/apps/meteor/client/sidebarv2/Item/Condensed.tsx @@ -1,7 +1,7 @@ import { IconButton, SidebarV2Item, SidebarV2ItemAvatarWrapper, SidebarV2ItemMenu, SidebarV2ItemTitle } from '@rocket.chat/fuselage'; import { useEffectEvent, usePrefersReducedMotion } from '@rocket.chat/fuselage-hooks'; import type { Keys as IconName } from '@rocket.chat/icons'; -import type { HTMLAttributes, ReactElement } from 'react'; +import type { HTMLAttributes, ReactElement, UIEvent } from 'react'; import { memo, useState } from 'react'; type CondensedProps = { @@ -24,8 +24,8 @@ const Condensed = ({ icon, title, avatar, actions, unread, menu, badges, ...prop const isReduceMotionEnabled = usePrefersReducedMotion(); - const handleMenu = useEffectEvent((e) => { - setMenuVisibility(e.target.offsetWidth > 0 && Boolean(menu)); + const handleMenu = useEffectEvent((e: UIEvent) => { + setMenuVisibility(e.currentTarget.offsetWidth > 0 && Boolean(menu)); }); const handleMenuEvent = { [isReduceMotionEnabled ? 'onMouseEnter' : 'onTransitionEnd']: handleMenu, diff --git a/apps/meteor/client/sidebarv2/Item/Extended.tsx b/apps/meteor/client/sidebarv2/Item/Extended.tsx index 55fae2158cdb..12d999c5a3d9 100644 --- a/apps/meteor/client/sidebarv2/Item/Extended.tsx +++ b/apps/meteor/client/sidebarv2/Item/Extended.tsx @@ -11,7 +11,7 @@ import { } from '@rocket.chat/fuselage'; import { useEffectEvent, usePrefersReducedMotion } from '@rocket.chat/fuselage-hooks'; import type { Keys as IconName } from '@rocket.chat/icons'; -import type { HTMLAttributes, ReactNode } from 'react'; +import type { HTMLAttributes, ReactNode, UIEvent } from 'react'; import { memo, useState } from 'react'; import { useShortTimeAgo } from '../../hooks/useTimeAgo'; @@ -55,8 +55,8 @@ const Extended = ({ const isReduceMotionEnabled = usePrefersReducedMotion(); - const handleMenu = useEffectEvent((e) => { - setMenuVisibility(e.target.offsetWidth > 0 && Boolean(menu)); + const handleMenu = useEffectEvent((e: UIEvent) => { + setMenuVisibility(e.currentTarget.offsetWidth > 0 && Boolean(menu)); }); const handleMenuEvent = { [isReduceMotionEnabled ? 'onMouseEnter' : 'onTransitionEnd']: handleMenu, diff --git a/apps/meteor/client/sidebarv2/Item/Medium.tsx b/apps/meteor/client/sidebarv2/Item/Medium.tsx index 6200dd1e4954..0b4e04c031de 100644 --- a/apps/meteor/client/sidebarv2/Item/Medium.tsx +++ b/apps/meteor/client/sidebarv2/Item/Medium.tsx @@ -1,7 +1,7 @@ import { IconButton, SidebarV2Item, SidebarV2ItemAvatarWrapper, SidebarV2ItemMenu, SidebarV2ItemTitle } from '@rocket.chat/fuselage'; import { useEffectEvent, usePrefersReducedMotion } from '@rocket.chat/fuselage-hooks'; import type { Keys as IconName } from '@rocket.chat/icons'; -import type { HTMLAttributes, ReactNode } from 'react'; +import type { HTMLAttributes, ReactNode, UIEvent } from 'react'; import { memo, useState } from 'react'; type MediumProps = { @@ -23,8 +23,8 @@ const Medium = ({ icon, title, avatar, actions, badges, unread, menu, ...props } const isReduceMotionEnabled = usePrefersReducedMotion(); - const handleMenu = useEffectEvent((e) => { - setMenuVisibility(e.target.offsetWidth > 0 && Boolean(menu)); + const handleMenu = useEffectEvent((e: UIEvent) => { + setMenuVisibility(e.currentTarget.offsetWidth > 0 && Boolean(menu)); }); const handleMenuEvent = { [isReduceMotionEnabled ? 'onMouseEnter' : 'onTransitionEnd']: handleMenu, diff --git a/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx b/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx index 2ac7e2918b21..88ea7fd5ca0e 100644 --- a/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx +++ b/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx @@ -37,7 +37,7 @@ const AccountIntegrationsPage = () => { }, }); - const handleSubmitForm = useEffectEvent(({ accountSelected }) => { + const handleSubmitForm = useEffectEvent(({ accountSelected }: { accountSelected: string }) => { removeMutation.mutate({ accountSelected }); }); diff --git a/apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx b/apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx index fa4f066e9242..552e6012d735 100644 --- a/apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx +++ b/apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx @@ -30,7 +30,31 @@ import AutoCompleteDepartment from '../../../components/AutoCompleteDepartment'; import GenericModal from '../../../components/GenericModal'; import { PageScrollableContentWithShadow } from '../../../components/Page'; -const EmailInboxForm = ({ inboxData }: { inboxData?: IEmailInboxPayload }): ReactElement => { +type EmailInboxFormData = { + active: boolean; + name: string; + email: string; + description?: string; + senderInfo?: string; + department?: string; + smtpServer: string; + smtpPort: string; + smtpUsername: string; + smtpPassword: string; + smtpSecure: boolean; + imapServer: string; + imapPort: string; + imapUsername: string; + imapPassword: string; + imapSecure: boolean; + imapRetries: string; +}; + +type EmailInboxFormProps = { + inboxData?: IEmailInboxPayload; +}; + +const EmailInboxForm = ({ inboxData }: EmailInboxFormProps): ReactElement => { const { t } = useTranslation(); const dispatchToastMessage = useToastMessageDispatch(); const setModal = useSetModal(); @@ -46,27 +70,27 @@ const EmailInboxForm = ({ inboxData }: { inboxData?: IEmailInboxPayload }): Reac control, handleSubmit, formState: { errors, isDirty }, - } = useForm({ + } = useForm({ values: { active: inboxData?.active ?? true, - name: inboxData?.name, - email: inboxData?.email, + name: inboxData?.name ?? '', + email: inboxData?.email ?? '', description: inboxData?.description, senderInfo: inboxData?.senderInfo, - department: inboxData?.department || '', + department: inboxData?.department, // SMTP - smtpServer: inboxData?.smtp.server, - smtpPort: inboxData?.smtp.port ?? 587, - smtpUsername: inboxData?.smtp.username, - smtpPassword: inboxData?.smtp.password, + smtpServer: inboxData?.smtp.server ?? '', + smtpPort: String(inboxData?.smtp.port ?? 587), + smtpUsername: inboxData?.smtp.username ?? '', + smtpPassword: inboxData?.smtp.password ?? '', smtpSecure: inboxData?.smtp.secure ?? false, // IMAP - imapServer: inboxData?.imap.server, - imapPort: inboxData?.imap.port ?? 993, - imapUsername: inboxData?.imap.username, - imapPassword: inboxData?.imap.password, + imapServer: inboxData?.imap.server ?? '', + imapPort: String(inboxData?.imap.port ?? 993), + imapUsername: inboxData?.imap.username ?? '', + imapPassword: inboxData?.imap.password ?? '', imapSecure: inboxData?.imap.secure ?? false, - imapRetries: inboxData?.imap.maxRetries ?? 10, + imapRetries: String(inboxData?.imap.maxRetries ?? 10), }, mode: 'all', }); @@ -110,10 +134,10 @@ const EmailInboxForm = ({ inboxData }: { inboxData?: IEmailInboxPayload }): Reac imapPassword, imapSecure, imapRetries, - }) => { + }: EmailInboxFormData) => { const smtp = { server: smtpServer, - port: parseInt(smtpPort), + port: parseInt(smtpPort, 10), username: smtpUsername, password: smtpPassword, secure: smtpSecure, @@ -121,11 +145,11 @@ const EmailInboxForm = ({ inboxData }: { inboxData?: IEmailInboxPayload }): Reac const imap = { server: imapServer, - port: parseInt(imapPort), + port: parseInt(imapPort, 10), username: imapUsername, password: imapPassword, secure: imapSecure, - maxRetries: parseInt(imapRetries), + maxRetries: parseInt(imapRetries, 10), }; const payload = { @@ -135,7 +159,7 @@ const EmailInboxForm = ({ inboxData }: { inboxData?: IEmailInboxPayload }): Reac email, description, senderInfo, - ...(department && { department: typeof department === 'string' ? department : department.value }), + ...(department && { department }), smtp, imap, }; @@ -150,7 +174,7 @@ const EmailInboxForm = ({ inboxData }: { inboxData?: IEmailInboxPayload }): Reac }, ); - const checkEmailExists = useEffectEvent(async (email) => { + const checkEmailExists = useEffectEvent(async (email: string) => { if (!email) { return; } diff --git a/apps/meteor/client/views/admin/integrations/outgoing/history/HistoryItem.tsx b/apps/meteor/client/views/admin/integrations/outgoing/history/HistoryItem.tsx index d9581600110c..74327d4968bf 100644 --- a/apps/meteor/client/views/admin/integrations/outgoing/history/HistoryItem.tsx +++ b/apps/meteor/client/views/admin/integrations/outgoing/history/HistoryItem.tsx @@ -3,6 +3,7 @@ import { Button, Icon, Box, AccordionItem, Field, FieldGroup, FieldLabel, FieldR import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { useMethod } from '@rocket.chat/ui-contexts'; import DOMPurify from 'dompurify'; +import type { MouseEvent } from 'react'; import { useTranslation } from 'react-i18next'; import { outgoingEvents } from '../../../../../../app/integrations/lib/outgoingEvents'; @@ -35,7 +36,7 @@ const HistoryItem = ({ data }: { data: Serialized }) => { const createdAt = typeof _createdAt === 'string' ? _createdAt : (_createdAt as Date).toISOString(); const updatedAt = typeof _updatedAt === 'string' ? _updatedAt : (_updatedAt as Date).toISOString(); - const handleClickReplay = useEffectEvent((e) => { + const handleClickReplay = useEffectEvent((e: MouseEvent) => { e.stopPropagation(); replayOutgoingIntegration({ integrationId, historyId: _id }); }); diff --git a/apps/meteor/client/views/admin/moderation/ModerationConsoleTable.tsx b/apps/meteor/client/views/admin/moderation/ModerationConsoleTable.tsx index bf57345490aa..816bec605bce 100644 --- a/apps/meteor/client/views/admin/moderation/ModerationConsoleTable.tsx +++ b/apps/meteor/client/views/admin/moderation/ModerationConsoleTable.tsx @@ -1,3 +1,4 @@ +import type { IUser } from '@rocket.chat/core-typings'; import { Pagination } from '@rocket.chat/fuselage'; import { useDebouncedValue, useMediaQuery, useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { useEndpoint, useRouter } from '@rocket.chat/ui-contexts'; @@ -62,7 +63,7 @@ const ModerationConsoleTable = () => { placeholderData: keepPreviousData, }); - const handleClick = useEffectEvent((id): void => { + const handleClick = useEffectEvent((id: IUser['_id']): void => { router.navigate({ pattern: '/admin/moderation/:tab?/:context?/:id?', params: { diff --git a/apps/meteor/client/views/admin/moderation/UserReports/ModConsoleUsersTable.tsx b/apps/meteor/client/views/admin/moderation/UserReports/ModConsoleUsersTable.tsx index e980be1fce75..87af70d21044 100644 --- a/apps/meteor/client/views/admin/moderation/UserReports/ModConsoleUsersTable.tsx +++ b/apps/meteor/client/views/admin/moderation/UserReports/ModConsoleUsersTable.tsx @@ -1,3 +1,4 @@ +import type { IUser } from '@rocket.chat/core-typings'; import { Pagination, States, StatesAction, StatesActions, StatesIcon, StatesTitle } from '@rocket.chat/fuselage'; import { useDebouncedValue, useMediaQuery, useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { useEndpoint, useRouter } from '@rocket.chat/ui-contexts'; @@ -58,7 +59,7 @@ const ModConsoleUsersTable = () => { placeholderData: keepPreviousData, }); - const handleClick = useEffectEvent((id): void => { + const handleClick = useEffectEvent((id: IUser['_id']): void => { router.navigate({ pattern: '/admin/moderation/:tab?/:context?/:id?', params: { tab: 'users', context: 'info', id }, diff --git a/apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx b/apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx index 80ff678b1780..ae4180ead2cc 100644 --- a/apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx +++ b/apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx @@ -1,6 +1,7 @@ import { Select, Box, type SelectOption } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import moment, { type Moment } from 'moment'; +import type { Key } from 'react'; import { useMemo, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; @@ -25,7 +26,7 @@ const getWeekRange = (daysToSubtractFromStart: number, daysToSubtractFromEnd: nu const DateRangePicker = ({ onChange }: DateRangePickerProps) => { const { t } = useTranslation(); - const handleRange = useEffectEvent((range) => { + const handleRange = useEffectEvent((range: { start: string; end: string }) => { onChange(range); }); @@ -47,7 +48,7 @@ const DateRangePicker = ({ onChange }: DateRangePickerProps) => { }); }, [handleRange]); - const handleOptionClick = useEffectEvent((action) => { + const handleOptionClick = useEffectEvent((action: Key) => { switch (action) { case 'today': handleRange(getWeekRange(0, 0)); diff --git a/apps/meteor/client/views/admin/permissions/EditRolePage.tsx b/apps/meteor/client/views/admin/permissions/EditRolePage.tsx index 018750e878a1..d68998e5e09f 100644 --- a/apps/meteor/client/views/admin/permissions/EditRolePage.tsx +++ b/apps/meteor/client/views/admin/permissions/EditRolePage.tsx @@ -11,7 +11,7 @@ import { ContextualbarFooter, ContextualbarScrollableContent } from '../../../co import GenericModal from '../../../components/GenericModal'; export type EditRolePageFormData = { - roleId?: string; + roleId: string; name: string; description: string; scope: 'Users' | 'Subscriptions'; @@ -48,7 +48,7 @@ const EditRolePage = ({ role, isEnterprise }: { role?: IRole; isEnterprise: bool } }); - const handleSave = useEffectEvent(async (data) => { + const handleSave = useEffectEvent(async (data: EditRolePageFormData) => { try { if (data.roleId) { await updateRole(data); diff --git a/apps/meteor/client/views/admin/permissions/PermissionsTable/PermissionsTableFilter.tsx b/apps/meteor/client/views/admin/permissions/PermissionsTable/PermissionsTableFilter.tsx index 8bc1fea42a4d..a86f97d66e95 100644 --- a/apps/meteor/client/views/admin/permissions/PermissionsTable/PermissionsTableFilter.tsx +++ b/apps/meteor/client/views/admin/permissions/PermissionsTable/PermissionsTableFilter.tsx @@ -1,6 +1,6 @@ import { TextInput } from '@rocket.chat/fuselage'; import { useEffectEvent, useDebouncedValue } from '@rocket.chat/fuselage-hooks'; -import type { ReactElement } from 'react'; +import type { FormEvent, ReactElement } from 'react'; import { useState, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; @@ -13,7 +13,7 @@ const PermissionsTableFilter = ({ onChange }: { onChange: (debouncedFilter: stri onChange(debouncedFilter); }, [debouncedFilter, onChange]); - const handleFilter = useEffectEvent(({ currentTarget: { value } }) => { + const handleFilter = useEffectEvent(({ currentTarget: { value } }: FormEvent) => { setFilter(value); }); diff --git a/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRoleTable/UsersInRoleTable.tsx b/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRoleTable/UsersInRoleTable.tsx index d433d0b8f844..3d7d26f463cb 100644 --- a/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRoleTable/UsersInRoleTable.tsx +++ b/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRoleTable/UsersInRoleTable.tsx @@ -1,4 +1,4 @@ -import type { IRole, IRoom } from '@rocket.chat/core-typings'; +import type { IRole, IRoom, IUserInRole } from '@rocket.chat/core-typings'; import { Pagination } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { useSetModal, useToastMessageDispatch, useEndpoint } from '@rocket.chat/ui-contexts'; @@ -61,9 +61,11 @@ const UsersInRoleTable = ({ rid, roleId, roleName, description }: UsersInRoleTab _updatedAt: new Date(user._updatedAt), })) || []; - const handleRemove = useEffectEvent((username) => { + const handleRemove = useEffectEvent((username: IUserInRole['username']) => { const remove = async () => { try { + if (!username) throw new Error('Username is required'); + await removeUserFromRoleEndpoint({ roleId, username, scope: rid }); dispatchToastMessage({ type: 'success', message: t('User_removed') }); queryClient.invalidateQueries({ diff --git a/apps/meteor/client/views/admin/permissions/hooks/useChangeRole.ts b/apps/meteor/client/views/admin/permissions/hooks/useChangeRole.ts index c94d34f0fa85..0537131c46d9 100644 --- a/apps/meteor/client/views/admin/permissions/hooks/useChangeRole.ts +++ b/apps/meteor/client/views/admin/permissions/hooks/useChangeRole.ts @@ -13,7 +13,7 @@ export const useChangeRole = ({ }): ((roleId: IRole['_id'], granted: boolean) => Promise) => { const dispatchToastMessage = useToastMessageDispatch(); - return useEffectEvent(async (roleId, granted) => { + return useEffectEvent(async (roleId: IRole['_id'], granted: boolean) => { try { if (granted) { await onRemove(permissionId, roleId); diff --git a/apps/meteor/client/views/admin/rooms/EditRoom.tsx b/apps/meteor/client/views/admin/rooms/EditRoom.tsx index 9b46b1e25e56..ce20490fba08 100644 --- a/apps/meteor/client/views/admin/rooms/EditRoom.tsx +++ b/apps/meteor/client/views/admin/rooms/EditRoom.tsx @@ -32,7 +32,7 @@ type EditRoomProps = { onDelete: () => void; }; -type EditRoomFormValues = { +type EditRoomFormData = { roomName: IRoom['name']; roomTopic: string; roomType: IRoom['t']; @@ -47,7 +47,7 @@ type EditRoomFormValues = { archived: boolean; }; -const getInitialValues = (room: Pick): EditRoomFormValues => ({ +const getInitialValues = (room: Pick): EditRoomFormData => ({ roomName: room.t === 'd' ? room.usernames?.join(' x ') : roomCoordinator.getRoomName(room.t, room), roomType: room.t, readOnly: !!room.ro, @@ -73,7 +73,7 @@ const EditRoom = ({ room, onChange, onDelete }: EditRoomProps) => { reset, handleSubmit, formState: { isDirty, errors, dirtyFields }, - } = useForm({ values: getInitialValues(room) }); + } = useForm({ values: getInitialValues(room) }); const { canViewName, @@ -96,10 +96,9 @@ const EditRoom = ({ room, onChange, onDelete }: EditRoomProps) => { const handleArchive = useArchiveRoom(room); - const handleUpdateRoomData = useEffectEvent(async ({ isDefault, favorite, ...formData }) => { + const handleUpdateRoomData = useEffectEvent(async ({ isDefault, favorite, ...formData }: EditRoomFormData) => { const data = getDirtyFields(formData, dirtyFields); delete data.archived; - delete data.favorite; try { await saveAction({ @@ -117,7 +116,7 @@ const EditRoom = ({ room, onChange, onDelete }: EditRoomProps) => { } }); - const handleSave = useEffectEvent((data) => + const handleSave = useEffectEvent((data: EditRoomFormData) => Promise.all([isDirty && handleUpdateRoomData(data), changeArchiving && handleArchive()].filter(Boolean)), ); diff --git a/apps/meteor/client/views/admin/settings/groups/VoipGroupPage/AssignAgentButton.tsx b/apps/meteor/client/views/admin/settings/groups/VoipGroupPage/AssignAgentButton.tsx index 4aaaa7c96186..29d2acb685cc 100644 --- a/apps/meteor/client/views/admin/settings/groups/VoipGroupPage/AssignAgentButton.tsx +++ b/apps/meteor/client/views/admin/settings/groups/VoipGroupPage/AssignAgentButton.tsx @@ -1,6 +1,7 @@ import { IconButton } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { useSetModal } from '@rocket.chat/ui-contexts'; +import type { MouseEvent } from 'react'; import { useTranslation } from 'react-i18next'; import AssignAgentModal from './AssignAgentModal'; @@ -12,7 +13,7 @@ const AssignAgentButton = ({ extension, reload }: AssignAgentButtonProps) => { const { t } = useTranslation(); const setModal = useSetModal(); - const handleAssociation = useEffectEvent((e) => { + const handleAssociation = useEffectEvent((e: MouseEvent) => { e.stopPropagation(); setModal( setModal()} reload={reload} />); }); diff --git a/apps/meteor/client/views/admin/settings/groups/VoipGroupPage/AssignAgentModal.tsx b/apps/meteor/client/views/admin/settings/groups/VoipGroupPage/AssignAgentModal.tsx index 1757aeb77de5..0f81944b2daf 100644 --- a/apps/meteor/client/views/admin/settings/groups/VoipGroupPage/AssignAgentModal.tsx +++ b/apps/meteor/client/views/admin/settings/groups/VoipGroupPage/AssignAgentModal.tsx @@ -1,6 +1,7 @@ import { Button, Modal, Select, Field, FieldGroup, FieldLabel, FieldRow, Box } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { useToastMessageDispatch, useEndpoint } from '@rocket.chat/ui-contexts'; +import type { FormEvent } from 'react'; import { useState, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -23,7 +24,7 @@ const AssignAgentModal = ({ existingExtension, closeModal, reload }: AssignAgent const assignAgent = useEndpoint('POST', '/v1/omnichannel/agent/extension'); - const handleAssignment = useEffectEvent(async (e) => { + const handleAssignment = useEffectEvent(async (e: FormEvent) => { e.preventDefault(); try { await assignAgent({ username: agent, extension }); @@ -33,7 +34,7 @@ const AssignAgentModal = ({ existingExtension, closeModal, reload }: AssignAgent reload(); closeModal(); }); - const handleAgentChange = useEffectEvent((e) => setAgent(e)); + const handleAgentChange = useEffectEvent((e: string) => setAgent(e)); const { value: availableExtensions, phase: state } = useEndpointData('/v1/omnichannel/extension', { params: query }); diff --git a/apps/meteor/client/views/admin/settings/groups/VoipGroupPage/RemoveAgentButton.tsx b/apps/meteor/client/views/admin/settings/groups/VoipGroupPage/RemoveAgentButton.tsx index ac39806afcb2..f2c13b5329e0 100644 --- a/apps/meteor/client/views/admin/settings/groups/VoipGroupPage/RemoveAgentButton.tsx +++ b/apps/meteor/client/views/admin/settings/groups/VoipGroupPage/RemoveAgentButton.tsx @@ -1,6 +1,7 @@ import { IconButton } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { useSetModal, useToastMessageDispatch, useEndpoint } from '@rocket.chat/ui-contexts'; +import type { MouseEvent } from 'react'; import { useTranslation } from 'react-i18next'; import GenericModal from '../../../../../components/GenericModal'; @@ -23,7 +24,7 @@ const RemoveAgentButton = ({ username, reload }: RemoveAgentButtonProps) => { reload(); }); - const handleDelete = useEffectEvent((e) => { + const handleDelete = useEffectEvent((e: MouseEvent) => { e.stopPropagation(); const onDeleteAgent = async (): Promise => { try { diff --git a/apps/meteor/client/views/admin/users/UsersTable/UsersTable.tsx b/apps/meteor/client/views/admin/users/UsersTable/UsersTable.tsx index 838c513ea796..bd23c13b88de 100644 --- a/apps/meteor/client/views/admin/users/UsersTable/UsersTable.tsx +++ b/apps/meteor/client/views/admin/users/UsersTable/UsersTable.tsx @@ -1,4 +1,4 @@ -import type { IRole, Serialized } from '@rocket.chat/core-typings'; +import type { IRole, IUser, Serialized } from '@rocket.chat/core-typings'; import { Pagination } from '@rocket.chat/fuselage'; import { useEffectEvent, useBreakpoints } from '@rocket.chat/fuselage-hooks'; import type { PaginatedResult, DefaultUserInfo } from '@rocket.chat/rest-typings'; @@ -63,7 +63,7 @@ const UsersTable = ({ return (event as KeyboardEvent).key !== undefined; }; - const handleClickOrKeyDown = useEffectEvent((id, e: MouseEvent | KeyboardEvent): void => { + const handleClickOrKeyDown = useEffectEvent((id: IUser['_id'], e: MouseEvent | KeyboardEvent): void => { e.stopPropagation(); const keyboardSubmitKeys = ['Enter', ' ']; diff --git a/apps/meteor/client/views/audit/components/forms/DateRangePicker.tsx b/apps/meteor/client/views/audit/components/forms/DateRangePicker.tsx index fbb5f18bfb5e..9d659169622e 100644 --- a/apps/meteor/client/views/audit/components/forms/DateRangePicker.tsx +++ b/apps/meteor/client/views/audit/components/forms/DateRangePicker.tsx @@ -1,7 +1,7 @@ import { Box, InputBox, Menu, Margins, Option } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import moment from 'moment'; -import type { ReactElement, ComponentProps, SetStateAction } from 'react'; +import type { ReactElement, ComponentProps, SetStateAction, FormEvent } from 'react'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -122,11 +122,11 @@ const DateRangePicker = ({ value, onChange, ...props }: DateRangePickerProps): R onChange?.(newRange); }); - const handleChangeStart = useEffectEvent(({ currentTarget }) => { + const handleChangeStart = useEffectEvent(({ currentTarget }: FormEvent) => { dispatch({ newStart: currentTarget.value }); }); - const handleChangeEnd = useEffectEvent(({ currentTarget }) => { + const handleChangeEnd = useEffectEvent(({ currentTarget }: FormEvent) => { dispatch({ newEnd: currentTarget.value }); }); diff --git a/apps/meteor/client/views/e2e/EnterE2EPasswordModal.tsx b/apps/meteor/client/views/e2e/EnterE2EPasswordModal.tsx index 888afa1d7b3e..0a439705e0eb 100644 --- a/apps/meteor/client/views/e2e/EnterE2EPasswordModal.tsx +++ b/apps/meteor/client/views/e2e/EnterE2EPasswordModal.tsx @@ -1,7 +1,7 @@ import { Box, PasswordInput, Field, FieldGroup, FieldRow, FieldError } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import DOMPurify from 'dompurify'; -import type { ChangeEvent, ReactElement } from 'react'; +import type { ChangeEvent, FormEvent, ReactElement } from 'react'; import { useState, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -28,7 +28,7 @@ const EnterE2EPasswordModal = ({ [setPassword], ); - const handleConfirm = useEffectEvent((e): void => { + const handleConfirm = useEffectEvent((e: FormEvent): void => { e.preventDefault(); if (password === '') { setPasswordError(t('Invalid_pass')); diff --git a/apps/meteor/client/views/modal/uikit/hooks/useValues.ts b/apps/meteor/client/views/modal/uikit/hooks/useValues.ts deleted file mode 100644 index c2dbe247dcce..000000000000 --- a/apps/meteor/client/views/modal/uikit/hooks/useValues.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; -import type { Block, LayoutBlock } from '@rocket.chat/ui-kit'; -import { useReducer } from 'react'; - -type LayoutBlockWithElement = Extract; -type LayoutBlockWithElements = Extract; -type ElementFromLayoutBlock = LayoutBlockWithElement['element'] | LayoutBlockWithElements['elements'][number]; - -const hasElementInBlock = (block: LayoutBlock): block is LayoutBlockWithElement => 'element' in block; -const hasElementsInBlock = (block: LayoutBlock): block is LayoutBlockWithElements => 'elements' in block; -const hasInitialValueAndActionId = ( - element: ElementFromLayoutBlock, -): element is Extract & { initialValue: unknown } => - 'initialValue' in element && 'actionId' in element && typeof element.actionId === 'string' && !!element?.initialValue; - -const extractValue = (element: ElementFromLayoutBlock, obj: Record, blockId?: string) => { - if (hasInitialValueAndActionId(element)) { - obj[element.actionId] = { value: element.initialValue, blockId }; - } -}; - -const reduceBlocks = (obj: Record, block: LayoutBlock) => { - if (hasElementInBlock(block)) { - extractValue(block.element, obj, block.blockId); - } - if (hasElementsInBlock(block)) { - for (const element of block.elements) { - extractValue(element, obj, block.blockId); - } - } - - return obj; -}; - -export const useValues = (blocks: Block[]) => { - const reducer = useEffectEvent((values, { actionId, payload }) => ({ - ...values, - [actionId]: payload, - })); - - const initializer = useEffectEvent((blocks: LayoutBlock[]) => { - const obj: Record = {}; - - return blocks.reduce(reduceBlocks, obj); - }); - - return useReducer(reducer, blocks, initializer); -}; diff --git a/apps/meteor/client/views/omnichannel/agents/AgentEdit.tsx b/apps/meteor/client/views/omnichannel/agents/AgentEdit.tsx index 0cbfc9ea95fd..f643e99a8ebb 100644 --- a/apps/meteor/client/views/omnichannel/agents/AgentEdit.tsx +++ b/apps/meteor/client/views/omnichannel/agents/AgentEdit.tsx @@ -1,4 +1,4 @@ -import type { ILivechatAgent, ILivechatDepartment, ILivechatDepartmentAgents } from '@rocket.chat/core-typings'; +import type { ILivechatAgent, ILivechatAgentStatus, ILivechatDepartment, ILivechatDepartmentAgents } from '@rocket.chat/core-typings'; import { Field, FieldLabel, @@ -32,6 +32,16 @@ import { import { UserInfoAvatar } from '../../../components/UserInfo'; import { MaxChatsPerAgent } from '../additionalForms'; +type AgentEditFormData = { + name: string | undefined; + username: string | undefined; + email: string | undefined; + departments: string[]; + status: ILivechatAgentStatus; + maxNumberSimultaneousChat: number; + voipExtension: string; +}; + type AgentEditProps = { agentData: Pick; userDepartments: (Pick & { departmentName: string })[]; @@ -81,7 +91,7 @@ const AgentEdit = ({ agentData, userDepartments, availableDepartments }: AgentEd const initialDepartmentValue = useMemo(() => userDepartments.map(({ departmentId }) => departmentId) || [], [userDepartments]); - const methods = useForm({ + const methods = useForm({ values: { name, username, @@ -103,7 +113,7 @@ const AgentEdit = ({ agentData, userDepartments, availableDepartments }: AgentEd const saveAgentInfo = useMethod('livechat:saveAgentInfo'); const saveAgentStatus = useEndpoint('POST', '/v1/livechat/agent.status'); - const handleSave = useEffectEvent(async ({ status, departments, ...data }) => { + const handleSave = useEffectEvent(async ({ status, departments, ...data }: AgentEditFormData) => { try { await saveAgentStatus({ agentId: agentData._id, status }); await saveAgentInfo(agentData._id, data, departments); diff --git a/apps/meteor/client/views/omnichannel/agents/AgentsTable/AgentsTable.tsx b/apps/meteor/client/views/omnichannel/agents/AgentsTable/AgentsTable.tsx index 448dee910c03..068745fe3824 100644 --- a/apps/meteor/client/views/omnichannel/agents/AgentsTable/AgentsTable.tsx +++ b/apps/meteor/client/views/omnichannel/agents/AgentsTable/AgentsTable.tsx @@ -39,7 +39,7 @@ const AgentsTable = () => { const [defaultQuery] = useState(hashKey([query])); const queryHasChanged = defaultQuery !== hashKey([query]); - const onHeaderClick = useEffectEvent((id) => { + const onHeaderClick = useEffectEvent((id: 'name' | 'username' | 'emails.address' | 'statusLivechat') => { if (sortBy === id) { setSort(id, sortDirection === 'asc' ? 'desc' : 'asc'); return; diff --git a/apps/meteor/client/views/omnichannel/analytics/DateRangePicker.tsx b/apps/meteor/client/views/omnichannel/analytics/DateRangePicker.tsx index 72859bfc7495..427591f4aeaa 100644 --- a/apps/meteor/client/views/omnichannel/analytics/DateRangePicker.tsx +++ b/apps/meteor/client/views/omnichannel/analytics/DateRangePicker.tsx @@ -2,7 +2,7 @@ import { Box, InputBox, Menu, Field, FieldLabel, FieldRow } from '@rocket.chat/f import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import type { Moment } from 'moment'; import moment from 'moment'; -import type { ComponentProps } from 'react'; +import type { ComponentProps, FormEvent } from 'react'; import { useState, useMemo, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; @@ -32,7 +32,7 @@ const DateRangePicker = ({ onChange = () => undefined, ...props }: DateRangePick const { start, end } = range; - const handleStart = useEffectEvent(({ currentTarget }) => { + const handleStart = useEffectEvent(({ currentTarget }: FormEvent) => { const rangeObj = { start: currentTarget.value, end: range.end, @@ -41,7 +41,7 @@ const DateRangePicker = ({ onChange = () => undefined, ...props }: DateRangePick onChange(rangeObj); }); - const handleEnd = useEffectEvent(({ currentTarget }) => { + const handleEnd = useEffectEvent(({ currentTarget }: FormEvent) => { const rangeObj = { end: currentTarget.value, start: range.start, @@ -50,7 +50,7 @@ const DateRangePicker = ({ onChange = () => undefined, ...props }: DateRangePick onChange(rangeObj); }); - const handleRange = useEffectEvent((range) => { + const handleRange = useEffectEvent((range: { start: string; end: string }) => { setRange(range); onChange(range); }); diff --git a/apps/meteor/client/views/omnichannel/analytics/InterchangeableChart.tsx b/apps/meteor/client/views/omnichannel/analytics/InterchangeableChart.tsx index 9708ddf2003a..8daa8481aa8a 100644 --- a/apps/meteor/client/views/omnichannel/analytics/InterchangeableChart.tsx +++ b/apps/meteor/client/views/omnichannel/analytics/InterchangeableChart.tsx @@ -57,32 +57,42 @@ const InterchangeableChart = ({ const loadData = useMethod('livechat:getAnalyticsChartData'); - const draw = useEffectEvent(async (params) => { - try { - const tooltipCallbacks = getChartTooltips(chartName); - if (!params?.daterange?.from || !params?.daterange?.to) { - return; - } - const result = await loadData(params); - if (!result?.chartLabel || !result?.dataLabels || !result?.dataPoints) { - throw new Error('Error! fetching chart data. Details: livechat:getAnalyticsChartData => Missing Data'); + const draw = useEffectEvent( + async (params: { + daterange: { + from: string; + to: string; + }; + chartOptions: { + name: string; + }; + }) => { + try { + const tooltipCallbacks = getChartTooltips(chartName); + if (!params?.daterange?.from || !params?.daterange?.to) { + return; + } + const result = await loadData(params); + if (!result?.chartLabel || !result?.dataLabels || !result?.dataPoints) { + throw new Error('Error! fetching chart data. Details: livechat:getAnalyticsChartData => Missing Data'); + } + (context.current || typeof context.current === 'undefined') && + canvas.current && + (context.current = await drawLineChart( + canvas.current, + context.current, + [result.chartLabel], + result.dataLabels, + [result.dataPoints], + { + tooltipCallbacks, + }, + )); + } catch (error) { + dispatchToastMessage({ type: 'error', message: error }); } - (context.current || typeof context.current === 'undefined') && - canvas.current && - (context.current = await drawLineChart( - canvas.current, - context.current, - [result.chartLabel], - result.dataLabels, - [result.dataPoints], - { - tooltipCallbacks, - }, - )); - } catch (error) { - dispatchToastMessage({ type: 'error', message: error }); - } - }); + }, + ); useEffect(() => { draw({ diff --git a/apps/meteor/client/views/omnichannel/appearance/AppearancePage.tsx b/apps/meteor/client/views/omnichannel/appearance/AppearancePage.tsx index b37e1ec0f5d4..e2d4780585e7 100644 --- a/apps/meteor/client/views/omnichannel/appearance/AppearancePage.tsx +++ b/apps/meteor/client/views/omnichannel/appearance/AppearancePage.tsx @@ -45,7 +45,7 @@ const AppearancePage = ({ settings }: { settings: Serialized[] }) => { const saveAction = useEndpoint('POST', '/v1/livechat/appearance'); - const methods = useForm({ defaultValues: reduceAppearance(settings) }); + const methods = useForm({ defaultValues: reduceAppearance(settings) }); const { reset, formState: { isDirty }, @@ -55,7 +55,7 @@ const AppearancePage = ({ settings }: { settings: Serialized[] }) => { const currentData = watch(); - const handleSave = useEffectEvent(async (data) => { + const handleSave = useEffectEvent(async (data: LivechatAppearanceSettings) => { const mappedAppearance = Object.entries(data) .map(([_id, value]) => ({ _id, value })) .filter((item) => item.value !== undefined) as { diff --git a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsRoute.tsx b/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsRoute.tsx index c94cfbfd989f..730cecf1e400 100644 --- a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsRoute.tsx +++ b/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsRoute.tsx @@ -13,7 +13,7 @@ const CurrentChatsRoute = (): ReactElement => { const canViewCurrentChats = usePermission('view-livechat-current-chats'); const router = useRouter(); - const onRowClick = useEffectEvent((_id) => { + const onRowClick = useEffectEvent((_id: string) => { router.navigate(`/omnichannel/current/${_id}`); }); diff --git a/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx b/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx index 914b8f608cc4..3d42313ff4d7 100644 --- a/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx +++ b/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx @@ -2,7 +2,7 @@ import { TextInput, Box, Select, InputBox } from '@rocket.chat/fuselage'; import { useEffectEvent, useLocalStorage } from '@rocket.chat/fuselage-hooks'; import { useSetModal, useToastMessageDispatch, useMethod } from '@rocket.chat/ui-contexts'; import moment from 'moment'; -import type { Dispatch, SetStateAction } from 'react'; +import type { Dispatch, FormEvent, Key, SetStateAction } from 'react'; import { useEffect } from 'react'; import { useTranslation } from 'react-i18next'; @@ -42,13 +42,13 @@ const FilterByText = ({ setFilter, reload, customFields, setCustomFields, hasCus const [to, setTo] = useLocalStorage('to', ''); const [tags, setTags] = useLocalStorage('tags', []); - const handleGuest = useEffectEvent((e) => setGuest(e.target.value)); - const handleServedBy = useEffectEvent((e) => setServedBy(e)); - const handleStatus = useEffectEvent((e) => setStatus(e)); - const handleDepartment = useEffectEvent((e) => setDepartment(e)); - const handleFrom = useEffectEvent((e) => setFrom(e.target.value)); - const handleTo = useEffectEvent((e) => setTo(e.target.value)); - const handleTags = useEffectEvent((e) => setTags(e)); + const handleGuest = useEffectEvent((e: FormEvent) => setGuest(e.currentTarget.value)); + const handleServedBy = useEffectEvent((e: string) => setServedBy(e)); + const handleStatus = useEffectEvent((e: Key) => setStatus(e as string)); + const handleDepartment = useEffectEvent((e: string) => setDepartment(e)); + const handleFrom = useEffectEvent((e: FormEvent) => setFrom(e.currentTarget.value)); + const handleTo = useEffectEvent((e: FormEvent) => setTo(e.currentTarget.value)); + const handleTags = useEffectEvent((e: { label: string; value: string }[]) => setTags(e)); const reset = useEffectEvent(() => { setGuest(''); @@ -61,7 +61,7 @@ const FilterByText = ({ setFilter, reload, customFields, setCustomFields, hasCus setCustomFields(undefined); }); - const onSubmit = useEffectEvent((e) => e.preventDefault()); + const onSubmit = useEffectEvent((e: FormEvent) => e.preventDefault()); useEffect(() => { setFilter((data) => ({ diff --git a/apps/meteor/client/views/omnichannel/currentChats/RemoveChatButton.tsx b/apps/meteor/client/views/omnichannel/currentChats/RemoveChatButton.tsx index a028b29b073f..2558055f7ea3 100644 --- a/apps/meteor/client/views/omnichannel/currentChats/RemoveChatButton.tsx +++ b/apps/meteor/client/views/omnichannel/currentChats/RemoveChatButton.tsx @@ -1,6 +1,7 @@ import { IconButton } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { useSetModal, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; +import type { MouseEvent } from 'react'; import { useTranslation } from 'react-i18next'; import { useRemoveCurrentChatMutation } from './hooks/useRemoveCurrentChatMutation'; @@ -18,7 +19,7 @@ const RemoveChatButton = ({ _id }: RemoveChatButtonProps) => { removeCurrentChatMutation.mutate(_id); }); - const handleDelete = useEffectEvent((e) => { + const handleDelete = useEffectEvent((e: MouseEvent) => { e.stopPropagation(); const onDeleteAgent = async (): Promise => { try { diff --git a/apps/meteor/client/views/omnichannel/customFields/CustomFieldsTable.tsx b/apps/meteor/client/views/omnichannel/customFields/CustomFieldsTable.tsx index 6c96bb87f859..6121fdc6ad49 100644 --- a/apps/meteor/client/views/omnichannel/customFields/CustomFieldsTable.tsx +++ b/apps/meteor/client/views/omnichannel/customFields/CustomFieldsTable.tsx @@ -28,7 +28,7 @@ const CustomFieldsTable = () => { const { sortBy, sortDirection, setSort } = useSort<'_id' | 'label' | 'scope' | 'visibility'>('_id'); const handleAddNew = useEffectEvent(() => router.navigate('/omnichannel/customfields/new')); - const onRowClick = useEffectEvent((id) => () => router.navigate(`/omnichannel/customfields/edit/${id}`)); + const onRowClick = useEffectEvent((id: string) => () => router.navigate(`/omnichannel/customfields/edit/${id}`)); const handleDelete = useRemoveCustomField(); diff --git a/apps/meteor/client/views/omnichannel/customFields/EditCustomFields.tsx b/apps/meteor/client/views/omnichannel/customFields/EditCustomFields.tsx index e8bd17e2576f..aa0877ad9bcc 100644 --- a/apps/meteor/client/views/omnichannel/customFields/EditCustomFields.tsx +++ b/apps/meteor/client/views/omnichannel/customFields/EditCustomFields.tsx @@ -76,7 +76,7 @@ const EditCustomFields = ({ customFieldData }: { customFieldData?: Serialized { + const handleSave = useEffectEvent(async ({ visibility, ...data }: EditCustomFieldsFormData) => { try { await saveCustomField(customFieldData?._id as unknown as string, { visibility: visibility ? 'visible' : 'hidden', diff --git a/apps/meteor/client/views/omnichannel/customFields/useRemoveCustomField.tsx b/apps/meteor/client/views/omnichannel/customFields/useRemoveCustomField.tsx index 4dd947ad8dbf..b075319cf510 100644 --- a/apps/meteor/client/views/omnichannel/customFields/useRemoveCustomField.tsx +++ b/apps/meteor/client/views/omnichannel/customFields/useRemoveCustomField.tsx @@ -12,7 +12,7 @@ export const useRemoveCustomField = () => { const removeCustomField = useMethod('livechat:removeCustomField'); const queryClient = useQueryClient(); - const handleDelete = useEffectEvent((id) => { + const handleDelete = useEffectEvent((id: string) => { const onDeleteAgent = async () => { try { await removeCustomField(id); diff --git a/apps/meteor/client/views/omnichannel/departments/DepartmentAgentsTable/AddAgent.tsx b/apps/meteor/client/views/omnichannel/departments/DepartmentAgentsTable/AddAgent.tsx index 976b62891a12..482397dff0fe 100644 --- a/apps/meteor/client/views/omnichannel/departments/DepartmentAgentsTable/AddAgent.tsx +++ b/apps/meteor/client/views/omnichannel/departments/DepartmentAgentsTable/AddAgent.tsx @@ -17,7 +17,7 @@ function AddAgent({ agentList, onAdd }: { agentList: IDepartmentAgent[]; onAdd: const dispatchToastMessage = useToastMessageDispatch(); - const handleAgent = useEffectEvent((e) => setUserId(e)); + const handleAgent = useEffectEvent((e: string) => setUserId(e)); const handleSave = useEffectEvent(async () => { if (!userId) { diff --git a/apps/meteor/client/views/omnichannel/departments/DepartmentAgentsTable/RemoveAgentButton.tsx b/apps/meteor/client/views/omnichannel/departments/DepartmentAgentsTable/RemoveAgentButton.tsx index fc26999d1f47..9b41cf23b41b 100644 --- a/apps/meteor/client/views/omnichannel/departments/DepartmentAgentsTable/RemoveAgentButton.tsx +++ b/apps/meteor/client/views/omnichannel/departments/DepartmentAgentsTable/RemoveAgentButton.tsx @@ -1,6 +1,7 @@ import { IconButton } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { useSetModal, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; +import type { MouseEvent } from 'react'; import { useTranslation } from 'react-i18next'; import GenericModal from '../../../../components/GenericModal'; @@ -10,7 +11,7 @@ function RemoveAgentButton({ agentId, onRemove }: { agentId: string; onRemove: ( const dispatchToastMessage = useToastMessageDispatch(); const { t } = useTranslation(); - const handleDelete = useEffectEvent((e) => { + const handleDelete = useEffectEvent((e: MouseEvent) => { e.stopPropagation(); const onRemoveAgent = async () => { diff --git a/apps/meteor/client/views/omnichannel/departments/DepartmentsPage.tsx b/apps/meteor/client/views/omnichannel/departments/DepartmentsPage.tsx index bbc71c31b816..faa32004aa3b 100644 --- a/apps/meteor/client/views/omnichannel/departments/DepartmentsPage.tsx +++ b/apps/meteor/client/views/omnichannel/departments/DepartmentsPage.tsx @@ -14,10 +14,14 @@ const DepartmentsPage = () => { const context = useRouteParameter('context'); const id = useRouteParameter('id'); - const handleTabClick = useEffectEvent((tab) => - departmentsRoute.push({ - context: tab, - }), + const handleTabClick = useEffectEvent((tab: undefined | 'archived') => + departmentsRoute.push( + tab + ? { + context: tab, + } + : {}, + ), ); const onAddNew = useEffectEvent(() => diff --git a/apps/meteor/client/views/omnichannel/departments/DepartmentsTable/RemoveDepartmentModal.tsx b/apps/meteor/client/views/omnichannel/departments/DepartmentsTable/RemoveDepartmentModal.tsx index 2c7c150a581c..802739cc2ff2 100644 --- a/apps/meteor/client/views/omnichannel/departments/DepartmentsTable/RemoveDepartmentModal.tsx +++ b/apps/meteor/client/views/omnichannel/departments/DepartmentsTable/RemoveDepartmentModal.tsx @@ -1,7 +1,7 @@ import { Box, Input } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { useToastMessageDispatch, useEndpoint } from '@rocket.chat/ui-contexts'; -import type { ChangeEvent, ReactElement } from 'react'; +import type { ChangeEvent, FormEvent, ReactElement } from 'react'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -21,7 +21,7 @@ const RemoveDepartmentModal = ({ _id = '', name, reset, onClose }: RemoveDepartm const removeDepartment = useEndpoint('DELETE', '/v1/livechat/department/:_id', { _id }); const dispatchToast = useToastMessageDispatch(); - const onSubmit = useEffectEvent(async (e) => { + const onSubmit = useEffectEvent(async (e: FormEvent) => { e.preventDefault(); try { diff --git a/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx b/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx index 8c2b4b2a98bc..4fd437aedac0 100644 --- a/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx +++ b/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx @@ -41,14 +41,14 @@ const CallTable = () => { 500, ); - const onRowClick = useEffectEvent((id, token) => { + const onRowClick = useEffectEvent((id: string, token?: string) => { directoryRoute.push( { tab: 'calls', context: 'info', id, }, - { token }, + token ? { token } : {}, ); }); diff --git a/apps/meteor/client/views/omnichannel/directory/chats/ChatsTable/ChatsTableRow.tsx b/apps/meteor/client/views/omnichannel/directory/chats/ChatsTable/ChatsTableRow.tsx index 2660702e0d26..c48ae5ca30fe 100644 --- a/apps/meteor/client/views/omnichannel/directory/chats/ChatsTable/ChatsTableRow.tsx +++ b/apps/meteor/client/views/omnichannel/directory/chats/ChatsTable/ChatsTableRow.tsx @@ -36,7 +36,7 @@ const ChatsTableRow = (room: IOmnichannelRoomWithDepartment) => { return onHold ? t('On_Hold_Chats') : t('Room_Status_Open'); }; - const onRowClick = useEffectEvent((id) => + const onRowClick = useEffectEvent((id: string) => directoryRoute.push({ tab: 'chats', context: 'info', diff --git a/apps/meteor/client/views/omnichannel/directory/contacts/ContactTableRow.tsx b/apps/meteor/client/views/omnichannel/directory/contacts/ContactTableRow.tsx index 356561d0975d..78304d132a13 100644 --- a/apps/meteor/client/views/omnichannel/directory/contacts/ContactTableRow.tsx +++ b/apps/meteor/client/views/omnichannel/directory/contacts/ContactTableRow.tsx @@ -26,7 +26,7 @@ const ContactTableRow = ({ _id, name, phones, contactManager, lastChat, channels })[0]; const onRowClick = useEffectEvent( - (id) => (): void => + (id: string) => (): void => directoryRoute.push({ id, tab: 'contacts', diff --git a/apps/meteor/client/views/omnichannel/managers/RemoveManagerButton.tsx b/apps/meteor/client/views/omnichannel/managers/RemoveManagerButton.tsx index 7c9e7df45cdc..da3960077e19 100644 --- a/apps/meteor/client/views/omnichannel/managers/RemoveManagerButton.tsx +++ b/apps/meteor/client/views/omnichannel/managers/RemoveManagerButton.tsx @@ -1,7 +1,7 @@ import { IconButton } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { useSetModal, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import type { MouseEvent, ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import GenericModal from '../../../components/GenericModal'; @@ -18,7 +18,7 @@ const RemoveManagerButton = ({ _id, reload }: { _id: string; reload: () => void await deleteAction(); reload(); }); - const handleDelete = useEffectEvent((e) => { + const handleDelete = useEffectEvent((e: MouseEvent) => { e.stopPropagation(); const onDeleteManager = async (): Promise => { try { diff --git a/apps/meteor/client/views/omnichannel/queueList/QueueListFilter.tsx b/apps/meteor/client/views/omnichannel/queueList/QueueListFilter.tsx index b73966e5e276..c3022430fd31 100644 --- a/apps/meteor/client/views/omnichannel/queueList/QueueListFilter.tsx +++ b/apps/meteor/client/views/omnichannel/queueList/QueueListFilter.tsx @@ -1,6 +1,6 @@ import { Box, Select, Label } from '@rocket.chat/fuselage'; import { useEffectEvent, useLocalStorage } from '@rocket.chat/fuselage-hooks'; -import type { Dispatch, SetStateAction } from 'react'; +import type { Dispatch, FormEvent, Key, SetStateAction } from 'react'; import { useEffect } from 'react'; import { useTranslation } from 'react-i18next'; @@ -23,11 +23,11 @@ export const QueueListFilter = ({ setFilter, ...props }: QueueListFilterProps) = const [status, setStatus] = useLocalStorage('status', 'online'); const [department, setDepartment] = useLocalStorage('department', 'all'); - const handleServedBy = useEffectEvent((e) => setServedBy(e)); - const handleStatus = useEffectEvent((e) => setStatus(e)); - const handleDepartment = useEffectEvent((e) => setDepartment(e)); + const handleServedBy = useEffectEvent((e: string) => setServedBy(e)); + const handleStatus = useEffectEvent((e: Key) => setStatus(e as string)); + const handleDepartment = useEffectEvent((e: string) => setDepartment(e)); - const onSubmit = useEffectEvent((e) => e.preventDefault()); + const onSubmit = useEffectEvent((e: FormEvent) => e.preventDefault()); useEffect(() => { const filters = { status } as { diff --git a/apps/meteor/client/views/omnichannel/realTimeMonitoring/RealTimeMonitoringPage.tsx b/apps/meteor/client/views/omnichannel/realTimeMonitoring/RealTimeMonitoringPage.tsx index 0f0650094a2b..5933825514b2 100644 --- a/apps/meteor/client/views/omnichannel/realTimeMonitoring/RealTimeMonitoringPage.tsx +++ b/apps/meteor/client/views/omnichannel/realTimeMonitoring/RealTimeMonitoringPage.tsx @@ -1,7 +1,7 @@ import type { SelectOption } from '@rocket.chat/fuselage'; import { Box, Select, Margins, Option } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; -import type { MutableRefObject } from 'react'; +import type { Key, MutableRefObject } from 'react'; import { useRef, useState, useMemo, useEffect, Fragment } from 'react'; import { useTranslation } from 'react-i18next'; @@ -103,7 +103,7 @@ const RealTimeMonitoringPage = () => {