Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ const VoteOption = (props: Props) => {
: 'Enable Analytics on the Settings page to vote for a recommendation')

return (
<EuiToolTip
content={getTooltipContent(voteOption)}
position="bottom"
data-testid={`${voteOption}-vote-tooltip`}
>
<EuiPopover
initialFocus={false}
anchorPosition="rightCenter"
isOpen={popover === voteOption}
closePopover={() => setPopover('')}
anchorClassName={styles.popoverAnchor}
panelClassName={cx('euiToolTip', 'popoverLikeTooltip', styles.popover)}
button={(
<EuiPopover
initialFocus={false}
anchorPosition="rightCenter"
isOpen={popover === voteOption}
closePopover={() => setPopover('')}
anchorClassName={styles.popoverAnchor}
panelClassName={cx('euiToolTip', 'popoverLikeTooltip', styles.popover)}
button={(
<EuiToolTip
content={getTooltipContent(voteOption)}
position="bottom"
data-testid={`${voteOption}-vote-tooltip`}
>
<EuiButtonIcon
disabled={!isAnalyticsEnable}
iconType={iconType[voteOption] ?? 'default'}
Expand All @@ -105,64 +105,64 @@ const VoteOption = (props: Props) => {
data-testid={`${voteOption}-vote-btn`}
onClick={() => handleClick(name)}
/>
</EuiToolTip>
)}
>
<div className={styles.popoverWrapper}>
<EuiFlexGroup gutterSize="none" direction="column" alignItems="flexEnd">
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="none">
<EuiFlexItem grow={false}>
<EuiIcon type={PetardIcon} className={styles.petardIcon} />
</EuiFlexItem>
<EuiFlexItem>
<div>
<EuiText className={styles.text} data-testid="common-text">Thank you for the feedback.</EuiText>
<EuiText className={styles.text} data-testid="custom-text">{getVotedText(voteOption)}</EuiText>
</div>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon
iconType="cross"
color="primary"
id="close-voting-popover"
aria-label="close popover"
data-testid="close-popover"
className={styles.closeBtn}
onClick={() => setPopover('')}
/>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem>
<EuiButton
aria-label="recommendation feedback"
fill
data-testid="recommendation-feedback-btn"
className={styles.feedbackBtn}
color="secondary"
size="s"
>
<div className={styles.popoverWrapper} data-testid={`${name}-${voteOption}-popover`}>
<EuiFlexGroup gutterSize="none" direction="column" alignItems="flexEnd">
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="none">
<EuiFlexItem grow={false}>
<EuiIcon type={PetardIcon} className={styles.petardIcon} />
</EuiFlexItem>
<EuiFlexItem>
<div>
<EuiText className={styles.text} data-testid="common-text">Thank you for the feedback.</EuiText>
<EuiText className={styles.text} data-testid="custom-text">{getVotedText(voteOption)}</EuiText>
</div>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon
iconType="cross"
color="primary"
id="close-voting-popover"
aria-label="close popover"
data-testid="close-popover"
className={styles.closeBtn}
onClick={() => setPopover('')}
/>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem>
<EuiButton
aria-label="recommendation feedback"
fill
data-testid="recommendation-feedback-btn"
className={styles.feedbackBtn}
color="secondary"
size="s"
>
<EuiLink
external={false}
className={styles.link}
href={EXTERNAL_LINKS.recommendationFeedback}
target="_blank"
data-test-subj="github-repo-link"
>
<EuiLink
external={false}
className={styles.link}
href={EXTERNAL_LINKS.recommendationFeedback}
target="_blank"
data-test-subj="github-repo-link"
>
<EuiIcon
className={styles.githubIcon}
aria-label="redis insight github issues"
type={GithubSVG}
data-testid="github-repo-icon"
/>
To Github
</EuiLink>
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
</div>
</EuiPopover>
</EuiToolTip>
<EuiIcon
className={styles.githubIcon}
aria-label="redis insight github issues"
type={GithubSVG}
data-testid="github-repo-icon"
/>
To Github
</EuiLink>
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
</div>
</EuiPopover>
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,13 @@

.wrapper {
height: 100%;

.badgesLegend {
margin: 0 22px 14px 0 !important;
padding-top: 20px;

.badgeWrapper {
margin-right: 0;
}

.badge {
margin: 0 0 0 24px;
}

.badgeIcon {
margin-right: 14px;
}
}

.badgeIcon {
fill: var(--badgeIconColor);
}

.badgeWrapper {
display: flex;
align-items: center;
margin-right: 24px;
}
}

.recommendationsContainer {
@include euiScrollBar;
overflow-y: auto;
overflow-x: hidden;
max-height: calc(100% - 51px);
max-height: calc(100% - 70px);

.accordionButton :global(.euiFlexItem) {
margin: 0;
Expand Down Expand Up @@ -100,15 +73,6 @@
margin-bottom: 6px;
padding: 30px 18px 11px;

ul {
list-style: initial;
padding-left: 21px;

li::marker {
color: var(--euiTextSubduedColor);
}
}

.accordionContent {
padding: 18px 0 0 !important;
}
Expand Down
42 changes: 41 additions & 1 deletion redisinsight/ui/src/utils/recommendation/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@
display: inline !important;
}

.list {
list-style: initial;
padding-left: 21px;

.listItem::marker {
color: var(--euiTextSubduedColor);
}

.listItem.insights::marker {
color: var(--htmlColor) !important;
}
}

.code {
background-color: var(--separatorColor);
border-radius: 4px;
Expand All @@ -23,4 +36,31 @@
code {
font-family: "Roboto Mono", Consolas, Menlo, Courier, monospace !important;
}
}
}

.badgesLegend {
margin: 0 22px 14px 0 !important;
padding-top: 20px;

.badgeWrapper {
margin-right: 0;
}

.badge {
margin: 0 0 0 24px;
}

.badgeIcon {
margin-right: 14px;
}
}

.badgeIcon {
fill: var(--badgeIconColor);
}

.badgeWrapper {
display: flex;
align-items: center;
margin-right: 24px;
}
9 changes: 6 additions & 3 deletions redisinsight/ui/src/utils/recommendation/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,13 @@ const renderContentElement = (
)
case 'list':
return (
<ul data-testid={`list-${telemetryName}-${idx}`} key={`${telemetryName}-${idx}`}>
<ul className={styles.list} data-testid={`list-${telemetryName}-${idx}`} key={`${telemetryName}-${idx}`}>
{isArray(jsonValue) && jsonValue.map((listElement: IRecommendationContent[], idx) => (
// eslint-disable-next-line react/no-array-index-key
<li key={`list-item-${listElement[0]}-${idx}`}>
<li
className={cx(styles.listItem, { [styles.insights]: insights })}
// eslint-disable-next-line react/no-array-index-key
key={`list-item-${listElement[0]}-${idx}`}
>
{renderRecommendationContent(listElement, params, telemetryName, insights)}
</li>
))}
Expand Down