Merge branch 'US-15-Activar-DesactivarAdministradordeComunidaddeViviendas' into US-14-EliminarAdministradordeComunidaddeViviendas
This commit is contained in:
		
						commit
						ebd54ad24f
					
				| 
						 | 
					@ -155,6 +155,12 @@ export class AppController {
 | 
				
			||||||
    return this.appService.deleteAdminSystem(id);
 | 
					    return this.appService.deleteAdminSystem(id);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @Delete('user/deleteAdminCommunity/:id')
 | 
				
			||||||
 | 
					  deleteAdminCommunity(@Param('id') id: string) {
 | 
				
			||||||
 | 
					    return this.appService.deleteAdminCommunity(id);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @Post('user/changeStatus')
 | 
					  @Post('user/changeStatus')
 | 
				
			||||||
  changeStatusUser(
 | 
					  changeStatusUser(
 | 
				
			||||||
    @Body('id') pId: string,
 | 
					    @Body('id') pId: string,
 | 
				
			||||||
| 
						 | 
					@ -215,6 +221,8 @@ export class AppController {
 | 
				
			||||||
  ) {
 | 
					  ) {
 | 
				
			||||||
    return this.appService.changeStatusCommunity(pId, pStatus);
 | 
					    return this.appService.changeStatusCommunity(pId, pStatus);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  // #==== API Common Areas
 | 
					  // #==== API Common Areas
 | 
				
			||||||
  @Post('commonArea/createCommonArea')
 | 
					  @Post('commonArea/createCommonArea')
 | 
				
			||||||
  createCommonArea(
 | 
					  createCommonArea(
 | 
				
			||||||
| 
						 | 
					@ -254,6 +262,14 @@ export class AppController {
 | 
				
			||||||
    return this.appService.deleteCommonArea(id);
 | 
					    return this.appService.deleteCommonArea(id);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @Post('commonArea/changeStatus')
 | 
				
			||||||
 | 
					  changeStatusCommonArea(
 | 
				
			||||||
 | 
					    @Body('id') pId: string,
 | 
				
			||||||
 | 
					    @Body('status') pStatus: string,
 | 
				
			||||||
 | 
					  ) {
 | 
				
			||||||
 | 
					    return this.appService.changeStatusCommonArea(pId, pStatus);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // #==== API GUEST
 | 
					  // #==== API GUEST
 | 
				
			||||||
  //#API userService - create user
 | 
					  //#API userService - create user
 | 
				
			||||||
  @Post('guest/createGuest')
 | 
					  @Post('guest/createGuest')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -193,6 +193,14 @@ export class AppService {
 | 
				
			||||||
      .pipe(map((message: string) => ({ message })));
 | 
					      .pipe(map((message: string) => ({ message })));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  deleteAdminCommunity(id: string) {
 | 
				
			||||||
 | 
					    const pattern = { cmd: 'deleteAdminCommunity' };
 | 
				
			||||||
 | 
					    const payload = { id: id };
 | 
				
			||||||
 | 
					    return this.clientUserApp
 | 
				
			||||||
 | 
					      .send<string>(pattern, payload)
 | 
				
			||||||
 | 
					      .pipe(map((message: string) => ({ message })));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  inicioSesion(pEmail: string, pPassword: string) {
 | 
					  inicioSesion(pEmail: string, pPassword: string) {
 | 
				
			||||||
    const pattern = { cmd: 'loginUser' };
 | 
					    const pattern = { cmd: 'loginUser' };
 | 
				
			||||||
    const payload = { email: pEmail, password: pPassword };
 | 
					    const payload = { email: pEmail, password: pPassword };
 | 
				
			||||||
| 
						 | 
					@ -343,6 +351,15 @@ export class AppService {
 | 
				
			||||||
      .pipe(map((message: string) => ({ message })));
 | 
					      .pipe(map((message: string) => ({ message })));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  changeStatusCommonArea(pId: string, pStatus: string) {
 | 
				
			||||||
 | 
					    const pattern = { cmd: 'changeStatus' };
 | 
				
			||||||
 | 
					    const payload = { id: pId, status: pStatus };
 | 
				
			||||||
 | 
					    return this.clientCommonAreaApp
 | 
				
			||||||
 | 
					      .send<string>(pattern, payload)
 | 
				
			||||||
 | 
					      .pipe(map((message: string) => ({ message })));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // ====================== GUESTS ===============================
 | 
					  // ====================== GUESTS ===============================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //POST parameter from API
 | 
					  //POST parameter from API
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -39,4 +39,12 @@ export class CommonAreasController {
 | 
				
			||||||
    let _community_id = id['community_id'];
 | 
					    let _community_id = id['community_id'];
 | 
				
			||||||
    return this.commonAreasService.findByCommunity(_community_id);
 | 
					    return this.commonAreasService.findByCommunity(_community_id);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   //cambiar de estado
 | 
				
			||||||
 | 
					   @MessagePattern({ cmd: 'changeStatus' })
 | 
				
			||||||
 | 
					   changeStatus(@Payload() body: string) {
 | 
				
			||||||
 | 
					     let pid = body['id'];
 | 
				
			||||||
 | 
					     let pstatus = body['status'];
 | 
				
			||||||
 | 
					     return this.commonAreasService.changeStatus(pid,pstatus);
 | 
				
			||||||
 | 
					   }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -41,4 +41,10 @@ export class CommonAreasService {
 | 
				
			||||||
    return this.commonAreaModel.find({ community_id: community_id }).exec();
 | 
					    return this.commonAreaModel.find({ community_id: community_id }).exec();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  async changeStatus(id: string, status: string) {
 | 
				
			||||||
 | 
					    return this.commonAreaModel.findOneAndUpdate({ _id: id }, {status: status}, {
 | 
				
			||||||
 | 
					      new: true,
 | 
				
			||||||
 | 
					    });  
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -112,11 +112,16 @@ export class UsersController {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @MessagePattern({ cmd: 'deleteAdminSystem' })
 | 
					  @MessagePattern({ cmd: 'deleteAdminSystem' })
 | 
				
			||||||
  deleteAdminSystem(@Payload() user: any) {
 | 
					  deleteAdminSystem(@Payload() user: any) {
 | 
				
			||||||
    console.log('entró');
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return this.userService.deleteAdminSystem(user['id']);
 | 
					    return this.userService.deleteAdminSystem(user['id']);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  @MessagePattern({ cmd: 'deleteAdminCommunity' })
 | 
				
			||||||
 | 
					  deleteAdminCommunity(@Payload() user: any) {
 | 
				
			||||||
 | 
					    return this.userService.deleteAdminCommunity(user['id']);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @MessagePattern({ cmd: 'changeStatus' })
 | 
					  @MessagePattern({ cmd: 'changeStatus' })
 | 
				
			||||||
  changeStatus(@Payload() body: string) {
 | 
					  changeStatus(@Payload() body: string) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -185,6 +185,13 @@ export class UsersService {
 | 
				
			||||||
    });  
 | 
					    });  
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  deleteAdminCommunity(id: string) {
 | 
				
			||||||
 | 
					    return this.userModel.findOneAndUpdate({ _id: id }, {status: '-1'}, {
 | 
				
			||||||
 | 
					      new: true,
 | 
				
			||||||
 | 
					    });  
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  async validateEmail(email: string) {
 | 
					  async validateEmail(email: string) {
 | 
				
			||||||
    let repo1 = this.userModel;
 | 
					    let repo1 = this.userModel;
 | 
				
			||||||
    return new Promise<User>((resolve, reject) => {
 | 
					    return new Promise<User>((resolve, reject) => {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,7 @@ import { faHome, faUserAlt } from '@fortawesome/free-solid-svg-icons';
 | 
				
			||||||
import { faPhoneAlt } from '@fortawesome/free-solid-svg-icons';
 | 
					import { faPhoneAlt } from '@fortawesome/free-solid-svg-icons';
 | 
				
			||||||
import { faAt } from '@fortawesome/free-solid-svg-icons';
 | 
					import { faAt } from '@fortawesome/free-solid-svg-icons';
 | 
				
			||||||
import { faIdCardAlt } from '@fortawesome/free-solid-svg-icons';
 | 
					import { faIdCardAlt } from '@fortawesome/free-solid-svg-icons';
 | 
				
			||||||
import { faEllipsis } from '@fortawesome/free-solid-svg-icons';
 | 
					import { faCircleQuestion } from '@fortawesome/free-solid-svg-icons';
 | 
				
			||||||
import { faHomeAlt } from '@fortawesome/free-solid-svg-icons';
 | 
					import { faHomeAlt } from '@fortawesome/free-solid-svg-icons';
 | 
				
			||||||
import { Dropdown } from 'primereact/dropdown';
 | 
					import { Dropdown } from 'primereact/dropdown';
 | 
				
			||||||
import classNames from 'classnames';
 | 
					import classNames from 'classnames';
 | 
				
			||||||
| 
						 | 
					@ -31,7 +31,8 @@ const AdministradoresComunidad = () => {
 | 
				
			||||||
        community_name: '',
 | 
					        community_name: '',
 | 
				
			||||||
        user_type: '2',
 | 
					        user_type: '2',
 | 
				
			||||||
        date_entry: new Date(),
 | 
					        date_entry: new Date(),
 | 
				
			||||||
        status: '1'
 | 
					        status: '1',
 | 
				
			||||||
 | 
					        status_text: '',
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const [listaAdmins, setListaAdmins] = useState([]);
 | 
					    const [listaAdmins, setListaAdmins] = useState([]);
 | 
				
			||||||
| 
						 | 
					@ -47,12 +48,23 @@ const AdministradoresComunidad = () => {
 | 
				
			||||||
    const toast = useRef(null);
 | 
					    const toast = useRef(null);
 | 
				
			||||||
    const dt = useRef(null);
 | 
					    const dt = useRef(null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const [changeStatusAdminCommunityDialog, setChangeStatusAdminCommunityDialog] = useState(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async function listaAdmin() {
 | 
					    async function listaAdmin() {
 | 
				
			||||||
        let nombres = await fetch('http://localhost:4000/user/findAdminComunidad/', { method: 'GET' })
 | 
					        await fetch('http://localhost:4000/user/findAdminComunidad/', { method: 'GET' })
 | 
				
			||||||
            .then((response) => response.json())
 | 
					            .then((response) => response.json())
 | 
				
			||||||
            .then((data) => {
 | 
					            .then((data) => {
 | 
				
			||||||
                return Promise.all(data.message.map(item => {
 | 
					                return Promise.all(data.message.map(item => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    if (item.status == '1') {
 | 
				
			||||||
 | 
					                        item.status_text = 'Activo';
 | 
				
			||||||
 | 
					                    } else if (item.status == '0') {
 | 
				
			||||||
 | 
					                        item.status_text = 'Inactivo';
 | 
				
			||||||
 | 
					                    } else {
 | 
				
			||||||
 | 
					                        item.status_text = 'Eliminado';
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                    //item.full_name returns the repositorie name
 | 
					                    //item.full_name returns the repositorie name
 | 
				
			||||||
                    return fetch(`http://localhost:4000/community/findCommunityName/${item.community_id}`, { method: 'GET' })
 | 
					                    return fetch(`http://localhost:4000/community/findCommunityName/${item.community_id}`, { method: 'GET' })
 | 
				
			||||||
                        .then((response2) => response2.json())
 | 
					                        .then((response2) => response2.json())
 | 
				
			||||||
| 
						 | 
					@ -63,7 +75,13 @@ const AdministradoresComunidad = () => {
 | 
				
			||||||
                        })
 | 
					                        })
 | 
				
			||||||
                }));
 | 
					                }));
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
            .then(data => setListaAdmins(data));
 | 
					            .then(data => {
 | 
				
			||||||
 | 
					                data = data.filter(
 | 
				
			||||||
 | 
					                    (val) => val.status != -1,
 | 
				
			||||||
 | 
					                );
 | 
				
			||||||
 | 
					                console.log(data)
 | 
				
			||||||
 | 
					                setListaAdmins(data);
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -72,11 +90,16 @@ const AdministradoresComunidad = () => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    async function getCommunites() {
 | 
					    async function getCommunites() {
 | 
				
			||||||
        let response = await fetch('http://localhost:4000/community/allCommunities', { method: 'GET' });
 | 
					        let response = await fetch('http://localhost:4000/community/allCommunities', { method: 'GET' })
 | 
				
			||||||
        let resList = await response.json();
 | 
					            .then((response) => response.json())
 | 
				
			||||||
        let list = await resList.message;
 | 
					            .then(data => data.message)
 | 
				
			||||||
 | 
					            .then(data => {
 | 
				
			||||||
 | 
					                data = data.filter(
 | 
				
			||||||
 | 
					                    (val) => val.status != -1,
 | 
				
			||||||
 | 
					                )
 | 
				
			||||||
 | 
					                setCommunitiesList(data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        setCommunitiesList(await list);
 | 
					            })
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    useEffect(() => {
 | 
					    useEffect(() => {
 | 
				
			||||||
| 
						 | 
					@ -85,7 +108,7 @@ const AdministradoresComunidad = () => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    useEffect(() => {
 | 
					    useEffect(() => {
 | 
				
			||||||
        getCommunites();
 | 
					        getCommunites();
 | 
				
			||||||
    },[])
 | 
					    }, [])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const cList = communitiesList.map((item) => ({
 | 
					    const cList = communitiesList.map((item) => ({
 | 
				
			||||||
        label: item.name,
 | 
					        label: item.name,
 | 
				
			||||||
| 
						 | 
					@ -94,64 +117,56 @@ const AdministradoresComunidad = () => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const deleteAdminCommunity = () => {
 | 
					    const deleteAdminCommunity = () => {
 | 
				
			||||||
        /*   fetch('http://localhost:4000/community/deleteCommunity/' + community._id, {
 | 
					        fetch('http://localhost:4000/user/deleteAdminCommunity/' + adminCommunity._id, {
 | 
				
			||||||
               cache: 'no-cache',
 | 
					            cache: 'no-cache',
 | 
				
			||||||
               method: 'DELETE',
 | 
					            method: 'DELETE',
 | 
				
			||||||
               headers: {
 | 
					            headers: {
 | 
				
			||||||
                   'Content-Type': 'application/json'
 | 
					                'Content-Type': 'application/json'
 | 
				
			||||||
               }
 | 
					            }
 | 
				
			||||||
           })
 | 
					        })
 | 
				
			||||||
               .then(
 | 
					            .then(
 | 
				
			||||||
                   function (response) {
 | 
					                function (response) {
 | 
				
			||||||
                       if (response.status != 201)
 | 
					                    if (response.status != 201)
 | 
				
			||||||
                           console.log('Ocurrió un error con el servicio: ' + response.status);
 | 
					                        console.log('Ocurrió un error con el servicio: ' + response.status);
 | 
				
			||||||
                       else
 | 
					                    else
 | 
				
			||||||
                           return response.json();
 | 
					                        return response.json();
 | 
				
			||||||
                   }
 | 
					                }
 | 
				
			||||||
               )
 | 
					            )
 | 
				
			||||||
               .then(
 | 
					            .then(
 | 
				
			||||||
                   function (response) {
 | 
					                function (response) {
 | 
				
			||||||
                       
 | 
					
 | 
				
			||||||
                       let _community = communities.filter(val => val._id !== community._id);
 | 
					                    let _administrators = listaAdmins.filter(
 | 
				
			||||||
                       setCommunities(_community);
 | 
					                        (val) => val._id !== adminCommunity._id,
 | 
				
			||||||
                       setDeleteCommunityDialog(false);
 | 
					                    );
 | 
				
			||||||
                       setCommunity(emptyCommunity);
 | 
					                    setListaAdmins(_administrators);
 | 
				
			||||||
                       toast.current.show({ severity: 'success', summary: 'Exito', detail: 'Comunidad de Viviendas Eliminada', life: 3000 });
 | 
					                    setDeleteAdminCommunityDialog(false);
 | 
				
			||||||
                   }
 | 
					                    setAdminCommunity(emptyAdminCommunity);
 | 
				
			||||||
               )
 | 
					                    toast.current.show({ severity: 'success', summary: 'Exito', detail: 'Administrador Comunidad Eliminada', life: 3000 });
 | 
				
			||||||
               .catch(
 | 
					                }
 | 
				
			||||||
                   err => {
 | 
					            )
 | 
				
			||||||
                       console.log('Ocurrió un error con el fetch', err)
 | 
					            .catch(
 | 
				
			||||||
                       toast.current.show({ severity: 'danger', summary: 'Error', detail: 'Comunidad de Viviendas no se pudo eliminar', life: 3000 });
 | 
					                err => {
 | 
				
			||||||
                   }
 | 
					                    console.log('Ocurrió un error con el fetch', err)
 | 
				
			||||||
               ); 
 | 
					                    toast.current.show({ severity: 'danger', summary: 'Error', detail: 'Administrador Comunidad no se pudo eliminar', life: 3000 });
 | 
				
			||||||
        */
 | 
					                }
 | 
				
			||||||
        let _administrators = listaAdmins.filter(
 | 
					            );
 | 
				
			||||||
            (val) => val._id !== adminCommunity._id,
 | 
					
 | 
				
			||||||
        );
 | 
					       
 | 
				
			||||||
        setListaAdmins(_administrators);
 | 
					 | 
				
			||||||
        setDeleteAdminCommunityDialog(false);
 | 
					 | 
				
			||||||
        setAdminCommunity(emptyAdminCommunity);
 | 
					 | 
				
			||||||
        toast.current.show({
 | 
					 | 
				
			||||||
            severity: 'success',
 | 
					 | 
				
			||||||
            summary: 'Administrador de Comunidad Eliminada',
 | 
					 | 
				
			||||||
            life: 3000,
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const deleteSelectedAdminsCommunity = () => {
 | 
					    const deleteSelectedAdminsCommunity = () => {
 | 
				
			||||||
        let _admins = listaAdmins.filter(
 | 
					        let _admins = listaAdmins.filter(
 | 
				
			||||||
            (val) => !selectedAdminsCommunities.includes(val),
 | 
					            (val) => !selectedAdminsCommunities.includes(val),
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
        /*  selectedCommunities.map((item) => {
 | 
					         selectedAdminsCommunities.map((item) => {
 | 
				
			||||||
                 fetch('http://localhost:4000/user/deleteCommunity/' + item._id, {
 | 
					                 fetch('http://localhost:4000/user/deleteAdminCommunity/' + item._id, {
 | 
				
			||||||
                     cache: 'no-cache',
 | 
					                     cache: 'no-cache',
 | 
				
			||||||
                     method: 'DELETE',
 | 
					                     method: 'DELETE',
 | 
				
			||||||
                     headers: {
 | 
					                     headers: {
 | 
				
			||||||
                         'Content-Type': 'application/json'
 | 
					                         'Content-Type': 'application/json'
 | 
				
			||||||
                     }
 | 
					                     }
 | 
				
			||||||
                 })
 | 
					                 })
 | 
				
			||||||
             })*/
 | 
					             })
 | 
				
			||||||
        setListaAdmins(_admins);
 | 
					        setListaAdmins(_admins);
 | 
				
			||||||
        setDeleteAdminsCommunitiesDialog(false);
 | 
					        setDeleteAdminsCommunitiesDialog(false);
 | 
				
			||||||
        setSelectedAdminsCommunities(null);
 | 
					        setSelectedAdminsCommunities(null);
 | 
				
			||||||
| 
						 | 
					@ -163,6 +178,52 @@ const AdministradoresComunidad = () => {
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const cambiarStatusAdminCommuniy = () => {
 | 
				
			||||||
 | 
					        if (adminCommunity.status == '1') {
 | 
				
			||||||
 | 
					            adminCommunity.status = '0';
 | 
				
			||||||
 | 
					            adminCommunity.status_text = 'Inactivo';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        } else if (adminCommunity.status == '0') {
 | 
				
			||||||
 | 
					            adminCommunity.status = '1';
 | 
				
			||||||
 | 
					            adminCommunity.status_text = 'Activo';
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        var data = {
 | 
				
			||||||
 | 
					            id: adminCommunity._id,
 | 
				
			||||||
 | 
					            status: adminCommunity.status,
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					        fetch('http://localhost:4000/user/changeStatus', {
 | 
				
			||||||
 | 
					            cache: 'no-cache',
 | 
				
			||||||
 | 
					            method: 'POST',
 | 
				
			||||||
 | 
					            body: JSON.stringify(data),
 | 
				
			||||||
 | 
					            headers: {
 | 
				
			||||||
 | 
					                '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(
 | 
				
			||||||
 | 
					                function (response) {
 | 
				
			||||||
 | 
					                    setChangeStatusAdminCommunityDialog(false);
 | 
				
			||||||
 | 
					                    toast.current.show({
 | 
				
			||||||
 | 
					                        severity: 'success',
 | 
				
			||||||
 | 
					                        summary: 'Éxito',
 | 
				
			||||||
 | 
					                        detail: 'Administrador de Comunidad Actualizado',
 | 
				
			||||||
 | 
					                        life: 3000,
 | 
				
			||||||
 | 
					                    });
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            .catch(
 | 
				
			||||||
 | 
					                err => console.log('Ocurrió un error con el fetch', err)
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const saveAdminCommunity = () => {
 | 
					    const saveAdminCommunity = () => {
 | 
				
			||||||
        if (adminCommunity.name && adminCommunity.dni && adminCommunity.last_name && adminCommunity.email && adminCommunity.phone) {
 | 
					        if (adminCommunity.name && adminCommunity.dni && adminCommunity.last_name && adminCommunity.email && adminCommunity.phone) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -228,11 +289,33 @@ const AdministradoresComunidad = () => {
 | 
				
			||||||
        setDeleteAdminsCommunitiesDialog(true);
 | 
					        setDeleteAdminsCommunitiesDialog(true);
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const hideChangeStatusAdmimCommunityDialog = () => {
 | 
				
			||||||
 | 
					        setChangeStatusAdminCommunityDialog(false);
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const confirmChangeStatuAdminCommunity = (adminCommunity) => {
 | 
				
			||||||
 | 
					        setAdminCommunity(adminCommunity);
 | 
				
			||||||
 | 
					        setChangeStatusAdminCommunityDialog(true);
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const actionsAdminCommunity = (rowData) => {
 | 
					    const actionsAdminCommunity = (rowData) => {
 | 
				
			||||||
 | 
					        let icono = '';
 | 
				
			||||||
 | 
					        let text = '';
 | 
				
			||||||
 | 
					        if (rowData.status == '0') {
 | 
				
			||||||
 | 
					            icono = "pi pi-eye";
 | 
				
			||||||
 | 
					            text = "Activar Administrador de Comunidad"
 | 
				
			||||||
 | 
					        } else if (rowData.status == '1') {
 | 
				
			||||||
 | 
					            icono = "pi pi-eye-slash";
 | 
				
			||||||
 | 
					            text = "Inactivar Administrador de Comunidad"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        return (
 | 
					        return (
 | 
				
			||||||
            <div className="actions">
 | 
					            <div className="actions">
 | 
				
			||||||
 | 
					                <Button
 | 
				
			||||||
 | 
					                    icon={`${icono}`}
 | 
				
			||||||
 | 
					                    className="p-button-rounded p-button-warning mt-2 mx-2"
 | 
				
			||||||
 | 
					                    onClick={() => confirmChangeStatuAdminCommunity(rowData)}
 | 
				
			||||||
 | 
					                    title={`${text}`}
 | 
				
			||||||
 | 
					                />
 | 
				
			||||||
                <Button
 | 
					                <Button
 | 
				
			||||||
                    icon="pi pi-trash"
 | 
					                    icon="pi pi-trash"
 | 
				
			||||||
                    className="p-button-rounded p-button-danger mt-2"
 | 
					                    className="p-button-rounded p-button-danger mt-2"
 | 
				
			||||||
| 
						 | 
					@ -257,6 +340,22 @@ const AdministradoresComunidad = () => {
 | 
				
			||||||
        </>
 | 
					        </>
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const changeStatusAdminCommunityDialogFooter = (
 | 
				
			||||||
 | 
					        <>
 | 
				
			||||||
 | 
					            <Button
 | 
				
			||||||
 | 
					                label="No"
 | 
				
			||||||
 | 
					                icon="pi pi-times"
 | 
				
			||||||
 | 
					                className="p-button-text"
 | 
				
			||||||
 | 
					                onClick={hideChangeStatusAdmimCommunityDialog}
 | 
				
			||||||
 | 
					            />
 | 
				
			||||||
 | 
					            <Button
 | 
				
			||||||
 | 
					                label="Yes"
 | 
				
			||||||
 | 
					                icon="pi pi-check"
 | 
				
			||||||
 | 
					                className="p-button-text"
 | 
				
			||||||
 | 
					                onClick={cambiarStatusAdminCommuniy}
 | 
				
			||||||
 | 
					            />
 | 
				
			||||||
 | 
					        </>
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const leftToolbarTemplate = () => {
 | 
					    const leftToolbarTemplate = () => {
 | 
				
			||||||
        return (
 | 
					        return (
 | 
				
			||||||
| 
						 | 
					@ -344,7 +443,16 @@ const AdministradoresComunidad = () => {
 | 
				
			||||||
        </>
 | 
					        </>
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  
 | 
					    const headerStatus = (
 | 
				
			||||||
 | 
					        <>
 | 
				
			||||||
 | 
					            <p> {' '}
 | 
				
			||||||
 | 
					                <FontAwesomeIcon icon={faCircleQuestion} style={{ color: "#C08135" }} />{' '}
 | 
				
			||||||
 | 
					                Estado
 | 
				
			||||||
 | 
					            </p>
 | 
				
			||||||
 | 
					        </>
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const onInputChange = (e, name) => {
 | 
					    const onInputChange = (e, name) => {
 | 
				
			||||||
        const val = (e.target && e.target.value) || '';
 | 
					        const val = (e.target && e.target.value) || '';
 | 
				
			||||||
| 
						 | 
					@ -360,6 +468,18 @@ const AdministradoresComunidad = () => {
 | 
				
			||||||
        console.log(getCommunityValue)
 | 
					        console.log(getCommunityValue)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const statusBodyTemplate = (rowData) => {
 | 
				
			||||||
 | 
					        return (
 | 
				
			||||||
 | 
					            <>
 | 
				
			||||||
 | 
					                <span
 | 
				
			||||||
 | 
					                    className={`status status-${rowData.status}`}
 | 
				
			||||||
 | 
					                >
 | 
				
			||||||
 | 
					                    {rowData.status_text}
 | 
				
			||||||
 | 
					                </span>
 | 
				
			||||||
 | 
					            </>
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return (
 | 
					    return (
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -380,9 +500,10 @@ const AdministradoresComunidad = () => {
 | 
				
			||||||
                        <Column field="dni" sortable header={headerDNI} style={{ flexGrow: 1, flexBasis: '160px', minWidth: '160px', wordBreak: 'break-word' }}>
 | 
					                        <Column field="dni" sortable header={headerDNI} style={{ flexGrow: 1, flexBasis: '160px', minWidth: '160px', wordBreak: 'break-word' }}>
 | 
				
			||||||
                        </Column>
 | 
					                        </Column>
 | 
				
			||||||
                        <Column field="email" sortable header={headerEmail} style={{ flexGrow: 1, flexBasis: '160px', minWidth: '160px', wordBreak: 'break-word' }}></Column>
 | 
					                        <Column field="email" sortable header={headerEmail} style={{ flexGrow: 1, flexBasis: '160px', minWidth: '160px', wordBreak: 'break-word' }}></Column>
 | 
				
			||||||
                        <Column field="phone"  header={headerPhone} style={{ flexGrow: 1, flexBasis: '160px', minWidth: '160px', wordBreak: 'break-word' }}></Column>
 | 
					                        <Column field="phone" header={headerPhone} style={{ flexGrow: 1, flexBasis: '160px', minWidth: '160px', wordBreak: 'break-word' }}></Column>
 | 
				
			||||||
                        <Column field="community_name" sortable header={headerCommuntiy} style={{ flexGrow: 1, flexBasis: '160px', minWidth: '160px', wordBreak: 'break-word' }}></Column>
 | 
					                        <Column field="community_name" sortable header={headerCommuntiy} style={{ flexGrow: 1, flexBasis: '160px', minWidth: '160px', wordBreak: 'break-word' }}></Column>
 | 
				
			||||||
                        <Column  style={{ flexGrow: 1, flexBasis: '130px', minWidth: '130px' }} body={actionsAdminCommunity}></Column>
 | 
					                        <Column field="status" sortable header={headerStatus} body={statusBodyTemplate} style={{ flexGrow: 1, flexBasis: '160px', minWidth: '160px', wordBreak: 'break-word' }}></Column>
 | 
				
			||||||
 | 
					                        <Column style={{ flexGrow: 1, flexBasis: '130px', minWidth: '130px' }} body={actionsAdminCommunity}></Column>
 | 
				
			||||||
                    </DataTable>
 | 
					                    </DataTable>
 | 
				
			||||||
                    <Dialog visible={deleteAdminCommunityDialog} style={{ width: '450px' }} header="Confirmar" modal footer={deleteAdminCommunityDialogFooter} onHide={hideDeleteAdminCommunityDialog}>
 | 
					                    <Dialog visible={deleteAdminCommunityDialog} style={{ width: '450px' }} header="Confirmar" modal footer={deleteAdminCommunityDialogFooter} onHide={hideDeleteAdminCommunityDialog}>
 | 
				
			||||||
                        <div className="flex align-items-center justify-content-center">
 | 
					                        <div className="flex align-items-center justify-content-center">
 | 
				
			||||||
| 
						 | 
					@ -396,6 +517,26 @@ const AdministradoresComunidad = () => {
 | 
				
			||||||
                            {selectedAdminsCommunities && <span>¿Está seguro eliminar los administradores de las comunidades de viviendas seleccionados?</span>}
 | 
					                            {selectedAdminsCommunities && <span>¿Está seguro eliminar los administradores de las comunidades de viviendas seleccionados?</span>}
 | 
				
			||||||
                        </div>
 | 
					                        </div>
 | 
				
			||||||
                    </Dialog>
 | 
					                    </Dialog>
 | 
				
			||||||
 | 
					                    <Dialog
 | 
				
			||||||
 | 
					                        visible={changeStatusAdminCommunityDialog}
 | 
				
			||||||
 | 
					                        style={{ width: '450px' }}
 | 
				
			||||||
 | 
					                        header="Confirmar"
 | 
				
			||||||
 | 
					                        modal
 | 
				
			||||||
 | 
					                        footer={changeStatusAdminCommunityDialogFooter}
 | 
				
			||||||
 | 
					                        onHide={hideChangeStatusAdmimCommunityDialog}
 | 
				
			||||||
 | 
					                    >
 | 
				
			||||||
 | 
					                        <div className="flex align-items-center justify-content-center">
 | 
				
			||||||
 | 
					                            <i
 | 
				
			||||||
 | 
					                                className="pi pi-exclamation-triangle mr-3"
 | 
				
			||||||
 | 
					                                style={{ fontSize: '2rem' }}
 | 
				
			||||||
 | 
					                            />
 | 
				
			||||||
 | 
					                            {adminCommunity && (
 | 
				
			||||||
 | 
					                                <span>
 | 
				
			||||||
 | 
					                                    ¿Estás seguro que desea cambiar estado a <b>{adminCommunity.name}</b>?
 | 
				
			||||||
 | 
					                                </span>
 | 
				
			||||||
 | 
					                            )}
 | 
				
			||||||
 | 
					                        </div>
 | 
				
			||||||
 | 
					                    </Dialog>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div className="col-12">
 | 
					            <div className="col-12">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -44,7 +44,6 @@ const AdministradoresSistema = () => {
 | 
				
			||||||
    status_text: '',
 | 
					    status_text: '',
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
  async function fetchP() {
 | 
					  async function fetchP() {
 | 
				
			||||||
    let nombres = await fetch(urlFetch, { method: 'GET' });
 | 
					    let nombres = await fetch(urlFetch, { method: 'GET' });
 | 
				
			||||||
    let adminRes = await nombres.json();
 | 
					    let adminRes = await nombres.json();
 | 
				
			||||||
| 
						 | 
					@ -60,11 +59,11 @@ const AdministradoresSistema = () => {
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    setAdministrators(await data);
 | 
					    setAdministrators(await data);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  useEffect(() => {
 | 
					  useEffect(() => {
 | 
				
			||||||
    fetchP();
 | 
					    fetchP();
 | 
				
			||||||
  }, [])
 | 
					  }, [])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
  function registrarAdmin() {
 | 
					  function registrarAdmin() {
 | 
				
			||||||
    var data = {
 | 
					    var data = {
 | 
				
			||||||
      dni: document.getElementById('identificacion').value,
 | 
					      dni: document.getElementById('identificacion').value,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,6 +43,7 @@ const AreasComunes = () => {
 | 
				
			||||||
    const dt = useRef(null);
 | 
					    const dt = useRef(null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const [cookies, setCookie] = useCookies();
 | 
					    const [cookies, setCookie] = useCookies();
 | 
				
			||||||
 | 
					    const [changeStatusAreaDialog, setChangeStatusAreaDialog] = useState(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -220,6 +221,51 @@ const AreasComunes = () => {
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const cambiarStatuscommonArea = () => {
 | 
				
			||||||
 | 
					        if (commonArea.status == '1') {
 | 
				
			||||||
 | 
					            commonArea.status = '0';
 | 
				
			||||||
 | 
					            commonArea.status_text = 'Inactivo';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        } else if (commonArea.status == '0') {
 | 
				
			||||||
 | 
					            commonArea.status = '1';
 | 
				
			||||||
 | 
					            commonArea.status_text = 'Activo';
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        var data = {
 | 
				
			||||||
 | 
					            id: commonArea._id,
 | 
				
			||||||
 | 
					            status: commonArea.status,
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					        fetch('http://localhost:4000/commonArea/changeStatus', {
 | 
				
			||||||
 | 
					            cache: 'no-cache',
 | 
				
			||||||
 | 
					            method: 'POST',
 | 
				
			||||||
 | 
					            body: JSON.stringify(data),
 | 
				
			||||||
 | 
					            headers: {
 | 
				
			||||||
 | 
					                '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(
 | 
				
			||||||
 | 
					                function (response) {
 | 
				
			||||||
 | 
					                    setChangeStatusAreaDialog(false);
 | 
				
			||||||
 | 
					                    toast.current.show({
 | 
				
			||||||
 | 
					                        severity: 'success',
 | 
				
			||||||
 | 
					                        summary: 'Éxito',
 | 
				
			||||||
 | 
					                        detail: 'Área Común Actualizada',
 | 
				
			||||||
 | 
					                        life: 3000,
 | 
				
			||||||
 | 
					                    });
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            .catch(
 | 
				
			||||||
 | 
					                err => console.log('Ocurrió un error con el fetch', err)
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const hideDeleteCommonAreaDialog = () => {
 | 
					    const hideDeleteCommonAreaDialog = () => {
 | 
				
			||||||
        setDeleteCommonAreaDialog(false);
 | 
					        setDeleteCommonAreaDialog(false);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -237,9 +283,36 @@ const AreasComunes = () => {
 | 
				
			||||||
        setDeleteCommonAreasDialog(true);
 | 
					        setDeleteCommonAreasDialog(true);
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const hideChangeStatusAreaDialog = () => {
 | 
				
			||||||
 | 
					        setChangeStatusAreaDialog(false);
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const confirmChangeStatusArea = (commonArea) => {
 | 
				
			||||||
 | 
					        setCommonArea(commonArea);
 | 
				
			||||||
 | 
					        setChangeStatusAreaDialog(true);
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const actionsCommonArea = (rowData) => {
 | 
					    const actionsCommonArea = (rowData) => {
 | 
				
			||||||
 | 
					        let icono = '';
 | 
				
			||||||
 | 
					        let text = '';
 | 
				
			||||||
 | 
					        if (rowData.status == '0') {
 | 
				
			||||||
 | 
					            icono = "pi pi-eye";
 | 
				
			||||||
 | 
					            text = "Activar Área Común"
 | 
				
			||||||
 | 
					        } else if (rowData.status == '1') {
 | 
				
			||||||
 | 
					            icono = "pi pi-eye-slash";
 | 
				
			||||||
 | 
					            text = "Inactivar Área Común"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return (
 | 
					        return (
 | 
				
			||||||
            <div className="actions">
 | 
					            <div className="actions">
 | 
				
			||||||
 | 
					                <Button
 | 
				
			||||||
 | 
					                    icon={`${icono}`}
 | 
				
			||||||
 | 
					                    className="p-button-rounded p-button-warning mt-2 mx-2"
 | 
				
			||||||
 | 
					                    onClick={() => confirmChangeStatusArea(rowData)}
 | 
				
			||||||
 | 
					                    title={`${text}`}
 | 
				
			||||||
 | 
					                />
 | 
				
			||||||
                <Button
 | 
					                <Button
 | 
				
			||||||
                    icon="pi pi-trash"
 | 
					                    icon="pi pi-trash"
 | 
				
			||||||
                    className="p-button-rounded p-button-danger mt-2"
 | 
					                    className="p-button-rounded p-button-danger mt-2"
 | 
				
			||||||
| 
						 | 
					@ -276,6 +349,22 @@ const AreasComunes = () => {
 | 
				
			||||||
        </>
 | 
					        </>
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const changeStatusAreaDialogFooter = (
 | 
				
			||||||
 | 
					        <>
 | 
				
			||||||
 | 
					            <Button
 | 
				
			||||||
 | 
					                label="No"
 | 
				
			||||||
 | 
					                icon="pi pi-times"
 | 
				
			||||||
 | 
					                className="p-button-text"
 | 
				
			||||||
 | 
					                onClick={hideChangeStatusAreaDialog}
 | 
				
			||||||
 | 
					            />
 | 
				
			||||||
 | 
					            <Button
 | 
				
			||||||
 | 
					                label="Yes"
 | 
				
			||||||
 | 
					                icon="pi pi-check"
 | 
				
			||||||
 | 
					                className="p-button-text"
 | 
				
			||||||
 | 
					                onClick={cambiarStatuscommonArea}
 | 
				
			||||||
 | 
					            />
 | 
				
			||||||
 | 
					        </>
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const leftToolbarTemplate = () => {
 | 
					    const leftToolbarTemplate = () => {
 | 
				
			||||||
        return (
 | 
					        return (
 | 
				
			||||||
| 
						 | 
					@ -431,6 +520,26 @@ const AreasComunes = () => {
 | 
				
			||||||
                            {selectedCommonAreas && <span>¿Está seguro eliminar las áreas comunes seleccionadas?</span>}
 | 
					                            {selectedCommonAreas && <span>¿Está seguro eliminar las áreas comunes seleccionadas?</span>}
 | 
				
			||||||
                        </div>
 | 
					                        </div>
 | 
				
			||||||
                    </Dialog>
 | 
					                    </Dialog>
 | 
				
			||||||
 | 
					                    <Dialog
 | 
				
			||||||
 | 
					                        visible={changeStatusAreaDialog}
 | 
				
			||||||
 | 
					                        style={{ width: '450px' }}
 | 
				
			||||||
 | 
					                        header="Confirmar"
 | 
				
			||||||
 | 
					                        modal
 | 
				
			||||||
 | 
					                        footer={changeStatusAreaDialogFooter}
 | 
				
			||||||
 | 
					                        onHide={hideChangeStatusAreaDialog}
 | 
				
			||||||
 | 
					                    >
 | 
				
			||||||
 | 
					                        <div className="flex align-items-center justify-content-center">
 | 
				
			||||||
 | 
					                            <i
 | 
				
			||||||
 | 
					                                className="pi pi-exclamation-triangle mr-3"
 | 
				
			||||||
 | 
					                                style={{ fontSize: '2rem' }}
 | 
				
			||||||
 | 
					                            />
 | 
				
			||||||
 | 
					                            {commonArea && (
 | 
				
			||||||
 | 
					                                <span>
 | 
				
			||||||
 | 
					                                    ¿Estás seguro que desea cambiar estado a <b>{commonArea.name}</b>?
 | 
				
			||||||
 | 
					                                </span>
 | 
				
			||||||
 | 
					                            )}
 | 
				
			||||||
 | 
					                        </div>
 | 
				
			||||||
 | 
					                    </Dialog>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div className="col-12">
 | 
					            <div className="col-12">
 | 
				
			||||||
| 
						 | 
					@ -513,7 +622,7 @@ const AreasComunes = () => {
 | 
				
			||||||
                        </div>
 | 
					                        </div>
 | 
				
			||||||
                        <div className="field col-12 md:col-6">
 | 
					                        <div className="field col-12 md:col-6">
 | 
				
			||||||
                            <label htmlFor="bookable">¿Necesita Reservación?</label>
 | 
					                            <label htmlFor="bookable">¿Necesita Reservación?</label>
 | 
				
			||||||
                            <div className="formgrid grid align-items-end" style={{marginTop: '12px', width: '300px'}}>
 | 
					                            <div className="formgrid grid align-items-end" style={{ marginTop: '12px', width: '300px' }}>
 | 
				
			||||||
                                <div className="field-radiobutton col-6">
 | 
					                                <div className="field-radiobutton col-6">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                    <RadioButton
 | 
					                                    <RadioButton
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue