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

1430/listings management, fcfs and lottery #1485

Closed
wants to merge 12 commits into from

Conversation

emilyjablonski
Copy link
Collaborator

@emilyjablonski emilyjablonski commented Jul 7, 2021

Pull Request Template

Issue

Addresses #1430

  • This change addresses the issue in full
  • This change addresses only certain aspects of the issue
  • This change is a dependency for another issue
  • This change has a dependency from another issue

Description

Adds the lottery and first come first serve radio button selection to the rankings and results portion of listings management.

If you select FCFS, an additional radio question Is there an application due date? will appear - if you select No, the application due date field at the bottom of the page should become disabled

If you select Lottery, three additional fields for the date, start time, and end time, as well as a textbox field for notes should appear

I added a computed backend field to be able to tell if a listing is FCFS.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Prototype/POC (not to merge)
  • This change is a refactor/address technical debt
  • This change requires a documentation update
  • This change requires a SQL Script

How Can This Be Tested/Reviewed?

Add a new listing with FCFS and no due date, and check that the public listing displays "First come first serve"
Add a new listing with Lottery and check out the additional lottery section with the time range and notes in the right hand panel

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have reviewed the changes in a desktop view
  • I have reviewed the changes in a mobile view
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have assigned reviewers
  • I have updated the changelog to include a description of my changes

@emilyjablonski emilyjablonski added the wip This PR is not ready for review, do not review it's a “Work In Progress” label Jul 7, 2021
@netlify
Copy link

netlify bot commented Jul 7, 2021

✔️ Deploy Preview for jovial-davinci-1d67a0 ready!

🔨 Explore the source changes: 5af5a35

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-davinci-1d67a0/deploys/60f0caa4bf4ee100084b782b

😎 Browse the preview: https://deploy-preview-1485--jovial-davinci-1d67a0.netlify.app

@netlify
Copy link

netlify bot commented Jul 7, 2021

✔️ Deploy Preview for dev-storybook-bloom ready!

🔨 Explore the source changes: 5af5a35

🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-storybook-bloom/deploys/60f0caa450bc2d0008cb9704

😎 Browse the preview: https://deploy-preview-1485--dev-storybook-bloom.netlify.app

@netlify
Copy link

netlify bot commented Jul 7, 2021

✔️ Deploy Preview for dev-bloom ready!

🔨 Explore the source changes: 5af5a35

🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-bloom/deploys/60f0caa46d169d0008270fef

😎 Browse the preview: https://deploy-preview-1485--dev-bloom.netlify.app

@netlify
Copy link

netlify bot commented Jul 7, 2021

❌ Deploy Preview for dev-partners-bloom failed.

🔨 Explore the source changes: 5af5a35

🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-partners-bloom/deploys/60f0caa457448d00076d575c

@emilyjablonski emilyjablonski added ready for review and removed wip This PR is not ready for review, do not review it's a “Work In Progress” labels Jul 8, 2021
@emilyjablonski
Copy link
Collaborator Author

Large prettier diff is making it hard to review, taking a look at that

@emilyjablonski emilyjablonski marked this pull request as ready for review July 8, 2021 20:36
Copy link
Collaborator

@seanmalbert seanmalbert left a comment

Choose a reason for hiding this comment

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

@emilyjablonski ,
Overall this looks good. The main change that's needed is how reviewOrderType is defined in the backend. Please see my comment on that.

My machine is probably a little slow at the moment, but it does seem to take a long time to switch between the first come first serve and lottery options in the form. If it seems a little slow to you too, consider moving those pieces to a memoized component(s).

Comment on lines 415 to 427
@Expose()
@IsOptional({ groups: [ValidationsGroupsEnum.default] })
@ApiProperty()
get reviewOrderType(): ListingReviewOrder {
let lotteryEventExists = false
this.events.forEach((event) => {
if (event.type === ListingEventType.publicLottery) {
lotteryEventExists = true
}
})
return lotteryEventExists ? ListingReviewOrder.lottery : ListingReviewOrder.firstComeFirstServe
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be moved to the listing DTO. See the other definitions in there with the @Transform decorator. Also, with the way it is now generate client doesn't properly add reviewOrderType or ListingReviewOrder, which causes issues, so the definition should include reviewOrderType: ListingReviewOrder.

@pbn4
Copy link
Contributor

pbn4 commented Jul 15, 2021

@emilyjablonski Could you please try to revert the formatting commits? I can make it a separate PR.

@emilyjablonski emilyjablonski added wip This PR is not ready for review, do not review it's a “Work In Progress” and removed ready for review labels Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip This PR is not ready for review, do not review it's a “Work In Progress”
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants