Commit 5797df7b authored by ReemyHasan's avatar ReemyHasan

clean 10

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