Skip to content

Commit 8111122

Browse files
committed
fix(sonar): fixes to multiple medium level sonar issues
HCRC-162
1 parent 9099007 commit 8111122

4 files changed

Lines changed: 21 additions & 31 deletions

File tree

src/core/card/card.module.scss

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@
140140
flex-direction: row;
141141
}
142142
}
143+
144+
&.horizontalBorder {
145+
// overriding withborder param
146+
border: none;
147+
148+
@include breakpoints.respond_below(s) {
149+
border: 1px solid var(--color-black-30);
150+
}
151+
}
143152
}
144153

145154
& > :first-child {
@@ -182,17 +191,6 @@
182191
}
183192
}
184193
}
185-
186-
&.responsive-reverse {
187-
&.horizontalBorder {
188-
// overriding withborder param
189-
border: none;
190-
191-
@include breakpoints.respond_below(s) {
192-
border: 1px solid var(--color-black-30);
193-
}
194-
}
195-
}
196194
}
197195

198196
.imageWrapper {
@@ -292,21 +290,13 @@
292290

293291
.content {
294292
flex: 1;
295-
@include breakpoints.respond_above(s) {
296-
// min-height: var(--height-image-desktop);
297-
// height: 100%;
298-
}
299293
}
300294

301295
.textWrapper {
302296
display: flex;
303297
flex-direction: column;
304298
padding: var(--spacing-s) var(--spacing-m);
305299

306-
@include breakpoints.respond_below(s) {
307-
// background-color: var(--color-white);
308-
}
309-
310300
.title {
311301
font-size: var(--fontsize-heading-s);
312302
line-height: var(--lineheight-m);
@@ -341,6 +331,7 @@
341331
display: -webkit-box;
342332
&.clamp {
343333
-webkit-line-clamp: 2;
334+
line-clamp: 2;
344335
-webkit-box-orient: vertical;
345336
overflow: hidden;
346337
}
@@ -353,6 +344,7 @@
353344
margin-bottom: var(--spacing-2-xs);
354345
&.clamp {
355346
-webkit-line-clamp: 3;
347+
line-clamp: 3;
356348
-webkit-box-orient: vertical;
357349
}
358350
}

src/core/carousel/components/CarouselSlideButton.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ export function CarouselPreviousSlideButton() {
2525
handleUpdateSlideProps(targetSlide);
2626
};
2727

28+
const ariaLabelTitle = title ? ` - ${title}` : '';
29+
2830
return (
2931
<button
3032
type="button"
31-
aria-label={`${previous}${title ? ` - ${title}` : ''}`}
33+
aria-label={`${previous}${ariaLabelTitle}`}
3234
className={classNames(styles.btn, styles.btnPrev)}
3335
onClick={handlePrevClick}
3436
disabled={!isReady}
@@ -57,10 +59,12 @@ export function CarouselNextSlideButton() {
5759
);
5860
};
5961

62+
const ariaLabelTitle = title ? ` - ${title}` : '';
63+
6064
return (
6165
<button
6266
type="button"
63-
aria-label={`${next}${title ? ` - ${title}` : ''}`}
67+
aria-label={`${next}${ariaLabelTitle}`}
6468
className={classNames(styles.btn, styles.btnNext)}
6569
onClick={handleNextClick}
6670
disabled={!isReady}

src/core/carousel/components/CarouselSliderPage.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import classNames from 'classnames';
33

44
import styles from '../carousel.module.scss';
5-
import { getItemSetItemKey, getItemSetKey } from '../utils/utils';
5+
import { getItemSetItemKey } from '../utils/utils';
66
import { MOBILE_WIDTH } from '../constants';
77
import { useCarouselContext } from '../context/CarouselContext';
88

@@ -24,12 +24,6 @@ export function CarouselSliderPage({
2424
node && node.toggleAttribute('inert', itemSetIndex !== currentSlide)
2525
}
2626
aria-hidden={itemSetIndex !== currentSlide}
27-
key={getItemSetKey(
28-
itemSetIndex,
29-
'id' in itemSet && typeof itemSet.id === 'string'
30-
? itemSet.id
31-
: undefined,
32-
)}
3327
className={classNames(
3428
styles.slide,
3529
itemSetIndex === currentSlide && styles.slideSelected,
@@ -40,9 +34,7 @@ export function CarouselSliderPage({
4034
<div
4135
key={getItemSetItemKey(
4236
itemIndex,
43-
'id' in itemSet && typeof itemSet.id === 'string'
44-
? itemSet.id
45-
: undefined,
37+
undefined,
4638
`itemSet-${itemSetIndex}-item`,
4739
)}
4840
className={styles.slideItem}

src/core/imageGallery/ImagesGrid.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ export function ImagesGrid({
5656
<Grid colsCount={images.length === 1 ? 1 : columns}>
5757
{images.map((image, i) => (
5858
<ImageItem
59+
// eslint-disable-next-line react/no-array-index-key
60+
key={`grid-image-${i}`}
5961
imageId={i}
6062
image={image}
6163
lightboxUid={lightboxUid}

0 commit comments

Comments
 (0)