Skip to content

Commit

Permalink
fix: update score height (#2296)
Browse files Browse the repository at this point in the history
* fix: update score height

* fix: remove redundant code
  • Loading branch information
valerydluski authored Sep 10, 2023
1 parent f2d6abe commit 292c27e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/src/components/Sider/AdminSider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function AdminSider(props: Props) {
const adminMenuItems = getAdminMenuItems(session);
const courseManagementMenuItems = useMemo(
() => getCourseManagementMenuItems(session, props.activeCourse ?? activeCourse),
[activeCourse],
[activeCourse, props.activeCourse],
);

const menuIconProps = {
Expand Down
2 changes: 1 addition & 1 deletion client/src/modules/Score/components/ScoreTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export function ScoreTable(props: Props) {
<Table<ScoreStudentDto>
className="table-score"
showHeader
scroll={{ x: getTableWidth(getVisibleColumns(columns).length), y: 'calc(95vh - 290px)' }}
scroll={{ x: getTableWidth(getVisibleColumns(columns).length), y: 'calc(95vh - 320px)' }}
pagination={{ ...students.pagination, showTotal: total => `Total ${total} students` }}
rowKey="githubId"
rowClassName={record => (!record.isActive ? 'rs-table-row-disabled' : '')}
Expand Down
11 changes: 7 additions & 4 deletions client/src/pages/admin/mentor-registry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Alert, Button, Col, Form, message, notification, Row, Select, Tabs, Typ
import { DisciplineDto, DisciplinesApi, MentorRegistryDto } from 'api';

import { MentorRegistryService } from 'services/mentorRegistry';
import { CourseRole } from 'services/models';
import { Course, CourseRole } from 'services/models';
import { ModalForm } from 'components/Forms';
import { MentorRegistryResendModal } from 'modules/MentorRegistry/components/MentorRegistryResendModal';
import { MentorRegistryDeleteModal } from 'modules/MentorRegistry/components/MentorRegistryDeleteModal';
Expand All @@ -18,7 +18,8 @@ import { AdminPageLayout } from 'components/PageLayout';
import { tabRenderer } from 'components/TabsWithCounter/renderers';
import css from 'styled-jsx/css';
import { CommentModal } from 'components/CommentModal';
import { ActiveCourseProvider, SessionProvider, useActiveCourseContext } from 'modules/Course/contexts';
import { ActiveCourseProvider, SessionProvider } from 'modules/Course/contexts';
import { CoursesService } from 'services/courses';

type NotificationType = 'success' | 'info' | 'warning' | 'error';

Expand All @@ -35,14 +36,15 @@ type ModalData = Partial<{
}>;

const mentorRegistryService = new MentorRegistryService();
const coursesService = new CoursesService();
const disciplinesApi = new DisciplinesApi();

function Page() {
const { courses } = useActiveCourseContext();
const [loading, withLoading] = useLoading(false);

const [api, contextHolder] = notification.useNotification();

const [courses, setCourses] = useState<Course[]>([]);
const [modalLoading, setModalLoading] = useState(false);
const [showAll, setShowAll] = useState(false);
const [data, setData] = useState<MentorRegistryDto[]>([]);
Expand All @@ -61,9 +63,10 @@ function Page() {
};

const loadData = withLoading(async () => {
const allData = await mentorRegistryService.getMentors();
const [allData, courses] = await Promise.all([mentorRegistryService.getMentors(), coursesService.getCourses()]);
const { data: disciplines } = await disciplinesApi.getDisciplines();
setAllData(allData);
setCourses(courses);
updateData(showAll, allData);
setDisciplines(disciplines);
});
Expand Down

0 comments on commit 292c27e

Please sign in to comment.