-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 270 Dashboard Filters. Refactor multiple queries used to generate KPIs, allowing for more flexible date range scopes. Update the system admin dashboard UI to add simple links to filter KPIs based on predefined date ranges aligned with the application windows. Additionally to help with local ssl testing, add cert.pem, key.pem to .gitignore.
- Loading branch information
1 parent
9ec2ffb
commit d9a5dfc
Showing
30 changed files
with
1,015 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
--- | ||
ignore: | ||
- CVE-2023-26141 | ||
- CVE-2024-21636 | ||
- GHSA-xc9x-jj77-9p9j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,6 @@ bin/fetch_config.rb | |
|
||
/app/assets/builds/* | ||
!/app/assets/builds/.keep | ||
|
||
./nginx/key.pem | ||
./nginx/cert.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Initially created to help display the correct form of day or days in the dashboard. | ||
module InflectionHelper | ||
def pluralize_word(count, word) | ||
"#{count} #{word.pluralize(count)}" | ||
end | ||
|
||
def calculate_day_stats(durations) | ||
min_days = pluralize_word(durations.min.abs, "day") if durations.min | ||
max_days = pluralize_word(durations.max.abs, "day") if durations.max | ||
average_duration = durations.size.positive? ? (durations.sum / durations.size.to_f).round.abs : 0 | ||
average_days = pluralize_word(average_duration, "day") | ||
|
||
{ min: min_days, max: max_days, average: average_days } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
class TimeToBankingApprovalQuery | ||
include InflectionHelper | ||
def initialize(relation = ApplicationProgress.all) | ||
@relation = relation | ||
end | ||
|
||
def call | ||
applications_list = @relation.where.not(school_checks_completed_at: nil).where.not(banking_approval_completed_at: nil) | ||
|
||
durations = applications_list.map { |app| (app.banking_approval_completed_at.to_date - app.school_checks_completed_at.to_date).to_i } | ||
|
||
min_days = "#{durations.min.abs} days" if durations.min | ||
max_days = "#{durations.max.abs} days" if durations.max | ||
average_days = durations.size.positive? ? "#{(durations.sum / durations.size.to_f).round.abs} days" : "0 days" | ||
|
||
{ min: min_days, max: max_days, average: average_days } | ||
calculate_day_stats(durations) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
class TimeToHomeOfficeChecksQuery | ||
include InflectionHelper | ||
|
||
def initialize(relation = ApplicationProgress.all) | ||
@relation = relation | ||
end | ||
|
||
def call | ||
applications_list = @relation.where.not(initial_checks_completed_at: nil).where.not(home_office_checks_completed_at: nil) | ||
|
||
durations = applications_list.map { |app| (app.home_office_checks_completed_at.to_date - app.initial_checks_completed_at.to_date).to_i } | ||
|
||
min_days = "#{durations.min.abs} days" if durations.min | ||
max_days = "#{durations.max.abs} days" if durations.max | ||
average_days = durations.size.positive? ? "#{(durations.sum / durations.size.to_f).round.abs} days" : "0 days" | ||
|
||
{ min: min_days, max: max_days, average: average_days } | ||
calculate_day_stats(durations) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
class TimeToInitialChecksQuery | ||
include InflectionHelper | ||
|
||
def initialize(relation = ApplicationProgress.all) | ||
@relation = relation | ||
end | ||
|
||
def call | ||
applications_list = @relation.where.not(created_at: nil).where.not(initial_checks_completed_at: nil) | ||
|
||
durations = applications_list.map { |app| (app.initial_checks_completed_at.to_date - app.created_at.to_date).to_i } | ||
|
||
min_days = "#{durations.min.abs} days" if durations.min | ||
max_days = "#{durations.max.abs} days" if durations.max | ||
average_days = durations.size.positive? ? "#{(durations.sum / durations.size.to_f).round.abs} days" : "0 days" | ||
|
||
{ min: min_days, max: max_days, average: average_days } | ||
calculate_day_stats(durations) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
class TimeToPaymentConfirmationQuery | ||
include InflectionHelper | ||
def initialize(relation = ApplicationProgress.all) | ||
@relation = relation | ||
end | ||
|
||
def call | ||
applications_list = @relation.where.not(payment_confirmation_completed_at: nil).where.not(banking_approval_completed_at: nil) | ||
|
||
durations = applications_list.map { |app| (app.payment_confirmation_completed_at.to_date - app.banking_approval_completed_at.to_date).to_i } | ||
|
||
min_days = "#{durations.min.abs} days" if durations.min | ||
max_days = "#{durations.max.abs} days" if durations.max | ||
average_days = durations.size.positive? ? "#{(durations.sum / durations.size.to_f).round.abs} days" : "0 days" | ||
|
||
{ min: min_days, max: max_days, average: average_days } | ||
calculate_day_stats(durations) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
class TimeToSchoolChecksQuery | ||
include InflectionHelper | ||
def initialize(relation = ApplicationProgress.all) | ||
@relation = relation | ||
end | ||
|
||
def call | ||
applications_list = @relation.where.not(home_office_checks_completed_at: nil).where.not(school_checks_completed_at: nil) | ||
|
||
durations = applications_list.map { |app| (app.school_checks_completed_at.to_date - app.home_office_checks_completed_at.to_date).to_i } | ||
|
||
min_days = "#{durations.min.abs} days" if durations.min | ||
max_days = "#{durations.max.abs} days" if durations.max | ||
average_days = durations.size.positive? ? "#{(durations.sum / durations.size.to_f).round.abs} days" : "0 days" | ||
|
||
{ min: min_days, max: max_days, average: average_days } | ||
calculate_day_stats(durations) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.