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

feat/my applications #1079

Merged
merged 10 commits into from
Apr 9, 2021
Merged

feat/my applications #1079

merged 10 commits into from
Apr 9, 2021

Conversation

emilyjablonski
Copy link
Collaborator

@emilyjablonski emilyjablonski commented Mar 17, 2021

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!

@emilyjablonski emilyjablonski added the not ready yet Not ready for review, do not review it’s a WIP label Mar 17, 2021
@exygy-dev exygy-dev temporarily deployed to bloom-refere-feat-my-ap-ic8eat March 17, 2021 20:10 Inactive
@exygy-dev exygy-dev temporarily deployed to bloom-refere-feat-my-ap-yfnftw March 24, 2021 18:20 Inactive
@netlify
Copy link

netlify bot commented Mar 24, 2021

Deploy preview for clever-edison-cd22c1 ready!

Built with commit ad94b00

https://deploy-preview-1079--clever-edison-cd22c1.netlify.app

@exygy-dev exygy-dev temporarily deployed to bloom-refere-feat-my-ap-1h2eho March 24, 2021 19:13 Inactive
@exygy-dev exygy-dev temporarily deployed to bloom-refere-feat-my-ap-6q8ce3 March 29, 2021 15:44 Inactive
@emilyjablonski emilyjablonski added ready for review and removed not ready yet Not ready for review, do not review it’s a WIP labels Mar 29, 2021
/>
))}
{applications.length == 0 && noApplicationsSection}
{applications &&
Copy link
Collaborator

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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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"

@jaredcwhite
Copy link
Collaborator

@emilyjablonski Regarding your questions: (1) seems good to me… (2) it'd be prudent to add a security check before merging in this PR.

@emilyjablonski
Copy link
Collaborator Author

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 👍

@exygy-dev exygy-dev temporarily deployed to bloom-refere-feat-my-ap-notx0l April 1, 2021 22:51 Inactive
@exygy-dev exygy-dev temporarily deployed to bloom-refere-feat-my-ap-kd8dkb April 1, 2021 22:52 Inactive
@exygy-dev exygy-dev temporarily deployed to bloom-refere-feat-my-ap-pleybw April 1, 2021 23:13 Inactive
@emilyjablonski
Copy link
Collaborator Author

emilyjablonski commented Apr 1, 2021

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

@exygy-dev exygy-dev temporarily deployed to bloom-refere-feat-my-ap-o6r7pc April 6, 2021 21:21 Inactive
@exygy-dev exygy-dev temporarily deployed to bloom-refere-feat-my-ap-1zlrat April 6, 2021 21:48 Inactive
@emilyjablonski
Copy link
Collaborator Author

This is ready again!

@exygy-dev exygy-dev temporarily deployed to bloom-refere-feat-my-ap-qwro3j April 7, 2021 19:11 Inactive
@slowbot
Copy link
Collaborator

slowbot commented Apr 7, 2021

@emilyjablonski Updated some simple text styles. Otherwise LGTM

@emilyjablonski
Copy link
Collaborator Author

@jaredcwhite This is the one we were just chatting about :)

@jaredcwhite
Copy link
Collaborator

I'll take a look at this first thing in the morning!

Copy link
Collaborator

@jaredcwhite jaredcwhite left a 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) => {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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)
Copy link
Collaborator

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

Copy link
Collaborator Author

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}`))
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made this change, thanks!

@exygy-dev exygy-dev temporarily deployed to bloom-refere-feat-my-ap-sgdjg0 April 9, 2021 17:16 Inactive
Copy link
Collaborator

@jaredcwhite jaredcwhite left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@emilyjablonski emilyjablonski merged commit 2800ee3 into master Apr 9, 2021
@kathyccheng kathyccheng mentioned this pull request Apr 9, 2021
@emilyjablonski emilyjablonski deleted the feat/my-applications branch May 28, 2021 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants