From 8fd5ac16ac961040145d9c64ef461cea00563824 Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Fri, 23 Jul 2021 18:56:05 -0300 Subject: [PATCH 1/4] Fix 1 day delay and update nivo version --- .../components/UsersTab/NewUsersSection.js | 13 +- package-lock.json | 265 ++++++++---------- package.json | 10 +- 3 files changed, 129 insertions(+), 159 deletions(-) diff --git a/ee/app/engagement-dashboard/client/components/UsersTab/NewUsersSection.js b/ee/app/engagement-dashboard/client/components/UsersTab/NewUsersSection.js index c433ecdabb834..a9866a64e18f7 100644 --- a/ee/app/engagement-dashboard/client/components/UsersTab/NewUsersSection.js +++ b/ee/app/engagement-dashboard/client/components/UsersTab/NewUsersSection.js @@ -35,7 +35,7 @@ const NewUsersSection = ({ timezone }) => { ? moment().set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).subtract(7, 'days').utc() : moment().set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).subtract(7, 'days'), end: utc - ? moment.utc().set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).subtract(1, 'days').utc() + ? moment().set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).subtract(1, 'days').utc() : moment().set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).subtract(1, 'days'), }; @@ -45,7 +45,7 @@ const NewUsersSection = ({ timezone }) => { ? moment().set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).subtract(30, 'days').utc() : moment().set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).subtract(30, 'days'), end: utc - ? moment.utc().set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).subtract(1, 'days').utc() + ? moment().set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).subtract(1, 'days').utc() : moment().set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).subtract(1, 'days'), }; @@ -209,11 +209,10 @@ const NewUsersSection = ({ timezone }) => { }, }, tooltip: { - container: { - backgroundColor: '#1F2329', - boxShadow: '0px 0px 12px rgba(47, 52, 61, 0.12), 0px 0px 2px rgba(47, 52, 61, 0.08)', - borderRadius: 2, - }, + backgroundColor: '#1F2329', + boxShadow: '0px 0px 12px rgba(47, 52, 61, 0.12), 0px 0px 2px rgba(47, 52, 61, 0.08)', + borderRadius: 2, + padding: 4, }, }} tooltip={({ value, indexValue }) => diff --git a/package-lock.json b/package-lock.json index 51c31183e9f46..376536f406fd6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4485,35 +4485,35 @@ } }, "@nivo/annotations": { - "version": "0.70.1", - "resolved": "https://registry.npmjs.org/@nivo/annotations/-/annotations-0.70.1.tgz", - "integrity": "sha512-5DmciXCt2DkegkvfdqiJyEYedFiSyoByzIwXMrAHDKM0agw4Z2YWzCjodNSeM5jhMR3MLwscbcCWDAv174InLg==", + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@nivo/annotations/-/annotations-0.73.0.tgz", + "integrity": "sha512-1rLAX5tcQh1Zo8ToENIO2WI1va72UhKc9K3219rtGRhXsy3f2hbmRZiw/iOJCLqzGtmT8RIKA++hOExWSyh4dQ==", "requires": { - "@nivo/colors": "0.70.1", - "@react-spring/web": "9.1.2", - "lodash": "^4.17.11" + "@nivo/colors": "0.73.0", + "@react-spring/web": "9.2.4", + "lodash": "^4.17.21" } }, "@nivo/arcs": { - "version": "0.70.1", - "resolved": "https://registry.npmjs.org/@nivo/arcs/-/arcs-0.70.1.tgz", - "integrity": "sha512-4x56KlSN573wm7EpVKj9SddiQQz1jqbxsc5G8Pyhf+MBTcD5jSazNKIRg1HdbuWWqIiaTjc41lW54DkOkkhNSQ==", + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@nivo/arcs/-/arcs-0.73.0.tgz", + "integrity": "sha512-jIjqr3McQUrDWoP6X4CZh8Tg0HphLZdU6K1IDfna2nkG8Dkr2LcB7Ejt5SFbhff+0SC/hjvjNC//h8vcynl7yA==", "requires": { - "@nivo/colors": "0.70.1", - "@react-spring/web": "9.1.2", + "@nivo/colors": "0.73.0", + "@react-spring/web": "9.2.4", "d3-shape": "^1.3.5" } }, "@nivo/axes": { - "version": "0.70.1", - "resolved": "https://registry.npmjs.org/@nivo/axes/-/axes-0.70.1.tgz", - "integrity": "sha512-jde8UOvdp3sYL3Y+GjhFNPF9cHlkCFxBvA4QSncUaLE6vFvO4WK2LIt0NDr6oKCoF6NhR0Z3YcjshYT1EBbPKw==", + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@nivo/axes/-/axes-0.73.0.tgz", + "integrity": "sha512-tyB+PqQTW117q9E5vz1jVTywDG6mjqD/RvtVGeqAwHziHAQxpSVb+r0UUtTFOgyaddEbLDaOXPqjD3l6Npo89g==", "requires": { - "@nivo/scales": "0.70.0", - "@react-spring/web": "9.1.2", + "@nivo/scales": "0.73.0", + "@react-spring/web": "9.2.4", "d3-format": "^1.4.4", "d3-time": "^1.0.11", - "d3-time-format": "^2.1.3" + "d3-time-format": "^3.0.0" }, "dependencies": { "d3-format": { @@ -4525,54 +4525,46 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.1.0.tgz", "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==" - }, - "d3-time-format": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz", - "integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==", - "requires": { - "d3-time": "1" - } } } }, "@nivo/bar": { - "version": "0.70.1", - "resolved": "https://registry.npmjs.org/@nivo/bar/-/bar-0.70.1.tgz", - "integrity": "sha512-BT9UmXSTCSQWXj904eUSj4+GcG45Q5IbRFYhDpsDja3SW2yocyGCEy1zLqGP6y9GtX9MFmGQrmP6CEkY5ddQ7w==", - "requires": { - "@nivo/annotations": "0.70.1", - "@nivo/axes": "0.70.1", - "@nivo/colors": "0.70.1", - "@nivo/legends": "0.70.1", - "@nivo/recompose": "0.70.0", - "@nivo/scales": "0.70.0", - "@nivo/tooltip": "0.70.1", + "version": "0.73.1", + "resolved": "https://registry.npmjs.org/@nivo/bar/-/bar-0.73.1.tgz", + "integrity": "sha512-sBltCxCEgFV7kErW4K14OSUjsU1cmYAWWvKoelVI1NTJ0MWhH/Z4UVip6+Zk7/TOzdZntT0x3SE6cAc9Ov7rxg==", + "requires": { + "@nivo/annotations": "0.73.0", + "@nivo/axes": "0.73.0", + "@nivo/colors": "0.73.0", + "@nivo/legends": "0.73.0", + "@nivo/recompose": "0.73.0", + "@nivo/scales": "0.73.0", + "@nivo/tooltip": "0.73.0", + "@react-spring/web": "9.2.4", "d3-scale": "^3.2.3", "d3-shape": "^1.2.2", - "lodash": "^4.17.11", - "react-motion": "^0.5.2" + "lodash": "^4.17.21" } }, "@nivo/colors": { - "version": "0.70.1", - "resolved": "https://registry.npmjs.org/@nivo/colors/-/colors-0.70.1.tgz", - "integrity": "sha512-PexRlQzybxfeX7noIl0lzIK4VAItEmx9dG8qo9iHkgrDzY6XSxRIMqIGb8aqu7aiopbpivdZ44Ud2bA1O89NUg==", + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@nivo/colors/-/colors-0.73.0.tgz", + "integrity": "sha512-6T1FBR+sv7cCfAZCkjeY71//W4RqDNGkXJqsnyJA/6EsjLEbOBc1l2v66cRmZs2bioOkYcS+f4hQxB9d1WAgwA==", "requires": { "d3-color": "^2.0.0", "d3-scale": "^3.2.3", "d3-scale-chromatic": "^2.0.0", - "lodash": "^4.17.11", + "lodash": "^4.17.21", "react-motion": "^0.5.2" } }, "@nivo/core": { - "version": "0.70.1", - "resolved": "https://registry.npmjs.org/@nivo/core/-/core-0.70.1.tgz", - "integrity": "sha512-j+SCOCR5TdXrpy25gnNoWjyU4p3nCupEJDhJsfNF+VeIDm84Zpzk9bT8DGlXKSKHKHql4Cg+9urxx8Sm61D23w==", + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@nivo/core/-/core-0.73.0.tgz", + "integrity": "sha512-NFKSk5NQgC2NB3olG8hltN4b4Ri0rB0vt3q1yGmQj+RdGRS4f82Dtwt5Ratxu6QeZD8lt0DhqN9Q7TJ+j/kt0g==", "requires": { - "@nivo/recompose": "0.70.0", - "@react-spring/web": "9.1.2", + "@nivo/recompose": "0.73.0", + "@react-spring/web": "9.2.4", "d3-color": "^2.0.0", "d3-format": "^1.4.4", "d3-hierarchy": "^1.1.8", @@ -4580,8 +4572,8 @@ "d3-scale": "^3.2.3", "d3-scale-chromatic": "^2.0.0", "d3-shape": "^1.3.5", - "d3-time-format": "^2.1.3", - "lodash": "^4.17.11", + "d3-time-format": "^3.0.0", + "lodash": "^4.17.21", "resize-observer-polyfill": "^1.5.1" }, "dependencies": { @@ -4589,113 +4581,92 @@ "version": "1.4.5", "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.5.tgz", "integrity": "sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ==" - }, - "d3-time": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.1.0.tgz", - "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==" - }, - "d3-time-format": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz", - "integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==", - "requires": { - "d3-time": "1" - } } } }, "@nivo/heatmap": { - "version": "0.70.1", - "resolved": "https://registry.npmjs.org/@nivo/heatmap/-/heatmap-0.70.1.tgz", - "integrity": "sha512-VpM+g3RQNGvlhL7g0w6nCx2+vNaaFPZAgUfvEZmbj9XYZ1KsjH48CLnBv26nvCNvoXKk+1J2+IHdMcamSko+Hg==", - "requires": { - "@nivo/axes": "0.70.1", - "@nivo/colors": "0.70.1", - "@nivo/tooltip": "0.70.1", - "@react-spring/web": "9.1.2", + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@nivo/heatmap/-/heatmap-0.73.0.tgz", + "integrity": "sha512-Qte30yf0oT0PfM2HdYdLhLjo9uePvUNSguDfL88lF9JvqymEcC54dKLKZ1UQD1n1kzNYNP3uYnYzokS8bUe32w==", + "requires": { + "@nivo/axes": "0.73.0", + "@nivo/colors": "0.73.0", + "@nivo/tooltip": "0.73.0", + "@react-spring/web": "9.2.4", "d3-scale": "^3.2.3" } }, "@nivo/legends": { - "version": "0.70.1", - "resolved": "https://registry.npmjs.org/@nivo/legends/-/legends-0.70.1.tgz", - "integrity": "sha512-a+syic9S/PcnnGgeNCjgxgdnsXJ6tXEDrk+rTpOgFVRHBlqVa1TPT+HUGaDixqLv458RoVIbZmsr2RPTHvFF7Q==" + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@nivo/legends/-/legends-0.73.0.tgz", + "integrity": "sha512-OWyu3U6PJL2VGlAfoz6nTU4opXHlR0yp0h+0Q0rf/hMKQLiew6NmecKcR1Nx2Qw4dJHgOnZRXqQ6vQrhcNV3WQ==" }, "@nivo/line": { - "version": "0.70.1", - "resolved": "https://registry.npmjs.org/@nivo/line/-/line-0.70.1.tgz", - "integrity": "sha512-0KPwS/jbX8j7M/aVf1qWMMbDypi7L6qBUtFCICNTG8zOGcalCMhyiinh+Fzg0ohJHkUKx1k2khSmYmospOD4+g==", - "requires": { - "@nivo/annotations": "0.70.1", - "@nivo/axes": "0.70.1", - "@nivo/colors": "0.70.1", - "@nivo/legends": "0.70.1", - "@nivo/scales": "0.70.0", - "@nivo/tooltip": "0.70.1", - "@nivo/voronoi": "0.70.1", - "@react-spring/web": "9.1.2", + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@nivo/line/-/line-0.73.0.tgz", + "integrity": "sha512-ZxCJyoYN6tFx3NA4KvxKtbYLLzEl+S8TU57Qd/iGfJ2AbFAgiBhOiYH4kBY7VuxbUjcqQhPUvkPGcolnzqEXMg==", + "requires": { + "@nivo/annotations": "0.73.0", + "@nivo/axes": "0.73.0", + "@nivo/colors": "0.73.0", + "@nivo/legends": "0.73.0", + "@nivo/scales": "0.73.0", + "@nivo/tooltip": "0.73.0", + "@nivo/voronoi": "0.73.0", + "@react-spring/web": "9.2.4", "d3-shape": "^1.3.5" } }, "@nivo/pie": { - "version": "0.70.1", - "resolved": "https://registry.npmjs.org/@nivo/pie/-/pie-0.70.1.tgz", - "integrity": "sha512-YiRbyk/VC6c63JGPOWdxSaBgu5VEPVoAyuDh+w0/KACxk05yhY/mOdegi+/CNIVUfLbXMGUDhTVIehL+jvgsIw==", - "requires": { - "@nivo/arcs": "0.70.1", - "@nivo/colors": "0.70.1", - "@nivo/legends": "0.70.1", - "@nivo/tooltip": "0.70.1", + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@nivo/pie/-/pie-0.73.0.tgz", + "integrity": "sha512-CWwpK9NSs1hfqvhcVvYJMTk+qD/tuxKDloURjfgJglUOs5m2NT1osDJN64jr02aZ6wZyplkP6WvJuc4K6mej6Q==", + "requires": { + "@nivo/arcs": "0.73.0", + "@nivo/colors": "0.73.0", + "@nivo/legends": "0.73.0", + "@nivo/tooltip": "0.73.0", "d3-shape": "^1.3.5" } }, "@nivo/recompose": { - "version": "0.70.0", - "resolved": "https://registry.npmjs.org/@nivo/recompose/-/recompose-0.70.0.tgz", - "integrity": "sha512-cl4DHKpROmpNpUKfbhY8PzYgWSSsAijxQIP72ZV6JqQ0Q+0dHLgTuLuG7Utmt3QKt+9oAp2I47g5PlDiBEh3AQ==", + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@nivo/recompose/-/recompose-0.73.0.tgz", + "integrity": "sha512-WzFJMkyfX1jGPxjcGjvMKxzodgARv9x+alWbr4o39wJ+0eqpZlq6K7oaJ0RnVazcKrKxIe7mKK2piZ0usRt+Zg==", "requires": { "react-lifecycles-compat": "^3.0.4" } }, "@nivo/scales": { - "version": "0.70.0", - "resolved": "https://registry.npmjs.org/@nivo/scales/-/scales-0.70.0.tgz", - "integrity": "sha512-WpCRxaUw1gTfEI0/LAMEz2C0bzqVU0vXh1bvfx5LYfEey+BDUpdHy2/pAms+U+kOSywN6QjRwro7cYStBlkJVw==", + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@nivo/scales/-/scales-0.73.0.tgz", + "integrity": "sha512-xnvCEXz6KkT7/SG4ubJ/hBtbMcTraZnJSKKSVkttBkvfIhkSpQChHkNX8g0Wd4hpwBv2QlltLbjoD6pJ0b/mRA==", "requires": { "d3-scale": "^3.2.3", "d3-time": "^1.0.11", - "d3-time-format": "^2.1.3", - "lodash": "^4.17.11" + "d3-time-format": "^3.0.0", + "lodash": "^4.17.21" }, "dependencies": { "d3-time": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.1.0.tgz", "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==" - }, - "d3-time-format": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz", - "integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==", - "requires": { - "d3-time": "1" - } } } }, "@nivo/tooltip": { - "version": "0.70.1", - "resolved": "https://registry.npmjs.org/@nivo/tooltip/-/tooltip-0.70.1.tgz", - "integrity": "sha512-znCyNY9qEAmU9dr87sgg2tmBQIsMBAmCvjtqWl6VEdhoogiuXkxOhHId3+kXzC7lgkcn0SYjHJNQmV/0sNfRsw==", + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@nivo/tooltip/-/tooltip-0.73.0.tgz", + "integrity": "sha512-6tRRV5mzn1siArAlChXqBC/ISD0AV0tvGRbuyZokVXcM2xbvtfi6OAPaZ10UYbVejBo1rRI3gnhhyNkP0UG2ug==", "requires": { - "@react-spring/web": "9.1.2" + "@react-spring/web": "9.2.4" } }, "@nivo/voronoi": { - "version": "0.70.1", - "resolved": "https://registry.npmjs.org/@nivo/voronoi/-/voronoi-0.70.1.tgz", - "integrity": "sha512-nS6MWzCJ6bYxBn6PxR9iaWRr3Js5v8QFd8uccD/HxpOnCa9BRNhf7ewR4vzHUUrIFSOTRTxrwT4kkZiI0ha+NA==", + "version": "0.73.0", + "resolved": "https://registry.npmjs.org/@nivo/voronoi/-/voronoi-0.73.0.tgz", + "integrity": "sha512-jYDwNkNhEXRt4LR3hTxBZpuRDUQN4GtdP4fxcJIFGxvmh3Bsd3XQMWPqZYTNpgDddYjsnLtLe5RvR5gC7hBojw==", "requires": { "d3-delaunay": "^5.3.0", "d3-scale": "^3.2.3" @@ -4840,47 +4811,52 @@ } }, "@react-spring/animated": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@react-spring/animated/-/animated-9.1.2.tgz", - "integrity": "sha512-nKOGk+3aWbNp46V/CB1J2vR3GJI/Vork8N1WTI5mt+32QekrSsBn5/YFt4/iPaDGhLjukFxF0IjLs6hRLqSObw==", + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/@react-spring/animated/-/animated-9.2.4.tgz", + "integrity": "sha512-AfV6ZM8pCCAT29GY5C8/1bOPjZrv/7kD0vedjiE/tEYvNDwg9GlscrvsTViWR2XykJoYrDfdkYArrldWpsCJ5g==", "requires": { - "@react-spring/shared": "~9.1.2", - "@react-spring/types": "~9.1.2" + "@react-spring/shared": "~9.2.0", + "@react-spring/types": "~9.2.0" } }, "@react-spring/core": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@react-spring/core/-/core-9.1.2.tgz", - "integrity": "sha512-rgobYPCcLdDwbHBVqAmvtXhhX92G7MoPltJlzUge843yp1dNr47tkagFdCtw9NMGp6eHu/CE5byh/imlhLLAxw==", + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/@react-spring/core/-/core-9.2.4.tgz", + "integrity": "sha512-R+PwyfsjiuYCWqaTTfCpYpRmsP0h87RNm7uxC1Uxy7QAHUfHEm2sAHn+AdHPwq/MbVwDssVT8C5yf2WGcqiXGg==", "requires": { - "@react-spring/animated": "~9.1.2", - "@react-spring/shared": "~9.1.2", - "@react-spring/types": "~9.1.2" + "@react-spring/animated": "~9.2.0", + "@react-spring/shared": "~9.2.0", + "@react-spring/types": "~9.2.0" } }, + "@react-spring/rafz": { + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/@react-spring/rafz/-/rafz-9.2.4.tgz", + "integrity": "sha512-SOKf9eue+vAX+DGo7kWYNl9i9J3gPUlQjifIcV9Bzw9h3i30wPOOP0TjS7iMG/kLp2cdHQYDNFte6nt23VAZkQ==" + }, "@react-spring/shared": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@react-spring/shared/-/shared-9.1.2.tgz", - "integrity": "sha512-sj/RrhFZAteCWAMk+W0t6Ku/skn/lbskCCs8B7ZnHNLMGPM+Zb3MOk+aVbX3T/D0iq/oTnKWyQYqrXDKiFcZ7g==", + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/@react-spring/shared/-/shared-9.2.4.tgz", + "integrity": "sha512-ZEr4l2BxmyFRUvRA2VCkPfCJii4E7cGkwbjmTBx1EmcGrOnde/V2eF5dxqCTY3k35QuCegkrWe0coRJVkh8q2Q==", "requires": { - "@react-spring/types": "~9.1.2", - "rafz": "^0.1.14" + "@react-spring/rafz": "~9.2.0", + "@react-spring/types": "~9.2.0" } }, "@react-spring/types": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@react-spring/types/-/types-9.1.2.tgz", - "integrity": "sha512-NZNImL0ymRFbss1cGKX2qSEeFdFoOgnIJZEW4Uczt+wm04J7g0Zuf23Hf8hM35JtxDr8QO5okp8BBtCM5FzzMg==" + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/@react-spring/types/-/types-9.2.4.tgz", + "integrity": "sha512-zHUXrWO8nweUN/ISjrjqU7GgXXvoEbFca1CgiE0TY0H/dqJb3l+Rhx8ecPVNYimzFg3ZZ1/T0egpLop8SOv4aA==" }, "@react-spring/web": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@react-spring/web/-/web-9.1.2.tgz", - "integrity": "sha512-E5W9Hmi2bO6CPorCNV/2iv12ux9LxHJAbpXmrBPKWFRqZixysiHoNQKKPG0DmSvUU1uKkvCvMC4VoB6pj/2kxw==", + "version": "9.2.4", + "resolved": "https://registry.npmjs.org/@react-spring/web/-/web-9.2.4.tgz", + "integrity": "sha512-vtPvOalLFvuju/MDBtoSnCyt0xXSL6Amyv82fljOuWPl1yGd4M1WteijnYL9Zlriljl0a3oXcPunAVYTD9dbDQ==", "requires": { - "@react-spring/animated": "~9.1.2", - "@react-spring/core": "~9.1.2", - "@react-spring/shared": "~9.1.2", - "@react-spring/types": "~9.1.2" + "@react-spring/animated": "~9.2.0", + "@react-spring/core": "~9.2.0", + "@react-spring/shared": "~9.2.0", + "@react-spring/types": "~9.2.0" } }, "@rocket.chat/apps-engine": { @@ -30274,11 +30250,6 @@ "performance-now": "^2.1.0" } }, - "rafz": { - "version": "0.1.14", - "resolved": "https://registry.npmjs.org/rafz/-/rafz-0.1.14.tgz", - "integrity": "sha512-YiQkedSt1urYtYbvHhTQR3l67M8SZbUvga5eJFM/v4vx/GmDdtXlE2hjJIyRjhhO/PjcdGC+CXCYOUA4onit8w==" - }, "ramda": { "version": "0.21.0", "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.21.0.tgz", diff --git a/package.json b/package.json index 4d428c9cb2c3b..d09e38df177b3 100644 --- a/package.json +++ b/package.json @@ -150,11 +150,11 @@ "@google-cloud/language": "^3.8.0", "@google-cloud/storage": "^2.5.0", "@google-cloud/vision": "^1.11.0", - "@nivo/bar": "^0.70.1", - "@nivo/core": "^0.70.1", - "@nivo/heatmap": "^0.70.1", - "@nivo/line": "^0.70.1", - "@nivo/pie": "^0.70.1", + "@nivo/bar": "0.73.1", + "@nivo/core": "0.73.0", + "@nivo/heatmap": "0.73.0", + "@nivo/line": "0.73.0", + "@nivo/pie": "0.73.0", "@rocket.chat/apps-engine": "1.27.1", "@rocket.chat/css-in-js": "^0.27.0", "@rocket.chat/emitter": "^0.27.0", From 519bd22738e8f5f90625af44e75aa96b052b1eba Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Mon, 26 Jul 2021 12:17:05 -0300 Subject: [PATCH 2/4] Revert tooltip style changes --- .../client/components/UsersTab/NewUsersSection.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ee/app/engagement-dashboard/client/components/UsersTab/NewUsersSection.js b/ee/app/engagement-dashboard/client/components/UsersTab/NewUsersSection.js index a9866a64e18f7..be2c7657a6666 100644 --- a/ee/app/engagement-dashboard/client/components/UsersTab/NewUsersSection.js +++ b/ee/app/engagement-dashboard/client/components/UsersTab/NewUsersSection.js @@ -209,10 +209,11 @@ const NewUsersSection = ({ timezone }) => { }, }, tooltip: { - backgroundColor: '#1F2329', - boxShadow: '0px 0px 12px rgba(47, 52, 61, 0.12), 0px 0px 2px rgba(47, 52, 61, 0.08)', - borderRadius: 2, - padding: 4, + container: { + backgroundColor: '#1F2329', + boxShadow: '0px 0px 12px rgba(47, 52, 61, 0.12), 0px 0px 2px rgba(47, 52, 61, 0.08)', + borderRadius: 2, + }, }, }} tooltip={({ value, indexValue }) => From ba28375a02a2a86e5c17e19c2c1e79aeab23f5f4 Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Mon, 26 Jul 2021 12:35:46 -0300 Subject: [PATCH 3/4] Add tooltip style --- .../client/components/UsersTab/NewUsersSection.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ee/app/engagement-dashboard/client/components/UsersTab/NewUsersSection.js b/ee/app/engagement-dashboard/client/components/UsersTab/NewUsersSection.js index be2c7657a6666..a9866a64e18f7 100644 --- a/ee/app/engagement-dashboard/client/components/UsersTab/NewUsersSection.js +++ b/ee/app/engagement-dashboard/client/components/UsersTab/NewUsersSection.js @@ -209,11 +209,10 @@ const NewUsersSection = ({ timezone }) => { }, }, tooltip: { - container: { - backgroundColor: '#1F2329', - boxShadow: '0px 0px 12px rgba(47, 52, 61, 0.12), 0px 0px 2px rgba(47, 52, 61, 0.08)', - borderRadius: 2, - }, + backgroundColor: '#1F2329', + boxShadow: '0px 0px 12px rgba(47, 52, 61, 0.12), 0px 0px 2px rgba(47, 52, 61, 0.08)', + borderRadius: 2, + padding: 4, }, }} tooltip={({ value, indexValue }) => From ffc8102dedcba59e27f2c2308a64718fbeb4915e Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Mon, 26 Jul 2021 15:11:07 -0300 Subject: [PATCH 4/4] Add type definitions for GenericTable --- .../{index.js => GenericTable.tsx} | 65 +++++++++++++++---- client/components/GenericTable/index.ts | 6 ++ client/views/teams/ChannelDesertionTable.tsx | 4 +- .../cannedResponses/CannedResponsesPage.tsx | 10 +-- .../cannedResponses/CannedResponsesRoute.tsx | 9 ++- 5 files changed, 71 insertions(+), 23 deletions(-) rename client/components/GenericTable/{index.js => GenericTable.tsx} (60%) create mode 100644 client/components/GenericTable/index.ts diff --git a/client/components/GenericTable/index.js b/client/components/GenericTable/GenericTable.tsx similarity index 60% rename from client/components/GenericTable/index.js rename to client/components/GenericTable/GenericTable.tsx index e606a43ae64d5..6e7fcf57f7af9 100644 --- a/client/components/GenericTable/index.js +++ b/client/components/GenericTable/GenericTable.tsx @@ -1,34 +1,67 @@ import { Box, Pagination, Table, Tile } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; -import React, { useState, useEffect, useCallback, forwardRef } from 'react'; +import React, { + useState, + useEffect, + useCallback, + forwardRef, + ReactNode, + ReactElement, + Key, + RefAttributes, +} from 'react'; import flattenChildren from 'react-keyed-flatten-children'; import { useTranslation } from '../../contexts/TranslationContext'; import ScrollableContentWrapper from '../ScrollableContentWrapper'; -import HeaderCell from './HeaderCell'; import LoadingRow from './LoadingRow'; -const GenericTable = ( +const defaultParamsValue = { text: '', current: 0, itemsPerPage: 25 } as const; +const defaultSetParamsValue = (): void => undefined; + +type Params = { text?: string; current?: number; itemsPerPage?: 25 | 50 | 100 }; + +type GenericTableProps< + FilterProps extends { onChange?: (params: Params) => void }, + ResultProps extends { _id?: Key }, +> = { + fixed?: boolean; + header?: ReactNode; + params?: Params; + setParams?: (params: Params) => void; + children?: (props: ResultProps, key: number) => ReactElement; + renderFilter?: (props: FilterProps) => ReactElement; + renderRow?: (props: ResultProps) => ReactElement; + results?: ResultProps[]; + total?: number; + pagination?: boolean; +} & FilterProps; + +const GenericTable: { + void }, ResultProps extends { _id?: Key }>( + props: GenericTableProps & RefAttributes, + ): ReactElement | null; +} = forwardRef(function GenericTable( { children, fixed = true, header, - params: paramsDefault = '', + params: paramsDefault = defaultParamsValue, + setParams = defaultSetParamsValue, renderFilter, renderRow: RenderRow, results, - setParams = () => {}, total, pagination = true, ...props }, ref, -) => { +) { const t = useTranslation(); const [filter, setFilter] = useState(paramsDefault); - const [itemsPerPage, setItemsPerPage] = useState(25); + const [itemsPerPage, setItemsPerPage] = useState<25 | 50 | 100>(25); const [current, setCurrent] = useState(0); @@ -40,7 +73,13 @@ const GenericTable = ( const Loading = useCallback(() => { const headerCells = flattenChildren(header); - return Array.from({ length: 10 }, (_, i) => ); + return ( + <> + {Array.from({ length: 10 }, (_, i) => ( + + ))} + + ); }, [header]); const showingResultsLabel = useCallback( @@ -53,7 +92,9 @@ const GenericTable = ( return ( <> - {typeof renderFilter === 'function' ? renderFilter({ onChange: setFilter, ...props }) : null} + {typeof renderFilter === 'function' + ? renderFilter({ ...props, onChange: setFilter } as any) // TODO: ugh + : null} {results && !results.length ? ( {t('No_data_found')} @@ -98,8 +139,6 @@ const GenericTable = ( )} ); -}; - -export default Object.assign(forwardRef(GenericTable), { - HeaderCell, }); + +export default GenericTable; diff --git a/client/components/GenericTable/index.ts b/client/components/GenericTable/index.ts new file mode 100644 index 0000000000000..8da6df3fc14e1 --- /dev/null +++ b/client/components/GenericTable/index.ts @@ -0,0 +1,6 @@ +import GenericTable from './GenericTable'; +import HeaderCell from './HeaderCell'; + +export default Object.assign(GenericTable, { + HeaderCell, +}); diff --git a/client/views/teams/ChannelDesertionTable.tsx b/client/views/teams/ChannelDesertionTable.tsx index dfa1401abe04a..8aeb8db306734 100644 --- a/client/views/teams/ChannelDesertionTable.tsx +++ b/client/views/teams/ChannelDesertionTable.tsx @@ -66,11 +66,11 @@ const ChannelDesertionTable: FC = ({ fixed={false} pagination={false} > - {(room: IRoom, key: string): ReactElement => ( + {(room, key): ReactElement => ( >; - params: { current: number; itemsPerPage: number }; + setParams: Dispatch>; + params: { current?: number; itemsPerPage?: 25 | 50 | 100 }; title: string; - renderRow: ReactNode | null; - renderFilter: FC; + renderFilter?: (props: any) => ReactElement; + renderRow?: (props: any) => ReactElement; }; const CannedResponsesPage: FC = ({ diff --git a/ee/client/omnichannel/cannedResponses/CannedResponsesRoute.tsx b/ee/client/omnichannel/cannedResponses/CannedResponsesRoute.tsx index 945100eb9d371..cd3d0210be764 100644 --- a/ee/client/omnichannel/cannedResponses/CannedResponsesRoute.tsx +++ b/ee/client/omnichannel/cannedResponses/CannedResponsesRoute.tsx @@ -1,6 +1,6 @@ import { Table, Box } from '@rocket.chat/fuselage'; import { useDebouncedValue, useMutableCallback } from '@rocket.chat/fuselage-hooks'; -import React, { useMemo, useCallback, useState, FC, ReactNode, ReactElement } from 'react'; +import React, { useMemo, useCallback, useState, FC, ReactElement } from 'react'; import GenericTable from '../../../../client/components/GenericTable'; import NotAuthorizedPage from '../../../../client/components/NotAuthorizedPage'; @@ -39,7 +39,10 @@ const CannedResponsesRoute: FC = () => { const { sharing, createdBy, tags, text } = values as CannedResponseFilterValues; const { handleSharing, handleCreatedBy, handleTags, handleText } = handlers; - const [params, setParams] = useState({ current: 0, itemsPerPage: 25 }); + const [params, setParams] = useState<{ current?: number; itemsPerPage?: 25 | 50 | 100 }>({ + current: 0, + itemsPerPage: 25, + }); const [sort, setSort] = useState<[string, 'asc' | 'desc' | undefined]>(['shortcut', 'asc']); const debouncedParams = useDebouncedValue(params, 500); @@ -141,7 +144,7 @@ const CannedResponsesRoute: FC = () => { ); const renderRow = useCallback( - ({ _id, shortcut, scope, createdBy, createdAt, tags = [] }): ReactNode => ( + ({ _id, shortcut, scope, createdBy, createdAt, tags = [] }): ReactElement => (