From d2ceb28b2e79114885c9c1a66c16b98220c34eaf Mon Sep 17 00:00:00 2001 From: Mariela Date: Fri, 22 Jul 2022 23:51:44 -0600 Subject: [PATCH] fixes vista lista comunidad --- .../src/components/AdministradoresSistema.js | 3 +- .../src/components/ComunidadViviendas.js | 97 +++++++++++++++---- 2 files changed, 77 insertions(+), 23 deletions(-) diff --git a/web-ui/web-react/src/components/AdministradoresSistema.js b/web-ui/web-react/src/components/AdministradoresSistema.js index 243ff142..e775d275 100644 --- a/web-ui/web-react/src/components/AdministradoresSistema.js +++ b/web-ui/web-react/src/components/AdministradoresSistema.js @@ -258,8 +258,7 @@ const AdministradoresSistema = () => { rowsPerPageOptions={[5, 10, 25]} className="datatable-responsive mt-3" paginatorTemplate="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown" currentPageReportTemplate="Mostrando {first} a {last} de {totalRecords} administradores del sistema" - globalFilter={globalFilter} emptyMessage="No hay administradores del sistema registrados." - > + globalFilter={globalFilter} emptyMessage="No hay administradores del sistema registrados."> diff --git a/web-ui/web-react/src/components/ComunidadViviendas.js b/web-ui/web-react/src/components/ComunidadViviendas.js index dcee03df..e39ff7ba 100644 --- a/web-ui/web-react/src/components/ComunidadViviendas.js +++ b/web-ui/web-react/src/components/ComunidadViviendas.js @@ -7,6 +7,12 @@ import { Dropdown } from 'primereact/dropdown'; import { Toast } from 'primereact/toast'; import classNames from 'classnames'; import { Toolbar } from 'primereact/toolbar'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faHome } from '@fortawesome/free-solid-svg-icons'; +import { faMapLocationDot } from '@fortawesome/free-solid-svg-icons'; +import { faPhoneAlt } from '@fortawesome/free-solid-svg-icons'; +import { faEllipsis } from '@fortawesome/free-solid-svg-icons'; + const Communities = () => { @@ -41,7 +47,8 @@ const Communities = () => { const [deleteCommunityDialog, setDeleteCommunityDialog] = useState(false); const [deleteCommunitiesDialog, setDeleteCommunitiesDialog] = useState(false); const toast = useRef(null); - const dt = useEffect(null); + const dt = useRef(null); + const p = provincesList.map((item) => ({ @@ -64,8 +71,6 @@ const Communities = () => { - - useEffect(() => { fillProvinces(); @@ -292,15 +297,15 @@ const Communities = () => { const deleteSelectedCommunities = () => { let _communities = communitiesList.filter(val => !selectedCommunities.includes(val)); - /* selectedCommunities.map((item) => { - fetch('http://localhost:4000/user/deleteCommunity/' + item._id, { - cache: 'no-cache', - method: 'DELETE', - headers: { - 'Content-Type': 'application/json' - } - }) - })*/ + /* selectedCommunities.map((item) => { + fetch('http://localhost:4000/user/deleteCommunity/' + item._id, { + cache: 'no-cache', + method: 'DELETE', + headers: { + 'Content-Type': 'application/json' + } + }) + })*/ setCommunitiesList(_communities); setDeleteCommunitiesDialog(false); setSelectedCommunities(null); @@ -350,25 +355,75 @@ const Communities = () => { ); + const headerName = ( + <> +

Nombre

+ + ) + + const headerProvince = ( + <> +

Pronvincia

+ + ) + + const headerCanton = ( + <> +

Cantón

+ + ) + + const headerDistrict = ( + <> +

Distrito

+ + ) + + const headerPhone = ( + <> +

Teléfono

+ + ) + + const headerNumberHouses = ( + <> +

Número de viviendas

+ + ) + + const headerAdministrator = ( + <> +

Administrador

+ + ) + + const headerOptions = ( + <> +

Opciones

+ + ) + return (
- +
- < Toolbar className="mb-4" left={leftToolbarTemplate} right={rightToolbarTemplate}> + < Toolbar className="mb-4" left={leftToolbarTemplate} right={rightToolbarTemplate}> setSelectedCommunities(e.value)} scrollable scrollHeight="400px" scrollDirection="both" header={header} rowsPerPageOptions={[5, 10, 25]} className="datatable-responsive mt-3" paginatorTemplate="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown" currentPageReportTemplate="Mostrando {first} a {last} de {totalRecords} comunidades de viviendas" globalFilter={globalFilter} emptyMessage="No hay comunidades de viviendas registrados."> - - - - - - - + + + + + + + + +