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
4 changes: 2 additions & 2 deletions src/components/Assets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ export const Assets = () => {
/>
)
)}
<Tooltip title="Refresh">
<Tooltip title={"Refresh"}>
<s.RefreshButton
buttonType="tertiary"
buttonType={"tertiary"}
icon={RefreshIcon}
onClick={handleRefresh}
/>
Expand Down
47 changes: 28 additions & 19 deletions src/components/Insights/InsightsCatalog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { useCallback, useContext, useEffect, useState } from "react";
import { usePrevious } from "../../../hooks/usePrevious";

import { useTheme } from "styled-components";
import { getFeatureFlagValue } from "../../../featureFlags";
import { useDebounce } from "../../../hooks/useDebounce";
import { isNumber } from "../../../typeGuards/isNumber";
import { FeatureFlag } from "../../../types";
import { sendTrackingEvent } from "../../../utils/sendTrackingEvent";
import { ConfigContext } from "../../common/App/ConfigContext";
import { Pagination } from "../../common/Pagination";
Expand Down Expand Up @@ -50,6 +52,11 @@ export const InsightsCatalog = (props: InsightsCatalogProps) => {
const previousMode = usePrevious(mode);
const theme = useTheme();

const isViewModeButtonVisible = getFeatureFlagValue(
config,
FeatureFlag.IS_INSIGHT_DISMISSAL_ENABLED
);

const refreshData = useCallback(
() =>
props.onQueryChange({
Expand Down Expand Up @@ -145,9 +152,9 @@ export const InsightsCatalog = (props: InsightsCatalogProps) => {
]}
default={defaultQuery.sorting}
/>
<Tooltip title="Refresh">
<Tooltip title={"Refresh"}>
<s.RefreshButton
buttonType="tertiary"
buttonType={"tertiary"}
icon={RefreshIcon}
onClick={handleRefreshButtonClick}
/>
Expand All @@ -156,8 +163,8 @@ export const InsightsCatalog = (props: InsightsCatalogProps) => {
{mode === ViewMode.OnlyDismissed && (
<s.InsightsViewModeToolbar>
<Button
buttonType="tertiary"
label="Back to All Insights"
buttonType={"tertiary"}
label={"Back to All Insights"}
icon={(props) => (
<ChevronIcon {...props} direction={Direction.LEFT} />
)}
Expand Down Expand Up @@ -197,21 +204,23 @@ export const InsightsCatalog = (props: InsightsCatalogProps) => {
</s.FooterItemsCount>
</>
)}
<Button
buttonType="tertiary"
icon={(props) => (
<GroupIcon
{...props}
crossOut={mode !== ViewMode.OnlyDismissed}
color={
mode === ViewMode.OnlyDismissed
? theme.colors.v3.icon.brandSecondary
: props.color
}
/>
)}
onClick={handleViewModeChange}
/>
{isViewModeButtonVisible && (
<Button
buttonType={"tertiary"}
icon={(props) => (
<GroupIcon
{...props}
crossOut={mode !== ViewMode.OnlyDismissed}
color={
mode === ViewMode.OnlyDismissed
? theme.colors.v3.icon.brandSecondary
: props.color
}
/>
)}
onClick={handleViewModeChange}
/>
)}
</s.Footer>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Insights/common/InsightCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const InsightCard = (props: InsightCardProps) => {
};

const handleShowClick = () => {
sendTrackingEvent(trackingEvents.UNDISMISS_BUTTON_CLICKED, {
sendTrackingEvent(trackingEvents.SHOW_BUTTON_CLICKED, {
insightType: props.insight.type
});

Expand Down
13 changes: 7 additions & 6 deletions src/components/Insights/common/InsightCard/styles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from "styled-components";
import styled, { css } from "styled-components";
import { subscriptRegularTypography } from "../../../common/App/typographies";
import { Button } from "../../../common/v3/Button";
import { Card } from "../../../common/v3/Card";
Expand Down Expand Up @@ -40,11 +40,12 @@ export const ContentContainer = styled.div`
`;

export const StyledInsightCard = styled(Card)<StyledInsightCardProps>`
${({ $isDismissed, theme }) => {
if ($isDismissed) {
return `background: ${theme.colors.v3.surface.sidePanelHeader}`;
}
}}
${({ $isDismissed, theme }) =>
$isDismissed
? css`
background: ${theme.colors.v3.surface.sidePanelHeader};
`
: ""}
`;

export const DismissButton = styled(Button)`
Expand Down
2 changes: 1 addition & 1 deletion src/components/Insights/common/InsightCard/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ export interface InsightCardProps {
}

export interface StyledInsightCardProps extends CardProps {
$isDismissed: boolean;
$isDismissed?: boolean;
}
2 changes: 1 addition & 1 deletion src/components/Insights/tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const trackingEvents = addPrefix(
"jira ticket attachment download button clicked",
JIRA_TICKET_HINT_CLOSED: "jira ticket hint closed",
DISMISS_BUTTON_CLICKED: "insight dismiss button clicked",
UNDISMISS_BUTTON_CLICKED: "insight show button clicked",
SHOW_BUTTON_CLICKED: "insight show button clicked",
REFRESH_BUTTON_CLICKED: "refresh button clicked"
},
" "
Expand Down
7 changes: 4 additions & 3 deletions src/components/Insights/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ export enum InsightStatus {
Active = "Active",
InEvaluation = "InEvaluation",
PossiblyFixed = "PossiblyFixed",
Regression = "Regression"
Regression = "Regression",
Inactive = "Inactive"
}

export interface CodeObjectInsight extends Insight {
Expand Down Expand Up @@ -196,8 +197,8 @@ export interface CodeObjectInsight extends Insight {
ticketLink: string | null;
id: string;
sourceSpanCodeObjectInsight: string;
isDismissed: boolean;
isDismissible: boolean;
isDismissed?: boolean;
isDismissible?: boolean;
status?: InsightStatus;
}

Expand Down
3 changes: 2 additions & 1 deletion src/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export const featureFlagMinBackendVersions: Record<FeatureFlag, string> = {
[FeatureFlag.IS_ASSETS_SERVICE_FILTER_VISIBLE]: "v0.2.174",
[FeatureFlag.IS_ASSETS_OVERALL_IMPACT_HIDDEN]: "v0.2.181-alpha.1",
[FeatureFlag.IS_INSIGHT_TICKET_LINKAGE_ENABLED]: "v0.2.200",
[FeatureFlag.IS_ASSETS_COMPLEX_FILTER_ENABLED]: "v0.2.215"
[FeatureFlag.IS_ASSETS_COMPLEX_FILTER_ENABLED]: "v0.2.215",
[FeatureFlag.IS_INSIGHT_DISMISSAL_ENABLED]: "v0.2.238"
};

export const getFeatureFlagValue = (
Expand Down
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export enum FeatureFlag {
IS_ASSETS_SERVICE_FILTER_VISIBLE,
IS_ASSETS_OVERALL_IMPACT_HIDDEN,
IS_INSIGHT_TICKET_LINKAGE_ENABLED,
IS_ASSETS_COMPLEX_FILTER_ENABLED
IS_ASSETS_COMPLEX_FILTER_ENABLED,
IS_INSIGHT_DISMISSAL_ENABLED
}

export enum InsightType {
Expand Down