Added schedule load to daily veiw with additional CSS fixes. BOD-319
This commit is contained in:
@@ -13,7 +13,7 @@ import Icon, {
|
|||||||
UnorderedListOutlined,
|
UnorderedListOutlined,
|
||||||
UserOutlined,
|
UserOutlined,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { Avatar, Layout, Menu } from "antd";
|
import { Avatar, Menu } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { BsKanban } from "react-icons/bs";
|
import { BsKanban } from "react-icons/bs";
|
||||||
@@ -29,16 +29,12 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { selectRecentItems } from "../../redux/application/application.selectors";
|
import { selectRecentItems } from "../../redux/application/application.selectors";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { signOutStart } from "../../redux/user/user.actions";
|
import { signOutStart } from "../../redux/user/user.actions";
|
||||||
import {
|
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
selectBodyshop,
|
|
||||||
selectCurrentUser,
|
|
||||||
} from "../../redux/user/user.selectors";
|
|
||||||
import GlobalSearch from "../global-search/global-search.component";
|
import GlobalSearch from "../global-search/global-search.component";
|
||||||
import "./header.styles.scss";
|
import "./header.styles.scss";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
bodyshop: selectBodyshop,
|
|
||||||
recentItems: selectRecentItems,
|
recentItems: selectRecentItems,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -53,7 +49,6 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function Header({
|
function Header({
|
||||||
bodyshop,
|
|
||||||
handleMenuClick,
|
handleMenuClick,
|
||||||
currentUser,
|
currentUser,
|
||||||
signOutStart,
|
signOutStart,
|
||||||
@@ -63,10 +58,8 @@ function Header({
|
|||||||
recentItems,
|
recentItems,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { Header } = Layout;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Header>
|
|
||||||
<Menu
|
<Menu
|
||||||
mode="horizontal"
|
mode="horizontal"
|
||||||
theme="dark"
|
theme="dark"
|
||||||
@@ -219,9 +212,7 @@ function Header({
|
|||||||
<Menu.Divider />
|
<Menu.Divider />
|
||||||
|
|
||||||
<Menu.Item key="timetickets">
|
<Menu.Item key="timetickets">
|
||||||
<Link to="/manage/timetickets">
|
<Link to="/manage/timetickets">{t("menus.header.timetickets")}</Link>
|
||||||
{t("menus.header.timetickets")}
|
|
||||||
</Link>
|
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
key="entertimetickets"
|
key="entertimetickets"
|
||||||
@@ -337,7 +328,6 @@ function Header({
|
|||||||
</Menu.SubMenu>
|
</Menu.SubMenu>
|
||||||
</Menu.SubMenu>
|
</Menu.SubMenu>
|
||||||
</Menu>
|
</Menu>
|
||||||
</Header>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,14 +100,17 @@ export function ScheduleCalendarHeaderComponent({
|
|||||||
</div>
|
</div>
|
||||||
</Popover>
|
</Popover>
|
||||||
) : null;
|
) : null;
|
||||||
|
console.log("loadData", loadData);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div className="imex-calendar-load">
|
||||||
<ScheduleBlockDay date={date} refetch={refetch}>
|
<ScheduleBlockDay date={date} refetch={refetch}>
|
||||||
<div>
|
<div>
|
||||||
{label}
|
{label}
|
||||||
{calculating ? <LoadingSkeleton /> : LoadComponent}
|
{calculating ? <LoadingSkeleton /> : LoadComponent}
|
||||||
</div>
|
</div>
|
||||||
</ScheduleBlockDay>
|
</ScheduleBlockDay>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
@import "react-big-calendar/lib/sass/styles";
|
@import "react-big-calendar/lib/sass/styles";
|
||||||
|
|
||||||
.rbc-time-view .rbc-row {
|
.rbc-time-header-cell-single-day {
|
||||||
box-sizing: unset !important;
|
display: unset;
|
||||||
min-height: unset !important;
|
}
|
||||||
|
.rbc-time-view .rbc-allday-cell {
|
||||||
|
height: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imex-event-arrived {
|
.imex-event-arrived {
|
||||||
@@ -20,3 +22,9 @@
|
|||||||
.rbc-event.rbc-selected {
|
.rbc-event.rbc-selected {
|
||||||
background-color: slategrey;
|
background-color: slategrey;
|
||||||
}
|
}
|
||||||
|
.imex-calendar-load {
|
||||||
|
max-width: 12rem;
|
||||||
|
position: relative;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,25 +1,11 @@
|
|||||||
import { SyncOutlined } from "@ant-design/icons";
|
import { SyncOutlined } from "@ant-design/icons";
|
||||||
import { Button } from "antd";
|
import { Button } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { connect } from "react-redux";
|
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
|
||||||
import ScheduleCalendarWrapperComponent from "../schedule-calendar-wrapper/scheduler-calendar-wrapper.component";
|
import ScheduleCalendarWrapperComponent from "../schedule-calendar-wrapper/scheduler-calendar-wrapper.component";
|
||||||
import ScheduleModal from "../schedule-job-modal/schedule-job-modal.container";
|
import ScheduleModal from "../schedule-job-modal/schedule-job-modal.container";
|
||||||
import ScheduleProductionList from "../schedule-production-list/schedule-production-list.component";
|
import ScheduleProductionList from "../schedule-production-list/schedule-production-list.component";
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
export default function ScheduleCalendarComponent({ data, refetch }) {
|
||||||
setScheduleContext: (context) =>
|
|
||||||
dispatch(setModalContext({ context: context, modal: "schedule" })),
|
|
||||||
});
|
|
||||||
|
|
||||||
export function ScheduleCalendarComponent({
|
|
||||||
data,
|
|
||||||
refetch,
|
|
||||||
setScheduleContext,
|
|
||||||
}) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="imex-flex-row">
|
<div className="imex-flex-row">
|
||||||
@@ -32,19 +18,6 @@ export function ScheduleCalendarComponent({
|
|||||||
<SyncOutlined />
|
<SyncOutlined />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button
|
|
||||||
className="imex-flex-row__margin"
|
|
||||||
onClick={() => {
|
|
||||||
setScheduleContext({
|
|
||||||
actions: { refetch: refetch },
|
|
||||||
context: {
|
|
||||||
jobId: null,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("appointments.actions.new")}
|
|
||||||
</Button>
|
|
||||||
<ScheduleProductionList />
|
<ScheduleProductionList />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -54,4 +27,3 @@ export function ScheduleCalendarComponent({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default connect(null, mapDispatchToProps)(ScheduleCalendarComponent);
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { Button, Checkbox, Col, Row } from "antd";
|
import { Button, Checkbox, Col, Row } from "antd";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import moment from "moment";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { auth } from "../../firebase/firebase.utils";
|
|
||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
|
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
|
||||||
import EmailInput from "../form-items-formatted/email-form-item.component";
|
import EmailInput from "../form-items-formatted/email-form-item.component";
|
||||||
import ScheduleDayViewContainer from "../schedule-day-view/schedule-day-view.container";
|
import ScheduleDayViewContainer from "../schedule-day-view/schedule-day-view.container";
|
||||||
import ScheduleExistingAppointmentsList from "../schedule-existing-appointments-list/schedule-existing-appointments-list.component";
|
import ScheduleExistingAppointmentsList from "../schedule-existing-appointments-list/schedule-existing-appointments-list.component";
|
||||||
import moment from "moment";
|
|
||||||
|
|
||||||
export default function ScheduleJobModalComponent({
|
export default function ScheduleJobModalComponent({
|
||||||
|
jobId,
|
||||||
existingAppointments,
|
existingAppointments,
|
||||||
appData,
|
appData,
|
||||||
setAppData,
|
setAppData,
|
||||||
@@ -20,15 +20,9 @@ export default function ScheduleJobModalComponent({
|
|||||||
const handleAuto = async () => {
|
const handleAuto = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const response = await axios.post(
|
const response = await axios.post("/scheduling/job", {
|
||||||
"/scheduling/job",
|
jobId: "661dd1d5-bf06-426f-8bd2-bd9e41de8eb1",
|
||||||
{ jobId: "661dd1d5-bf06-426f-8bd2-bd9e41de8eb1" },
|
});
|
||||||
{
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
setAppData({ ...appData, smartDates: response.data });
|
setAppData({ ...appData, smartDates: response.data });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("error", error, error.message);
|
console.log("error", error, error.message);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
toggleModalVisible: () => dispatch(toggleModalVisible("schedule")),
|
toggleModalVisible: () => dispatch(toggleModalVisible("schedule")),
|
||||||
setEmailOptions: (e) => dispatch(setEmailOptions(e)),
|
setEmailOptions: (e) => dispatch(setEmailOptions(e)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export function ScheduleJobModalContainer({
|
export function ScheduleJobModalContainer({
|
||||||
scheduleModal,
|
scheduleModal,
|
||||||
bodyshop,
|
bodyshop,
|
||||||
@@ -163,6 +164,7 @@ export function ScheduleJobModalContainer({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ScheduleJobModalComponent
|
<ScheduleJobModalComponent
|
||||||
|
jobId={jobId}
|
||||||
existingAppointments={existingAppointments}
|
existingAppointments={existingAppointments}
|
||||||
appData={appData}
|
appData={appData}
|
||||||
setAppData={setAppData}
|
setAppData={setAppData}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Button, Card, Popover } from "antd";
|
import { DownOutlined } from "@ant-design/icons";
|
||||||
|
import { Card, Popover } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useLazyQuery } from "react-apollo";
|
import { useLazyQuery } from "react-apollo";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -59,9 +60,10 @@ export default function ScheduleProductionList() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover content={content} trigger="click" placement="bottomRight">
|
<Popover content={content} trigger="click" placement="bottomRight">
|
||||||
<Button onClick={() => callQuery()}>
|
<a href=" #" onClick={() => callQuery()}>
|
||||||
{t("appointments.labels.inproduction")}
|
{t("appointments.labels.inproduction")}
|
||||||
</Button>
|
<DownOutlined />
|
||||||
|
</a>
|
||||||
</Popover>
|
</Popover>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ const TimeTicketsAll = lazy(() =>
|
|||||||
import("../time-tickets/time-tickets.container")
|
import("../time-tickets/time-tickets.container")
|
||||||
);
|
);
|
||||||
|
|
||||||
const { Content } = Layout;
|
const { Content, Header } = Layout;
|
||||||
|
|
||||||
const stripePromise = new Promise((resolve, reject) => {
|
const stripePromise = new Promise((resolve, reject) => {
|
||||||
client.query({ query: QUERY_STRIPE_ID }).then((resp) => {
|
client.query({ query: QUERY_STRIPE_ID }).then((resp) => {
|
||||||
@@ -152,8 +152,9 @@ export function Manage({ match, conflict }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout className="layout-container">
|
<Layout className="layout-container">
|
||||||
|
<Header>
|
||||||
<HeaderContainer />
|
<HeaderContainer />
|
||||||
|
</Header>
|
||||||
<Content className="content-container">
|
<Content className="content-container">
|
||||||
<FcmNotification />
|
<FcmNotification />
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
|
|||||||
Reference in New Issue
Block a user