-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #224 from kpi-ua/staging
- Loading branch information
Showing
81 changed files
with
919 additions
and
733 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
import { Group } from '../models/Group'; | ||
import { Lecturer } from '../models/Lecturer'; | ||
import { PagedResponse } from '../models/PagedResponse'; | ||
import Http from "./index"; | ||
|
||
export const getAllLecturers = () => { | ||
export const getAllLecturers = (): Promise<PagedResponse<Lecturer[]>> => { | ||
return Http.get("/schedule/lecturer/list").then(({ data }) => data); | ||
}; | ||
|
||
export const getAllGroups = () => { | ||
return Http.get("/schedule/groups").then(({ data }) => { | ||
return { | ||
data: data.data.map((row: {name: string, faculty: string, id: string}) => ({ | ||
name: `${row.name.trim()} (${row.faculty.trim()})`, | ||
id: row.id, | ||
})), | ||
}; | ||
}); | ||
export const getAllGroups = async (): Promise<PagedResponse<Group[]>> => { | ||
const response = await Http.get<PagedResponse<Group[]>>("/schedule/groups") | ||
|
||
return { | ||
...response.data, | ||
data: response.data.data.map(row => ({ | ||
...row, | ||
name: `${row.name.trim()} (${row.faculty.trim()})`, | ||
id: row.id, | ||
})) | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { CurrentTime } from '../models/CurrentTime'; | ||
import { PagedResponse } from '../models/PagedResponse'; | ||
import Http from './index'; | ||
|
||
export const getCurrentDateValues = () => { | ||
return Http.get('/time/current') | ||
.then(res => res.data); | ||
export const getCurrentDateValues = (): Promise<PagedResponse<CurrentTime>> => { | ||
return Http.get('/time/current').then(res => res.data); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import { Exam } from '../models/Exam'; | ||
import { LecturerLesson } from '../models/LecturerLesson'; | ||
import { PagedResponse } from '../models/PagedResponse'; | ||
import { StudentLesson } from '../models/StudentLesson'; | ||
import Http from './index'; | ||
|
||
export const getScheduleByLecturer = (lecturerId: string) => { | ||
export const getScheduleByLecturer = (lecturerId: string): Promise<PagedResponse<LecturerLesson[]>> => { | ||
return Http.get('/schedule/lecturer?lecturerId=' + lecturerId) | ||
.then(res => res.data); | ||
} | ||
|
||
export const getScheduleByGroup = (groupId: string) => { | ||
export const getScheduleByGroup = (groupId: string): Promise<PagedResponse<StudentLesson[]>> => { | ||
return Http.get('/schedule/lessons?groupId=' + groupId) | ||
.then(res => res.data); | ||
} | ||
|
||
export const getExamsByGroup = (groupName: string) => { | ||
export const getExamsByGroup = (groupName: string): Promise<PagedResponse<Exam[]>> => { | ||
return Http.get('/exams/group?groupId=' + groupName) | ||
.then(res => res.data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
import { MODES } from './modes'; | ||
import { ListOption } from '../../types/ListOption'; | ||
import { ScreenSize } from '../../types/ScreenSize'; | ||
|
||
export const DAY_OPTIONS = { | ||
[MODES.EXTRA_SMALL]: [ | ||
{label: 'ПН', value: '0-1'}, | ||
{label: 'ВТ', value: '1-2'}, | ||
{label: 'СР', value: '2-3'}, | ||
{label: 'ЧТ', value: '3-4'}, | ||
{label: 'ПТ', value: '4-5'}, | ||
{label: 'СБ', value: '5-6'}, | ||
export type DaysRange = `${number}-${number}`; | ||
|
||
export const DAY_OPTIONS: Partial<Record<ScreenSize, ListOption<DaysRange>[]>> = { | ||
[ScreenSize.ExtraSmall]: [ | ||
{label: 'ПН', value: '1-1'}, | ||
{label: 'ВТ', value: '2-2'}, | ||
{label: 'СР', value: '3-3'}, | ||
{label: 'ЧТ', value: '4-4'}, | ||
{label: 'ПТ', value: '5-5'}, | ||
{label: 'СБ', value: '6-6'}, | ||
], | ||
[ScreenSize.Small]: [ | ||
{label: 'ПН-ВТ', value: '1-2'}, | ||
{label: 'СР-ЧТ', value: '3-4'}, | ||
{label: 'ПТ-СБ', value: '5-6'}, | ||
], | ||
[MODES.SMALL]: [ | ||
{label: 'ПН-ВТ', value: '0-2'}, | ||
{label: 'СР-ЧТ', value: '2-4'}, | ||
{label: 'ПТ-СБ', value: '4-6'}, | ||
[ScreenSize.Medium]: [ | ||
{label: 'ПН-СР', value: '1-3'}, | ||
{label: 'ЧТ-СБ', value: '4-6'}, | ||
], | ||
[MODES.MEDIUM]: [ | ||
{label: 'ПН-СР', value: '0-3'}, | ||
{label: 'ЧТ-СБ', value: '3-6'}, | ||
] | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { ScreenSize } from '../../types/ScreenSize'; | ||
|
||
export const SCREEN_SIZES: Record<ScreenSize, string> = { | ||
[ScreenSize.Big]: '1441px', | ||
[ScreenSize.Medium]: '1440px', | ||
[ScreenSize.Small]: '988px', | ||
[ScreenSize.ExtraSmall]: '639px', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.