-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat/my applications #1079
feat/my applications #1079
Conversation
Deploy preview for clever-edison-cd22c1 ready! Built with commit ad94b00 https://deploy-preview-1079--clever-edison-cd22c1.netlify.app |
/> | ||
))} | ||
{applications.length == 0 && noApplicationsSection} | ||
{applications && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably use optionals here to condense it a bit?
interface AppStatusItemProps { | ||
application: Application | ||
listing: Listing | ||
status: string | ||
setDeletingApplication: (application: Application) => void | ||
lotteryNumber?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with the changes to remove this AppStatusItem functionality. Can you let me know why this changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! So the designs I had didn't have anything in them to delete applications so I removed that piece, and then there was an older TODO on line 9 "// TODO status and lotteryNumber should be loaded from Application"
@emilyjablonski Regarding your questions: (1) seems good to me… (2) it'd be prudent to add a security check before merging in this PR. |
Gotcha, I think we'll need to have a conversation as a full team about how to approach those kinds of security checks across the app before we can move forward with this then 👍 |
bb39cb6
to
bc93fdd
Compare
There's some better context from Michal in this issue, but the security concerns are not a problem here :) The backend will not retrieve an application that belongs to another user (I tested it out locally to be sure). I will need some copy in the "don't have access" case - right now it just renders a blank page - I requested it from Jesse and then can update this PR w that info |
70622a3
to
99e98d5
Compare
This is ready again! |
@emilyjablonski Updated some simple text styles. Otherwise LGTM |
@jaredcwhite This is the one we were just chatting about :) |
I'll take a look at this first thing in the morning! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than a few comments on potential code reuse or error handling, looks good to me! 👍
import { useRouter } from "next/router" | ||
import moment from "moment" | ||
|
||
const dateSubmitted = (submissionDate: Date) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it could be a useful "generic" helper. Maybe we can relocate to ui-components
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-located :)
const [application, setApplication] = useState<Application>() | ||
const [listing, setListing] = useState<Listing>() | ||
const [unauthorized, setUnauthorized] = useState(false) | ||
const [noApplication, setNoApplication] = useState(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 403/404 state hooks are neat. I wonder if we could make a standard hook that would provide this and set the appropriate state on either 404 or 403, so we could use it on other pages. This might be good to review as well if we move towards using SWR everywhere: https://swr.vercel.app/docs/error-handling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored this to be a little cleaner, but would hope we could accomplish this in another ticket?
.then((apps) => { | ||
setApplications(apps) | ||
}) | ||
.catch((err) => console.error(`Error fetching applications: ${err}`)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On this page it looks like any error condition will simply show that no applications are present. Could be frustrating if somebody's seeing that instead of at least a message that some kind of error occurred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this change, thanks!
…ng/bloom into feat/my-applications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
This PR adds the ability for a signed-in user to view their submitted applications.
You can go to your account page and then click on My Applications to access it!