Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
d3cca88
Actualizo ruta para borrado lógico
DracoAlex84 Oct 24, 2023
c04001f
Corrigo buf detail
DracoAlex84 Oct 24, 2023
8b1d3d7
Agrego notificaciones a users y projects
DracoAlex84 Oct 24, 2023
f65e0b2
Actualizo detail
DracoAlex84 Oct 25, 2023
539d2bb
A
DracoAlex84 Oct 25, 2023
5941490
Face
DracoAlex84 Oct 25, 2023
f96d24f
Corrijo bug detail
DracoAlex84 Oct 25, 2023
909ea33
Actualizo borrado lógico de proyectos y usuarios para admin
DracoAlex84 Oct 25, 2023
4cf5017
gestionUsers
jesib03 Oct 25, 2023
7e7595e
Corrijo bug delete
DracoAlex84 Oct 25, 2023
bf62598
mas cambios
jesib03 Oct 25, 2023
69d1a1f
mas porque no me funciona probando
jesib03 Oct 25, 2023
5be7744
luego de la ruta deleteUsers no me funciona
jesib03 Oct 25, 2023
6c527bf
Update mercadopago.js
guspaz0 Oct 26, 2023
08a9b72
Update auth.js
guspaz0 Oct 26, 2023
2ee2d52
Update package.json
guspaz0 Oct 26, 2023
4ca4d01
Update index.js
guspaz0 Oct 26, 2023
a4fae00
Update projectsUser.json
guspaz0 Oct 26, 2023
4c478ac
Update dashboard.js
guspaz0 Oct 26, 2023
a8ff16b
Update userDashboard.js
guspaz0 Oct 26, 2023
05d9e9b
jsonwebtoken en package log
DracoAlex84 Oct 26, 2023
48aff3d
modificamos re-direct de git hub
DracoAlex84 Oct 26, 2023
bb7000e
Modifico github
DracoAlex84 Oct 26, 2023
e6ad5f6
Github
DracoAlex84 Oct 26, 2023
0517376
Console log req
DracoAlex84 Oct 26, 2023
057c1bf
Comento nodemailer en user
DracoAlex84 Oct 26, 2023
d7d92bf
Modifico mail de Alexis
DracoAlex84 Oct 26, 2023
fdf62eb
Sube mail de usuario
DracoAlex84 Oct 26, 2023
598244d
Update Users.js
guspaz0 Oct 26, 2023
8f2b09d
Update user.js
guspaz0 Oct 26, 2023
7911aa4
Update payment.js
guspaz0 Oct 26, 2023
51e7eca
Update package.json
guspaz0 Oct 26, 2023
174d278
maaaas
jesib03 Oct 26, 2023
8eaa86f
Update payment.js
guspaz0 Oct 26, 2023
27907b6
Update payment.js
guspaz0 Oct 26, 2023
07b62c9
Update Users.js
guspaz0 Oct 26, 2023
833203d
Update Users.js
guspaz0 Oct 26, 2023
079f381
Update Users.js
guspaz0 Oct 26, 2023
a7132ba
Update Users.js
guspaz0 Oct 26, 2023
0f5d102
Update users.js
guspaz0 Oct 26, 2023
8c4e5fa
Update index.js
guspaz0 Oct 26, 2023
36aeb98
Update userDashboard.js
guspaz0 Oct 26, 2023
353ec7e
Update Users.js
guspaz0 Oct 26, 2023
f6ded0e
gestion de Usuarios
jesib03 Oct 26, 2023
d76e9e1
Update projects.js
guspaz0 Oct 26, 2023
7e8bf35
Update projects.js
guspaz0 Oct 27, 2023
c490599
Update projects.js
guspaz0 Oct 27, 2023
3b8ae8d
Corrijo bug
DracoAlex84 Oct 27, 2023
9e34c3f
Update mercadopago.js
guspaz0 Oct 27, 2023
a129ba6
Update mercadopago.js
guspaz0 Oct 27, 2023
49c6b5a
Update index.js
guspaz0 Oct 27, 2023
bf1dd87
Update index.js
guspaz0 Oct 27, 2023
ce79618
Update mercadopago.js
guspaz0 Oct 27, 2023
608a0af
Update payment.js
guspaz0 Oct 27, 2023
6552da3
Update payment.js
guspaz0 Oct 27, 2023
b49f9dc
Update payment.js
guspaz0 Oct 27, 2023
f39d7a9
Update payment.js
guspaz0 Oct 27, 2023
a6f3dc1
Update payment.js
guspaz0 Oct 27, 2023
98682af
Mail confirmación usuario
DracoAlex84 Oct 27, 2023
7fffefa
Envio mail de usuario
DracoAlex84 Oct 27, 2023
b9c5784
Modifico mensaje de proyecto
DracoAlex84 Oct 27, 2023
4bfc70b
push para revisar gestionUsers
jesib03 Oct 27, 2023
7875829
request para revisar error en gestionUsers
jesib03 Oct 27, 2023
b09c1d0
luego de pull, request para gestionUsers
jesib03 Oct 27, 2023
91176ce
ultimos cambios
jesib03 Oct 27, 2023
c201bca
ultimos cambios despues del pull
jesib03 Oct 27, 2023
f5cbe12
ultimos cambiooos
jesib03 Oct 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added front/components/PROJUNITY.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 16 additions & 9 deletions front/components/admin/HeadAndFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ import { useRouter } from "next/router";
import { getSesion, logout } from "../../redux/actions/actionsUser";
import Swal from "sweetalert2";
import { useDispatch, useSelector } from "react-redux";
import HomeIcon from "@mui/icons-material/Home";
import { Flex } from "@chakra-ui/react";



// If loading a variable font, you don't need to specify the font weight
const inter = Inter({
Expand Down Expand Up @@ -106,16 +110,19 @@ const HeadFooter = ({ children }) => {
<Logo measures={21} /> <b className="ml-2">ProjUnity</b>
</Link>
</NavbarBrand>
<NavbarItem>
<Flex alignItems="center" mr={8}>
<HomeIcon />
<Link
disableRipple
className="p-0 bg-transparent data-[hover=true]:bg-transparent font-semibold cursor-pointer"
href="/admin"
>
Home
</Link>
</Flex>
</NavbarItem>
<NavbarContent className="hidden sm:flex gap-4" justify="center">
<NavbarItem>
<Link
disableRipple
className="p-0 bg-transparent data-[hover=true]:bg-transparent font-semibold cursor-pointer"
href="/admin"
>
Home
</Link>
</NavbarItem>
<Dropdown backdrop="blur">
<NavbarItem>
<DropdownTrigger>
Expand Down
18 changes: 10 additions & 8 deletions front/components/admin/transactionDetalles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,25 @@ const TransactionDetailsPage = ({ transaction }) => {

// Agregar contenido al PDF
doc.text("Detalles de la Transacción", 10, 10);

const imgData = "./components/PROJUNITY.png"; // Reemplaza con la URL de tu imagen
doc.addImage(imgData, "PNG", 10, 40, 50, 50);

doc.autoTable({
head: [["Campo", "Valor"]],
body: [
["Id", transaction.orderId],
["Nombre", transaction.nombre],
["Fecha", transaction.fecha],
["Total", transaction.total],
["Producto", transaction.metodoPago],
["Estado del Pago", transaction.estadoPago],
["Método de Pago", transaction.metodoPago],
],
});

// Descargar el PDF
doc.save("DetallesTransaccion.pdf");
}


return (
<Box m="8">
<Flex justify="space-between" mb="4">
Expand Down Expand Up @@ -71,6 +73,10 @@ const TransactionDetailsPage = ({ transaction }) => {
<Td fontWeight="bold">Total:</Td>
<Td>{transaction.total}</Td>
</Tr>
<Tr>
<Td fontWeight="bold">Producto:</Td>
<Td>{transaction.metodoPago}</Td>
</Tr>
<Tr>
<Td fontWeight="bold">Estado del Pago:</Td>
<Td>
Expand All @@ -87,10 +93,6 @@ const TransactionDetailsPage = ({ transaction }) => {
</Badge>
</Td>
</Tr>
<Tr>
<Td fontWeight="bold">Método de Pago:</Td>
<Td>{transaction.metodoPago}</Td>
</Tr>
</Tbody>
</Table>
<Link href="/admin">
Expand All @@ -104,4 +106,4 @@ const TransactionDetailsPage = ({ transaction }) => {
);
};

export default TransactionDetailsPage;
export default TransactionDetailsPage;
1 change: 1 addition & 0 deletions front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@nextui-org/react": "^2.1.13",
"@react-email/link": "0.0.5",
"axios": "^1.5.1",
"date-fns": "^2.30.0",
"formik": "^2.4.5",
"framer-motion": "^10.16.4",
"jspdf": "^2.5.1",
Expand Down
36 changes: 18 additions & 18 deletions front/pages/admin/detallesTransaccion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ import HeadFooter from "../../components/admin/HeadAndFooter";

const transactionsData = [
{
orderId: "12345",
nombre: "Juan Pérez",
fecha: "2023-10-15",
total: "$50.00",
estadoPago: "Aprobado",
metodoPago: "Tarjeta de Crédito",
orderId: "560",
nombre: "Dario",
fecha: "22023-10-27 06:42",
total: "$67.80",
metodoPago: "Laravel",
estadoPago: "Created",
},
{
orderId: "54321",
nombre: "María González",
fecha: "2023-10-14",
total: "$30.00",
estadoPago: "Denegado",
metodoPago: "Transferencia Mercado Pago",
orderId: "559",
nombre: "Dario",
fecha: "2023-10-27 06:31",
total: "$15.00",
metodoPago: "WooCommerce",
estadoPago: "Created",
},
{
orderId: "87435",
nombre: "Fernando Guevara",
fecha: "2023-08-16",
total: "$80.00",
estadoPago: "Pendiente",
metodoPago: "Mercado Pago",
orderId: "559",
nombre: "Dario",
fecha: "2023-10-27 06:31",
total: "$67.80",
metodoPago: "Laravel",
estadoPago: "Created",
},
// Agrega más transacciones aquí
];
Expand Down
33 changes: 21 additions & 12 deletions front/pages/admin/gananciasUser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,30 @@ const diasDeVenta = [
export default function GananciasView() {

const dispatch = useDispatch();

const id = useSelector((state) => state.usersData.sesion.id);
console.log(id);

const userDashboardData = useSelector((state) => state.userDashboard.userDashboardData);
console.log(userDashboardData);

React.useEffect(() => {
let sesion = JSON.parse(localStorage.getItem("sesion"));
if (sesion.id) {
dispatch(getUserDashboard(sesion.id));
}
}, [dispatch]);

React.useEffect(() => {
dispatch(getUserDashboard(id));
}, [dispatch, id]);
// const id = useSelector((state) => state.usersData.sesion.id);
// console.log(id);

// React.useEffect(() => {
// if (id) {
// dispatch(getUserDashboard(id));
// }
// }, [dispatch, id]);

const userDashboardData = useSelector(
(state) => state.userDashboard.userDashboardData
);
console.log(userDashboardData);

const loading = useSelector((state) => state.userDashboard.loading);
if (loading) return <Loader />;

// Preparar datos para el gráfico de barras
const data = [];
Expand All @@ -81,9 +92,7 @@ export default function GananciasView() {
}
return total;
}
const loading = useSelector((state) => state.projectsData.loading);
//* Aqui se maneja el loader
if (loading) return <Loader />;

return (
<HeadFooter>
<Box
Expand Down
115 changes: 85 additions & 30 deletions front/pages/admin/gestionProyectos.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,67 @@ import {
import HeadFooter from "../../components/admin/HeadAndFooter";
import Loader from "../../components/layout/loader";
import { useDispatch, useSelector } from 'react-redux';
import { getProjects } from "../../redux/actions/actions";
import { ArrowForwardIcon, ArrowBackIcon } from "@chakra-ui/icons";


const projectData = [
{
id: 1,
name: "Proyecto A",
owner: "Usuario 1",
status: "Activo",
},
{
id: 2,
name: "Proyecto B",
owner: "Usuario 2",
status: "En pausa",
},
{
id: 3,
name: "Proyecto C",
owner: "Usuario 3",
status: "Activo",
},
// Agrega más proyectos aquí
];
// const projectData = [
// {
// id: 1,
// name: "Proyecto A",
// owner: "Usuario 1",
// status: "Activo",
// },
// {
// id: 2,
// name: "Proyecto B",
// owner: "Usuario 2",
// status: "En pausa",
// },
// {
// id: 3,
// name: "Proyecto C",
// owner: "Usuario 3",
// status: "Activo",
// },
// // Agrega más proyectos aquí
// ];

export default function ProjectManagement() {
const [searchTerm, setSearchTerm] = useState("");

const filteredProjects = projectData.filter((project) =>
project.name.toLowerCase().includes(searchTerm.toLowerCase())
);
const dispatch = useDispatch();

React.useEffect(() => {
/* projects.length === 0 && */ dispatch(getProjects());
// dispatch(getCategory());
}, [dispatch]);

const projects = useSelector((state) => state.projectsData.projectsFilter);
console.log(projects)

const [searchTerm, setSearchTerm ] = useState("");
const [currentPage, setCurrentPage] = useState(1);
const itemsPerPage = 5;

const loading = useSelector((state) => state.projectsData.loading);
//* Aqui se maneja el loader
if (loading) return <Loader />;

const loading = useSelector((state) => state.projectsData.loading);
//* Aqui se maneja el loader
if (loading) return <Loader />;

const filteredProjects = projects.filter((project) =>
project.name.toLowerCase().includes(searchTerm.toLowerCase())
);

// Cálculo del total de páginas para la paginación
const totalPages = Math.ceil(filteredProjects.length / itemsPerPage);

// Función para obtener los proyectos de la página actual
const getCurrentPageProjects = () => {
const startIndex = (currentPage - 1) * itemsPerPage;
const endIndex = startIndex + itemsPerPage;
return filteredProjects.slice(startIndex, endIndex);
};

return (
<HeadFooter>
<Box m="6">
Expand Down Expand Up @@ -79,11 +104,20 @@ if (loading) return <Loader />;
</Tr>
</Thead>
<Tbody bg="gray.200">
{filteredProjects.map((project) => (
{getCurrentPageProjects()
.filter((project) =>
project.name.toLowerCase().includes(searchTerm.toLowerCase())
)
.map((project) => (
<Tr key={project.id}>
<Td>{project.id}</Td>
<Td>{project.name}</Td>
<Td>{project.owner}</Td>
<Td>
{project.Users.map((user) => (
<Td key={user.id}>{user.githubUser}</Td>

))}
</Td>
<Td>{project.status}</Td>
<Td>
<Link href="/admin/historialUser">
Expand All @@ -104,6 +138,27 @@ if (loading) return <Loader />;
))}
</Tbody>
</Table>
{/* Agregar la paginación */}
<Flex justify="space-between" mt="4">
<Button
onClick={() => setCurrentPage((prevPage) => prevPage - 1)}
disabled={currentPage === 1}
colorScheme="gray"
variant='outline'
leftIcon={<ArrowBackIcon />}
>
Anterior
</Button>
<Button
onClick={() => setCurrentPage((prevPage) => prevPage + 1)}
disabled={currentPage === totalPages}
colorScheme="gray"
variant='outline'
rightIcon={<ArrowForwardIcon />}
>
Siguiente
</Button>
</Flex>
</Box>
</HeadFooter>
);
Expand Down
Loading