Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add preview check #4126

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sites/public/src/components/listing/ListingView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ export const ListingView = (props: ListingProps) => {
{!applicationsClosed && getWaitlist()}
{hasNonReferralMethods &&
!applicationsClosed &&
listing.status !== ListingsStatusEnum.closed ? (
(listing.status !== ListingsStatusEnum.closed || props.preview) ? (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this still have the issue of if they are trying to reopen a listing that the application due date is in the past? I guess they shouldn't be publishing a listing like that, but they might want to still preview it. And even in that case an easy fix for them would to update the application due date to something in the future.

Copy link
Collaborator Author

@ColinBuyck ColinBuyck Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will still have that behavior but my thought was that it wouldn't be an issue because it is representing what the listing would show when published. I know some admin use preview as a final "does everything look good" check and I think I'd prefer a closed application flagged to them then.

<>{applySidebar()}</>
) : (
<></>
Expand Down Expand Up @@ -784,7 +784,7 @@ export const ListingView = (props: ListingProps) => {
{!applicationsClosed && getWaitlist()}
{hasNonReferralMethods &&
!applicationsClosed &&
listing.status !== ListingsStatusEnum.closed &&
(listing.status !== ListingsStatusEnum.closed || props.preview) &&
applySidebar()}
{listing?.referralApplication && (
<ReferralApplication
Expand Down