Skip to content

Archive 21-22 applications and make 22-23 the current application year - #42708

Merged
tim-dot-org merged 7 commits into
stagingfrom
archive-applications
Oct 11, 2021
Merged

Archive 21-22 applications and make 22-23 the current application year#42708
tim-dot-org merged 7 commits into
stagingfrom
archive-applications

Conversation

@tim-dot-org

Copy link
Copy Markdown
Contributor

Flip the active application model current application year constant from 2021-2022 to 2022-2023. This affects the year displayed in the application and the applications that are retrieved for the application dashboard.

Links

Testing story

Tested manually in local environment

@tim-dot-org
tim-dot-org requested a review from a team September 27, 2021 23:26
Comment thread dashboard/app/models/pd/application/active_application_models.rb Outdated
@tim-dot-org
tim-dot-org force-pushed the archive-applications branch from 088f07a to d8bdc84 Compare October 4, 2021 16:47
@tim-dot-org
tim-dot-org requested review from a team and clareconstantine October 5, 2021 16:15
@tim-dot-org

Copy link
Copy Markdown
Contributor Author

requesting a re-review for this PR, I've added a bunch to refactor how we handle the year in the application classes, because I realized that we'll still need these classes to instantiate correctly for older years. This required moving some of the constants around and changing how the year and next_year methods work/get inherited. The applications now default to being created for the current year, but if the db already has a year set, they'll defer to that year (or it can be set directly). I only changed how this worked for teacher and principal applications, as the facilitator applications are unused and should be removed. I'd prefer there to be less static stuff still overall, but I got it to work workable place.


def self.next_year
YEAR_22_23
def self.next_year(year)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ooh, I like that this removes another place we would have had to manually update!

# - two scripts (teacher_applications_to_gdrive and scheduled_pd_application_emails) use the constant
# - used for regional partner workshop enrollment counts
APPLICATION_CURRENT_YEAR = YEAR_21_22
APPLICATION_CURRENT_YEAR_SHORT = YEAR_21_22_SHORT

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

without these, can we remove include ApplicationConstants?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes! I'll clean that up

@davidsbailey davidsbailey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice cleanup!

One request for next time if you want me to look at something I've already approved is to @ mention me or click the button to re-request review. Otherwise, if it looks like you're just pushing commits to fix tests and stuff I may unsubscribe from the PR and miss follow-up messages which do not mention me explicitly.

].freeze

APPLICATION_CURRENT_YEAR = YEAR_22_23

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it could be helpful to add a quick comment indicating what belongs here vs dashboard/app/models/pd/application/application_constants.rb. are you moving these constants here because you plan to start accessing them from js? are application_constants.rb still shared across multiple application types, just not across ruby + js?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Mostly this move was for structural reasons. Year was used in some of the strings that were already shared to js, but it was hard coded separately from APPLICATION_CURRENT_YEAR, so I wanted to consolidate them, which required moving it all to shared, because the shared file couldn't reference the other constants file.

@tim-dot-org
tim-dot-org merged commit e946ef7 into staging Oct 11, 2021
@tim-dot-org
tim-dot-org deleted the archive-applications branch October 11, 2021 16:24
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.

3 participants