@byu-oit/vue-decision-processing-components 8.35.12 → 8.35.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DetailsCesHold.vue +35 -2
- package/hsSummary.json +0 -3
- package/package.json +1 -1
- package/parsers/application.js +1 -0
- package/parsers/packetList.js +0 -2
- package/vuexModules/users/index.js +0 -1
package/DetailsCesHold.vue
CHANGED
|
@@ -63,15 +63,48 @@
|
|
|
63
63
|
computed: {
|
|
64
64
|
...mapState({
|
|
65
65
|
env: 'environment',
|
|
66
|
-
applicantId: state => state.application.applicantId
|
|
66
|
+
applicantId: state => state.application.applicantId,
|
|
67
|
+
applicantFirstName: state => state.application.preferredFirstName,
|
|
68
|
+
applicantSurname: state => state.application.surname,
|
|
69
|
+
applicantDob: state => state.application.personalRecords.dateOfBirth
|
|
67
70
|
}),
|
|
68
71
|
spinner () { return faSpinner },
|
|
69
72
|
holdIcon () {
|
|
70
73
|
return this.holdSet ? faExclamationTriangle : this.error ? faQuestionCircle : faCheck
|
|
71
74
|
}
|
|
72
75
|
},
|
|
76
|
+
methods: {
|
|
77
|
+
getByuId: async function () {
|
|
78
|
+
try {
|
|
79
|
+
const surname = this.applicantSurname ? this.applicantSurname.trim() : ''
|
|
80
|
+
const preferredFirstName = this.applicantFirstName ? this.applicantFirstName.trim() : ''
|
|
81
|
+
const applicantDob = this.applicantDob ? new Date(this.applicantDob).toISOString().split('T')[0].trim() : ''
|
|
82
|
+
const url = this.env === 'production'
|
|
83
|
+
? `https://api.byu.edu/byuapi/persons/v4/?preferred_first_name=${preferredFirstName}&surname=${surname}&vital_record.date_of_birth=${applicantDob}`
|
|
84
|
+
: `https://api-sandbox.byu.edu/byuapi/persons/v4/?preferred_first_name=${preferredFirstName}&surname=${surname}&vital_record.date_of_birth=${applicantDob}`
|
|
85
|
+
|
|
86
|
+
const { body, status } = await window.byu.auth.request({ url })
|
|
87
|
+
if (status >= 400) {
|
|
88
|
+
this.error = true
|
|
89
|
+
return null
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const data = JSON.parse(body)
|
|
93
|
+
const recordCount = data.values.length
|
|
94
|
+
|
|
95
|
+
if (recordCount !== 1) {
|
|
96
|
+
return null
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return data.values[0].byu_id.value
|
|
100
|
+
} catch (err) {
|
|
101
|
+
console.error(err)
|
|
102
|
+
this.error = true
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
73
106
|
async mounted () {
|
|
74
|
-
const applicantId = this.applicantId
|
|
107
|
+
const applicantId = this.applicantId ? this.applicantId : await this.getByuId()
|
|
75
108
|
if (!applicantId) {
|
|
76
109
|
this.error = true
|
|
77
110
|
return
|
package/hsSummary.json
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
},
|
|
18
18
|
"high_school_codes__info": {
|
|
19
19
|
"rel": "high_school_codes__info",
|
|
20
|
-
"href": "https://api.byu.edu/byuapi/meta/high_school_codes/v1/130535",
|
|
21
20
|
"method": "GET"
|
|
22
21
|
}
|
|
23
22
|
},
|
|
@@ -36,7 +35,6 @@
|
|
|
36
35
|
"high_school_type": {
|
|
37
36
|
"value": "USAC",
|
|
38
37
|
"description": "US-Accredited",
|
|
39
|
-
"domain": "https://api.byu.edu/byuapi/meta/high_school_types/v1",
|
|
40
38
|
"api_type": "modifiable",
|
|
41
39
|
"key": true,
|
|
42
40
|
"display_label": "High School Type"
|
|
@@ -44,7 +42,6 @@
|
|
|
44
42
|
"high_school": {
|
|
45
43
|
"value": "130535",
|
|
46
44
|
"description": "MADISON HIGH SCHOOL",
|
|
47
|
-
"domain": "https://api.byu.edu/byuapi/meta/high_schools/v1",
|
|
48
45
|
"api_type": "related",
|
|
49
46
|
"key": true,
|
|
50
47
|
"related_resource": "persons",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byu-oit/vue-decision-processing-components",
|
|
3
|
-
"version": "8.35.
|
|
3
|
+
"version": "8.35.14",
|
|
4
4
|
"description": "Vue components shared between decision processing systems for the CES schools.",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@fortawesome/fontawesome-free": "^5.15.4",
|
package/parsers/application.js
CHANGED
package/parsers/packetList.js
CHANGED
|
@@ -40,7 +40,6 @@ const parseTotal = json => {
|
|
|
40
40
|
|
|
41
41
|
const parseStats = json => {
|
|
42
42
|
const stats = get(json, 'stats', [])
|
|
43
|
-
console.log(`api/packetList::parseStats::stats=${JSON.stringify(stats)}`)
|
|
44
43
|
const admitPeriods = stats.map(s => s.key).filter(s => /^[0-9]{5}$/.test(s))
|
|
45
44
|
return stats.reduce((acc, curr) => {
|
|
46
45
|
const { key, value } = curr
|
|
@@ -52,6 +51,5 @@ export default (json) => {
|
|
|
52
51
|
const data = parseValues(json)
|
|
53
52
|
const total = parseTotal(json)
|
|
54
53
|
const stats = parseStats(json)
|
|
55
|
-
console.log(`api/packetList::parseResponse::stats=${JSON.stringify(stats)}`)
|
|
56
54
|
return { data, total, stats }
|
|
57
55
|
}
|