Showing AI reviews for crm-dashbaord
Project AI Score ?
73%
Quality Avg ?
74%
Security Avg ?
74%
Reviews ?
130

Review Result ?

solutionbowl/crm-dashbaord · 1015eafb
The commit brings a comprehensive implementation of the market_odds_type feature across multiple key components related to horse racing markets and stats, enhancing UI behavior and data consistency. However, some redundant or repetitive style and conditional logic patterns reduce maintainability. Some commented-out code remains which may cause confusion and minor clutter. There is no clear indication of added tests or validations for the new marketOddsType logic. Accessibility is addressed for hiding sections but could be improved by ensuring all necessary semantics are properly implemented.
Quality ?
85%
Security ?
70%
Business Value ?
80%
Maintainability ?
85%
Issues & Suggested Fixes ?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Duplicate Logic
Where src/modules/horse/pages/Race/AdminRacepage.tsx:39
Issue / Evidence duplicate string key declarations for marketOddsType
Suggested Fix refactor to ensure consistent type usage to improve quality and reduce bugs
Duplicate Logic
Where src/modules/horse/pages/Race/AdminRacepage.tsx:945
Issue / Evidence repeated identical marginLeft conditional ('!isWinner && !isFancy ? 90 : 90')
Suggested Fix simplify by removing ternary for clearer code
Duplicate Logic
Where src/modules/horse/pages/Race/AdminRacepage.tsx:973
Issue / Evidence repeated inline style objects with minor variations
Suggested Fix extract to constants or CSS classes to improve maintainability
Commented Out Navigation Code
Where src/modules/horse/pages/Race/AllRaces.tsx:97
Issue / Evidence commented out navigation code
Suggested Fix remove or refactor as needed to reduce confusion and fake work risk
Duplicate Logic
Where src/modules/horse/pages/Race/stats.tsx:204
Issue / Evidence duplicated isToteMarketOddsType function
Suggested Fix consider centralizing utility functions to reduce bugs and improve clarity
Duplicate Logic
Where src/pages/Platforms/AdminMarketPage.tsx:39
Issue / Evidence duplicate type declarations similar to AdminRacepage
Suggested Fix DRY principles should be applied
Addition Of Permission Structure Unrelated...
Where src/pages/Platformuser/CreatePlatformUser.tsx:18
Issue / Evidence addition of permission structure unrelated to main marketOddsType change
Suggested Fix ensure this addition has corresponding usage or tests to improve business value and reduce fake work risk
Code Change Preview · src/modules/horse/pages/Race/AdminRacepage.tsx ?
Removed / Before Commit
- diff --git a/src/modules/horse/pages/Race/AdminRacepage.tsx b/src/modules/horse/pages/Race/AdminRacepage.tsx
- index 9cb6a44..3855352 100644
- 
- type Market = {
- originalMarketId?:  string;
- marketId:           string;
- marketName:         string;
- marketType:         string;
- back_static_volume: number | null;
- lay_static_volume:  number | null;
- back_volume:        number | null;
- marketId: string;
- marketName: string;
- marketType: string;
- back_static_volume: number | null;
- lay_static_volume: number | null;
- back_volume: number | null;
- normalizedName.includes("FANCY")
Added / After Commit
+ diff --git a/src/modules/horse/pages/Race/AdminRacepage.tsx b/src/modules/horse/pages/Race/AdminRacepage.tsx
+ index 9cb6a44..3855352 100644
+ 
+ type Market = {
+ originalMarketId?:  string;
+   originalMarketOddsType?: string;
+ marketId:           string;
+ marketName:         string;
+ marketType:         string;
+   marketOddsType:     string;
+ back_static_volume: number | null;
+ lay_static_volume:  number | null;
+ back_volume:        number | null;
+ marketId: string;
+ marketName: string;
+ marketType: string;
+     marketOddsType: string;
+ back_static_volume: number | null;
Removed / Before Commit
- diff --git a/src/modules/horse/pages/Race/AllRaces.tsx b/src/modules/horse/pages/Race/AllRaces.tsx
- index b4dd076..6abbe88 100644
- const handleViewDetail =(raceId: string)=>{
- navigate(`/horse/races/detail/${raceId}`);
- };
-   const handleOpenTotePage =(raceId: string)=>{
-     navigate(`/horse/races/Tote/${raceId}`);
-   };
- const handleOpenAdminRacePage = (raceId: string) => {
- navigate(`/horse/races/admin/${raceId}`);
- };
- className="btn btn-sm btn-icon btn-dark btn-wave"
- title="Open punching Race Page"
- onClick={() => {
-               if (row.raceType === "ToteMarket") {
-                 handleOpenTotePage(row._id);
-                 return;
-               }
Added / After Commit
+ diff --git a/src/modules/horse/pages/Race/AllRaces.tsx b/src/modules/horse/pages/Race/AllRaces.tsx
+ index b4dd076..6abbe88 100644
+ const handleViewDetail =(raceId: string)=>{
+ navigate(`/horse/races/detail/${raceId}`);
+ };
+   // const handleOpenTotePage =(raceId: string)=>{
+   //   navigate(`/horse/races/Tote/${raceId}`);
+   // };
+ const handleOpenAdminRacePage = (raceId: string) => {
+ navigate(`/horse/races/admin/${raceId}`);
+ };
+ className="btn btn-sm btn-icon btn-dark btn-wave"
+ title="Open punching Race Page"
+ onClick={() => {
+               // if (row.raceType === "ToteMarket") {
+               //   handleOpenTotePage(row._id);
+               //   return;
+               // }
Removed / Before Commit
- diff --git a/src/modules/horse/pages/Race/stats.tsx b/src/modules/horse/pages/Race/stats.tsx
- index c9f6182..a374cbd 100644
- import React, { Fragment, useCallback, useEffect, useMemo, useState } from "react";
- import { Alert, Badge, Button, Card, Col, Row, Spinner, Table } from "react-bootstrap";
- import { useLocation, useParams } from "react-router-dom";
- import { toast } from "react-toastify";
- import Pageheader from "../../components/pageheader/pageheader";
- import { tenantServiceInstance as axiosInstance } from "../../../../services/api/axiosConfig";
- marketId: string;
- marketName: string;
- marketType: string;
- back_static_volume: number | null;
- lay_static_volume: number | null;
- back_volume: number | null;
- marketId: String(market?.marketId ?? market?._id ?? market?.id ?? `market_${index}`),
- marketName: String(market?.marketName ?? market?.market_name ?? market?.name ?? `Market ${index + 1}`),
- marketType: String(market?.marketType ?? market?.market_type ?? "-"),
- back_static_volume: toNullableNumber(market?.back_static_volume),
Added / After Commit
+ diff --git a/src/modules/horse/pages/Race/stats.tsx b/src/modules/horse/pages/Race/stats.tsx
+ index c9f6182..a374cbd 100644
+ import React, { Fragment, useCallback, useEffect, useMemo, useState } from "react";
+ import { Alert, Badge, Button, Card, Col, Row, Spinner, Table } from "react-bootstrap";
+ import { useParams } from "react-router-dom";
+ import { toast } from "react-toastify";
+ import Pageheader from "../../components/pageheader/pageheader";
+ import { tenantServiceInstance as axiosInstance } from "../../../../services/api/axiosConfig";
+ marketId: string;
+ marketName: string;
+ marketType: string;
+   marketOddsType: string;
+ back_static_volume: number | null;
+ lay_static_volume: number | null;
+ back_volume: number | null;
+ marketId: String(market?.marketId ?? market?._id ?? market?.id ?? `market_${index}`),
+ marketName: String(market?.marketName ?? market?.market_name ?? market?.name ?? `Market ${index + 1}`),
+ marketType: String(market?.marketType ?? market?.market_type ?? "-"),
Removed / Before Commit
- diff --git a/src/pages/commonpages.css b/src/pages/commonpages.css
- index ad28c03..1438dc1 100644
- color: #7c3aed;
- }
- 
- @media (max-width: 767.98px) {
- .page-search-input {
- width: 100%;
- flex-direction: column;
- width: 100%;
- }
- }
Added / After Commit
+ diff --git a/src/pages/commonpages.css b/src/pages/commonpages.css
+ index ad28c03..1438dc1 100644
+ color: #7c3aed;
+ }
+ 
+ .platform-permission-access {
+   max-width: 1200px;
+   border: 1px solid var(--default-border, #dee2e6);
+   border-radius: 8px;
+   background: var(--custom-white, #ffffff);
+   overflow: hidden;
+ }
+ 
+ .platform-permission-access-header {
+   display: flex;
+   align-items: center;
+   justify-content: space-between;
+   gap: 1rem;
Removed / Before Commit
- diff --git a/src/pages/Platforms/AdminMarketPage.tsx b/src/pages/Platforms/AdminMarketPage.tsx
- index 1e4097f..125169e 100644
- 
- type Market = {
- originalMarketId?:  string;
- marketId:           string;
- marketName:         string;
- marketType:         string;
- back_static_volume: number | null;
- lay_static_volume:  number | null;
- back_volume:        number | null;
- marketId: string;
- marketName: string;
- marketType: string;
- back_static_volume: number | null;
- lay_static_volume: number | null;
- back_volume: number | null;
- normalizedName.includes("FANCY")
Added / After Commit
+ diff --git a/src/pages/Platforms/AdminMarketPage.tsx b/src/pages/Platforms/AdminMarketPage.tsx
+ index 1e4097f..125169e 100644
+ 
+ type Market = {
+ originalMarketId?:  string;
+   originalMarketOddsType?: string;
+ marketId:           string;
+ marketName:         string;
+ marketType:         string;
+   marketOddsType:     string;
+ back_static_volume: number | null;
+ lay_static_volume:  number | null;
+ back_volume:        number | null;
+ marketId: string;
+ marketName: string;
+ marketType: string;
+     marketOddsType: string;
+ back_static_volume: number | null;
Removed / Before Commit
- diff --git a/src/pages/Platformuser/CreatePlatformUser.tsx b/src/pages/Platformuser/CreatePlatformUser.tsx
- index 66a1e8c..5bfed71 100644
- { key: "punching", label: "Punching" },
- ];
- 
- const PermissionDropdown: React.FC<{
- permissions: { key: string; label: string }[];
- selected: string[];
- const [loading, setLoading] = useState(false);
- const [showModal, setShowModal] = useState(false);
- const [credentials, setCredentials] = useState<UserCredentials | null>(null);
- const [form, setForm] = useState<FormState>({
- name: "",
- email: "",
- }));
- };
- 
- const handleSubmit = async (event: React.FormEvent) => {
Added / After Commit
+ diff --git a/src/pages/Platformuser/CreatePlatformUser.tsx b/src/pages/Platformuser/CreatePlatformUser.tsx
+ index 66a1e8c..5bfed71 100644
+ { key: "punching", label: "Punching" },
+ ];
+ 
+ const STATIC_PERMISSION_ACCESS = [
+   {
+     key: "dashboard",
+     label: "Dashboard",
+     icon: "ri-dashboard-line",
+     items: [
+       { key: "dashboard_view_metrics", label: "View DashBoard" },
+   
+     ],
+   },
+   {
+     key: "user",
+     label: "User ",
Removed / Before Commit
- diff --git a/src/pages/Races/stats.tsx b/src/pages/Races/stats.tsx
- index d08a9d7..9a22f80 100644
- import React, { Fragment, useCallback, useEffect, useMemo, useState } from "react";
- import { Alert, Button, Card, Col, Row, Spinner, Table } from "react-bootstrap";
- import { useLocation, useParams } from "react-router-dom";
- import { toast } from "react-toastify";
- import Pageheader from "../../components/pageheader/pageheader";
- import { adjustOdd } from "../../modules/horse/utils/odds";
- marketId: string;
- marketName: string;
- marketType: string;
- back_static_volume: number | null;
- lay_static_volume: number | null;
- back_volume: number | null;
- betAmount: string;
- };
- 
- type OwnerRaceApiRow = {
Added / After Commit
+ diff --git a/src/pages/Races/stats.tsx b/src/pages/Races/stats.tsx
+ index d08a9d7..9a22f80 100644
+ import React, { Fragment, useCallback, useEffect, useMemo, useState } from "react";
+ import { Alert, Button, Card, Col, Row, Spinner, Table } from "react-bootstrap";
+ import { useParams } from "react-router-dom";
+ import { toast } from "react-toastify";
+ import Pageheader from "../../components/pageheader/pageheader";
+ import { adjustOdd } from "../../modules/horse/utils/odds";
+ marketId: string;
+ marketName: string;
+ marketType: string;
+   marketOddsType: string;
+ back_static_volume: number | null;
+ lay_static_volume: number | null;
+ back_volume: number | null;
+ betAmount: string;
+ };
+