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
1 change: 1 addition & 0 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
23 changes: 19 additions & 4 deletions src/components/Dashboard/Report/ReportHeader/index.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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<string[]>([]);
const [selectedEnvironment, setSelectedEnvironment] = useState<string>("");
const [selectedEnvironment, setSelectedEnvironment] = useState<string | null>(
null
);
const environments = useGlobalStore.use.environments();
const handleSelectedEnvironmentChanged = (option: string | string[]) => {
const newItem =
Expand Down Expand Up @@ -59,20 +68,26 @@ export const ReportHeader = ({
const { data: services, getData } = useFetchData<
GetServicesPayload,
string[]
>(dataFetcherIssuesStatsConfiguration, getServicesPayload);
>(dataFetcherFiltersConfiguration, getServicesPayload);

useEffect(() => {
getData();
}, []);

const handleRefresh = () => {
getData();
onRefresh();
refreshEnvList();
};

return (
<s.Container>
<Ribbon
onDownload={() => {
// TODO
}}
onRefresh={() => {
onRefresh();
handleRefresh();
}}
/>
<s.FiltersContainer>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Dashboard/Report/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface ReportFilterQuery {
environmentId: string;
environmentId: string | null;
services: string[];
}

Expand All @@ -22,5 +22,5 @@ export interface AssetCategory {
}

export interface GetServicesPayload {
environment: string;
environment: string | null;
}
2 changes: 2 additions & 0 deletions src/components/Insights/Issues/IssuesFilter/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export const Footer = styled.div`
`;

export const ClearAllButton = styled(NewButton)`
padding: 0;

span {
color: ${({ theme }) => theme.colors.v3.status.high};
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/common/icons/CheckmarkIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<svg
xmlns="http://www.w3.org/2000/svg"
height={height}
width={width}
fill="none"
viewBox="0 0 6 4"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/v3/Checkmark/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const Checkmark = ({ onChange, value, disabled }: CheckmarkProps) => {
/>
{value && (
<s.CheckmarkContainer>
<CheckmarkIcon color={"currentColor"} height={5} />
<CheckmarkIcon color={"currentColor"} height={10} width={10} />
</s.CheckmarkContainer>
)}
</s.Container>
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/v3/Checkmark/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
6 changes: 4 additions & 2 deletions src/components/common/v3/Select/styles.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import styled from "styled-components";
import {
bodyRegularTypography,
footnoteRegularTypography
footnoteRegularTypography,
subscriptRegularTypography
} from "../../App/typographies";
import {
ButtonProps,
Expand All @@ -10,6 +11,7 @@ import {
} from "./types";

export const Button = styled.button<ButtonProps>`
height: 28px;
border: 1px solid
${({ theme, $isActive }) =>
$isActive
Expand Down Expand Up @@ -48,7 +50,7 @@ export const Button = styled.button<ButtonProps>`
`;

export const ButtonLabel = styled.span`
${footnoteRegularTypography}
${subscriptRegularTypography}
margin-right: auto;
text-overflow: ellipsis;
overflow: hidden;
Expand Down