|
@@ -1,7 +1,7 @@
|
|
|
import React, { Component } from "react";
|
|
import React, { Component } from "react";
|
|
|
import ContentWrapper from "@/components/Layout/ContentWrapper";
|
|
import ContentWrapper from "@/components/Layout/ContentWrapper";
|
|
|
-import { Card, CardBody, CardHeader, CardTitle, Button, Row, Col } from "reactstrap";
|
|
|
|
|
-import { getPelaporan, addStatus, removeLaporan, activeLaporan, changeRoleData } from "@/actions/pelaporan";
|
|
|
|
|
|
|
+import { Card, CardBody, CardHeader, CardTitle, Button, Row, Col, FormGroup, Input } from "reactstrap";
|
|
|
|
|
+import { getPelaporan, getOneLaporan, updateLaporan } from "@/actions/pelaporan";
|
|
|
import { updateJadwal } from "@/actions/penjadwalan";
|
|
import { updateJadwal } from "@/actions/penjadwalan";
|
|
|
import DetailLaporan from "@/components/Main/DetailLaporan";
|
|
import DetailLaporan from "@/components/Main/DetailLaporan";
|
|
|
import Link from "next/link";
|
|
import Link from "next/link";
|
|
@@ -11,13 +11,15 @@ import timeGridPlugin from "@fullcalendar/timegrid";
|
|
|
import interactionPlugin, { Draggable } from "@fullcalendar/interaction";
|
|
import interactionPlugin, { Draggable } from "@fullcalendar/interaction";
|
|
|
import listPlugin from "@fullcalendar/list";
|
|
import listPlugin from "@fullcalendar/list";
|
|
|
import bootstrapPlugin from "@fullcalendar/bootstrap";
|
|
import bootstrapPlugin from "@fullcalendar/bootstrap";
|
|
|
-import events from "./calendar.events";
|
|
|
|
|
import Select from "react-select";
|
|
import Select from "react-select";
|
|
|
import moment from "moment";
|
|
import moment from "moment";
|
|
|
import { connect } from "react-redux";
|
|
import { connect } from "react-redux";
|
|
|
import Loader from "@/components/Common/Loader";
|
|
import Loader from "@/components/Common/Loader";
|
|
|
import Router from "next/router";
|
|
import Router from "next/router";
|
|
|
import { ToastContainer, toast } from "react-toastify";
|
|
import { ToastContainer, toast } from "react-toastify";
|
|
|
|
|
+import { Formik, Form, Field, ErrorMessage } from "formik";
|
|
|
|
|
+import * as Yup from "yup";
|
|
|
|
|
+import Datetime from "react-datetime";
|
|
|
|
|
|
|
|
const status = [
|
|
const status = [
|
|
|
{ value: "Ditindaklanjuti DIKTI", label: "Ditindaklanjuti DIKTI", className: "State-ACT" },
|
|
{ value: "Ditindaklanjuti DIKTI", label: "Ditindaklanjuti DIKTI", className: "State-ACT" },
|
|
@@ -30,9 +32,13 @@ const statusLLDIKTI = [
|
|
|
{ value: "Delegasi ke DIKTI", label: "Delegasi ke DIKTI", className: "State-ACT" },
|
|
{ value: "Delegasi ke DIKTI", label: "Delegasi ke DIKTI", className: "State-ACT" },
|
|
|
{ value: "Ditutup", label: "Ditutup", className: "State-ACT" },
|
|
{ value: "Ditutup", label: "Ditutup", className: "State-ACT" },
|
|
|
];
|
|
];
|
|
|
-class Calendar extends Component {
|
|
|
|
|
- calendarEvents = events;
|
|
|
|
|
|
|
|
|
|
|
|
+const jadwalSchema = Yup.object().shape({
|
|
|
|
|
+ judul: Yup.string().required("Required"),
|
|
|
|
|
+ dari_tanggal: Yup.date().required("Required"),
|
|
|
|
|
+ sampai_tanggal: Yup.date().required("Required"),
|
|
|
|
|
+});
|
|
|
|
|
+class Calendar extends Component {
|
|
|
calendarPlugins = [interactionPlugin, dayGridPlugin, timeGridPlugin, listPlugin, bootstrapPlugin];
|
|
calendarPlugins = [interactionPlugin, dayGridPlugin, timeGridPlugin, listPlugin, bootstrapPlugin];
|
|
|
|
|
|
|
|
calendarHeader = {
|
|
calendarHeader = {
|
|
@@ -52,55 +58,44 @@ class Calendar extends Component {
|
|
|
dataEvent: [],
|
|
dataEvent: [],
|
|
|
laporan: {},
|
|
laporan: {},
|
|
|
selectedOption: null,
|
|
selectedOption: null,
|
|
|
|
|
+ color: "",
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static getInitialProps = ({ query }) => ({ query });
|
|
static getInitialProps = ({ query }) => ({ query });
|
|
|
|
|
|
|
|
async componentDidMount() {
|
|
async componentDidMount() {
|
|
|
- /* initialize the external events */
|
|
|
|
|
- new Draggable(this.refs.externalEventsList, {
|
|
|
|
|
- itemSelector: ".fce-event",
|
|
|
|
|
- eventData: function (eventEl) {
|
|
|
|
|
- return {
|
|
|
|
|
- title: eventEl.innerText.trim(),
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- const { organisasi, peran } = this.props.user.peran[0];
|
|
|
|
|
-
|
|
|
|
|
- const queryDataLaporan = { role: peran.id === 2021 ? "lldikti" : "dikti", penjadwalan: true, active: true };
|
|
|
|
|
- if (peran.id === 2021) queryDataLaporan.orgId = organisasi.id;
|
|
|
|
|
- const dataLaporan = await getPelaporan(queryDataLaporan);
|
|
|
|
|
-
|
|
|
|
|
- const laporan = await getPelaporan({ number: this.props.query.number, ptId: this.props.query.ptId });
|
|
|
|
|
|
|
+ const { token, query } = this.props;
|
|
|
|
|
+ const laporan = await getOneLaporan(token, query.id);
|
|
|
|
|
+ const dataLaporan = await getPelaporan(token, { jadwal: true });
|
|
|
|
|
|
|
|
this.setState({ dataLaporan });
|
|
this.setState({ dataLaporan });
|
|
|
this.getDataEvent();
|
|
this.getDataEvent();
|
|
|
- await this.defaultStatus(laporan.data[0]);
|
|
|
|
|
- // const cek = this.state.dataLaporan.data.filter((e) => e._number === this.props.query.number && e.pt_id == this.props.query.ptId)[0];
|
|
|
|
|
|
|
+ this.defaultStatus();
|
|
|
this.setState({ laporan });
|
|
this.setState({ laporan });
|
|
|
|
|
+
|
|
|
let color = "#" + Math.floor(Math.random() * 16777215).toString(16);
|
|
let color = "#" + Math.floor(Math.random() * 16777215).toString(16);
|
|
|
- if (laporan.data[0].penjadwalan) {
|
|
|
|
|
- color = laporan.data[0].penjadwalan.background_color;
|
|
|
|
|
|
|
+ if (laporan.data.jadwal) {
|
|
|
|
|
+ color = laporan.data.jadwal.warna;
|
|
|
}
|
|
}
|
|
|
- this.setState({ externalEvents: [{ id: this.props.query.number, color, name: `Jadwal Pemeriksaan - No.Laporan : ${this.props.query.number} - ${laporan.data[0].pt.nama}`, allDay: true }] });
|
|
|
|
|
|
|
+ this.setState({ color });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- getStatus = () => (this.props.user.peran[0].peran.id === 2021 ? statusLLDIKTI : status);
|
|
|
|
|
|
|
+ componentShouldUpdate(nextProps, nextState) {
|
|
|
|
|
+ return nextState.dataLaporan !== this.state.dataLaporan;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ getStatus = () => (this.props.user.role.id === 2021 ? statusLLDIKTI : status);
|
|
|
|
|
|
|
|
getDataEvent = () => {
|
|
getDataEvent = () => {
|
|
|
- const dataEvent = this.state.dataLaporan.data
|
|
|
|
|
- .filter((e) => e.penjadwalan)
|
|
|
|
|
- .map((e) => ({
|
|
|
|
|
- id: e._id,
|
|
|
|
|
- title: e.penjadwalan.title,
|
|
|
|
|
- start: new Date(e.penjadwalan.from_date),
|
|
|
|
|
- end: new Date(e.penjadwalan.to_date),
|
|
|
|
|
- backgroundColor: e.penjadwalan.background_color, //red
|
|
|
|
|
- borderColor: e.penjadwalan.background_color,
|
|
|
|
|
- }));
|
|
|
|
|
|
|
+ const dataEvent = this.state.dataLaporan.data.map((e) => ({
|
|
|
|
|
+ id: e._id,
|
|
|
|
|
+ title: e.jadwal.judul,
|
|
|
|
|
+ start: new Date(e.jadwal.dari_tanggal),
|
|
|
|
|
+ end: new Date(e.jadwal.sampai_tanggal),
|
|
|
|
|
+ backgroundColor: e.jadwal.warna,
|
|
|
|
|
+ borderColor: e.jadwal.warna,
|
|
|
|
|
+ }));
|
|
|
this.setState({ dataEvent });
|
|
this.setState({ dataEvent });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -113,10 +108,6 @@ class Calendar extends Component {
|
|
|
this.setState({ selectedEvent: data });
|
|
this.setState({ selectedEvent: data });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- addEvent(event) {
|
|
|
|
|
- this.calendarEvents.push(event);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
handleEventReceive = (info) => {
|
|
handleEventReceive = (info) => {
|
|
|
var styles = getComputedStyle(info.draggedEl);
|
|
var styles = getComputedStyle(info.draggedEl);
|
|
|
info.event.setProp("backgroundColor", styles.backgroundColor);
|
|
info.event.setProp("backgroundColor", styles.backgroundColor);
|
|
@@ -124,55 +115,55 @@ class Calendar extends Component {
|
|
|
this.handleEventCalendar(info);
|
|
this.handleEventCalendar(info);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- handleEventCalendar = ({ event }) => {
|
|
|
|
|
- const number = this.props.query.number;
|
|
|
|
|
- const ptId = this.props.query.ptId;
|
|
|
|
|
- const data = {
|
|
|
|
|
- title: event.title,
|
|
|
|
|
- from_date: event.start,
|
|
|
|
|
- to_date: event.end || event.start,
|
|
|
|
|
- background_color: event.backgroundColor,
|
|
|
|
|
- };
|
|
|
|
|
- toast.promise(updateJadwal({ number, ptId }, data), {
|
|
|
|
|
- pending: "Loading",
|
|
|
|
|
- success: "Success",
|
|
|
|
|
- error: "Error",
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ handleEventCalendar = async (data) => {
|
|
|
|
|
+ const { query, token } = this.props;
|
|
|
|
|
+ const { id } = query;
|
|
|
|
|
+ const { color, laporan } = this.state;
|
|
|
|
|
+
|
|
|
|
|
+ await toast.promise(
|
|
|
|
|
+ updateJadwal(token, id, {
|
|
|
|
|
+ judul: "No.Laporan " + laporan.data.no_laporan + " - " + data.judul,
|
|
|
|
|
+ dari_tanggal: data.dari_tanggal,
|
|
|
|
|
+ sampai_tanggal: data.sampai_tanggal,
|
|
|
|
|
+ warna: color,
|
|
|
|
|
+ }),
|
|
|
|
|
+ {
|
|
|
|
|
+ pending: "Loading",
|
|
|
|
|
+ success: "Success",
|
|
|
|
|
+ error: "Error",
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ const dataLaporan = await getPelaporan(token, { jadwal: true });
|
|
|
|
|
+ this.setState({ dataLaporan });
|
|
|
|
|
+ this.getDataEvent();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- defaultStatus = async (data) => {
|
|
|
|
|
- const { ptId, number } = this.props.query;
|
|
|
|
|
|
|
+ defaultStatus = async () => {
|
|
|
const status = this.getStatus();
|
|
const status = this.getStatus();
|
|
|
- if (!data.status) {
|
|
|
|
|
- await addStatus({ number, ptId }, { status: status[0].value });
|
|
|
|
|
- return this.setState({ selectedOption: status[0] });
|
|
|
|
|
- }
|
|
|
|
|
- return this.setState({ selectedOption: status.filter((e) => e.value === data.status)[0] });
|
|
|
|
|
|
|
+ return this.setState({ selectedOption: status[0] });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
handleChangeSelect = (selectedOption) => this.setState({ selectedOption });
|
|
handleChangeSelect = (selectedOption) => this.setState({ selectedOption });
|
|
|
|
|
|
|
|
handleSimpan = async (e) => {
|
|
handleSimpan = async (e) => {
|
|
|
- const { selectedOption } = this.state;
|
|
|
|
|
- const { ptId, number } = this.props.query;
|
|
|
|
|
- this.setState({ selectedOption });
|
|
|
|
|
- const id = toast.loading("Please wait...");
|
|
|
|
|
- if (selectedOption.value === this.getStatus()[1].value) {
|
|
|
|
|
- const roleId = this.props.user.peran[0].peran.id;
|
|
|
|
|
- await changeRoleData({ number, ptId }, { role_data: roleId === 2021 ? "dikti" : "lldikti" });
|
|
|
|
|
- const statusData = roleId === 2021 ? status : statusLLDIKTI;
|
|
|
|
|
- await addStatus({ number, ptId }, { status: statusData[0].value });
|
|
|
|
|
- toast.update(id, { render: "All is good", type: "success", isLoading: false });
|
|
|
|
|
|
|
+ const toastid = toast.loading("Please wait...");
|
|
|
|
|
+ try {
|
|
|
|
|
+ const { selectedOption } = this.state;
|
|
|
|
|
+ const { token, query } = this.props;
|
|
|
|
|
+ const { id } = query;
|
|
|
|
|
+ this.setState({ selectedOption });
|
|
|
|
|
+ if (selectedOption.value === this.getStatus()[1].value) {
|
|
|
|
|
+ await updateLaporan(token, id, { change_role: "true" });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (selectedOption.value === this.getStatus()[2].value) {
|
|
|
|
|
+ await updateLaporan(token, id, { aktif: "false" });
|
|
|
|
|
+ }
|
|
|
Router.push("/app/penjadwalan");
|
|
Router.push("/app/penjadwalan");
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (selectedOption.value === this.getStatus()[2].value) {
|
|
|
|
|
- await removeLaporan({ number, ptId });
|
|
|
|
|
- } else if (!this.state.laporan.data[0].active) {
|
|
|
|
|
- await activeLaporan({ number, ptId });
|
|
|
|
|
|
|
+
|
|
|
|
|
+ toast.update(toastid, { render: "All is good", type: "success", isLoading: false, autoClose: true, closeButton: true });
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ toast.update(toastid, { render: "All is not good", type: "error", isLoading: false, autoClose: true, closeButton: true });
|
|
|
}
|
|
}
|
|
|
- await addStatus({ number, ptId }, { status: selectedOption.value });
|
|
|
|
|
- toast.update(id, { render: "All is good", type: "success", isLoading: false, autoClose: true, closeButton: true });
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
@@ -193,7 +184,7 @@ class Calendar extends Component {
|
|
|
<Col>
|
|
<Col>
|
|
|
<Card className="card-default">
|
|
<Card className="card-default">
|
|
|
<CardBody>
|
|
<CardBody>
|
|
|
- <DetailLaporan noStatus query={this.props.query} data={laporan.data[0]} handleChangeSelect={this.handleChangeSelect} />
|
|
|
|
|
|
|
+ <DetailLaporan noStatus data={laporan.data} />
|
|
|
</CardBody>
|
|
</CardBody>
|
|
|
</Card>
|
|
</Card>
|
|
|
</Col>
|
|
</Col>
|
|
@@ -215,7 +206,7 @@ class Calendar extends Component {
|
|
|
</CardHeader>
|
|
</CardHeader>
|
|
|
<CardBody>
|
|
<CardBody>
|
|
|
<Select value={selectedOption} onChange={this.handleChangeSelect} options={this.getStatus()} required />
|
|
<Select value={selectedOption} onChange={this.handleChangeSelect} options={this.getStatus()} required />
|
|
|
- <Button onClick={this.handleSimpan} className="mt-2" color="primary" block>
|
|
|
|
|
|
|
+ <Button onClick={this.handleSimpan} className="mt-2" color="primary" block disabled={laporan.data?.evaluasi.length}>
|
|
|
Simpan
|
|
Simpan
|
|
|
</Button>
|
|
</Button>
|
|
|
</CardBody>
|
|
</CardBody>
|
|
@@ -226,50 +217,78 @@ class Calendar extends Component {
|
|
|
<>
|
|
<>
|
|
|
<Card className="card-default" title="">
|
|
<Card className="card-default" title="">
|
|
|
<CardHeader>
|
|
<CardHeader>
|
|
|
- <CardTitle tag="h4">Daftar Pemeriksaan</CardTitle>
|
|
|
|
|
|
|
+ <CardTitle tag="h4">Input Jadwal</CardTitle>
|
|
|
</CardHeader>
|
|
</CardHeader>
|
|
|
<CardBody>
|
|
<CardBody>
|
|
|
- <div className="external-events" ref="externalEventsList">
|
|
|
|
|
- {externalEvents.map((ev) => (
|
|
|
|
|
- <div
|
|
|
|
|
- className="fce-event"
|
|
|
|
|
- style={{
|
|
|
|
|
- backgroundColor: ev.color,
|
|
|
|
|
- }}
|
|
|
|
|
- key={ev.name + ev.color}
|
|
|
|
|
- data-id={ev.id}
|
|
|
|
|
- >
|
|
|
|
|
- {ev.name}
|
|
|
|
|
- </div>
|
|
|
|
|
- ))}
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <Formik
|
|
|
|
|
+ enableReinitialize={true}
|
|
|
|
|
+ initialValues={{
|
|
|
|
|
+ judul: laporan.data?.jadwal?.judul ? laporan.data.jadwal.judul.split("- ")[1] : "",
|
|
|
|
|
+ dari_tanggal: laporan.data?.jadwal?.dari_tanggal ? moment(laporan.data.jadwal.dari_tanggal) : "",
|
|
|
|
|
+ sampai_tanggal: laporan.data?.jadwal?.sampai_tanggal ? moment(laporan.data.jadwal.sampai_tanggal) : "",
|
|
|
|
|
+ }}
|
|
|
|
|
+ validationSchema={jadwalSchema}
|
|
|
|
|
+ onSubmit={this.handleEventCalendar}
|
|
|
|
|
+ >
|
|
|
|
|
+ {() => (
|
|
|
|
|
+ <Form>
|
|
|
|
|
+ <FormGroup>
|
|
|
|
|
+ <label className="col-form-label">Warna</label>
|
|
|
|
|
+ <div className="badge d-block" style={{ backgroundColor: this.state.color, color: "white" }}>
|
|
|
|
|
+ {this.state.color}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </FormGroup>
|
|
|
|
|
+
|
|
|
|
|
+ <FormGroup>
|
|
|
|
|
+ <label className="col-form-label">Judul</label>
|
|
|
|
|
+ <Field name="judul">{({ field, form }) => <Input type="text" placeholder="judul" {...field} />}</Field>
|
|
|
|
|
+ <ErrorMessage name="judul" component="div" className="form-text text-danger" />
|
|
|
|
|
+ </FormGroup>
|
|
|
|
|
+ <FormGroup>
|
|
|
|
|
+ <label className="col-form-label">Dari Tanggal</label>
|
|
|
|
|
+ <Field name="dari_tanggal">
|
|
|
|
|
+ {({ field, form }) => (
|
|
|
|
|
+ <Datetime
|
|
|
|
|
+ timeFormat={false}
|
|
|
|
|
+ inputProps={{ className: "form-control" }}
|
|
|
|
|
+ value={field.value}
|
|
|
|
|
+ onChange={(e) => {
|
|
|
|
|
+ form.setFieldValue(field.name, e);
|
|
|
|
|
+ }}
|
|
|
|
|
+ />
|
|
|
|
|
+ )}
|
|
|
|
|
+ </Field>
|
|
|
|
|
+ <ErrorMessage name="dari_tanggal" component="div" className="form-text text-danger" />
|
|
|
|
|
+ </FormGroup>
|
|
|
|
|
+ <FormGroup>
|
|
|
|
|
+ <label className="col-form-label">Sampai Tanggal</label>
|
|
|
|
|
+ <Field name="sampai_tanggal">
|
|
|
|
|
+ {({ field, form }) => (
|
|
|
|
|
+ <Datetime
|
|
|
|
|
+ timeFormat={false}
|
|
|
|
|
+ inputProps={{ className: "form-control" }}
|
|
|
|
|
+ value={field.value}
|
|
|
|
|
+ onChange={(e) => {
|
|
|
|
|
+ form.setFieldValue(field.name, e);
|
|
|
|
|
+ }}
|
|
|
|
|
+ />
|
|
|
|
|
+ )}
|
|
|
|
|
+ </Field>
|
|
|
|
|
+ <ErrorMessage name="sampai_tanggal" component="div" className="form-text text-danger" />
|
|
|
|
|
+ </FormGroup>
|
|
|
|
|
+
|
|
|
|
|
+ <FormGroup row>
|
|
|
|
|
+ <div className="col-xl-12">
|
|
|
|
|
+ <Button color="primary" block type="submit" disabled={laporan.data?.evaluasi.length}>
|
|
|
|
|
+ Simpan Jadwal
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </FormGroup>
|
|
|
|
|
+ </Form>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </Formik>
|
|
|
</CardBody>
|
|
</CardBody>
|
|
|
</Card>
|
|
</Card>
|
|
|
- {laporan.data && laporan.data[0].penjadwalan && (
|
|
|
|
|
- <Card className="card-default">
|
|
|
|
|
- <CardHeader>
|
|
|
|
|
- <CardTitle tag="h4">Jadwal Pemeriksaan</CardTitle>
|
|
|
|
|
- </CardHeader>
|
|
|
|
|
- <CardBody>
|
|
|
|
|
- <table className="table">
|
|
|
|
|
- <tbody>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <td>Judul</td>
|
|
|
|
|
- <td>{laporan.data[0].penjadwalan.title}</td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <td>Waktu</td>
|
|
|
|
|
- <td>{`${moment(laporan.data[0].penjadwalan.from_date).format("DD MMMM YYYY")} ${
|
|
|
|
|
- moment(laporan.data[0].penjadwalan.from_date).format("DD MMMM YYYY") === moment(laporan.data[0].penjadwalan.to_date).format("DD MMMM YYYY")
|
|
|
|
|
- ? ""
|
|
|
|
|
- : `- ${moment(laporan.data[0].penjadwalan.to_date).add(-1, "d").format("DD MMMM YYYY")}`
|
|
|
|
|
- }`}</td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </tbody>
|
|
|
|
|
- </table>
|
|
|
|
|
- </CardBody>
|
|
|
|
|
- </Card>
|
|
|
|
|
- )}
|
|
|
|
|
</>
|
|
</>
|
|
|
)}
|
|
)}
|
|
|
<div className="mb-3">
|
|
<div className="mb-3">
|
|
@@ -298,13 +317,8 @@ class Calendar extends Component {
|
|
|
events={this.state.dataEvent}
|
|
events={this.state.dataEvent}
|
|
|
themeSystem={"bootstrap"}
|
|
themeSystem={"bootstrap"}
|
|
|
header={this.calendarHeader}
|
|
header={this.calendarHeader}
|
|
|
- editable={true}
|
|
|
|
|
- droppable={true}
|
|
|
|
|
deepChangeDetection={true}
|
|
deepChangeDetection={true}
|
|
|
eventClick={this.eventClick}
|
|
eventClick={this.eventClick}
|
|
|
- eventReceive={this.handleEventReceive}
|
|
|
|
|
- eventDrop={this.handleEventCalendar}
|
|
|
|
|
- eventResize={this.handleEventCalendar}
|
|
|
|
|
></FullCalendar>
|
|
></FullCalendar>
|
|
|
</CardBody>
|
|
</CardBody>
|
|
|
</Card>
|
|
</Card>
|
|
@@ -316,5 +330,5 @@ class Calendar extends Component {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const mapStateToProps = (state) => ({ user: state.user });
|
|
|
|
|
|
|
+const mapStateToProps = (state) => ({ user: state.user, token: state.token });
|
|
|
export default connect(mapStateToProps)(Calendar);
|
|
export default connect(mapStateToProps)(Calendar);
|