From 2f73510ee836cb475470c1089a26238872627ed1 Mon Sep 17 00:00:00 2001 From: BenjaVR Date: Sun, 17 Feb 2019 19:53:11 +0100 Subject: [PATCH] List with departments + color on plannings page --- .../planning/PlanningsPage.module.scss | 8 ++++ src/components/planning/PlanningsPage.tsx | 45 +++++++++++++++++-- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/src/components/planning/PlanningsPage.module.scss b/src/components/planning/PlanningsPage.module.scss index 26d75bb..9533ccb 100644 --- a/src/components/planning/PlanningsPage.module.scss +++ b/src/components/planning/PlanningsPage.module.scss @@ -58,3 +58,11 @@ .headerForUndefined { font-style: italic; } + +.unplannedStudentsList { + margin-bottom: 8px !important; +} + +.departmentNameColumn { + display: flex; +} diff --git a/src/components/planning/PlanningsPage.tsx b/src/components/planning/PlanningsPage.tsx index eb60ee5..0a77bf5 100644 --- a/src/components/planning/PlanningsPage.tsx +++ b/src/components/planning/PlanningsPage.tsx @@ -1,4 +1,4 @@ -import { Button, Calendar, Col, List, notification, Popover, Row, Spin, Tag, Tooltip } from "antd"; +import { Button, Calendar, Card, Col, List, notification, Popover, Row, Spin, Tag, Tooltip } from "antd"; import classNames from "classnames"; import moment from "moment"; import React from "react"; @@ -66,10 +66,14 @@ class PlanningsPage extends React.Component { return; }; + this.unsubscribeFromPlannedStudents = () => { + return; + }; this.renderStudentListHeader = this.renderStudentListHeader.bind(this); this.renderStudentListItem = this.renderStudentListItem.bind(this); + this.renderDepartmentsHeader = this.renderDepartmentsHeader.bind(this); + this.renderDepartmentsListItem = this.renderDepartmentsListItem.bind(this); this.renderDateCell = this.renderDateCell.bind(this); this.renderDepartmentPopoverContent = this.renderDepartmentPopoverContent.bind(this); this.handlePlanningsDetailClose = this.handlePlanningsDetailClose.bind(this); @@ -119,6 +123,7 @@ class PlanningsPage extends React.Component + + +

Afdelingen

+ + + ); + } + + private renderDepartmentsListItem(department: Department): React.ReactNode { + return ( + + + + + {department.name} + + + ({department.totalCapacity} totale capaciteit) + + + + ); + } + private renderDateCell(date: moment.Moment): React.ReactNode { const plannedStudentsToday = studentsPlannedInDay(this.state.plannedStudents, date); const departmentsRows = this.state.departments.map((department) => { @@ -212,7 +251,7 @@ class PlanningsPage extends React.Component {departmentsRows} - + ); }