Merge pull request '...' (#60) from statistics into master

Reviewed-on: http://git.plannaplan.pl/y0rune/frontend/pulls/60
Reviewed-by: Maciej <glowackimaciej97@gmail.com>
This commit is contained in:
Maciej 2021-01-23 22:14:09 +01:00
commit 52d4a384d9
5 changed files with 18 additions and 12 deletions

View File

@ -105,7 +105,8 @@ export const Dropdown = ({ open, input, handleCloseDropdown, selectedOption }: D
input input
.toLowerCase() .toLowerCase()
.normalize('NFD') .normalize('NFD')
.replace(/[\u0300-\u036f]/g, ''), .replace(/[\u0300-\u036f]/g, '')
.replace(/\s/g, ''),
), ),
); );
setFilteredStudents(filteredUsers); setFilteredStudents(filteredUsers);
@ -119,9 +120,9 @@ export const Dropdown = ({ open, input, handleCloseDropdown, selectedOption }: D
<> <>
{selectedOption === 'studenci' ? ( {selectedOption === 'studenci' ? (
<div> <div>
{filteredStudents.map(({ email, id }, index) => ( {filteredStudents.map(({ surname, name, id }, index) => (
<CourseContainer key={index} id={id.toString()} onClick={onUserClick}> <CourseContainer key={index} id={id.toString()} onClick={onUserClick}>
<p>{email}</p> <p>{name} {surname}</p>
</CourseContainer> </CourseContainer>
))} ))}
</div> </div>

View File

@ -5,8 +5,7 @@ import { days, hours } from '../constants/index';
import styled from 'styled-components/macro'; import styled from 'styled-components/macro';
import { SchedulerEvent } from '../types'; import { SchedulerEvent } from '../types';
import { coursesContext } from '../contexts/CoursesProvider'; import { coursesContext } from '../contexts/CoursesProvider';
import Button from '@material-ui/core/Button'; import Tooltip from '@material-ui/core/Tooltip';
import Tooltip, { TooltipProps } from '@material-ui/core/Tooltip';
const SchedulerWrapper = styled.div` const SchedulerWrapper = styled.div`
border-collapse: collapse; border-collapse: collapse;

View File

@ -204,6 +204,7 @@ export const SchedulerRow = ({ groups, indexRow, rowTop, cellWidth, cellHeight }
</TextWrapper> </TextWrapper>
) : ( ) : (
<TextWrapper style={{ flexDirection: 'column' }}> <TextWrapper style={{ flexDirection: 'column' }}>
{groups[index].isAccepted===true && <Icon alt="transfer" src={TickIcon} />}
<div style={{ alignSelf: 'flex-end' }}> <div style={{ alignSelf: 'flex-end' }}>
{groups[index].takenPlaces}/{groups[index].capacity} {groups[index].takenPlaces}/{groups[index].capacity}
</div> </div>

View File

@ -24,6 +24,7 @@ const Wrapper = styled.div`
border-top-left-radius: 6px; border-top-left-radius: 6px;
border-bottom-left-radius: 6px; border-bottom-left-radius: 6px;
user-select: none; user-select: none;
z-index:100;
`; `;
const Header = styled.div` const Header = styled.div`
display: flex; display: flex;

View File

@ -9,8 +9,7 @@ import ClickAwayListener from 'react-click-away-listener';
import { SelectMenu } from './SelectMenu'; import { SelectMenu } from './SelectMenu';
import { studentsContext } from '../contexts/StudentsProvider'; import { studentsContext } from '../contexts/StudentsProvider';
import { CASContext } from '../contexts/CASProvider'; import { CASContext } from '../contexts/CASProvider';
import { render } from 'react-dom'; import Tooltip from '@material-ui/core/Tooltip';
import { coursesContext } from '../contexts/CoursesProvider';
const Topbar = styled.div` const Topbar = styled.div`
background-color: #e3e5ed; background-color: #e3e5ed;
@ -113,8 +112,6 @@ const IconWrapper = styled.div`
margin-right: 10px; margin-right: 10px;
`; `;
const Icon = styled.img` const Icon = styled.img`
width: 40px; width: 40px;
margin-left: 40px; margin-left: 40px;
@ -217,11 +214,18 @@ export default function ({ handleTransfer }: TopbarProps) {
</ClickAwayListener> </ClickAwayListener>
</FlexboxColumn> </FlexboxColumn>
<IconWrapper> <IconWrapper>
<SelectedStudent>{selectedStudent?.email.replace(/@st.amu.edu.pl/, '')}</SelectedStudent> <SelectedStudent>{selectedStudent?.surname}</SelectedStudent>
{/* <Text>Maciej Głowacki</Text> */} {/* <Text>Maciej Głowacki</Text> */}
{userPrivilige === 'STUDENT' && <Icon alt="transfer" src={TransferIcon} onClick={handleTransfer} />} {userPrivilige === 'STUDENT' && (
<Tooltip title="Wymiana grupami">
<Icon alt="transfer" src={TransferIcon} onClick={handleTransfer} />
</Tooltip>
)}
{/* <Icon alt="change_language" src={isPolish ? EnglishIcon : PolishIcon} onClick={onLangChange} /> */} {/* <Icon alt="change_language" src={isPolish ? EnglishIcon : PolishIcon} onClick={onLangChange} /> */}
<Icon alt="logout" src={LogoutIcon} onClick={logout} /> <Tooltip title="Wyloguj">
<Icon alt="logout" src={LogoutIcon} onClick={logout} />
</Tooltip>
{/* <Profile anchorEl={anchorEl} handleClose={handleCloseProfile} /> */} {/* <Profile anchorEl={anchorEl} handleClose={handleCloseProfile} /> */}
</IconWrapper> </IconWrapper>
</Topbar> </Topbar>