diff --git a/src/_nav.js b/src/_nav.js
index 2e8ec6a..b0c36b0 100644
--- a/src/_nav.js
+++ b/src/_nav.js
@@ -24,6 +24,7 @@ import {
cilUser,
cilAlarm,
cilFeaturedPlaylist,
+ cilLocationPin,
} from "@coreui/icons";
import { CNavGroup, CNavItem, CNavTitle, CTabContent } from "@coreui/react";
@@ -40,12 +41,7 @@ const _nav = [
icon: ,
to: "/customers-details",
},
- // {
- // component: CNavItem,
- // name: "Design",
- // icon: ,
- // to: "/design",
- // },
+
{
component: CNavGroup,
name: "Charts",
@@ -297,6 +293,12 @@ const _nav = [
icon: ,
to: "/contact/request",
},
+ // {
+ // component: CNavItem,
+ // name: "Email CMS",
+ // icon: ,
+ // to: "/email-cms",
+ // },
],
},
//Blog start
@@ -306,6 +308,13 @@ const _nav = [
icon: ,
to: "/blogs",
},
+ // Employee
+ {
+ component: CNavItem,
+ name: "Employee",
+ icon: ,
+ to: "/employee",
+ },
// {
// component: CNavGroup,
diff --git a/src/routes.js b/src/routes.js
index c30e161..11c89e1 100644
--- a/src/routes.js
+++ b/src/routes.js
@@ -137,6 +137,10 @@ import { element } from "prop-types";
import OrderdayChart from "./views/Charts/OrderDaywise";
import RevenueCharts from "./views/Charts/RevenueCharts";
import AddCustomer from "./views/customerDetails/addCustomer";
+import EmailCms from "./views/CustomerSupport/EmailCMS/EmailCms";
+import RegistrationEmail from "./views/CustomerSupport/EmailCMS/RegistrationEmail";
+import Employee from "./views/EmployeeAccess/Employee";
+import AddEmployee from "./views/EmployeeAccess/addEmployee";
const routes = [
{ path: "/", exact: true, name: "Home" },
{
@@ -275,6 +279,16 @@ const routes = [
element: AddContactRequest,
},
//Support Requests
+ // {
+ // path: "/email-cms",
+ // name: "CustomerSupport Requests",
+ // element: EmailCms,
+ // },
+ // {
+ // path: "/email-cms/registration-email",
+ // name: "CustomerSupport Requests",
+ // element: RegistrationEmail,
+ // },
{
path: "/support/request",
@@ -334,17 +348,17 @@ const routes = [
path: "/home",
name: "Home",
element: Home,
- },
+ },
{
path: "/home/panel-1",
name: "EditPanel1",
element: EditPanel1,
- },
+ },
{
path: "/home/panel-2",
name: "EditPanel2",
element: EditPanel2,
- },
+ },
{
path: "/home/panel-3",
name: "EditPanel3",
@@ -354,12 +368,7 @@ const routes = [
path: "/home/panel-4",
name: "EditPanel4",
element: Editpanel4,
- },
-
-
-
-
-
+ },
// { path: '/complaint/view/:id', name: 'view Complain', element: ViewComplaint },
//Complaints
@@ -568,6 +577,17 @@ const routes = [
name: "Blogs",
element: ViewBlog,
},
+ // Employee
+ {
+ path: "/employee",
+ name: "Employee",
+ element: Employee,
+ },
+ {
+ path: "/add-employee",
+ name: "Employee",
+ element: AddEmployee,
+ },
//Charts
{
path: "/new-user-day-wise",
diff --git a/src/views/CustomerSupport/EmailCMS/EmailCms.js b/src/views/CustomerSupport/EmailCMS/EmailCms.js
new file mode 100644
index 0000000..dfb2489
--- /dev/null
+++ b/src/views/CustomerSupport/EmailCMS/EmailCms.js
@@ -0,0 +1,111 @@
+import {
+ Button,
+ Paper,
+ Table,
+ TableBody,
+ TableCell,
+ TableContainer,
+ TableHead,
+ TableRow,
+ Typography,
+} from "@mui/material";
+import React from "react";
+import { Link } from "react-router-dom";
+
+export default function EmailCms() {
+ const pages = [
+ {
+ name: "New user registration",
+ action: "Edit",
+ path: "/email-cms/registration-email",
+ },
+ {
+ name: "Forgot Password",
+ action: "Edit",
+ path: "#",
+ },
+ {
+ name: "Change Password Notification ",
+ action: "Edit",
+ path: "#",
+ },
+ {
+ name: "New Order",
+ action: "Edit",
+ path: "#",
+ },
+ {
+ name: "Order - Processing",
+ action: "Edit",
+ path: "#",
+ },
+ {
+ name: "Order - Dispatched",
+ action: "Edit",
+ path: "#",
+ },
+ {
+ name: "Order - Delivered",
+ action: "Edit",
+ path: "#",
+ },
+ {
+ name: "Order - Cancelled",
+ action: "Edit",
+ path: "#",
+ },
+ ];
+
+ return (
+
+
+ Email CMS
+
+
+
+
+
+ Page
+
+ Action
+
+
+
+
+ {pages.map((row) => (
+
+
+ {row.name}
+
+
+ {" "}
+
+
+
+
+
+ ))}
+
+
+
+
+ );
+}
diff --git a/src/views/CustomerSupport/EmailCMS/RegistrationEmail.js b/src/views/CustomerSupport/EmailCMS/RegistrationEmail.js
new file mode 100644
index 0000000..2f274f3
--- /dev/null
+++ b/src/views/CustomerSupport/EmailCMS/RegistrationEmail.js
@@ -0,0 +1,207 @@
+import { Typography } from "@material-ui/core";
+import { Box, Button } from "@mui/material";
+
+import React, { useEffect, useState } from "react";
+import ReactrichTextEditor from "../../Content/reactrichTextEditor";
+import ReactQuill from "react-quill";
+import "react-quill/dist/quill.snow.css";
+import axios from "axios";
+import { isAutheticated } from "src/auth";
+import { useNavigate, useNavigation } from "react-router-dom";
+
+// const TOOLBAR_OPTIONS = [
+// [{ header: [1, 2, 3, 4, 5, 6, false] }],
+// [{ font: [] }],
+// [{ list: "ordered" }, { list: "bullet" }],
+// ["bold", "italic", "underline", "strike"],
+// [{ color: [] }, { background: [] }],
+// [{ align: [] }],
+// [{ script: "super" }, { script: "sub" }],
+// ["undo", "redo"],
+// ];
+
+export default function RegistrationEmail() {
+ const [title, setTitle] = useState("Registration Email");
+ const [welcomemsg, setWelcomeMsg] = useState("");
+ const [welcomemsgforDescription, setWelcomeMsgForDescription] = useState("");
+
+ const [subject, setSubject] = useState("");
+ const [description, setDescription] = useState("");
+ const [content, setContent] = useState("");
+ const [added, setAdded] = useState(false);
+ const [olderContent, setOlderContent] = useState("");
+ const [id, setId] = useState(null);
+
+ const token = isAutheticated();
+
+ const getTermsAndConditions = async () => {
+ const response = await axios.get("/api/get-email-data", {
+ headers: {
+ Authorization: `Bearer ${token}`,
+ },
+ });
+ if (response.status === 200) {
+ if (response.data?.registerEmaildata.length === 0) {
+ return;
+ }
+ // console.log(response);
+ // setContent(response?.data?.registerEmaildata[0]?.termsAndContionContent);
+ // setOlderContent(
+ // response?.data?.registerEmaildata[0]?.termsAndContionContent
+ // );
+ setSubject(response?.data?.registerEmaildata[0]?.subject);
+ setDescription(response?.data?.registerEmaildata[0]?.description);
+ setId(response?.data?.registerEmaildata[0]?._id);
+ }
+ };
+
+ const addTermsandConditions = async () => {
+ const response = await axios.post(
+ "/api/register-email",
+ { subject: subject, description: description },
+ {
+ headers: {
+ Authorization: `Bearer ${token}`,
+ },
+ }
+ );
+ if (response.status == 200) {
+ swal({
+ title: "Congratulations!!",
+ text: response?.data?.message,
+ icon: "success",
+ button: "OK",
+ });
+ }
+ };
+ const handleCancelClick = () => {
+ setAdded(!added);
+ };
+
+ const handleSaveClick = async () => {
+ // if (id === null) {
+ await addTermsandConditions();
+ setAdded(true);
+ // } else {
+ // await updateContent();
+ // setAdded(false);
+ // }
+
+ // Reload terms and conditions
+ // await getTermsAndConditions();
+ };
+ useEffect(() => {
+ // addTermsandConditions();
+ getTermsAndConditions();
+ }, [added]);
+ return (
+
+ );
+}
diff --git a/src/views/EmployeeAccess/Employee.js b/src/views/EmployeeAccess/Employee.js
new file mode 100644
index 0000000..c1b20b4
--- /dev/null
+++ b/src/views/EmployeeAccess/Employee.js
@@ -0,0 +1,479 @@
+import React, { useState, useEffect } from "react";
+import { Link } from "react-router-dom";
+import Button from "@material-ui/core/Button";
+import { useNavigate } from "react-router-dom";
+import axios from "axios";
+import { isAutheticated } from "src/auth";
+import swal from "sweetalert";
+import {
+ Box,
+ FormControl,
+ IconButton,
+ InputLabel,
+ MenuItem,
+ Select,
+ TextField,
+} from "@mui/material";
+import SearchIcon from "@mui/icons-material/Search";
+import Fuse from "fuse.js";
+import { Typography } from "@material-ui/core";
+// import OrderDetails from "./orderDetails";
+const Employee = () => {
+ const token = isAutheticated();
+ const [query, setQuery] = useState("");
+ const navigate = useNavigate();
+ const [loading, setLoading] = useState(true);
+ const [loading1, setLoading1] = useState(true);
+ const [success, setSuccess] = useState(true);
+ const [users, setUsers] = useState([]);
+
+ const [currentPage, setCurrentPage] = useState(1);
+ const [itemPerPage, setItemPerPage] = useState(10);
+ const [showData, setShowData] = useState(users);
+
+ const handleShowEntries = (e) => {
+ setCurrentPage(1);
+ setItemPerPage(e.target.value);
+ };
+
+ // const getUsers = async () => {
+ // axios
+ // .get(`/api/v1/admin/users`, {
+ // headers: {
+ // Authorization: `Bearer ${token}`,
+ // },
+ // })
+ // .then((res) => {
+ // setUsers(res.data.users);
+ // setLoading(false);
+ // })
+ // .catch((error) => {
+ // swal({
+ // title: error,
+ // text: "please login to access the resource or refresh the page ",
+ // icon: "error",
+ // button: "Retry",
+ // dangerMode: true,
+ // });
+ // setLoading(false);
+ // });
+ // };
+
+ // useEffect(() => {
+ // getUsers();
+ // }, [success]);
+ // console.log(users);
+
+ // useEffect(() => {
+ // const loadData = () => {
+ // const indexOfLastPost = currentPage * itemPerPage;
+ // const indexOfFirstPost = indexOfLastPost - itemPerPage;
+ // setShowData(users.slice(indexOfFirstPost, indexOfLastPost));
+ // };
+ // loadData();
+ // }, [currentPage, itemPerPage, users]);
+ // console.log(users);
+
+ // const handleDelete = (id) => {
+ // swal({
+ // title: "Are you sure?",
+ // icon: "error",
+ // buttons: {
+ // Yes: { text: "Yes", value: true },
+ // Cancel: { text: "Cancel", value: "cancel" },
+ // },
+ // }).then((value) => {
+ // if (value === true) {
+ // axios
+ // .delete(`/api/user-address/deleteAddress/${id}`, {
+ // headers: {
+ // "Access-Control-Allow-Origin": "*",
+ // Authorization: `Bearer ${token}`,
+ // },
+ // })
+ // .then((res) => {
+ // swal({
+ // title: "Deleted",
+ // text: "Address Deleted successfully!",
+ // icon: "success",
+ // button: "ok",
+ // });
+ // setSuccess((prev) => !prev);
+ // })
+ // .catch((err) => {
+ // swal({
+ // title: "Warning",
+ // text: "Something went wrong!",
+ // icon: "error",
+ // button: "Retry",
+ // dangerMode: true,
+ // });
+ // });
+ // }
+ // });
+ // };
+
+ return (
+
+
+
+
+
+
+
+ All Employees
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Employee Name |
+ Email |
+
+ Access to |
+
+ Action |
+
+
+
+ {!loading && showData.length === 0 && (
+
+
+ No Data Available
+ |
+
+ )}
+ {!loading ? (
+
+
+ Loading...
+ |
+
+ ) : (
+ // showData.map((user, i) => {
+ // return (
+ //
+ // {user.name} |
+ // {user._id} |
+
+ //
+ // {new Date(user.createdAt).toLocaleString(
+ // "en-IN",
+ // {
+ // weekday: "short",
+ // month: "short",
+ // day: "numeric",
+ // year: "numeric",
+ // hour: "numeric",
+ // minute: "numeric",
+ // hour12: true,
+ // }
+ // )}
+ // |
+ // {loading1 && (
+ // <>
+ // loading... |
+ // loading... |
+ // >
+ // )}
+
+ //
+
+ //
+ // {/*
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+ // */}
+ //
+ //
+ //
+ // |
+ //
+ // );
+ // })
+
+ Roshan Garg |
+ roshan@gmail.com |
+ {/* Profile Image | */}
+ dashboard |
+
+ {/* Last Purchase |
+ Orders | */}
+
+
+
+ |
+
+ )}
+
+
+
+
+
+
+
+ Showing {currentPage * itemPerPage - itemPerPage + 1} to{" "}
+ {Math.min(currentPage * itemPerPage, users.length)} of{" "}
+ {users.length} entries
+
+
+
+
+
+
+ -
+ setCurrentPage((prev) => prev - 1)}
+ >
+ Previous
+
+
+
+ {!(currentPage - 1 < 1) && (
+ -
+
+ setCurrentPage((prev) => prev - 1)
+ }
+ >
+ {currentPage - 1}
+
+
+ )}
+
+ -
+
+ {currentPage}
+
+
+
+ {!(
+ (currentPage + 1) * itemPerPage - itemPerPage >
+ users.length - 1
+ ) && (
+ -
+ {
+ setCurrentPage((prev) => prev + 1);
+ }}
+ >
+ {currentPage + 1}
+
+
+ )}
+
+ -
+ users.length - 1
+ )
+ ? "paginate_button page-item next"
+ : "paginate_button page-item next disabled"
+ }
+ >
+ setCurrentPage((prev) => prev + 1)}
+ >
+ Next
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default Employee;
diff --git a/src/views/EmployeeAccess/addEmployee.js b/src/views/EmployeeAccess/addEmployee.js
new file mode 100644
index 0000000..b0efd0d
--- /dev/null
+++ b/src/views/EmployeeAccess/addEmployee.js
@@ -0,0 +1,123 @@
+import { Box, Button, Typography } from "@mui/material";
+import React, { useState } from "react";
+import FormGroup from "@mui/material/FormGroup";
+import FormControlLabel from "@mui/material/FormControlLabel";
+import Checkbox from "@mui/material/Checkbox";
+import { useNavigate } from "react-router-dom";
+import _nav from "src/_nav";
+
+const AddEmployee = () => {
+ const [employeeName, setEmployeeName] = useState("");
+ const [email, setEmail] = useState("");
+ const navigate = useNavigate();
+ const [checkedItems, setCheckedItems] = useState({});
+ const filteredNav = _nav.filter((item) => item.name !== "Employee");
+ const handleCheckboxChange = (name) => (event) => {
+ setCheckedItems({
+ ...checkedItems,
+ [name]: event.target.checked,
+ });
+ };
+ console.log(checkedItems);
+
+ return (
+
+
+ {/* setTitle(e.target.value)}
+ variant="outlined"
+ size="small"
+ fullWidth
+ /> */}
+
+ {" "}
+ Add Employee:{" "}
+
+
+
+
+
+ setEmployeeName(e.target.value)}
+ />
+
+
+
+
+
+ setEmail(e.target.value)}
+ />
+
+
+
+
+ {filteredNav.map((item, index) => (
+
+
+ {item.name}
+
+ ))}
+
+
+
+
+
+
+
+
+ );
+};
+
+export default AddEmployee;