From 30a36869641089868def5b39edf84f82cb8d39cd Mon Sep 17 00:00:00 2001 From: Maria Sanchez Date: Wed, 20 Jul 2022 09:59:03 -0600 Subject: [PATCH 1/7] css changes --- web-ui/web-react/postcss.config.js | 6 ++++++ web-ui/web-react/tailwind.config.js | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 web-ui/web-react/postcss.config.js create mode 100644 web-ui/web-react/tailwind.config.js diff --git a/web-ui/web-react/postcss.config.js b/web-ui/web-react/postcss.config.js new file mode 100644 index 00000000..33ad091d --- /dev/null +++ b/web-ui/web-react/postcss.config.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/web-ui/web-react/tailwind.config.js b/web-ui/web-react/tailwind.config.js new file mode 100644 index 00000000..1490793a --- /dev/null +++ b/web-ui/web-react/tailwind.config.js @@ -0,0 +1,10 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: [ + "./src/**/*.{js,jsx,ts,tsx}", + ], + theme: { + extend: {}, + }, + plugins: [], +} From 93922d07668de9351270a1731e0551ede8d68246 Mon Sep 17 00:00:00 2001 From: Mariela Date: Thu, 21 Jul 2022 14:42:22 -0600 Subject: [PATCH 2/7] fix listar mostrar "sin administrador" --- web-ui/web-react/src/components/ComunidadViviendas.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web-ui/web-react/src/components/ComunidadViviendas.js b/web-ui/web-react/src/components/ComunidadViviendas.js index c1e91666..025ae00a 100644 --- a/web-ui/web-react/src/components/ComunidadViviendas.js +++ b/web-ui/web-react/src/components/ComunidadViviendas.js @@ -142,6 +142,9 @@ const Communities = () => { item.province = pList.find(p => p.code === item.province).name item.canton = cList.find(p => p.code === item.canton).name item.district = dList.find(p => p.code === item.district).name + if(!item.id_admin){ + item.name_admin = "Sin Administrador" + } }) setCommunitiesList(await resJson.message); } From 22e5de830a829f0efbf269b2e91f61bb3e25739e Mon Sep 17 00:00:00 2001 From: Mariela Date: Fri, 22 Jul 2022 00:03:01 -0600 Subject: [PATCH 3/7] =?UTF-8?q?fix=20bug=20que=20no=20se=20quitaban=20la?= =?UTF-8?q?=20clase=20de=20"p-invalid"=20despu=C3=A9s=20de=20registrar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/ComunidadViviendas.js | 107 +++++++++--------- 1 file changed, 54 insertions(+), 53 deletions(-) diff --git a/web-ui/web-react/src/components/ComunidadViviendas.js b/web-ui/web-react/src/components/ComunidadViviendas.js index 025ae00a..087302c4 100644 --- a/web-ui/web-react/src/components/ComunidadViviendas.js +++ b/web-ui/web-react/src/components/ComunidadViviendas.js @@ -33,7 +33,7 @@ const Communities = () => { const [cantonId, setCantonId] = useState(null); const [districtsList, setDistrictsList] = useState([]); const [districtId, setDistrictId] = useState(null); - const [codeHouses, setCodeHouses] = useState(null); + const [codeHouses, setCodeHouses] = useState(''); const [submitted, setSubmitted] = useState(false); const toast = useRef(null); const dt = useRef(null); @@ -59,7 +59,7 @@ const Communities = () => { })) - + useEffect(() => { @@ -138,11 +138,11 @@ const Communities = () => { let pList = await getProvinces(); let cList = await getCantons(); let dList = await getDistricts(); - await resJson.message.map((item) => { + await resJson.message.map((item) => { item.province = pList.find(p => p.code === item.province).name item.canton = cList.find(p => p.code === item.canton).name item.district = dList.find(p => p.code === item.district).name - if(!item.id_admin){ + if (!item.id_admin) { item.name_admin = "Sin Administrador" } }) @@ -151,15 +151,12 @@ const Communities = () => { useEffect(() => { getCommunites(); - }, []) const saveCommunity = () => { - setSubmitted(true); - - if (community.name.trim()) { + if (community.name.trim() ) { let _communities = [...communitiesList]; let _community = { ...community }; _community.province = provinciaId; @@ -168,12 +165,12 @@ const Communities = () => { - for (let i = 0; i < _community.num_houses; i++){ + for (let i = 0; i < _community.num_houses; i++) { _community.houses.push({ - number_house: codeHouses + (i+1), + number_house: codeHouses + (i + 1), }) } - // console.log(houses) + // console.log(houses) fetch('http://localhost:4000/community/createCommunity', { cache: 'no-cache', method: 'POST', @@ -182,40 +179,44 @@ const Communities = () => { 'Content-Type': 'application/json' } }) - .then( - function (response) { - if (response.status != 201) - console.log('Ocurrió un error con el servicio: ' + response.status); - else - return response.json(); - } - ) - .then(() => { - - _community.province = provincesList.find(p => p.code === _community.province).name - _community.canton = cantonsList.find(p => p.code === _community.canton).name - _community.district = districtsList.find(p => p.code === _community.district).name + .then( + function (response) { + if (response.status != 201) + console.log('Ocurrió un error con el servicio: ' + response.status); + else + return response.json(); + } + ) + .then(() => { - _communities.push(_community); - toast.current.show({ severity: 'success', summary: 'Registro exitoso', detail: 'Comunidad de vivienda Creada', life: 3000 }); + _community.province = provincesList.find(p => p.code === _community.province).name + _community.canton = cantonsList.find(p => p.code === _community.canton).name + _community.district = districtsList.find(p => p.code === _community.district).name - setCommunitiesList(_communities); + _communities.push(_community); + toast.current.show({ severity: 'success', summary: 'Registro exitoso', detail: 'Comunidad de vivienda Creada', life: 3000 }); + + setCommunitiesList(_communities); - setProvinciaId(''); - setCantonId(''); - setDistrictId(''); - setCodeHouses(''); + setProvinciaId(''); + setCantonId(''); + setDistrictId(''); + setCodeHouses(''); - setCommunity(emptyCommunity); - }) - .catch( - err => console.log('Ocurrió un error con el fetch', err) - ); + setCommunity(emptyCommunity); + + }) + .catch( + err => console.log('Ocurrió un error con el fetch', err) + ); + + + } else { + setSubmitted(true); - } - + } const onInputChange = (e, name) => { @@ -245,20 +246,20 @@ const Communities = () => {
- +
Registro de comunidad de viviendas
- +
- onInputChange(e, 'name')} required autoFocus className={classNames( submitted && community.name==='' ? 'p-invalid' : '' )} /> + onInputChange(e, 'name')} required autoFocus className={submitted && community.name === '' ? 'p-invalid' : ''} />
- {submitted && community.name==='' && Nombre es requirido.} + {submitted && community.name === '' && Nombre es requirido.}
@@ -268,7 +269,7 @@ const Communities = () => { - +
{submitted && !provinciaId && Provincia es requirido.}
@@ -280,9 +281,9 @@ const Communities = () => { - +
- {submitted && !cantonId && Cantón es requirido.} + {submitted && !cantonId && Cantón es requirido.}
@@ -292,9 +293,9 @@ const Communities = () => { - +
- {submitted && !districtId && Distrito es requirido.} + {submitted && !districtId && Distrito es requirido.}
@@ -304,9 +305,9 @@ const Communities = () => { - onInputChange(e, 'phone')} required autoFocus className={classNames({ 'p-invalid': submitted && community.phone==='' } )} /> + onInputChange(e, 'phone')} required autoFocus className={classNames({ 'p-invalid': submitted && community.phone === '' })} />
- {submitted && community.phone==='' && Número de teléfono es requirido.} + {submitted && community.phone === '' && Número de teléfono es requirido.}
@@ -316,9 +317,9 @@ const Communities = () => { - onInputChange(e, 'num_houses')} required autoFocus className={classNames({ 'p-invalid': submitted && community.num_houses < 1 } )} /> + onInputChange(e, 'num_houses')} required autoFocus className={classNames({ 'p-invalid': submitted && community.num_houses < 1 })} />
- {submitted && community.num_houses < 1 && Número de viviendas es requirido y debe ser mayor que 0.} + {submitted && community.num_houses < 1 && Número de viviendas es requirido y debe ser mayor que 0.}
@@ -328,9 +329,9 @@ const Communities = () => { - +
- {submitted && !codeHouses && El código para las viviendas es requirido.} + {submitted && codeHouses === '' && El código para las viviendas es requirido.}
From ec1a7a86f0f5737813be888a51e50c77bfe78fb9 Mon Sep 17 00:00:00 2001 From: Mariela Date: Fri, 22 Jul 2022 00:17:09 -0600 Subject: [PATCH 4/7] fix error validaciones --- .../src/components/ComunidadViviendas.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/web-ui/web-react/src/components/ComunidadViviendas.js b/web-ui/web-react/src/components/ComunidadViviendas.js index 087302c4..ae57e65e 100644 --- a/web-ui/web-react/src/components/ComunidadViviendas.js +++ b/web-ui/web-react/src/components/ComunidadViviendas.js @@ -156,7 +156,7 @@ const Communities = () => { const saveCommunity = () => { - if (community.name.trim() ) { + if (community.name && community.num_houses > 0 && provinciaId && cantonId && districtId && community.phone ) { let _communities = [...communitiesList]; let _community = { ...community }; _community.province = provinciaId; @@ -234,13 +234,13 @@ const Communities = () => {
Comunidades de Viviendas
- - - - - - - + + + + + + +
@@ -257,7 +257,7 @@ const Communities = () => { - onInputChange(e, 'name')} required autoFocus className={submitted && community.name === '' ? 'p-invalid' : ''} /> + onInputChange(e, 'name')} required autoFocus className={classNames({'p-invalid' : submitted && community.name === ''})} /> {submitted && community.name === '' && Nombre es requirido.} @@ -329,7 +329,7 @@ const Communities = () => { - + {submitted && codeHouses === '' && El código para las viviendas es requirido.} From 9e04a6e1c5786d5eff4ba49a12991f317c353a28 Mon Sep 17 00:00:00 2001 From: Mariela Date: Fri, 22 Jul 2022 00:22:09 -0600 Subject: [PATCH 5/7] delete function test send mail del service del api gateway --- api-gateway/src/app.controller.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/api-gateway/src/app.controller.ts b/api-gateway/src/app.controller.ts index 3a559841..7b819bd6 100644 --- a/api-gateway/src/app.controller.ts +++ b/api-gateway/src/app.controller.ts @@ -343,20 +343,5 @@ export class AppController { return this.appService.html(email, name); } - // #==== API Users - @Post('user/testSendMail') - testSendMail( - @Body('dni') dni: string, - @Body('name') name: string, - @Body('last_name') last_name: string, - @Body('email') email: string, - @Body('phone') phone: number, - @Body('password') password: string, - @Body('user_type') user_type: string, - @Body('status') status: string, - @Body('date_entry') date_entry: Date, - ) { - return this.appService.testSendMail(dni, name, last_name, email, phone, password, - user_type, status, date_entry); - } + } \ No newline at end of file From e2c3bd51c2739f7f728edd978ae694d7cb66a49b Mon Sep 17 00:00:00 2001 From: Mariela Date: Fri, 22 Jul 2022 00:38:34 -0600 Subject: [PATCH 6/7] fix function duplicate usuario service --- servicio-usuarios/src/users/users.service.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/servicio-usuarios/src/users/users.service.ts b/servicio-usuarios/src/users/users.service.ts index 18b219cb..ea9aab88 100644 --- a/servicio-usuarios/src/users/users.service.ts +++ b/servicio-usuarios/src/users/users.service.ts @@ -82,10 +82,6 @@ export class UsersService { async findGuardsCommunity(pcommunity_id: string): Promise { return this.userModel.find({ user_type: 4 }).exec(); } - //find admin de comunidad - async allUsersAdminComunidad(): Promise { - return this.userModel.find({ user_type: 2 }).exec(); - } //find admin de comunidad async allUsersAdminComunidad(): Promise { From 6986c3da189b9d0fbd723ed85b985c814bb7c790 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Fri, 22 Jul 2022 02:13:19 -0600 Subject: [PATCH 7/7] cambiar tipo de input de telefono a "tel" --- web-ui/web-react/src/components/AdministradoresSistema.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-ui/web-react/src/components/AdministradoresSistema.js b/web-ui/web-react/src/components/AdministradoresSistema.js index 02ad4fb9..d6db77fd 100644 --- a/web-ui/web-react/src/components/AdministradoresSistema.js +++ b/web-ui/web-react/src/components/AdministradoresSistema.js @@ -93,7 +93,7 @@ const AdministradoresSistema = () => {
- +