Skip to content

Commit

Permalink
Merge branch 'main' into cfgov-helmed
Browse files Browse the repository at this point in the history
  • Loading branch information
cooldragontattoo authored Jan 2, 2025
2 parents d37c4de + ed92a96 commit 8558dca
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ <h2 class="instructions__about-heading">
</p>
<p>
<a
href="/{{url__root}}/understanding-your-financial-aid-offer/about-this-tool/"
href="/{{url_root}}/understanding-your-financial-aid-offer/about-this-tool/"
target="__blank" rel="noopener noreferrer">Get details
about how this tool works</a>
</p>
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion cfgov/unprocessed/apps/owning-a-home/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"license": "SEE LICENSE IN TERMS.md",
"dependencies": {
"@cfpb/jumbo-mortgage": "5.0.0",
"@cfpb/jumbo-mortgage": "6.0.0",
"amortize": "1.1.0",
"highcharts": "7.2.2",
"jquery": "3.6.0",
Expand Down
8 changes: 4 additions & 4 deletions cfgov/unprocessed/apps/owning-a-home/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@cfpb/jumbo-mortgage@5.0.0":
version "5.0.0"
resolved "https://registry.yarnpkg.com/@cfpb/jumbo-mortgage/-/jumbo-mortgage-5.0.0.tgz#4e6d197e3abce447dd0550c99ac718b86231ad44"
integrity sha512-XsOvs9twox5vcIL28PBt+4wlPW7wE0De26ZZVReKszzJVQqrplwRhVq1GZEb4BDZJq7+7zc42XWOJR0tJUKRMA==
"@cfpb/jumbo-mortgage@6.0.0":
version "6.0.0"
resolved "https://registry.yarnpkg.com/@cfpb/jumbo-mortgage/-/jumbo-mortgage-6.0.0.tgz#850338092a20cc6b2589caa6f885062cd069c182"
integrity sha512-sdVZFMWjoLbjG+s3X5hOcCGI6YdSMQCBhtkUVB2ibqK0M0MhPOke/bU/S4fP8ShAKSk78MytA61txE9/n2+XHg==
dependencies:
format-usd "~0.1.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ const app = {

// Add url values to the financial model
publish.extendFinancialData(this.urlValues);
if (typeof this.urlValues.totalCost === 'undefined') {
publish.financialData('totalCost', null);
}
const trueTotalCost = Math.max(
programData.totalCost,
this.urlValues.urlTotalCost,
);
publish.financialData('totalCost', trueTotalCost);
financialView.updateViewWithURL(schoolValues, this.urlValues);
// initialize metric view
metricView.init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function queryHandler(queryString) {
insl: 'tuitionRepay',
insi: 'tuitionRepayRate',
inst: 'tuitionRepayTerm',
totl: 'totalCost',
totl: 'urlTotalCost',
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ const financialView = {
*/
updateViewWithURL: function (values, urlvalues) {
this.totalDirectCostVisible(
typeof urlvalues.totalCost !== 'undefined' && urlvalues.totalCost !== 0,
typeof urlvalues.urlTotalCost !== 'undefined' &&
urlvalues.urlTotalCost !== 0,
);
this.tuitionPaymentPlanVisible(
typeof urlvalues.tuitionRepay !== 'undefined' &&
Expand Down
18 changes: 17 additions & 1 deletion cfgov/v1/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.utils.html import format_html_join

from wagtail import hooks
from wagtail.admin import messages
from wagtail.admin import messages, widgets
from wagtail.admin.menu import MenuItem
from wagtail.snippets.models import register_snippet

Expand Down Expand Up @@ -44,6 +44,22 @@

logger = logging.getLogger(__name__)

languages = dict(settings.LANGUAGES)


@hooks.register("register_page_header_buttons")
def page_header_buttons(page, user, view_name, next_url=None):
return [
widgets.Button(
f"Edit {languages[translation.language]} page",
f"/admin/pages/{translation.pk}/edit/",
priority=1000,
icon_name="globe",
)
for translation in page.get_translations()
if translation.language != page.language
]


@hooks.register("after_delete_page")
def log_page_deletion(request, page):
Expand Down
2 changes: 1 addition & 1 deletion requirements/libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ wagtailcharts==0.6.2
whitenoise==6.7.0

# These packages are installed from GitHub.
https://github.com/cfpb/owning-a-home-api/releases/download/0.18.2/owning_a_home_api-0.18.2-py3-none-any.whl
https://github.com/cfpb/owning-a-home-api/releases/download/0.19.0/owning_a_home_api-0.19.0-py3-none-any.whl
https://github.com/cfpb/ccdb5-api/releases/download/1.7.1/ccdb5_api-1.7.1-py3-none-any.whl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"socCodes": "",
"timeToComplete": null,
"titleIVDebt": null,
"totalCost": 104680,
"totalCost": 39000,
"transportation": null,
"tuition": 99255
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Disclosures', () => {

it('extends the financial model with url values', () => {
publishUpdate.extendFinancialData(getUrlValues());
expect(financialModel.values.totalCost).toBe(45000);
expect(financialModel.values.urlTotalCost).toBe(45000);
expect(financialModel.values.costOfAttendance).toBe(43626);
});

Expand Down

0 comments on commit 8558dca

Please sign in to comment.