Feature/add user activiry crud
This commit is contained in:
12
src/core/components/BlinkingCell.jsx
Normal file
12
src/core/components/BlinkingCell.jsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Box, Stack } from "@mui/material";
|
||||
import BlinkingCircle from "./BlinkingCircle";
|
||||
|
||||
const BlinkingCell = ({ visible = false, value }) => {
|
||||
return (
|
||||
<Stack direction={"row"} alignItems={"center"} spacing={0.5}>
|
||||
<Box>{value}</Box>
|
||||
{visible && <BlinkingCircle />}
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
export default BlinkingCell;
|
||||
24
src/core/components/BlinkingCircle.jsx
Normal file
24
src/core/components/BlinkingCircle.jsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { keyframes } from "@emotion/react";
|
||||
import { Box } from "@mui/material";
|
||||
|
||||
const blink = keyframes`
|
||||
0% { opacity: 1; }
|
||||
50% { opacity: 0.3; }
|
||||
100% { opacity: 1; }
|
||||
`;
|
||||
|
||||
const BlinkingCircle = () => {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
width: 6,
|
||||
height: 6,
|
||||
borderRadius: "50%",
|
||||
backgroundColor: (theme) => theme.palette.warning.main,
|
||||
animation: `${blink} 1.3s infinite ease-in-out`,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default BlinkingCircle;
|
||||
@@ -56,7 +56,7 @@ const errorClient = (response, notification, toastContainer, logout) => {
|
||||
};
|
||||
|
||||
export const errorResponse = (response, notification, toastContainer, logout) => {
|
||||
if (notification) toast.dismiss({ container: toastContainer });
|
||||
if (notification) toast.dismiss({ containerId: toastContainer });
|
||||
if (isServerError(response.status)) {
|
||||
errorServer(response, notification, toastContainer);
|
||||
} else if (isClientError(response.status)) {
|
||||
|
||||
@@ -95,7 +95,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <FactCheckIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["road_items.total"],
|
||||
badges: ["roadItem.total"],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadItemManagmentSupervisor",
|
||||
@@ -103,7 +103,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["road_items.supervise_cnt"],
|
||||
badges: ["roadItem.supervise_cnt"],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadItemManagmentSupervisorCartable",
|
||||
@@ -123,7 +123,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["road_items.operation_cnt"],
|
||||
badges: ["roadItem.operation_cnt"],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadItemManagmentOparationCartable",
|
||||
@@ -185,7 +185,6 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <FireTruckIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["road_patrols.total"],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadPatrolManagmentSupervisor",
|
||||
@@ -193,7 +192,6 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["road_patrols.supervise_cnt"],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadPatrolManagmentSupervisorCartable",
|
||||
@@ -213,7 +211,6 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["road_patrols.operation_cnt"],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadPatrolManagmentOparationCartable",
|
||||
@@ -293,7 +290,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <RouteIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["safety_and_privacy.step_one", "safety_and_privacy.step_two"],
|
||||
badges: ["safetyAndPrivacy.step_one", "safetyAndPrivacy.step_two"],
|
||||
Subitems: [
|
||||
{
|
||||
id: "safetyAndPrivacyManagmentOparation",
|
||||
@@ -347,7 +344,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <ElectricBoltIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["road_observations.total"],
|
||||
badges: ["roadObserved.total"],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadObservationsManagmentSupervisor",
|
||||
@@ -355,7 +352,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["road_observations.supervise_cnt"],
|
||||
badges: ["roadObserved.supervise_cnt", "roadObserved.complaint_cnt"],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadObservationsManagmentSupervisorCartable",
|
||||
@@ -372,7 +369,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["road_observations.operation_cnt"],
|
||||
badges: ["roadObserved.operation_cnt", "roadObserved.complaint_cnt"],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadObservationsManagmentOparationCartable",
|
||||
@@ -495,10 +492,18 @@ export const pageMenu = [
|
||||
id: "permissionItem",
|
||||
label: "سطح دسترسی ها",
|
||||
type: "page",
|
||||
route: "/dashboard/permission-table",
|
||||
route: "/dashboard/permissions",
|
||||
icon: <LockPersonIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["show-permissions-page"],
|
||||
},
|
||||
{
|
||||
id: "userActivities",
|
||||
label: "انواع فعالیت کاربران",
|
||||
type: "page",
|
||||
route: "/dashboard/user-activities",
|
||||
icon: <AssignmentLateIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["show-user-activities-page"],
|
||||
},
|
||||
{
|
||||
id: "CarDetails",
|
||||
label: "اطلاعات خودرو",
|
||||
|
||||
@@ -6,7 +6,7 @@ export const UPDATE_USER_ROUTE = api + "/api/v3/profile/edit";
|
||||
export const CHANGE_USER_PASSWORD = api + "/api/v3/profile/change_password";
|
||||
export const GET_LOGIN_ROUTE = api + "/login_dev";
|
||||
export const GET_PERMISSIONS_ROUTE = api + "/webapi/user/get-permission";
|
||||
export const GET_SIDEBAR_BADGE_ROUTE = api + "/v2/activity_statistics";
|
||||
export const GET_SIDEBAR_BADGE_ROUTE = api + "/api/v3/notifications";
|
||||
export const REFER_ADMIN_PROVINCE = "/v3/api/fake-submit";
|
||||
export const REFER_ADMIN_CITY = "/v3/api/fake-submit";
|
||||
export const GET_CITY_LISTS = "/v3/api/fake-cities";
|
||||
@@ -140,8 +140,14 @@ export const EXPORT_OPERATOR_ROAD_SAFETY = api + "/api/v3/safety_and_privacy/exc
|
||||
export const GET_ROAD_SAFETY_PROVINCE_ACTIVITY_REPORT = api + "/api/v3/safety_and_privacy_report/country_activity";
|
||||
export const GET_ROAD_SAFETY_CITY_ACTIVITY_REPORT = api + "/api/v3/safety_and_privacy_report/province_activity";
|
||||
|
||||
//permission table
|
||||
// permission table
|
||||
export const GET_PERMISSION_TABLE_LIST = api + "/api/v3/permissions";
|
||||
export const DELETE_PERMISSION = api + "/api/v3/permissions";
|
||||
export const UPDATE_PERMISSION = api + "/api/v3/permissions";
|
||||
export const CREATE_PERMISSION = api + "/api/v3/permissions";
|
||||
|
||||
// user activities
|
||||
export const GET_USER_ACTIVITIES_LIST = api + "/api/v3/log_list";
|
||||
export const CREATE_USER_ACTIVITY = api + "/api/v3/log_list";
|
||||
export const UPDATE_USER_ACTIVITY = api + "/api/v3/log_list";
|
||||
export const DELETE_USER_ACTIVITIES = api + "/api/v3/log_list";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { successToast } from "@/core/components/Toasts/success";
|
||||
|
||||
export const successRequest = (notification, toastContainer) => {
|
||||
if (notification) {
|
||||
toast.dismiss({ container: toastContainer });
|
||||
toast.dismiss({ containerId: toastContainer });
|
||||
successToast(toastContainer);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user