Skip to content

Commit b4eae48

Browse files
authored
Merge branch 'develop' into feature-2875/link-recipient-names
2 parents f0198f1 + 1e60cbd commit b4eae48

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

web-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"canvas-confetti": "^1.6.0",
2525
"date-fns": "^2.24.0",
2626
"dayjs": "^1.11.11",
27-
"dompurify": "^3.1.0",
27+
"dompurify": "^3.2.4",
2828
"fuse.js": "^6.4.6",
2929
"html-react-parser": "^5.1.12",
3030
"isomorphic-fetch": "^3.0.0",

web-ui/src/components/kudos/PublicKudosCard.jsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,18 @@ const KudosCard = ({ kudos }) => {
125125
return components;
126126
};
127127

128+
const multiTooltip = (num, list) => {
129+
let tooltip = "";
130+
let prefix = "";
131+
for (let member of list.slice(-num)) {
132+
tooltip += prefix + `${member.firstName} ${member.lastName}`;
133+
prefix = ", ";
134+
}
135+
return <Tooltip arrow title={tooltip}>
136+
<Typography>{`+${num}`}</Typography>
137+
</Tooltip>;
138+
};
139+
128140
const getRecipientComponent = useCallback(() => {
129141
if (kudos.recipientTeam) {
130142
return (
@@ -141,7 +153,9 @@ const KudosCard = ({ kudos }) => {
141153
}
142154

143155
return (
144-
<AvatarGroup max={4}>
156+
<AvatarGroup max={4}
157+
renderSurplus={(extra) => multiTooltip(
158+
extra, kudos.recipientMembers)}>
145159
{kudos.recipientMembers.map((member) => (
146160
<Tooltip
147161
arrow
@@ -176,7 +190,9 @@ const KudosCard = ({ kudos }) => {
176190
{linkNames(kudos)}
177191
</Typography>
178192
{kudos.recipientTeam && (
179-
<AvatarGroup max={12}>
193+
<AvatarGroup max={12}
194+
renderSurplus={(extra) => multiTooltip(
195+
extra, kudos.recipientMembers)}>
180196
{kudos.recipientMembers.map((member) => (
181197
<Tooltip
182198
arrow

web-ui/yarn.lock

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,11 @@
15401540
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304"
15411541
integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==
15421542

1543+
"@types/trusted-types@^2.0.7":
1544+
version "2.0.7"
1545+
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11"
1546+
integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==
1547+
15431548
"@types/unist@*", "@types/unist@^3.0.0":
15441549
version "3.0.3"
15451550
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.3.tgz#acaab0f919ce69cce629c2d4ed2eb4adc1b6c20c"
@@ -2944,10 +2949,12 @@ domhandler@^4.2.0, domhandler@^4.2.2:
29442949
dependencies:
29452950
domelementtype "^2.2.0"
29462951

2947-
dompurify@^3.1.0:
2948-
version "3.2.0"
2949-
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.2.0.tgz#53c414317c51503183696fcdef6dd3f916c607ed"
2950-
integrity sha512-AMdOzK44oFWqHEi0wpOqix/fUNY707OmoeFDnbi3Q5I8uOpy21ufUA5cDJPr0bosxrflOVD/H2DMSvuGKJGfmQ==
2952+
dompurify@^3.2.4:
2953+
version "3.2.4"
2954+
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.2.4.tgz#af5a5a11407524431456cf18836c55d13441cd8e"
2955+
integrity sha512-ysFSFEDVduQpyhzAob/kkuJjf5zWkZD8/A9ywSp1byueyuCfHamrCBa14/Oc2iiB0e51B+NpxSl5gmzn+Ms/mg==
2956+
optionalDependencies:
2957+
"@types/trusted-types" "^2.0.7"
29512958

29522959
domutils@^2.4.2, domutils@^2.8.0:
29532960
version "2.8.0"

0 commit comments

Comments
 (0)