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

Review Result ?

solutionbowl/crm-dashbaord · 9ab00989
The commit introduces the 'market_odds_type' feature in multiple components with consistent implementation including typing, conditional rendering, and UI changes. The logic to hide/show sections based on the odds type is clear and well-incorporated. However, there are some repeated inline style calculations and conditional logic that could be abstracted for clarity and maintainability. There is some commented code that should be removed to clean the codebase. No significant security issues are found, and the bug risk is low but could be further reduced with additional validations or type strictness.
Quality ?
85%
Security ?
90%
Business Value ?
80%
Maintainability ?
83%
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:135-137
Issue / Evidence The isToteMarketOddsType function is duplicated in three files
Suggested Fix refactor into a shared utility module to reduce duplication and improve maintainability.
Duplicate Logic
Where src/modules/horse/pages/Race/AdminRacepage.tsx:920-929, 943-1004, 1028-1038, 1449-1508
Issue / Evidence Multiple inline style objects and complex conditional calculations are repeated
Suggested Fix abstract common styles and calculations into reusable constants or hooks for better readability and maintainability.
Remove Or Document The Commented Out Block...
Where src/modules/horse/pages/Race/AllRaces.tsx:97-199
Issue / Evidence Remove or document the commented-out block of code to keep the codebase clean and avoid confusion.
Suggested Fix Review and simplify this section.
Improve Descriptiveness
Where commit message
Issue / Evidence Improve descriptiveness
Suggested Fix enhance the commit message with details on why the feature is added and how the market odds type affects UI/logic, improving project documentation and review clarity.
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;
+ };
+