Merge pull request #371 from Malte-D/feature/opt-in-booking
Feature/opt in booking
This commit is contained in:
15 files changed
+831
-258
No files matched your search
@@ -66,6 +66,7 @@ type EventTypeInput = {
|
||||
periodStartDate?: Date | string;
|
||||
periodEndDate?: Date | string;
|
||||
periodCountCalendarDays?: boolean;
|
||||
enteredRequiresConfirmation: boolean;
|
||||
};
|
||||
|
||||
const PERIOD_TYPES = [
|
||||
@@ -172,6 +173,7 @@ export default function EventTypePage({
|
||||
const descriptionRef = useRef<HTMLTextAreaElement>();
|
||||
const lengthRef = useRef<HTMLInputElement>();
|
||||
const isHiddenRef = useRef<HTMLInputElement>();
|
||||
const requiresConfirmationRef = useRef<HTMLInputElement>();
|
||||
const eventNameRef = useRef<HTMLInputElement>();
|
||||
const periodDaysRef = useRef<HTMLInputElement>();
|
||||
const periodDaysTypeRef = useRef<HTMLSelectElement>();
|
||||
@@ -188,6 +190,7 @@ export default function EventTypePage({
|
||||
const enteredDescription: string = descriptionRef.current.value;
|
||||
const enteredLength: number = parseInt(lengthRef.current.value);
|
||||
const enteredIsHidden: boolean = isHiddenRef.current.checked;
|
||||
const enteredRequiresConfirmation: boolean = requiresConfirmationRef.current.checked;
|
||||
const enteredEventName: string = eventNameRef.current.value;
|
||||
|
||||
const type = periodType.type;
|
||||
@@ -223,6 +226,7 @@ export default function EventTypePage({
|
||||
periodStartDate: enteredPeriodStartDate,
|
||||
periodEndDate: enteredPeriodEndDate,
|
||||
periodCountCalendarDays: enteredPeriodDaysType,
|
||||
requiresConfirmation: enteredRequiresConfirmation,
|
||||
};
|
||||
|
||||
if (enteredAvailability) {
|
||||
@@ -641,6 +645,29 @@ export default function EventTypePage({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="my-8">
|
||||
<div className="relative flex items-start">
|
||||
<div className="flex items-center h-5">
|
||||
<input
|
||||
ref={requiresConfirmationRef}
|
||||
id="requiresConfirmation"
|
||||
name="requiresConfirmation"
|
||||
type="checkbox"
|
||||
className="focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300 rounded"
|
||||
defaultChecked={eventType.requiresConfirmation}
|
||||
/>
|
||||
</div>
|
||||
<div className="ml-3 text-sm">
|
||||
<label htmlFor="requiresConfirmation" className="font-medium text-gray-700">
|
||||
Booking requires manual confirmation
|
||||
</label>
|
||||
<p className="text-gray-500">
|
||||
The booking needs to be confirmed, before it is pushed to the integrations and a
|
||||
confirmation mail is sent.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset className="my-8">
|
||||
<Text variant="largetitle">When can people book this event?</Text>
|
||||
@@ -991,6 +1018,7 @@ export const getServerSideProps: GetServerSideProps<Props> = async ({ req, query
|
||||
periodStartDate: true,
|
||||
periodEndDate: true,
|
||||
periodCountCalendarDays: true,
|
||||
requiresConfirmation: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user