Commit 5797df7b authored by ReemyHasan's avatar ReemyHasan

clean 10

parent d5f6f73e
......@@ -4,6 +4,7 @@ import { useCookies } from "react-cookie";
import { getSeverityStatistics } from "../../services/traps-service";
import useTranslation from "next-translate/useTranslation";
import { TranslationFiles } from "@/src/data/core";
import MainUtils from "@/src/utils/main";
export default function CardLineChart() {
const { t } = useTranslation(TranslationFiles.COMMON);
......@@ -32,7 +33,7 @@ export default function CardLineChart() {
window.myLine.destroy();
}
// Check if data has been fetched and is not an empty object
if (Object.keys(data).length > 0) {
if ( !MainUtils.isEmptyValue(data)) {
const labels = Object.keys(data).sort(); // Use the sorted timestamps as labels
const datasets = Object.keys(severityColors).map((severity) => ({
......
......@@ -82,7 +82,7 @@ const DashboardComponent = () => {
statSubtitle={t("traps")}
statTitle={trapCount !== undefined ? trapCount : "..."}
statArrow="up"
statPercent={`${(errorTrapCount/(trapCount+errorTrapCount))}`}
statPercent={trapCount !== undefined ? `${(errorTrapCount/(trapCount+errorTrapCount))}` : "..."}
statPercentColor="text-red-500"
statDescripiron={t("error-traps")}
statIconName="traps"
......
......@@ -193,6 +193,8 @@ export function getColumns(setModalProps:any) {
render: (text: any, record: any) => (
<FmsButton
type="primary"
size="middle"
borderRadius={8}
onClick={() => setModalProps({ isOpen: true, variableBinding: record.variableBindings })}
>
{t("show-details")}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment