From 7f2e812a80c0d195688b18004d6d1a9cdfd7e49b Mon Sep 17 00:00:00 2001
From: Charlon Palacay
One or more of your enrolled courses provides you access to
- required digital materials,
- in Canvas, on or before the first day of class.
+ required digital materials, in Canvas, on or before the
+ first day of class.
- To maintain access to these materials at Day One Access pricing,
- you must pay for these materials.
+ To maintain access to these materials at Day One Access pricing, you must pay for
+ these materials.
About the Day One Access Program.
+ >About the Day One Access Program.
Tuition & Fees
-
Tuition Statement
+ >Tuition Statement
@@ -195,7 +213,8 @@ Financial Aid Status + >Financial Aid Status @@ -209,11 +228,15 @@ Tuition Statement page. + >Tuition Statement + page. PCE Tuition portal. + >PCE Tuition + portal. @@ -344,18 +367,20 @@ export default { }, hasIacData() { // MUWM-5272 - return ( - (this.seaStud || this.botStud) && this.iacData && - this.iacData.bookstore_checkout_url); + return (this.seaStud || this.botStud) && this.iacData && this.iacData.bookstore_checkout_url; }, dayOneAccessDueDateFromNow() { // MUWM-5272 return this.toFromNowDate(this.iacData.payment_due_day); }, + dayOneAccessOverDue() { + // MUWM-5351 + return this.hasPassed(this.iacData.payment_due_day); + }, textbooksUrl() { // MUWM-5272 - return "/textbooks/" + this.iacData.year + ',' + this.iacData.quarter; - } + return '/textbooks/' + this.iacData.year + ',' + this.iacData.quarter; + }, }, created() { if (this.isStudent) { diff --git a/myuw_vue/mixins/utils.js b/myuw_vue/mixins/utils.js index b6020723d..f74670ea0 100644 --- a/myuw_vue/mixins/utils.js +++ b/myuw_vue/mixins/utils.js @@ -131,8 +131,22 @@ export default { pageTitle[0] = term; return pageTitle.map((s) => this.capitalizeString(s)).join(' '); }, + + hasPassed(dateStr, useCompDate = true) { + if (!dateStr) return false; + + dayjs.tz.setDefault("America/Los_Angeles"); + const dt = dayjs(dateStr); + + if (useCompDate && this.cardDisplayDates?.comparison_date) { + return dayjs(this.cardDisplayDates.comparison_date).isAfter(dt); + } + + return dayjs().isAfter(dt); + }, + nowDatetime(useCompDate = true) { - if (useCompDate && this.cardDisplayDates && this.cardDisplayDates.comparison_date) { + if (useCompDate && this.cardDisplayDates?.comparison_date) { return dayjs(this.cardDisplayDates.comparison_date); } // dayjs.tz.setDefault("America/Los_Angeles"); diff --git a/myuw_vue/tests/mixins.test.js b/myuw_vue/tests/mixins.test.js index a96085fcf..72e464ed2 100644 --- a/myuw_vue/tests/mixins.test.js +++ b/myuw_vue/tests/mixins.test.js @@ -140,6 +140,16 @@ describe('mixins', () => { .toEqual('in 4 days'); }); + it('hasPassed', async () => { + expect(utils.methods.hasPassed()).toEqual(false); + expect(utils.methods.hasPassed('')).toEqual(false); + const now = utils.methods.dayjs(); + expect(utils.methods.hasPassed(now.subtract(1, 'd').toISOString(), false)) + .toEqual(true); + expect(utils.methods.hasPassed(now.add(1, 'd').toISOString(), false)) + .toEqual(false); + }); + it('formatPhoneNumberLink', () => { expect(utils.methods.formatPhoneNumberLink("+1 206 543-0000")).toEqual('+1-206-543-0000'); expect(utils.methods.formatPhoneNumberLink("425-666-6666")).toEqual('+1-425-666-6666'); diff --git a/myuw_vue/tests/tuition.test.js b/myuw_vue/tests/tuition.test.js index 7c2c27bbe..e83af7171 100644 --- a/myuw_vue/tests/tuition.test.js +++ b/myuw_vue/tests/tuition.test.js @@ -120,6 +120,7 @@ describe('Tuition store', () => { expect(wrapper.findAllComponents(CardStatus).length).toBe(5); expect(wrapper.vm.hasIacData).toBeTruthy; expect(wrapper.vm.dayOneAccessDueDateFromNow).toBeTruthy; + expect(wrapper.vm.dayOneAccessOverDue).toBe(false); }); it('Evaluate the computed properties of jpce', async () => {