From bad70d7217e53a298a1284cf099b651bb15a022a Mon Sep 17 00:00:00 2001 From: Maria Sanchez Date: Fri, 22 Jul 2022 15:16:54 -0600 Subject: [PATCH 001/189] login web component --- web-ui/web-react/src/components/LogIn.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web-ui/web-react/src/components/LogIn.js b/web-ui/web-react/src/components/LogIn.js index 10c58bd6..4d0531e1 100644 --- a/web-ui/web-react/src/components/LogIn.js +++ b/web-ui/web-react/src/components/LogIn.js @@ -3,6 +3,8 @@ import { InputText } from 'primereact/inputtext'; const LogIn = () => { + + return (
From 72ea9d203304cb64e0ef8ff81b97c6d0b4efad5a Mon Sep 17 00:00:00 2001 From: Mariela Date: Sat, 23 Jul 2022 23:54:05 -0600 Subject: [PATCH 002/189] obtener inquilinos api --- api-gateway/src/app.controller.ts | 6 ++++++ api-gateway/src/app.service.ts | 11 +++++++++++ servicio-usuarios/src/users/users.controller.ts | 12 ++++++++++++ servicio-usuarios/src/users/users.service.ts | 11 +++++++++++ 4 files changed, 40 insertions(+) diff --git a/api-gateway/src/app.controller.ts b/api-gateway/src/app.controller.ts index 2d02bfe4..205c4339 100644 --- a/api-gateway/src/app.controller.ts +++ b/api-gateway/src/app.controller.ts @@ -77,6 +77,7 @@ export class AppController { allUsersAdminComunidad() { return this.appService.allUsersAdminComunidad(); } + @Get('user/findGuards/:community') findGuardsCommunity( @Param('community_id') community_id: string @@ -84,6 +85,11 @@ export class AppController { return this.appService.findGuardsCommunity(community_id); } + @Get('user/findTenants') + allUsersTenants() { + return this.appService.allUsersTenants(); + } + @Get('user/find/:dni') findUser( @Param('dni') paramUserDNI: string diff --git a/api-gateway/src/app.service.ts b/api-gateway/src/app.service.ts index 65ebd4f8..541d7907 100644 --- a/api-gateway/src/app.service.ts +++ b/api-gateway/src/app.service.ts @@ -95,6 +95,17 @@ export class AppService { ); } + allUsersTenants() { + const pattern = { cmd: 'findTenants' }; + const payload = {}; + return this.clientUserApp + .send(pattern, payload) + .pipe( + map((message: string) => ({ message })), + ); + } + + //GET parameter from API findUser(paramUserDNI: string) { const pattern = { cmd: 'findUserDNI' }; diff --git a/servicio-usuarios/src/users/users.controller.ts b/servicio-usuarios/src/users/users.controller.ts index ea3c70a9..03fb4fcd 100644 --- a/servicio-usuarios/src/users/users.controller.ts +++ b/servicio-usuarios/src/users/users.controller.ts @@ -41,6 +41,18 @@ export class UsersController { } + @MessagePattern({ cmd: 'findTenantsCommunity' }) + findTenantsCommunity(@Payload() community_id: string) { + let pcommunity_id = community_id['community_id']; + return this.userService.findTenantsCommunity(pcommunity_id); + } + + @MessagePattern({ cmd: 'findTenants' }) + findTenants() { + return this.userService.findTenants(); + } + + @MessagePattern({ cmd: 'updateUser' }) update(@Payload() user: UserDocument) { return this.userService.update(user.id, user); diff --git a/servicio-usuarios/src/users/users.service.ts b/servicio-usuarios/src/users/users.service.ts index edaf2ed0..e282108c 100644 --- a/servicio-usuarios/src/users/users.service.ts +++ b/servicio-usuarios/src/users/users.service.ts @@ -87,6 +87,17 @@ export class UsersService { return this.userModel.find({ user_type: 2 }).exec(); } + + //find inquilinos + async findTenants(): Promise { + return this.userModel.find({ user_type: 3 }).exec(); + } + + + //find inquilinos + async findTenantsCommunity(pcommunity_id: string): Promise { + return this.userModel.find({ community_id: pcommunity_id, user_type: 4 }).exec(); + } async testSendMail(user: UserDocument) { let passwordEncriptada = Md5.init(user.password); From 305a343936dddfdc7af6cd86b2b584ad3bc744c6 Mon Sep 17 00:00:00 2001 From: Mariela Date: Sat, 23 Jul 2022 23:54:26 -0600 Subject: [PATCH 003/189] set list inquilinos --- web-ui/web-react/src/components/Inquilinos.js | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/web-ui/web-react/src/components/Inquilinos.js b/web-ui/web-react/src/components/Inquilinos.js index 608a0a6b..661af956 100644 --- a/web-ui/web-react/src/components/Inquilinos.js +++ b/web-ui/web-react/src/components/Inquilinos.js @@ -1,10 +1,40 @@ import { Button } from 'primereact/button'; import { Dropdown } from 'primereact/dropdown'; import { InputText } from 'primereact/inputtext' -import React, { useEffect, useState } from 'react' +import React, { useEffect, useState, useRef } from 'react' +import { DataTable } from 'primereact/datatable'; +import { Column } from 'primereact/column'; +import { Dropdown } from 'primereact/dropdown'; +import { Toast } from 'primereact/toast'; +import classNames from 'classnames'; const Inquilinos = () => { const [communitiesList, setCommunitiesList] = useState([]); + const [tenants, setTenants] = useState([]); + + const [tenant, setTenant] = useState(emptyTenant); + + let emptyTenant = { + _id: null, + dni: '', + name: '', + last_name: '', + email: '', + phone: '', + password: '', + user_type: '1', + community_id: '', + community_name: '', + number_house: '', + status: '' + }; + + + async function getTenants() { + + } + + const communityIdList = communitiesList.map(community => community.id); async function getCommunites() { let response = await fetch('http://localhost:4000/community/allCommunities', { method: 'GET' }); @@ -53,7 +83,7 @@ const Inquilinos = () => {
-
From 9b8e324bf1748203a5324091452b1bcc261b2687 Mon Sep 17 00:00:00 2001 From: Mariela Date: Sun, 24 Jul 2022 17:44:25 -0600 Subject: [PATCH 004/189] add get tenants --- .../components/AdministradoresComunidad.js | 37 +---- web-ui/web-react/src/components/Inquilinos.js | 150 ++++++++++++++++-- 2 files changed, 145 insertions(+), 42 deletions(-) diff --git a/web-ui/web-react/src/components/AdministradoresComunidad.js b/web-ui/web-react/src/components/AdministradoresComunidad.js index 06416d5d..6d6cdb34 100644 --- a/web-ui/web-react/src/components/AdministradoresComunidad.js +++ b/web-ui/web-react/src/components/AdministradoresComunidad.js @@ -152,10 +152,7 @@ const AdministradoresComunidad = () => { setDeleteAdminCommunityDialog(true); } - const confirmDeleteSelected = () => { - setDeleteAdminsCommunitiesDialog(true); - } - + const actionsAdminCommunity = (rowData) => { return (
@@ -164,34 +161,6 @@ const AdministradoresComunidad = () => { ); } - const leftToolbarTemplate = () => { - return ( - -
-
-
- ) - } - - const rightToolbarTemplate = () => { - return ( - -
+ ); +} + +const leftToolbarTemplate = () => { + return ( + +
+
+
+ ) +} + +const rightToolbarTemplate = () => { + return ( + +