Skip to content

Commit 8b69a79

Browse files
authored
Merge pull request #2872 from uw-it-aca/qa
Qa
2 parents 86cfad3 + c8aa127 commit 8b69a79

24 files changed

+574
-2462
lines changed

myuw/dao/degree_notice.py myuw/dao/category_notice.py

+20-10
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
"""
5-
Define graduation card content items as notices so that
5+
Define card content as categorized notices so that
66
they can be marked "new"
77
"""
88

99
from uw_sws.models import Notice
1010

1111

12-
GRADUATION_NOTICES = [
12+
CATEGORIZED_NOTICES = [
1313
{
1414
"NoticeCategory": "Degree",
1515
"NoticeType": "Ceremony",
@@ -54,17 +54,27 @@
5454
"leaving UW?</span>" +
5555
"<span class=\"notice-body-with-title\"></span>"
5656
)
57+
},
58+
{
59+
"NoticeCategory": "Teaching",
60+
"NoticeType": "ClassResAccessible",
61+
"NoticeContent": (
62+
"<span class=\"notice-title\">Are your class resources " +
63+
"accessible for all students?</span>" +
64+
"<span class=\"notice-body-with-title\"></span>"
65+
)
5766
}
5867
]
5968

6069

61-
def get_graduation_notices():
70+
def get_category_notices(category):
6271
notices = []
63-
for notice in GRADUATION_NOTICES:
64-
notice_obj = Notice()
65-
notice_obj.notice_category = notice.get("NoticeCategory")
66-
notice_obj.notice_content = notice.get("NoticeContent")
67-
notice_obj.notice_type = notice.get("NoticeType")
68-
notice_obj.attributes = []
69-
notices.append(notice_obj)
72+
for notice in CATEGORIZED_NOTICES:
73+
if notice.get("NoticeCategory") == category:
74+
notice_obj = Notice()
75+
notice_obj.notice_category = notice.get("NoticeCategory")
76+
notice_obj.notice_content = notice.get("NoticeContent")
77+
notice_obj.notice_type = notice.get("NoticeType")
78+
notice_obj.attributes = []
79+
notices.append(notice_obj)
7080
return notices

myuw/dao/notice.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
from django.db import IntegrityError
1111
from uw_sws.notice import get_notices_by_regid
1212
from myuw.models import UserNotices
13-
from myuw.dao.degree_notice import get_graduation_notices
13+
from myuw.dao.category_notice import get_category_notices
1414
from myuw.dao.enrollment import get_latest_class_level
15+
from myuw.dao.instructor import is_instructor
1516
from myuw.dao.pws import get_regid_of_current_user
1617
from myuw.dao.notice_mapping import categorize_notices
1718
from myuw.dao.user import get_user_model
@@ -43,13 +44,17 @@ def mark_notices_read_for_current_user(request, notice_hashes):
4344

4445
def get_notices_for_current_user(request):
4546
notices = []
47+
if is_instructor(request):
48+
# MUWM-5199
49+
notices += categorize_notices(get_category_notices("Teaching"))
50+
4651
if is_student(request):
4752
notices += _get_notices_by_regid(get_regid_of_current_user(request))
4853

4954
# MUWM-5065
5055
class_level = get_latest_class_level(request)
5156
if class_level and class_level.upper() == 'SENIOR':
52-
notices += categorize_notices(get_graduation_notices())
57+
notices += categorize_notices(get_category_notices("Degree"))
5358

5459
notices += categorize_notices(get_myuw_notices_for_user(request))
5560
return _get_user_notices(request, notices)

myuw/dao/notice_categorization.py

+5
Original file line numberDiff line numberDiff line change
@@ -403,5 +403,10 @@
403403
"myuw_category": "Graduation NextDestination",
404404
"location_tags": ['graduation'],
405405
"critical": False
406+
},
407+
"teaching_classresaccessible": {
408+
"myuw_category": "Teaching ClassResAccessible",
409+
"location_tags": ['teaching_summary'],
410+
"critical": False
406411
}
407412
}

myuw/test/api/test_instructor_schedule.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_bill_current_term(self):
6060
'https://canvas.uw.edu/courses/149651')
6161
self.assertEqual(section1['limit_estimate_enrollment'], 15)
6262
self.assertEqual(section1['final_exam']['latitude'],
63-
'47.653693')
63+
47.6536929997)
6464
self.assertEqual(
6565
section1["email_list"]['section_list']['list_address'],
6666
'ess102a_sp13')
@@ -102,8 +102,8 @@ def test_billseata_current_term(self):
102102
data = json.loads(resp.content)
103103
# MUWM-4085
104104
final = data['sections'][0]['final_exam']
105-
self.assertTrue(len(final['longitude']) > 0)
106-
self.assertTrue(len(final['latitude']) > 0)
105+
self.assertTrue(final['longitude'])
106+
self.assertTrue(final['latitude'])
107107

108108

109109
@require_url('myuw_instructor_schedule_api',
@@ -194,7 +194,7 @@ def test_bill_section(self):
194194
data['sections'][0]['limit_estimate_enrollment'], 15)
195195
self.assertEqual(
196196
data['sections'][0]['final_exam']['latitude'],
197-
'47.653693')
197+
47.6536929997)
198198
self.assertEqual(data['sections'][0]['canvas_url'],
199199
'https://canvas.uw.edu/courses/149651')
200200
self.assertEqual(

myuw/test/api/test_instructor_section.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_bill_section(self):
8585
self.assertEqual(
8686
data['sections'][0]['limit_estimate_enrollment'], 15)
8787
self.assertEqual(
88-
data['sections'][0]['final_exam']['latitude'], '47.653693')
88+
data['sections'][0]['final_exam']['latitude'], 47.6536929997)
8989
self.assertEqual(data['sections'][0]['canvas_url'],
9090
'https://canvas.uw.edu/courses/149651')
9191
self.assertEqual(
@@ -186,7 +186,7 @@ def test_bill_section(self):
186186
self.assertEqual(
187187
data['sections'][0]['limit_estimate_enrollment'], 15)
188188
self.assertEqual(
189-
data['sections'][0]['final_exam']['latitude'], '47.653693')
189+
data['sections'][0]['final_exam']['latitude'], 47.6536929997)
190190
self.assertEqual(data['sections'][0]['canvas_url'],
191191
'https://canvas.uw.edu/courses/149651')
192192
self.assertEqual(

myuw/test/dao/test_building.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ class TestBuildings(TestCase):
1414

1515
def test_get_by_code(self):
1616
building = get_building_by_code('PAA')
17-
self.assertEquals(building.longitude, '-122.304747')
17+
self.assertEquals(building.longitude, -122.304747)
1818
self.assertEquals(
1919
building.json_data(),
2020
{
2121
'code': 'PAA',
22-
'latitude': '47.653693',
23-
'longitude': '-122.304747',
22+
'latitude': 47.6536929997,
23+
'longitude': -122.304747,
2424
'name': 'Mechanical Engineering Building',
2525
'number': '1347'
2626
})

myuw/test/dao/test_category_notice.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2022 UW-IT, University of Washington
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
from django.test import TestCase
5+
from myuw.dao.category_notice import get_category_notices
6+
from myuw.dao.notice_mapping import categorize_notices
7+
8+
9+
class TestDegreeNotices(TestCase):
10+
11+
def test_get_category_notices(self):
12+
notices = get_category_notices("Degree")
13+
self.assertEquals(len(notices), 5)
14+
self.assertEquals(notices[0].notice_category, "Degree")
15+
16+
final_notices = categorize_notices(notices)
17+
for notice in final_notices:
18+
print(notice)
19+
self.assertTrue('Graduation' in notice.custom_category)
20+
self.assertEquals(notice.location_tags[0], 'graduation')
21+
self.assertFalse(notice.is_critical)
22+
23+
notices = get_category_notices("Teaching")
24+
self.assertEquals(len(notices), 1)
25+
26+
final_notices = categorize_notices(notices)
27+
for notice in final_notices:
28+
print(notice)
29+
self.assertTrue('Teaching' in notice.custom_category)
30+
self.assertEquals(notice.location_tags[0], 'teaching_summary')
31+
self.assertFalse(notice.is_critical)

myuw/test/dao/test_degree_notice.py

-20
This file was deleted.

myuw/test/dao/test_notice_categorization.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class TestNoticeCategories(TestCase):
99

1010
def test_categories(self):
11-
self.assertEqual(len(NOTICE_CATEGORIES.keys()), 80)
11+
self.assertEqual(len(NOTICE_CATEGORIES.keys()), 81)
1212

1313
categorization = NOTICE_CATEGORIES.get("studentalr_intlstucheckin")
1414
self.assertIsNotNone(categorization)

myuw/test/dao/test_visual_schedule.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1153,15 +1153,15 @@ def test_building_map_uri(self):
11531153
self.assertEqual(len(schedule_json['periods']), 2)
11541154
meeting = schedule_json['periods'][0]['sections'][0]['meetings'][0]
11551155
# MUWM-3981
1156-
self.assertEqual(meeting['latitude'], "47.653693")
1157-
self.assertEqual(meeting['longitude'], "-122.304747")
1156+
self.assertEqual(meeting['latitude'], 47.6536929997)
1157+
self.assertEqual(meeting['longitude'], -122.304747)
11581158
self.assertEqual(
11591159
meeting['building_name'],
11601160
"Mechanical Engineering Building")
11611161
# MUWM_596
11621162
final = schedule_json['periods'][1]['sections'][0]['final_exam']
1163-
self.assertEqual(final['latitude'], "47.653693")
1164-
self.assertEqual(final['longitude'], "-122.304747")
1163+
self.assertEqual(final['latitude'], 47.6536929997)
1164+
self.assertEqual(final['longitude'], -122.304747)
11651165
self.assertEqual(
11661166
final['building_name'],
11671167
"Mechanical Engineering Building")

myuw/test/model/test_campus_building.py

+24-6
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,46 @@ class TestBuilding(MyuwApiTest):
1010
def test_building(self):
1111
fac_obj = Facilities().search_by_number("1347")
1212
b_obj = CampusBuilding.upd_building(fac_obj)
13-
self.assertEquals(b_obj.latitude, '47.653693')
14-
self.assertEquals(b_obj.longitude, '-122.304747')
13+
self.assertEquals(b_obj.latitude, 47.6536929997)
14+
self.assertEquals(b_obj.longitude, -122.304747)
1515
self.assertEquals(b_obj.name, "Mechanical Engineering Building")
1616
self.assertEquals(b_obj.code, 'MEB')
1717
self.assertEquals(b_obj.number, '1347')
1818
self.assertEquals(
1919
b_obj.json_data(),
2020
{
2121
'code': 'MEB',
22-
'latitude': '47.653693',
23-
'longitude': '-122.304747',
22+
'latitude': 47.6536929997,
23+
'longitude': -122.304747,
2424
'name': 'Mechanical Engineering Building',
2525
'number': '1347',
2626
}
2727
)
2828
self.assertIsNotNone(str(b_obj))
2929

3030
obj1 = CampusBuilding.get_building_by_code('MEB')
31-
self.assertEquals(b_obj, obj1)
31+
self.assertEquals(
32+
obj1.json_data(),
33+
{
34+
'code': 'MEB',
35+
'latitude': '47.6536929997',
36+
'longitude': '-122.304747',
37+
'name': 'Mechanical Engineering Building',
38+
'number': '1347',
39+
}
40+
)
3241

3342
obj2 = CampusBuilding.get_building_by_number('1347')
34-
self.assertEquals(b_obj, obj2)
43+
self.assertEquals(
44+
obj2.json_data(),
45+
{
46+
'code': 'MEB',
47+
'latitude': '47.6536929997',
48+
'longitude': '-122.304747',
49+
'name': 'Mechanical Engineering Building',
50+
'number': '1347',
51+
}
52+
)
3553

3654
self.assertTrue(CampusBuilding.exists('MEB'))
3755
self.assertTrue(CampusBuilding.exists_by_number('1347'))

myuw_vue/components/home/graduation/collapsed-item.vue myuw_vue/components/_common/collapsed-item.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</template>
3232

3333
<script>
34-
import Collapse from '../../_templates/collapse.vue';
34+
import Collapse from '../_templates/collapse.vue';
3535
import {mapActions} from 'vuex';
3636
export default {
3737
components: {
@@ -61,5 +61,5 @@ export default {
6161
</script>
6262
<style lang="scss" scoped>
6363
@use "sass:map";
64-
@import '../../../../myuw/static/css/myuw/variables.scss';
64+
@import '../../../myuw/static/css/myuw/variables.scss';
6565
</style>

myuw_vue/components/home/graduation/application-submitted.vue

+21-9
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@
137137
<div v-if="hasGrantedDegree">
138138
<h3 class="h6 myuw-font-encode-sans">Post-Graduation Success</h3>
139139
<ul class="list-style myuw-text-md">
140+
<li>
141+
Ensure that all information on your
142+
<a href="https://sdb.admin.uw.edu/sisStudents/uwnetid/untranscript.aspx"
143+
>unofficial transcript</a
144+
> is correct &#8211; any degrees, major and minor types. If anything is incorrect,
145+
contact the registrar&apos;s office and your academic advisor within 45 days of
146+
your degree being granted.
147+
</li>
140148
<li>
141149
Get guidance and resources for
142150
<a href="https://www.washington.edu/graduation/after-graduation/"
@@ -229,21 +237,25 @@
229237
<uw-collapsed-item :notice="degreeDiploma">
230238
<template #notice-body>
231239
<p>
232-
The Office of the University Registrar will send you an email about one month
233-
after graduation with the link to a form where you can log in and enter your
234-
diploma name and diploma mailing address.
240+
You can use the
241+
<a href="https://registrar.washington.edu/diploma-name/">
242+
Diploma Name and Address form</a>
243+
to update your diploma name and mailing address until the registrar&apos;s
244+
office places the diploma order for your quarter of graduation &#8211;
245+
approximately one month after your degree is granted.
235246
</p>
236247
<p>
237-
If you do not submit the form by the deadline given in the email, the name on
238-
your diploma will default to the name on your official student record which
239-
may vary from your preferred name.
248+
We urge you to update your information now. If you do not update your diploma
249+
name and address within this timeframe, information from your student record
250+
will be used to issue and mail your diploma.
240251
</p>
241252
<p>
242-
For more information about diplomas, visit the
253+
For more information about diplomas, including shipping time and CeDiplomas,
254+
visit the
243255
<a href="https://registrar.washington.edu/students/graduation-diplomas/"
244256
>Graduations and Diplomas</a
245257
>
246-
site.
258+
page.
247259
</p>
248260
</template>
249261
</uw-collapsed-item>
@@ -447,7 +459,7 @@
447459
import { mapGetters, mapState, mapActions } from 'vuex';
448460
import { faChevronUp, faChevronDown } from '@fortawesome/free-solid-svg-icons';
449461
import Card from '../../_templates/card.vue';
450-
import CollapsedItem from './collapsed-item.vue';
462+
import CollapsedItem from '../../_common/collapsed-item.vue';
451463
import Collapse from '../../_templates/collapse.vue';
452464
import Feedback from '../../_templates/feedback.vue';
453465

0 commit comments

Comments
 (0)