feat: add walk-in functionality and update desk events section
Introduced a new walk-in menu in the ShiftRoster component, allowing users to add walk-ins directly from the interface. Updated the desk events section to reflect this change, including renaming the heading for clarity. Enhanced styles for the walk-in menu to improve user experience and maintain consistency across the application.
This commit is contained in:
1 parent
e9bc80cd95
commit
a0fa56202e
2 files changed
+91
-17
No files matched your search
@@ -2321,6 +2321,33 @@ button.btn-quiet::before {
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The remove control sits in the heading row. Its height stays within that line so showing it does not push the list down. */
|
||||||
|
.desk-events > .desk-toolbar {
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desk-events > .desk-toolbar .desk-toolbar-copy {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desk-events > .desk-toolbar .pick-bar {
|
||||||
|
flex: none;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desk-events > .desk-toolbar .pick-bar .btn {
|
||||||
|
min-height: 2.2rem;
|
||||||
|
padding: 0.2rem 0.9rem;
|
||||||
|
font-size: 0.92rem;
|
||||||
|
line-height: 1.2;
|
||||||
|
width: auto;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
.pick,
|
.pick,
|
||||||
.pick-all {
|
.pick-all {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
@@ -2476,6 +2503,47 @@ button.btn-quiet::before {
|
|||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.walkin-menu {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.walkin-menu > summary {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.4rem;
|
||||||
|
width: fit-content;
|
||||||
|
min-height: 2.35rem;
|
||||||
|
padding: 0.28rem 0.9rem;
|
||||||
|
list-style: none;
|
||||||
|
cursor: pointer;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #d5dee6;
|
||||||
|
border-radius: 999px;
|
||||||
|
color: var(--hope-ink);
|
||||||
|
font-size: 0.92rem;
|
||||||
|
font-weight: 650;
|
||||||
|
}
|
||||||
|
|
||||||
|
.walkin-menu > summary::-webkit-details-marker {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.walkin-menu > summary::marker {
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
|
||||||
|
.walkin-menu:not([open]) > :not(summary) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.walkin-menu[open] .edit-chevron {
|
||||||
|
transform: translateY(0.08rem) rotate(225deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.walkin-menu > .signup-form {
|
||||||
|
margin-top: 0.85rem;
|
||||||
|
}
|
||||||
|
|
||||||
.event-remove {
|
.event-remove {
|
||||||
margin-top: 0.35rem;
|
margin-top: 0.35rem;
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-17
@@ -904,6 +904,9 @@ export function ShiftRoster(props: {
|
|||||||
const formError = props.shift.cancelled ? undefined : props.editError;
|
const formError = props.shift.cancelled ? undefined : props.editError;
|
||||||
const bannerError = props.error ?? (props.shift.cancelled ? props.editError : undefined);
|
const bannerError = props.error ?? (props.shift.cancelled ? props.editError : undefined);
|
||||||
const detailLine = props.shift.cancelled ? 'Cancelled. The roster stays until you remove it.' : props.shift.whenLabel;
|
const detailLine = props.shift.cancelled ? 'Cancelled. The roster stays until you remove it.' : props.shift.whenLabel;
|
||||||
|
const walkInOpen = Boolean(
|
||||||
|
props.walkIn && (props.walkIn.message || Object.values(props.walkIn.errors).some((message) => Boolean(message))),
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<div class="event-page">
|
<div class="event-page">
|
||||||
<Crumb
|
<Crumb
|
||||||
@@ -949,10 +952,10 @@ export function ShiftRoster(props: {
|
|||||||
</details>
|
</details>
|
||||||
)}
|
)}
|
||||||
</section>
|
</section>
|
||||||
<section class="desk-events" aria-labelledby="roster-heading">
|
<section class="desk-events" aria-labelledby="volunteers-heading">
|
||||||
<div class="desk-toolbar">
|
<div class="desk-toolbar">
|
||||||
<div class="desk-toolbar-copy">
|
<div class="desk-toolbar-copy">
|
||||||
<h2 id="roster-heading">Roster</h2>
|
<h2 id="volunteers-heading">Volunteers</h2>
|
||||||
</div>
|
</div>
|
||||||
{cancelledPeople.length > 0 ? (
|
{cancelledPeople.length > 0 ? (
|
||||||
<div class="desk-actions pick-bar">
|
<div class="desk-actions pick-bar">
|
||||||
@@ -982,21 +985,25 @@ export function ShiftRoster(props: {
|
|||||||
) : (
|
) : (
|
||||||
<Roster config={props.config} csrf={props.csrf} people={props.shift.people} moves={props.moves} />
|
<Roster config={props.config} csrf={props.csrf} people={props.shift.people} moves={props.moves} />
|
||||||
)}
|
)}
|
||||||
|
{props.walkIn ? (
|
||||||
|
<details class="walkin-menu" open={walkInOpen ? true : undefined}>
|
||||||
|
<summary>
|
||||||
|
Add a walk-in
|
||||||
|
<span class="edit-chevron" aria-hidden="true" />
|
||||||
|
</summary>
|
||||||
|
<WalkInForm
|
||||||
|
config={props.config}
|
||||||
|
csrf={props.csrf}
|
||||||
|
shiftId={props.shift.id}
|
||||||
|
spotsLeft={Math.max(0, props.shift.capacity - props.shift.occupied)}
|
||||||
|
form={props.walkIn}
|
||||||
|
contacts={props.contacts ?? []}
|
||||||
|
/>
|
||||||
|
</details>
|
||||||
|
) : props.walkInNote ? (
|
||||||
|
<p class="panel-note">{props.walkInNote}</p>
|
||||||
|
) : null}
|
||||||
</section>
|
</section>
|
||||||
{props.walkIn ? (
|
|
||||||
<section class="desk-events" aria-labelledby="walkin-heading">
|
|
||||||
<WalkInForm
|
|
||||||
config={props.config}
|
|
||||||
csrf={props.csrf}
|
|
||||||
shiftId={props.shift.id}
|
|
||||||
spotsLeft={Math.max(0, props.shift.capacity - props.shift.occupied)}
|
|
||||||
form={props.walkIn}
|
|
||||||
contacts={props.contacts ?? []}
|
|
||||||
/>
|
|
||||||
</section>
|
|
||||||
) : props.walkInNote ? (
|
|
||||||
<p class="panel-note">{props.walkInNote}</p>
|
|
||||||
) : null}
|
|
||||||
<div class="desk-actions">
|
<div class="desk-actions">
|
||||||
{props.shift.cancelled ? null : (
|
{props.shift.cancelled ? null : (
|
||||||
<ConfirmAnchor
|
<ConfirmAnchor
|
||||||
@@ -1665,7 +1672,6 @@ function WalkInForm(props: {
|
|||||||
const contactId = props.form.contactId ?? '';
|
const contactId = props.form.contactId ?? '';
|
||||||
return (
|
return (
|
||||||
<form method="post" action={appPath(props.config, `/admin/shifts/${props.shiftId}/walk-in`)} class="signup-form event-details-form">
|
<form method="post" action={appPath(props.config, `/admin/shifts/${props.shiftId}/walk-in`)} class="signup-form event-details-form">
|
||||||
<h2 id="walkin-heading">Add a walk-in</h2>
|
|
||||||
<p>Choose how many people are here, including the person named below. This signup holds that many spots and queues one confirmation email. Another person can use the same email. The name is listed on the public sign-up page when this shift is posted there. Email and notes stay off that page.</p>
|
<p>Choose how many people are here, including the person named below. This signup holds that many spots and queues one confirmation email. Another person can use the same email. The name is listed on the public sign-up page when this shift is posted there. Email and notes stay off that page.</p>
|
||||||
{props.form.message ? <p class="error">{props.form.message}</p> : null}
|
{props.form.message ? <p class="error">{props.form.message}</p> : null}
|
||||||
{errorEntries.length > 0 ? (
|
{errorEntries.length > 0 ? (
|
||||||
|
|||||||
Reference in new issue
Block a user