From a605a40f12beeda8eb381749508152690c9b6444 Mon Sep 17 00:00:00 2001 From: BenjaVR Date: Tue, 26 Feb 2019 19:09:59 +0100 Subject: [PATCH] Delete/edit internships from the planning page --- .../planning/PlanningDetailsModal.module.scss | 18 ++++-- .../planning/PlanningDetailsModal.tsx | 46 ++++++++++--- .../planning/PlanningsFormModal.tsx | 11 +++- src/components/planning/PlanningsPage.tsx | 64 +++++++++++++++++++ .../repositories/StudentsRepository.ts | 15 +++++ 5 files changed, 138 insertions(+), 16 deletions(-) diff --git a/src/components/planning/PlanningDetailsModal.module.scss b/src/components/planning/PlanningDetailsModal.module.scss index a5f217d..c80ddde 100644 --- a/src/components/planning/PlanningDetailsModal.module.scss +++ b/src/components/planning/PlanningDetailsModal.module.scss @@ -1,3 +1,5 @@ +@import "../../variables.scss"; + .title { font-weight: 400; @@ -18,14 +20,20 @@ margin: 2px !important; } -.studentName { - font-weight: bold; +.studentCol { + @media screen and (max-width: $breakpoint_sm) { + text-align: center; + } } -.studentDateRangeCol { - text-align: right; +.studentName { + font-weight: bold; } .internshipDays { font-style: italic; -} \ No newline at end of file +} + +.actionButton { + margin: 0 4px; +} diff --git a/src/components/planning/PlanningDetailsModal.tsx b/src/components/planning/PlanningDetailsModal.tsx index 8ff1a4d..6997df3 100644 --- a/src/components/planning/PlanningDetailsModal.tsx +++ b/src/components/planning/PlanningDetailsModal.tsx @@ -1,4 +1,4 @@ -import { Card, Col, Modal, Row } from "antd"; +import { Button, Card, Col, Modal, Popconfirm, Row, Tooltip } from "antd"; import moment from "moment"; import React from "react"; import { studentsPlannedInDay } from "../../helpers/filters"; @@ -16,6 +16,8 @@ interface IPlanningDetailsModalProps { selectedDate: moment.Moment | undefined; isVisible: boolean; onCloseRequested: () => void; + handleEditInternship: (student: Student) => void; + handleDeleteInternship: (student: Student) => void; } interface IPlanningDetailsModalState { @@ -111,19 +113,19 @@ class PlanningDetailsModal extends React.Component this.props.handleDeleteInternship(student); + const editFunc = () => this.props.handleEditInternship(student); return ( - - - {student.fullName} -   + + {student.fullName} +   {education !== undefined && - ({education.name}) - } - + ({education.name}) + } - + {student.internship !== undefined && {student.internship.startDate.format("DD/MM/YY")} - {student.internship.endDate.format("DD/MM/YY")} @@ -132,6 +134,32 @@ class PlanningDetailsModal extends React.Component } + + +