Skip to content

Commit

Permalink
fix: adjust code to sonarcloud issues
Browse files Browse the repository at this point in the history
  • Loading branch information
KsiBart committed Nov 7, 2024
1 parent 8f353bc commit c5cd6ef
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const APIServerDrawer = ({ item, isOpen, onClose }: Props) => {
const navigate = useNavigate();
const { data: componentDetail, isLoading } = useGetComponentSpecDetails(
currentProduct,
item?.metadata?.key || ""
item?.metadata?.key ?? ""
);

const columns = useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ type Props = {
props: DiagramProps;
};

const legendFormatter = (value: string) => (
<span className={styles.errorBrakedownLegend}>{value}</span>
);

const ErrorDiagram = ({ errorData }: { errorData: Array<unknown> }) => (
<ResponsiveContainer width="100%" height="100%">
<BarChart data={errorData}>
Expand All @@ -33,11 +37,7 @@ const ErrorDiagram = ({ errorData }: { errorData: Array<unknown> }) => (
/>
<YAxis stroke="0px" tick={{ fill: "#96A5B8" }} />
<Tooltip labelFormatter={formatDiagramDate} />
<Legend
formatter={(value: string) => (
<span className={styles.errorBrakedownLegend}>{value}</span>
)}
/>
<Legend formatter={legendFormatter} />
{["500", "404", "401", "400"].map((key, index) => (
<Bar
key={key}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ export const SearchIcon = () => (
<path fillRule="evenodd" clipRule="evenodd" d="M34.0049 33.2944H9.05643C8.34395 33.2944 7.76074 32.7395 7.76074 32.0617C7.76074 31.3839 8.34395 30.8281 9.05643 30.8281H34.0049C34.7174 30.8281 35.3006 31.3839 35.3006 32.0617C35.3006 32.7395 34.7174 33.2944 34.0049 33.2944Z" fill="white" />
<path fillRule="evenodd" clipRule="evenodd" d="M34.0049 40.6933H9.05643C8.34395 40.6933 7.76074 40.1385 7.76074 39.4606C7.76074 38.7819 8.34395 38.2271 9.05643 38.2271H34.0049C34.7174 38.2271 35.3006 38.7819 35.3006 39.4606C35.3006 40.1385 34.7174 40.6933 34.0049 40.6933Z" fill="white" />
<path fillRule="evenodd" clipRule="evenodd" d="M22.0791 48.0922H9.06197C8.34644 48.0922 7.76074 47.5374 7.76074 46.8596C7.76074 46.1808 8.34644 45.626 9.06197 45.626H22.0791C22.7947 45.626 23.3804 46.1808 23.3804 46.8596C23.3804 47.5374 22.7947 48.0922 22.0791 48.0922Z" fill="white" />
<path fillRule="evenodd" clipRule="evenodd" d="M48.3534 38.53C43.3647 43.5178 35.6415 44.0805 30.0346 40.2295C29.318 39.7286 28.636 39.1659 28 38.53C27.6726 38.2036 27.364 37.8669 27.0732 37.5123C26.4916 36.8042 25.9821 36.0491 25.5647 35.2689C24.8293 33.951 24.3293 32.5527 24.0563 31.1073C23.1755 26.5744 24.4925 21.6953 28 18.1895C31.5158 14.6732 36.3957 13.3648 40.9294 14.2371C42.374 14.5184 43.7737 15.0183 45.0917 15.7452C45.8731 16.1719 46.6179 16.6813 47.3272 17.2628C47.6807 17.5525 48.0176 17.8621 48.3439 18.1895C48.981 18.8254 49.5522 19.5062 50.0438 20.2237C53.8965 25.8287 53.3326 33.5515 48.3534 38.53Z" fill="white" fill-opacity="0.1" />
<path fillRule="evenodd" clipRule="evenodd" d="M48.3534 38.53C43.3647 43.5178 35.6415 44.0805 30.0346 40.2295C29.318 39.7286 28.636 39.1659 28 38.53C27.6726 38.2036 27.364 37.8669 27.0732 37.5123C26.4916 36.8042 25.9821 36.0491 25.5647 35.2689C24.8293 33.951 24.3293 32.5527 24.0563 31.1073C23.1755 26.5744 24.4925 21.6953 28 18.1895C31.5158 14.6732 36.3957 13.3648 40.9294 14.2371C42.374 14.5184 43.7737 15.0183 45.0917 15.7452C45.8731 16.1719 46.6179 16.6813 47.3272 17.2628C47.6807 17.5525 48.0176 17.8621 48.3439 18.1895C48.981 18.8254 49.5522 19.5062 50.0438 20.2237C53.8965 25.8287 53.3326 33.5515 48.3534 38.53Z" fill="white" fillOpacity="0.1" />
<path fillRule="evenodd" clipRule="evenodd" d="M46.9574 37.5475C41.7674 42.7385 33.3564 42.7375 28.1654 37.5475C22.9811 32.3632 22.9811 23.9513 28.1722 18.7612C33.3564 13.5769 41.7674 13.5769 46.9516 18.7612C52.1417 23.9513 52.1417 32.3632 46.9574 37.5475ZM49.6209 16.0946C42.959 9.43267 32.1636 9.43267 25.5017 16.0946C18.8407 22.7555 18.8349 33.5577 25.4959 40.2196C31.559 46.2808 41.0622 46.8275 47.7463 41.8508C48.3992 41.3641 49.0279 40.8184 49.6277 40.2196C50.2264 39.6199 50.7721 38.9912 51.2579 38.3383C56.2345 31.6532 55.6831 22.1568 49.6209 16.0946Z" fill="#EAEAEA" />
<path fillRule="evenodd" clipRule="evenodd" d="M75.8386 65.3316L75.5589 65.6113C73.7086 67.4626 70.6786 67.4626 68.8273 65.6113L51.7424 48.5264L58.7537 41.5151L75.8386 58.6C77.6899 60.4513 77.6899 63.4804 75.8386 65.3316Z" fill="url(#paint0_linear_5397_15656)" />
<path fillRule="evenodd" clipRule="evenodd" d="M51.6263 37.8159L56.675 42.8646L53.0908 46.4478L48.0431 41.3992C48.7093 40.9025 49.3498 40.3457 49.9628 39.7347C50.5738 39.1237 51.1306 38.4821 51.6263 37.8159Z" fill="#EAEAEA" />
<path fillRule="evenodd" clipRule="evenodd" d="M75.5829 58.3899L68.6163 65.3556L67.3621 64.1005L74.3278 57.1348L75.5829 58.3899Z" fill="#6A8BF8" />
<path fillRule="evenodd" clipRule="evenodd" d="M59.1413 41.7567L51.9838 48.9142L50.9204 47.8509L58.0778 40.6934L59.1413 41.7567Z" fill="url(#paint1_linear_5397_15656)" />
<path fillRule="evenodd" clipRule="evenodd" d="M43.5216 16.9755L25.9687 34.5276C25.3076 33.3429 24.8581 32.0857 24.6136 30.7863L39.7801 15.6196C41.0787 15.8735 42.3368 16.322 43.5216 16.9755Z" fill="white" fill-opacity="0.5" />
<path fillRule="evenodd" clipRule="evenodd" d="M49.2762 21.1476L30.2996 39.0492C29.62 38.6018 28.9731 38.0983 28.37 37.5293C28.0594 37.2363 27.7658 36.9359 27.491 36.6186L46.6988 18.4971C47.0351 18.7573 47.3546 19.0343 47.6641 19.3272C48.2673 19.8963 48.81 20.5056 49.2762 21.1476Z" fill="white" fill-opacity="0.5" />
<path fillRule="evenodd" clipRule="evenodd" d="M43.5216 16.9755L25.9687 34.5276C25.3076 33.3429 24.8581 32.0857 24.6136 30.7863L39.7801 15.6196C41.0787 15.8735 42.3368 16.322 43.5216 16.9755Z" fill="white" fillOpacity="0.5" />
<path fillRule="evenodd" clipRule="evenodd" d="M49.2762 21.1476L30.2996 39.0492C29.62 38.6018 28.9731 38.0983 28.37 37.5293C28.0594 37.2363 27.7658 36.9359 27.491 36.6186L46.6988 18.4971C47.0351 18.7573 47.3546 19.0343 47.6641 19.3272C48.2673 19.8963 48.81 20.5056 49.2762 21.1476Z" fill="white" fillOpacity="0.5" />
<defs>
<linearGradient id="paint0_linear_5397_15656" x1="64.4848" y1="28.7728" x2="39.0001" y2="54.2575" gradientUnits="userSpaceOnUse">
<stop stopColor="#9BB2FA" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export default function UpgradePlane() {
},
});

// @TODO: Available environment name for now: stage | production
const stageEnvId = useMemo(() => findEnvByName("stage")?.id, [findEnvByName]);
const productEnvId = useMemo(
() => findEnvByName("production")?.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import SelectAPI from "../SelectAPI";
import SelectResponseProperty from "../SelectResponseProperty";
import SonataResponseMapping from "../SonataResponseMapping";

type RightSideProps = {
type RightSideProps = Readonly<{
rightSide: number;
jsonSpec: any;
method: string;
handleSelectSonataProp: (value: any) => void;
handleSelectSellerProp: (value: any) => void;
isRequiredMapping: boolean;
};
}>;

export function RightSide({
rightSide,
Expand Down

0 comments on commit c5cd6ef

Please sign in to comment.