IO-2431 Created By for Appointments
This commit is contained in:
@@ -16,13 +16,17 @@ import { QUERY_LBR_HRS_BY_PK, UPDATE_JOBS } from "../../graphql/jobs.queries";
|
|||||||
import { setEmailOptions } from "../../redux/email/email.actions";
|
import { setEmailOptions } from "../../redux/email/email.actions";
|
||||||
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
||||||
import { selectSchedule } from "../../redux/modals/modals.selectors";
|
import { selectSchedule } from "../../redux/modals/modals.selectors";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import {
|
||||||
|
selectBodyshop,
|
||||||
|
selectCurrentUser,
|
||||||
|
} from "../../redux/user/user.selectors";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
import ScheduleJobModalComponent from "./schedule-job-modal.component";
|
import ScheduleJobModalComponent from "./schedule-job-modal.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
scheduleModal: selectSchedule,
|
scheduleModal: selectSchedule,
|
||||||
|
currentUser: selectCurrentUser,
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
toggleModalVisible: () => dispatch(toggleModalVisible("schedule")),
|
toggleModalVisible: () => dispatch(toggleModalVisible("schedule")),
|
||||||
@@ -34,6 +38,7 @@ export function ScheduleJobModalContainer({
|
|||||||
bodyshop,
|
bodyshop,
|
||||||
toggleModalVisible,
|
toggleModalVisible,
|
||||||
setEmailOptions,
|
setEmailOptions,
|
||||||
|
currentUser,
|
||||||
}) {
|
}) {
|
||||||
const { visible, context, actions } = scheduleModal;
|
const { visible, context, actions } = scheduleModal;
|
||||||
const { jobId, job, previousEvent } = context;
|
const { jobId, job, previousEvent } = context;
|
||||||
@@ -122,6 +127,7 @@ export function ScheduleJobModalContainer({
|
|||||||
end: moment(values.start).add(bodyshop.appt_length || 60, "minutes"),
|
end: moment(values.start).add(bodyshop.appt_length || 60, "minutes"),
|
||||||
color: values.color,
|
color: values.color,
|
||||||
note: values.note,
|
note: values.note,
|
||||||
|
created_by: currentUser.email,
|
||||||
},
|
},
|
||||||
jobId: jobId,
|
jobId: jobId,
|
||||||
altTransport: values.alt_transport,
|
altTransport: values.alt_transport,
|
||||||
|
|||||||
@@ -110,6 +110,7 @@
|
|||||||
- canceled
|
- canceled
|
||||||
- color
|
- color
|
||||||
- created_at
|
- created_at
|
||||||
|
- created_by
|
||||||
- end
|
- end
|
||||||
- id
|
- id
|
||||||
- isintake
|
- isintake
|
||||||
@@ -128,6 +129,7 @@
|
|||||||
- canceled
|
- canceled
|
||||||
- color
|
- color
|
||||||
- created_at
|
- created_at
|
||||||
|
- created_by
|
||||||
- end
|
- end
|
||||||
- id
|
- id
|
||||||
- isintake
|
- isintake
|
||||||
@@ -156,6 +158,7 @@
|
|||||||
- canceled
|
- canceled
|
||||||
- color
|
- color
|
||||||
- created_at
|
- created_at
|
||||||
|
- created_by
|
||||||
- end
|
- end
|
||||||
- id
|
- id
|
||||||
- isintake
|
- isintake
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."appointments" add column "created_by" text
|
||||||
|
-- null;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."appointments" add column "created_by" text
|
||||||
|
null;
|
||||||
Reference in New Issue
Block a user