Commit 19db695a authored by Matheus Horstmann's avatar Matheus Horstmann 🐴

Add disciplina filter, fix permission o comissao

parent c9d7d9ca
...@@ -176,7 +176,6 @@ export function Options(props) { ...@@ -176,7 +176,6 @@ export function Options(props) {
{"icon":salasIcon,"text":"Gerenciamento de Salas", "link":"/gerenciasala" }, {"icon":salasIcon,"text":"Gerenciamento de Salas", "link":"/gerenciasala" },
{"icon":locationIcon,"text":"Gerenciamento de Setores", "link":"/gerenciasetores" }, {"icon":locationIcon,"text":"Gerenciamento de Setores", "link":"/gerenciasetores" },
{"icon":locationIcon,"text":"Gerenciamento de Blocos", "link":"/gerenciabloco" }, {"icon":locationIcon,"text":"Gerenciamento de Blocos", "link":"/gerenciabloco" },
{"icon":locationIcon,"text":"Gerenciamento de Usuarios", "link":"/gerenciausuarios" },
] ]
break; break;
case "secretario_dpto": case "secretario_dpto":
......
import React from 'react'; import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Chip from '@material-ui/core/Chip'; import Chip from '@material-ui/core/Chip';
import Autocomplete from '@material-ui/lab/Autocomplete'; import Autocomplete from '@material-ui/lab/Autocomplete';
import TextField from '@material-ui/core/TextField'; import TextField from '@material-ui/core/TextField';
import clsx from 'clsx';
import { makeStyles, useTheme } from '@material-ui/core/styles';
import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
import MenuItem from '@material-ui/core/MenuItem';
import FormControl from '@material-ui/core/FormControl';
import ListItemText from '@material-ui/core/ListItemText';
import Select from '@material-ui/core/Select';
import Checkbox from '@material-ui/core/Checkbox';
const _useStyles = makeStyles(theme => ({
formControl: {
margin: theme.spacing(1),
minWidth: "100%",
maxWidth: "100%",
},
chips: {
display: 'flex',
flexWrap: 'wrap',
},
chip: {
margin: 2,
},
noLabel: {
marginTop: theme.spacing(3),
},
}));
const ITEM_HEIGHT = 48;
const ITEM_PADDING_TOP = 8;
const MenuProps = {
PaperProps: {
style: {
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
width: 250,
},
},
};
function getStyles(name, personName, theme) {
return {
fontWeight:
personName.indexOf(name) === -1
? theme.typography.fontWeightRegular
: theme.typography.fontWeightMedium,
};
}
export function MultipleSelect(props) {
const classes = _useStyles();
const theme = useTheme();
const [personName, setPersonName] = React.useState((props.defaultValue)? props.defaultValue : []);
React.useEffect(() => {
if( props.defaultValue)
setPersonName(props.defaultValue)
},[props.defaultValue]);
const handleChange = event => {
setPersonName(event.target.value);
console.log("valor em handleChange de MultipleSelect: ",event.target.value)
console.log("valor do array: ", personName)
};
React.useEffect(() => {
props.func(personName)
},[personName]);
const handleChangeMultiple = event => {
const { options } = event.target;
const value = [];
for (let i = 0, l = options.length; i < l; i += 1) {
if (options[i].selected) {
value.push(options[i].value);
}
}
setPersonName(value);
};
return (
<div>
<FormControl className={classes.formControl}>
<InputLabel id="demo-mutiple-checkbox-label">{props.label}</InputLabel>
<Select
labelId="demo-mutiple-checkbox-label"
id="demo-mutiple-checkbox"
multiple
value={personName}
onChange={handleChange}
input={<Input />}
renderValue={selected => selected.join(', ')}
MenuProps={MenuProps}
>
{props.suggestions.map(suggestion => (
<MenuItem key={suggestion[props.index_value]} value={suggestion[props.index_value]}>
<Checkbox color="default" checked={personName.indexOf(suggestion[props.index_value]) > -1} />
<ListItemText primary={suggestion[props.index]} />
</MenuItem>
))}
</Select>
</FormControl>
</div>
);
}
export function Tags(props) { export function Tags(props) {
return ( return (
...@@ -10,7 +115,13 @@ export function Tags(props) { ...@@ -10,7 +115,13 @@ export function Tags(props) {
<Autocomplete <Autocomplete
multiple multiple
options={props.suggestions} options={props.suggestions}
getOptionLabel={option => option[props.index]} getOptionLabel={option => option[props.index]}
onChange = { (evt,v) =>{
if(v)
props.func(v.map((i) => {return i[props.index_value]}))
else
props.func({})
}}
filterSelectedOptions filterSelectedOptions
renderInput={params => ( renderInput={params => (
<TextField <TextField
...@@ -52,16 +163,22 @@ export function SelectField(props) { ...@@ -52,16 +163,22 @@ export function SelectField(props) {
}} }}
autoHightlight autoHightlight
defaultValue={props.defaultValue} defaultValue={props.defaultValue}
onChange = { (evt,v) =>{ onChange = { (evt,v) =>{
if(v) if(v)
props.func(v[props.index_value]) props.func(v[props.index_value])
else else
props.func({}) props.func({})
}} }}
getOptionLabel={option => ( option && option[props.index] )? option[props.index] : ""} getOptionLabel={option => ( option && option[props.index] )? option[props.index] : ""}
renderOption={option => ( renderOption={option => (
<React.Fragment> <React.Fragment>
{/*<span>{option.value}</span> */} {/* se a oppção show_code estiver ativa ao passar o componente
* SelectField, então ao mostrar as opções no select será mostrado
* os valores de props.option[props.index_value] e props.option[props.index]
*/}
{ props.show_code &&
<span>{option[props.index_value]}</span>
}
<span>{option[props.index]}</span> <span>{option[props.index]}</span>
</React.Fragment> </React.Fragment>
)} )}
......
...@@ -162,29 +162,32 @@ export function CustTable(props) { ...@@ -162,29 +162,32 @@ export function CustTable(props) {
setSelected([]); setSelected([]);
} }
function handleClick(event, name) { function handleClick(event, name) {
const selectedIndex = selected.indexOf(name); const selectedIndex = selected.indexOf(name);
let newSelected = []; let newSelected = [];
if(props.setSelect) { // se foi passado uma funcao de selecao como props então chama essa
props.setSelect(props.array[name]); // funcao com o id da linha que foi clicada.
} if(props.setSelect) {
props.setSelect(props.array[name]);
}
if (selectedIndex === -1) { // javascript não tem switch case??
newSelected = newSelected.concat(selected, name); if (selectedIndex === -1) {
} else if (selectedIndex === 0) { newSelected = newSelected.concat(selected, name);
newSelected = newSelected.concat(selected.slice(1)); } else if (selectedIndex === 0) {
} else if (selectedIndex === selected.length - 1) { newSelected = newSelected.concat(selected.slice(1));
newSelected = newSelected.concat(selected.slice(0, -1)); } else if (selectedIndex === selected.length - 1) {
} else if (selectedIndex > 0) { newSelected = newSelected.concat(selected.slice(0, -1));
newSelected = newSelected.concat( } else if (selectedIndex > 0) {
selected.slice(0, selectedIndex), newSelected = newSelected.concat(
selected.slice(selectedIndex + 1), selected.slice(0, selectedIndex),
); selected.slice(selectedIndex + 1),
} );
}
setSelected(newSelected); setSelected(newSelected);
} }
function handleChangePage(event, newPage) { function handleChangePage(event, newPage) {
setPage(newPage); setPage(newPage);
...@@ -232,6 +235,7 @@ export function CustTable(props) { ...@@ -232,6 +235,7 @@ export function CustTable(props) {
<TableCell padding="checkbox"> <TableCell padding="checkbox">
<Checkbox <Checkbox
checked={isItemSelected} checked={isItemSelected}
color="green"
inputProps={{ 'aria-labelledby': labelId }} inputProps={{ 'aria-labelledby': labelId }}
/> />
</TableCell> </TableCell>
......
...@@ -73,7 +73,6 @@ const useStyles = makeStyles(theme => ({ ...@@ -73,7 +73,6 @@ const useStyles = makeStyles(theme => ({
})); }));
export function HeaderDisciplina(props) { export function HeaderDisciplina(props) {
const {change, setChange} = useContext(Change);
const classes = useStyles(); const classes = useStyles();
const style_code = { const style_code = {
fontSize: "18px", fontSize: "18px",
...@@ -109,7 +108,6 @@ export function HeaderDisciplina(props) { ...@@ -109,7 +108,6 @@ export function HeaderDisciplina(props) {
setMessage("Erro ao tentar remover disciplina: "+e) setMessage("Erro ao tentar remover disciplina: "+e)
setMessageActive(true) setMessageActive(true)
} }
setChange(!change);
} }
return ( return (
<Paper className={classes.paper}> <Paper className={classes.paper}>
...@@ -259,7 +257,6 @@ export function Disciplina(props) { ...@@ -259,7 +257,6 @@ export function Disciplina(props) {
const {disciplinas, setDisciplinas} = useContext(Disciplinas) const {disciplinas, setDisciplinas} = useContext(Disciplinas)
const {disciplina_select,setDisciplinaSelected} = useContext(DisciplinaSelect); const {disciplina_select,setDisciplinaSelected} = useContext(DisciplinaSelect);
const [dpt_code, setDptCodigo] = useState(departamento.codigo); const [dpt_code, setDptCodigo] = useState(departamento.codigo);
const {change, setChange} = useContext(Change);
useEffect(() => { useEffect(() => {
const fetchData = async () => { const fetchData = async () => {
const result = await api.get(`disciplinas?filter[where][departamentoCod]=${dpt_code}`,); const result = await api.get(`disciplinas?filter[where][departamentoCod]=${dpt_code}`,);
...@@ -272,18 +269,15 @@ export function Disciplina(props) { ...@@ -272,18 +269,15 @@ export function Disciplina(props) {
} }
setDisciplinas(_disciplinas); setDisciplinas(_disciplinas);
}; };
fetchData();},[dpt_code,change]) fetchData();},[dpt_code])
return ( return (
<Grid container justify="flex-end" spacing={2} direction="column"> <Grid container justify="flex-end">
<div> <Grid item sm={12}>
<Grid item > <HeaderDisciplina nome_curso={departamento.nome}></HeaderDisciplina>
<HeaderDisciplina nome_curso={departamento.nome}></HeaderDisciplina> </Grid>
</Grid> <Grid item sm={12}>
<Grid item xs={12} md={12} sm={12}> <ListDisciplina disciplinas={Object.values(disciplinas)} departamento={departamento.nome}/>
</Grid>
<ListDisciplina disciplinas={Object.values(disciplinas)} departamento={departamento.nome}/>
</Grid>
</div>
</Grid> </Grid>
) )
...@@ -295,7 +289,6 @@ function Equivalencia(props) { ...@@ -295,7 +289,6 @@ function Equivalencia(props) {
const {disciplinas,setDisciplinas} = useContext(Disciplinas) const {disciplinas,setDisciplinas} = useContext(Disciplinas)
const {message_active,setMessageActive} = React.useContext(MessageActive) const {message_active,setMessageActive} = React.useContext(MessageActive)
const {message,setMessage} = React.useContext(Messages); const {message,setMessage} = React.useContext(Messages);
const {change, setChange} = useContext(Change);
async function handleDelete() { async function handleDelete() {
try { try {
var a = await api.delete(`disciplinas/${disciplina_select.codigo}/equivalencias`,{params: { disciplina_eq_code:props.disciplina}}) var a = await api.delete(`disciplinas/${disciplina_select.codigo}/equivalencias`,{params: { disciplina_eq_code:props.disciplina}})
...@@ -333,7 +326,6 @@ function Equivalencia(props) { ...@@ -333,7 +326,6 @@ function Equivalencia(props) {
function AddEquivalency(props) { function AddEquivalency(props) {
const {disciplinas,setDisciplinas} = useContext(Disciplinas) const {disciplinas,setDisciplinas} = useContext(Disciplinas)
const {disciplina_select, setDisciplinaSelected} = useContext(DisciplinaSelect); const {disciplina_select, setDisciplinaSelected} = useContext(DisciplinaSelect);
const {change, setChange} = useContext(Change);
const {message_active,setMessageActive} = React.useContext(MessageActive) const {message_active,setMessageActive} = React.useContext(MessageActive)
const {message,setMessage} = React.useContext(Messages); const {message,setMessage} = React.useContext(Messages);
const [equiv, setEquiv] = useState(""); const [equiv, setEquiv] = useState("");
...@@ -361,6 +353,7 @@ function AddEquivalency(props) { ...@@ -361,6 +353,7 @@ function AddEquivalency(props) {
index="nome" index="nome"
index_value="codigo" index_value="codigo"
placeholder="selecione a disciplina" placeholder="selecione a disciplina"
show_code
func={(value)=>setEquiv(value)} func={(value)=>setEquiv(value)}
/> />
<Grid item align="right" > <Grid item align="right" >
...@@ -374,13 +367,9 @@ function AddEquivalency(props) { ...@@ -374,13 +367,9 @@ function AddEquivalency(props) {
export function MenuEquivalencia(props) { export function MenuEquivalencia(props) {
const {disciplinas,setDisciplinas} = useContext(Disciplinas) const {disciplinas,setDisciplinas} = useContext(Disciplinas)
const {disciplina_select, setDisciplinaSelected} = useContext(DisciplinaSelect); const {disciplina_select, setDisciplinaSelected} = useContext(DisciplinaSelect);
const {change, setChange} = useContext(Change);
const {message_active,setMessageActive} = React.useContext(MessageActive) const {message_active,setMessageActive} = React.useContext(MessageActive)
const {message,setMessage} = React.useContext(Messages); const {message,setMessage} = React.useContext(Messages);
const classes = useStyles(); const classes = useStyles();
function handleClick() {
console.log("oi")
}
const [new_equivalency, setNewEquivalency] = useState(false); const [new_equivalency, setNewEquivalency] = useState(false);
function handleClickNewEquivalency() { function handleClickNewEquivalency() {
setNewEquivalency(!new_equivalency); setNewEquivalency(!new_equivalency);
...@@ -424,7 +413,6 @@ export function MenuEquivalencia(props) { ...@@ -424,7 +413,6 @@ export function MenuEquivalencia(props) {
export function Menu(props) { export function Menu(props) {
const classes = useStyles(); const classes = useStyles();
const {disciplina_select, setDisciplinaSelect} = useContext(DisciplinaSelect); const {disciplina_select, setDisciplinaSelect} = useContext(DisciplinaSelect);
const {change, setChange} = useContext(Change);
const {message_active,setMessageActive} = React.useContext(MessageActive) const {message_active,setMessageActive} = React.useContext(MessageActive)
const {message,setMessage} = React.useContext(Messages); const {message,setMessage} = React.useContext(Messages);
async function salvahandle(event) { async function salvahandle(event) {
...@@ -438,7 +426,6 @@ export function Menu(props) { ...@@ -438,7 +426,6 @@ export function Menu(props) {
setMessageActive(true) setMessageActive(true)
/* handle error */ /* handle error */
} }
setChange(!change);
} }
return ( return (
<Paper elevation={2} > <Paper elevation={2} >
...@@ -476,15 +463,14 @@ export function GerenciarDisciplina (props) { ...@@ -476,15 +463,14 @@ export function GerenciarDisciplina (props) {
var [departamentos, setDepartamentos] = useState([]) var [departamentos, setDepartamentos] = useState([])
var [dpts, setDpts] = useState({}) var [dpts, setDpts] = useState({})
var [disciplina_select, setDisciplinaSelect] = useState({}); var [disciplina_select, setDisciplinaSelect] = useState({});
var [change, setChange] = useState(false);
const [disciplinas, setDisciplinas] = useState({}); const [disciplinas, setDisciplinas] = useState({});
//get data from apit //get data from api
useEffect(() => { useEffect(() => {
const fetchData = async () => { const fetchData = async () => {
const result = await api.get(`departamentos?filter${query}`,); const result = await api.get(`departamentos?filter${query}`,);
setDepartamentos(result.data); setDepartamentos(result.data);
}; };
fetchData();},[query,change]) fetchData();},[])
useEffect(() => { useEffect(() => {
const fetchData = async () => { const fetchData = async () => {
var _dpts = {} var _dpts = {}
...@@ -500,7 +486,6 @@ export function GerenciarDisciplina (props) { ...@@ -500,7 +486,6 @@ export function GerenciarDisciplina (props) {
function change_query(value) { function change_query(value) {
setQuery("[where][codigo]="+value); setQuery("[where][codigo]="+value);
set_query_cache("departamento_disciplina",value); set_query_cache("departamento_disciplina",value);
setChange(!change)
} }
function setDisciplinaSelected(disciplina){ function setDisciplinaSelected(disciplina){
setDisciplinaSelect(disciplina); setDisciplinaSelect(disciplina);
...@@ -508,7 +493,6 @@ export function GerenciarDisciplina (props) { ...@@ -508,7 +493,6 @@ export function GerenciarDisciplina (props) {
return ( return (
<DisciplinaSelect.Provider value={{disciplina_select,setDisciplinaSelected}}> <DisciplinaSelect.Provider value={{disciplina_select,setDisciplinaSelected}}>
<Disciplinas.Provider value={{disciplinas,setDisciplinas}}> <Disciplinas.Provider value={{disciplinas,setDisciplinas}}>
<Change.Provider value={{change,setChange}}>
<div className={classes._body}> <div className={classes._body}>
<Grid container spacing={4} > <Grid container spacing={4} >
<Grid item xs={12}> <Grid item xs={12}>
...@@ -525,12 +509,12 @@ export function GerenciarDisciplina (props) { ...@@ -525,12 +509,12 @@ export function GerenciarDisciplina (props) {
/> />
</Grid> </Grid>
</Grid> </Grid>
<Grid container direction="row" spacing={4} > <Grid container direction="row" spacing={1} >
<Grid item xs={8} md={8} lg={9} sm={8}> <Grid item xs={8} md={8} lg={9} >
<Grid container direction="column" justify="flex-start" spacing={4} > <Grid container direction="column" justify="flex-start" >
{ departamentos.map((departamento) =>{ { departamentos.map((departamento) =>{
return ( return (
<Grid item > <Grid item sm={12} >
<Disciplina departamento={departamento} setDisciplinaSelect={setDisciplinaSelect} /> <Disciplina departamento={departamento} setDisciplinaSelect={setDisciplinaSelect} />
</Grid> </Grid>
) )
...@@ -543,7 +527,6 @@ export function GerenciarDisciplina (props) { ...@@ -543,7 +527,6 @@ export function GerenciarDisciplina (props) {
</Grid> </Grid>
</Grid> </Grid>
</div> </div>
</Change.Provider>
</Disciplinas.Provider> </Disciplinas.Provider>
</DisciplinaSelect.Provider> </DisciplinaSelect.Provider>
) )
......
...@@ -98,7 +98,7 @@ export function HeaderEnsalamento(props) { ...@@ -98,7 +98,7 @@ export function HeaderEnsalamento(props) {
async function handleDelete() { async function handleDelete() {
try { try {
const response_t = api.delete("/semestres/deletesemestre",{params: {"semestreId":ensalamento_select.semestre}}); const response_t = api.delete("/semestres/deletesemestre",{params: {"semestreId":ensalamento_select.semestre}});
setMessage("Ensalamento removido com sucesso") setMessage("Requisição de remoção do semestre: "+ensalamento_select.semestre+" agendada com sucesso, pode demorar alguns minutos para ser totalmente removido")
setMessageActive(true) setMessageActive(true)
} catch (e) { } catch (e) {
...@@ -122,7 +122,7 @@ export function HeaderEnsalamento(props) { ...@@ -122,7 +122,7 @@ export function HeaderEnsalamento(props) {
initial_icon={<DeleteOutline style={{color:"#676767", fontSize:"12px"}}/>} initial_icon={<DeleteOutline style={{color:"#676767", fontSize:"12px"}}/>}
initial_button_title={"Excluir"} initial_button_title={"Excluir"}
handle_accept={handleDelete} handle_accept={handleDelete}
description={"Você realmente deseja remover este semestre? não é possível desfazer está operação. " } /> description={"Você realmente deseja remover este semestre? está operação vai remover todas as turmas e horarios associado ao semestre e não é possível desfazer. " } />
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>
...@@ -241,10 +241,7 @@ async function get_file_upload(ensalamento) { ...@@ -241,10 +241,7 @@ async function get_file_upload(ensalamento) {
var query = "[where][semestre]="+ensalamento.semestre; var query = "[where][semestre]="+ensalamento.semestre;
const f = await api.get(`file-uploads?filter${query}`) const f = await api.get(`file-uploads?filter${query}`)
console.log("--------------------------------")
console.log(ensalamento,f.data[0])
ensalamento.fileupload = (f.data.length)? f.data[0] : {status:"Sem arquivo"}; ensalamento.fileupload = (f.data.length)? f.data[0] : {status:"Sem arquivo"};
console.log(ensalamento.fileupload.completed)
} }
return ensalamento; return ensalamento;
...@@ -275,16 +272,16 @@ export function Ensalamento(props) { ...@@ -275,16 +272,16 @@ export function Ensalamento(props) {
setInterval(()=> { setInterval(()=> {
fetchData(); fetchData();
},4000); },4000);
return () => clearInterval(4000); return () => clearInterval(4000); // intervalo em milisegundos
},[change]) },[change])
return ( return (
<Grid container justify="flex-end" spacing={2} direction="column"> <Grid container justify="flex-end" direction="column">
<div> <div>
<Grid item > <Grid item sm={11} >
<HeaderEnsalamento nome_curso="Ensalamentos"></HeaderEnsalamento> <HeaderEnsalamento nome_curso="Ensalamentos"></HeaderEnsalamento>
</Grid> </Grid>
<Grid item xs={12} md={12} sm={12}> <Grid item xs={12} md={12} sm={11}>
<ListEnsalamento ensalamentos={ensalamentos} /> <ListEnsalamento ensalamentos={ensalamentos} />
</Grid> </Grid>
</div> </div>
...@@ -333,13 +330,13 @@ export function GerenciarEnsalador (props) { ...@@ -333,13 +330,13 @@ export function GerenciarEnsalador (props) {
<EnsalamentoSelect.Provider value={{ensalamento_select,setEnsalamentoSelected}}> <EnsalamentoSelect.Provider value={{ensalamento_select,setEnsalamentoSelected}}>
<Change.Provider value={{change,setChange}}> <Change.Provider value={{change,setChange}}>
<div className={classes._body}> <div className={classes._body}>
<Grid container spacing={4} > <Grid container spacing={4} justify="space-between" >
<Grid item xs={12}> <Grid item xs={12} sm={6}>
<Typography color="#707070" className={classes.header} >Gerenciar Ensalamentos</Typography> <Typography color="#707070" className={classes.header} >Gerenciar Ensalamentos</Typography>
</Grid> </Grid>
</Grid> </Grid>
<Grid container direction="row" spacing={4} > <Grid container direction="row" justify="space-between" spacing={4} >
<Grid item xs={8} md={8} lg={9} sm={8}> <Grid item xs={8} md={8} lg={9} sm={7}>
<Grid container direction="column" justify="flex-start" spacing={4} > <Grid container direction="column" justify="flex-start" spacing={4} >
<Grid item > <Grid item >
<Ensalamento /> <Ensalamento />
...@@ -347,7 +344,7 @@ export function GerenciarEnsalador (props) { ...@@ -347,7 +344,7 @@ export function GerenciarEnsalador (props) {
</Grid> </Grid>
</Grid> </Grid>
<Grid item xs={4} md={4} sm={4} lg={3}> {/* menu */} <Grid item xs={4} md={4} sm={3} lg={3}> {/* menu */}
<Menu setEnsalamentoSelect={setEnsalamentoSelect} codigo_ensalamento={ensalamento_select.nome}></Menu> <Menu setEnsalamentoSelect={setEnsalamentoSelect} codigo_ensalamento={ensalamento_select.nome}></Menu>
</Grid> </Grid>
</Grid> </Grid>
......
This diff is collapsed.
...@@ -87,6 +87,10 @@ export function SalaSearch(props) { ...@@ -87,6 +87,10 @@ export function SalaSearch(props) {
{dia: 3, horario_inicial: "19:30:00", horario_final: "21:30:00", livre: false, motivo: "aula", …} {dia: 3, horario_inicial: "19:30:00", horario_final: "21:30:00", livre: false, motivo: "aula", …}
] ]
<<<<<<< HEAD
=======
[
>>>>>>> e71fc51... Add disciplina filter, fix permission o comissao
curso: { curso: {
nome: "Informatica Biomedica" nome: "Informatica Biomedica"
codigo: "96A" codigo: "96A"
...@@ -95,7 +99,21 @@ export function SalaSearch(props) { ...@@ -95,7 +99,21 @@ export function SalaSearch(props) {
secretarioId: null secretarioId: null
blocoCod: "pa" blocoCod: "pa"
setorCod: null setorCod: null
<<<<<<< HEAD
} }
=======
},
curso: {
nome: "Ciencia da computacao"
codigo: "21A"
_id: 35
localizacao: null
secretarioId: null
blocoCod: "pa"
setorCod: null
},
]
>>>>>>> e71fc51... Add disciplina filter, fix permission o comissao
disciplina: { disciplina: {
codigo: "ci204" codigo: "ci204"
nome: "ADMINISTRACAO DE INFORMATICA" nome: "ADMINISTRACAO DE INFORMATICA"
...@@ -138,7 +156,7 @@ export function TurmaTable(props) { ...@@ -138,7 +156,7 @@ export function TurmaTable(props) {
</TableCell > </TableCell >
{rows.map(row => ( {rows.map(row => (
<TableCell align="center" > <TableCell align="center" >
{row.curso? row.curso.nome : ""} {row.curso_str? row.curso_str: ""}
</TableCell>))} </TableCell>))}
</TableRow> </TableRow>
...@@ -158,7 +176,7 @@ export function TurmaTable(props) { ...@@ -158,7 +176,7 @@ export function TurmaTable(props) {
</TableCell > </TableCell >
{rows.map(row => ( {rows.map(row => (
<TableCell align="center" > <TableCell align="center" >
{row.horarios.map((value, index) => { { row.horarios && row.horarios.map((value, index) => {
return <p>{value.salaCode}</p> return <p>{value.salaCode}</p>
})} })}
</TableCell>))} </TableCell>))}
...@@ -170,7 +188,7 @@ export function TurmaTable(props) { ...@@ -170,7 +188,7 @@ export function TurmaTable(props) {
</TableCell > </TableCell >
{rows.map(row => ( {rows.map(row => (
<TableCell align="center" > <TableCell align="center" >
{row.horarios.map((value, index) => { {row.horarios && row.horarios.map((value, index) => {
return <p>{DIAS_SEMANAS[value.dia]}</p> return <p>{DIAS_SEMANAS[value.dia]}</p>
})} })}
</TableCell>))} </TableCell>))}
...@@ -182,7 +200,7 @@ export function TurmaTable(props) { ...@@ -182,7 +200,7 @@ export function TurmaTable(props) {
</TableCell > </TableCell >
{rows.map(row => ( {rows.map(row => (
<TableCell align="center" > <TableCell align="center" >
{row.horarios.map((value, index) => { {row.horarios && row.horarios.map((value, index) => {
return <p>{value.horario_inicial}</p> return <p>{value.horario_inicial}</p>
})} })}
</TableCell>))} </TableCell>))}
...@@ -194,18 +212,18 @@ export function TurmaTable(props) { ...@@ -194,18 +212,18 @@ export function TurmaTable(props) {
</TableCell > </TableCell >