Skip to content

Commit d34b284

Browse files
authored
Merge pull request #3016 from uw-it-aca/qa
Qa
2 parents 20e2f98 + da746ac commit d34b284

9 files changed

+87
-12
lines changed

myuw/dao/student_profile.py

+11
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ def get_academic_info(request, response):
9494
response['class_level'] = enrollment.class_level
9595
break
9696

97+
for term in terms:
98+
if term in enrollments:
99+
enrollment = enrollments[term]
100+
if enrollment.has_pending_resident_change:
101+
response['has_pending_residency_change'] = True
102+
response['pending_residency_change_term'] = {
103+
'year': term.year,
104+
'quarter': term.quarter
105+
}
106+
break
107+
97108
response['term_majors'] = _get_degrees_for_terms(terms, enrollments,
98109
"majors")
99110
response['has_pending_major'] = False

myuw/resources/sws/file/student/v5/enrollment.json_reg_id_9136CCB8F66711D5BE060004AC494002_verbose_true_transcriptable_course_all_changed_since_date_

+1-1
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@
403403
"PendingClassChange": false,
404404
"PendingHonorsChange": false,
405405
"PendingMajorChange": false,
406-
"PendingResidentChange": false,
406+
"PendingResidentChange": true,
407407
"PendingSpecialProgramChange": false,
408408
"Person": {
409409
"Href": "/student/v5/person/9136CCB8F66711D5BE060004AC494002.json",

myuw/test/dao/test_student_profile.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_get_minors_for_terms(self):
3737
self.assertEquals(len(minors[0]['minors']), 1)
3838
self.assertEquals(len(minors[1]['minors']), 2)
3939

40-
def test_no_change(self):
40+
def test_major_no_change(self):
4141
req = get_request_with_user('javg005',
4242
get_request_with_date("2013-04-01"))
4343
terms, enrollments = get_cur_future_enrollments(req)
@@ -104,3 +104,12 @@ def test_degree_status(self):
104104
get_request_with_date("2013-04-01"))
105105
data = get_student_profile(req)
106106
self.assertIsNone(data['degree_status'])
107+
108+
def test_residency_status_change(self):
109+
req = get_request_with_user('javg002',
110+
get_request_with_date("2013-04-01"))
111+
data = get_student_profile(req)
112+
self.assertTrue(data['has_pending_residency_change'])
113+
self.assertEqual(
114+
data['pending_residency_change_term'],
115+
{"year": 2013, "quarter": "autumn"})

myuw_vue/components/_common/textbooks.vue

+13
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111
</h2>
1212
</template>
1313
<template #card-body>
14+
<div v-if="tacoma" class="alert alert-danger myuw-text-md" role="alert">
15+
<font-awesome-icon :icon="faExclamationTriangle" />
16+
<b>Textbook information on MyUW is currently incorrect due to a change in
17+
bookstore vendor.
18+
</b><br>
19+
Links to textbooks for each course section can be found on the
20+
<a href="https://www.tacoma.uw.edu/ts-quicksearch/application-core/secure/"
21+
>UWT Time Schedule Quicksearch</a> or the
22+
<a href="https://www.bkstr.com/uwtacomastore/shop/textbooks-and-course-materials"
23+
>bookstore website</a>.
24+
We are working to update UWT bookstore information to display correct textbooks.
25+
</div>
1426
<ul class="list-unstyled mb-2 myuw-text-md">
1527
<li v-for="(section, i) in bookData.sections" :key="i"
1628
class="d-flex mb-2">
@@ -82,6 +94,7 @@ export default {
8294
computed: {
8395
...mapState({
8496
student: (state) => state.user.affiliations.student,
97+
tacoma: (state) => state.user.affiliations.tacoma,
8598
isBeforeEndOfFirstWeek: (state) =>
8699
state.cardDisplayDates.is_before_eof_7days_of_term,
87100
}),

myuw_vue/components/profile/student-profile.vue

+15-8
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,19 @@
3939
</template>
4040
</ul>
4141
</uw-card-property>
42-
<!-- commenting out residency for MUWM-5290
43-
<uw-card-property v-if="showResidency" title="Residency">
44-
{{residentDisplayString}}
45-
<br><a v-out="'About residency statuses'"
46-
href="https://registrar.washington.edu/students/residency/"
47-
title="About residency statuses"
42+
<uw-card-property v-if="showResidency" title="Residency">
43+
{{residentDisplayString}}
44+
<span v-if="hasPendingResidencyChange"><br>
45+
Beginning {{ titleCaseWord(pendingResidencyChangeTerm.quarter) }}
46+
{{ pendingResidencyChangeTerm.year }}:
47+
Pending change in residency status
48+
</span>
49+
<br>
50+
<a v-out="'About residency statuses'"
51+
href="https://registrar.washington.edu/students/residency/"
52+
title="About residency statuses"
4853
>About residency statuses</a>
4954
</uw-card-property>
50-
-->
5155
</uw-card-property-group>
5256
<uw-card-property-group>
5357
<uw-card-property title="Local Address">
@@ -153,6 +157,8 @@ export default {
153157
permanentPhone: (state) => state.value.permanent_phone,
154158
directoryRelease: (state) => state.value.directory_release,
155159
residentCode: (state) => state.value.resident_code,
160+
hasPendingResidencyChange: (state) => state.value.has_pending_residency_change,
161+
pendingResidencyChangeTerm: (state) => state.value.pending_residency_change_term,
156162
}),
157163
...mapGetters('profile', {
158164
isReady: 'isReady',
@@ -180,10 +186,11 @@ export default {
180186
},
181187
residentDisplayString(){
182188
const resValues = ["1", "2"],
183-
nonresValues = ["3", "4", "5", "6"];
189+
nonresValues = ["3", "4", "6"];
184190
if(resValues.includes(this.residentCode)){
185191
return "Resident";
186192
}
193+
if(this.residentCode === "5") return "Non-resident student visa";
187194
if(nonresValues.includes(this.residentCode)){
188195
return "Non-resident";
189196
}

myuw_vue/components/textbooks/textbooks.vue

+14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
<template>
22
<uw-panel :loaded="isReady" :errored="isErrored">
33
<template #panel-body>
4+
<div v-if="tacoma" class="alert alert-danger myuw-text-md" role="alert">
5+
<font-awesome-icon :icon="faExclamationTriangle" />
6+
<b>Textbook information on MyUW is currently incorrect due to a change in
7+
bookstore vendor</b>.<br>
8+
Links to textbooks for each course section can be found on the
9+
<a href="https://www.tacoma.uw.edu/ts-quicksearch/application-core/secure/"
10+
>UWT Time Schedule Quicksearch</a> or the
11+
<a href="https://www.bkstr.com/uwtacomastore/shop/textbooks-and-course-materials"
12+
>bookstore website</a>.
13+
We are working to update UWT bookstore information to display correct textbooks.
14+
</div>
415
<div v-if="bookData.teachingSections.length > 0">
516
<h2 class="h5">Teaching</h2>
617
<hr class="bg-secondary">
@@ -91,6 +102,9 @@ export default {
91102
};
92103
},
93104
computed: {
105+
...mapState({
106+
tacoma: (state) => state.user.affiliations.tacoma,
107+
}),
94108
...mapState('stud_schedule', {
95109
studSchedule(state) {
96110
return state.value[this.term];

myuw_vue/tests/mock_data/profile/javg002.json

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"permanent_phone": "4255556789",
3333
"visa_type": "F1",
3434
"veteran_code": "0",
35+
"resident_code": "5",
3536
"is_student": true,
3637
"is_grad_student": false,
3738
"degree_status": {
@@ -40,6 +41,11 @@
4041
},
4142
"campus": "Seattle",
4243
"class_level": "SENIOR",
44+
"has_pending_residency_change": true,
45+
"pending_residency_change_term": {
46+
"year": 2013,
47+
"quarter": "autumn"
48+
},
4349
"term_majors": [
4450
{
4551
"quarter": "spring",

myuw_vue/tests/student-profile.test.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import profile from '../vuex/store/profile';
88

99
import StudentProfileCard from '../components/profile/student-profile.vue';
1010
import javg001Profile from './mock_data/profile/javg001.json';
11+
import javg002Profile from './mock_data/profile/javg002.json';
1112

1213
const localVue = createLocalVue(Vuex);
1314

@@ -33,13 +34,20 @@ describe('Student Profile Card', () => {
3334
});
3435

3536
it('Verify computed properties', async () => {
36-
axios.get.mockResolvedValue({data: javg001Profile, status: 200});
37+
axios.get.mockResolvedValue({data: javg002Profile, status: 200});
3738
const wrapper = shallowMount(StudentProfileCard, {store, localVue});
3839
await new Promise(setImmediate);
3940

4041
expect(wrapper.vm.showCard).toBe(true);
41-
expect(wrapper.vm.profile).toBeTruthy();
42+
expect(wrapper.vm.showResidency).toBeTruthy();
43+
expect(wrapper.vm.residentDisplayString).toBe("Non-resident student visa");
44+
expect(wrapper.vm.hasPendingResidencyChange).toBeTruthy();
45+
expect(wrapper.vm.pendingResidencyChangeTerm).toBeTruthy();
4246
expect(wrapper.vm.termMajors).toBeTruthy();
47+
expect(wrapper.vm.hasMinors).toBeTruthy();
48+
expect(wrapper.vm.termMinors).toBeTruthy();
49+
expect(wrapper.vm.localAddress).toBeTruthy();
50+
expect(wrapper.vm.permanentAddress).toBeTruthy();
4351
});
4452

4553
it('addressLocationString()', async () => {

myuw_vue/tests/textbooks.test.js

+7
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ describe('Textbook cards', () => {
4242
inst_schedule,
4343
textbooks,
4444
},
45+
state: {
46+
user: {
47+
affiliations: {
48+
seattle: true,
49+
}
50+
}
51+
}
4552
});
4653
});
4754

0 commit comments

Comments
 (0)