From a596ab287bb8db41b76635b00590ab06e3ad2b07 Mon Sep 17 00:00:00 2001 From: olehp Date: Fri, 2 Aug 2024 19:51:03 +0300 Subject: [PATCH 1/2] Fixed selector styles --- src/components/Insights/Issues/IssuesFilter/styles.ts | 2 ++ src/components/common/icons/CheckmarkIcon.tsx | 3 +++ src/components/common/v3/Checkmark/index.tsx | 2 +- src/components/common/v3/Checkmark/styles.ts | 4 ++-- src/components/common/v3/Select/styles.ts | 6 ++++-- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/Insights/Issues/IssuesFilter/styles.ts b/src/components/Insights/Issues/IssuesFilter/styles.ts index cef8adc46..b0e338051 100644 --- a/src/components/Insights/Issues/IssuesFilter/styles.ts +++ b/src/components/Insights/Issues/IssuesFilter/styles.ts @@ -56,6 +56,8 @@ export const Footer = styled.div` `; export const ClearAllButton = styled(NewButton)` + padding: 0; + span { color: ${({ theme }) => theme.colors.v3.status.high}; } diff --git a/src/components/common/icons/CheckmarkIcon.tsx b/src/components/common/icons/CheckmarkIcon.tsx index b56b5014d..cf0654474 100644 --- a/src/components/common/icons/CheckmarkIcon.tsx +++ b/src/components/common/icons/CheckmarkIcon.tsx @@ -4,16 +4,19 @@ import { IconProps } from "./types"; interface CheckmarkIconComponentProps extends IconProps { height?: number; + width?: number; } const CheckmarkIconComponent = (props: CheckmarkIconComponentProps) => { const { color } = useIconProps(props); const height = props.height ?? 4; + const width = props.width ?? 6; return ( diff --git a/src/components/common/v3/Checkmark/index.tsx b/src/components/common/v3/Checkmark/index.tsx index 1ed38e274..4d43e966f 100644 --- a/src/components/common/v3/Checkmark/index.tsx +++ b/src/components/common/v3/Checkmark/index.tsx @@ -18,7 +18,7 @@ export const Checkmark = ({ onChange, value, disabled }: CheckmarkProps) => { /> {value && ( - + )} diff --git a/src/components/common/v3/Checkmark/styles.ts b/src/components/common/v3/Checkmark/styles.ts index b162648fb..9b50a6342 100644 --- a/src/components/common/v3/Checkmark/styles.ts +++ b/src/components/common/v3/Checkmark/styles.ts @@ -20,8 +20,8 @@ export const Checkmark = styled.input` margin: 1px; cursor: pointer; border: 1px solid ${({ theme }) => theme.colors.v3.surface.highlight}; - width: 10px; - height: 10px; + width: 12px; + height: 12px; border-radius: 4px; background: ${({ theme }) => theme.colors.v3.surface.highlight}; diff --git a/src/components/common/v3/Select/styles.ts b/src/components/common/v3/Select/styles.ts index a0871c4d4..9459943c8 100644 --- a/src/components/common/v3/Select/styles.ts +++ b/src/components/common/v3/Select/styles.ts @@ -1,7 +1,8 @@ import styled from "styled-components"; import { bodyRegularTypography, - footnoteRegularTypography + footnoteRegularTypography, + subscriptRegularTypography } from "../../App/typographies"; import { ButtonProps, @@ -10,6 +11,7 @@ import { } from "./types"; export const Button = styled.button` + height: 28px; border: 1px solid ${({ theme, $isActive }) => $isActive @@ -48,7 +50,7 @@ export const Button = styled.button` `; export const ButtonLabel = styled.span` - ${footnoteRegularTypography} + ${subscriptRegularTypography} margin-right: auto; text-overflow: ellipsis; overflow: hidden; From 2a381657b45f9815e4c0d8b6a99eec6e36db037d Mon Sep 17 00:00:00 2001 From: olehp Date: Tue, 6 Aug 2024 15:46:32 +0300 Subject: [PATCH 2/2] Fix report issues --- src/actions.ts | 1 + .../Dashboard/Report/ReportHeader/index.tsx | 23 +++++++++++++++---- src/components/Dashboard/Report/types.ts | 4 ++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/actions.ts b/src/actions.ts index 93c1e8958..aff600ecf 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -27,6 +27,7 @@ export const actions = addPrefix(ACTION_PREFIX, { SET_BACKEND_INFO: "SET_BACKEND_INFO", PERSONALIZE_REGISTER: "PERSONALIZE_REGISTER", SET_ENVIRONMENTS: "SET_ENVIRONMENTS", + GET_ENVIRONMENTS: "GET_ENVIRONMENTS", SET_IS_MICROMETER_PROJECT: "SET_IS_MICROMETER_PROJECT", SAVE_TO_PERSISTENCE: "SAVE_TO_PERSISTENCE", GET_FROM_PERSISTENCE: "GET_FROM_PERSISTENCE", diff --git a/src/components/Dashboard/Report/ReportHeader/index.tsx b/src/components/Dashboard/Report/ReportHeader/index.tsx index 6dd3a7b7e..d43dd8faf 100644 --- a/src/components/Dashboard/Report/ReportHeader/index.tsx +++ b/src/components/Dashboard/Report/ReportHeader/index.tsx @@ -1,4 +1,5 @@ import { useEffect, useMemo, useState } from "react"; +import { actions as globalActions } from "../../../../actions"; import { useGlobalStore } from "../../../../containers/Main/stores/useGlobalStore"; import { DataFetcherConfiguration, @@ -19,18 +20,26 @@ const baseFetchConfig = { refreshOnPayloadChange: true }; -const dataFetcherIssuesStatsConfiguration: DataFetcherConfiguration = { +const dataFetcherFiltersConfiguration: DataFetcherConfiguration = { requestAction: actions.GET_SERVICES, responseAction: actions.SET_SERVICES, ...baseFetchConfig }; +const refreshEnvList = () => { + window.sendMessageToDigma({ + action: globalActions.GET_ENVIRONMENTS + }); +}; + export const ReportHeader = ({ onRefresh, onFilterChanged }: ReportHeaderProps) => { const [selectedServices, setSelectedServices] = useState([]); - const [selectedEnvironment, setSelectedEnvironment] = useState(""); + const [selectedEnvironment, setSelectedEnvironment] = useState( + null + ); const environments = useGlobalStore.use.environments(); const handleSelectedEnvironmentChanged = (option: string | string[]) => { const newItem = @@ -59,12 +68,18 @@ export const ReportHeader = ({ const { data: services, getData } = useFetchData< GetServicesPayload, string[] - >(dataFetcherIssuesStatsConfiguration, getServicesPayload); + >(dataFetcherFiltersConfiguration, getServicesPayload); useEffect(() => { getData(); }, []); + const handleRefresh = () => { + getData(); + onRefresh(); + refreshEnvList(); + }; + return ( { - onRefresh(); + handleRefresh(); }} /> diff --git a/src/components/Dashboard/Report/types.ts b/src/components/Dashboard/Report/types.ts index 197297248..b268f6299 100644 --- a/src/components/Dashboard/Report/types.ts +++ b/src/components/Dashboard/Report/types.ts @@ -1,5 +1,5 @@ export interface ReportFilterQuery { - environmentId: string; + environmentId: string | null; services: string[]; } @@ -22,5 +22,5 @@ export interface AssetCategory { } export interface GetServicesPayload { - environment: string; + environment: string | null; }