@byu-oit/vue-decision-processing-components 8.37.0-0 → 8.37.0-1
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 +60 -104
- package/package.json +1 -1
- package/vuexModules/packet/flags.js +17 -0
package/DetailsCesHold.vue
CHANGED
|
@@ -15,126 +15,82 @@
|
|
|
15
15
|
-->
|
|
16
16
|
<template>
|
|
17
17
|
<div class="ces-hold">
|
|
18
|
-
<span
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<font-awesome-icon :icon="holdIcon" />
|
|
23
|
-
{{ holdSet ? 'CES Standards Hold' : 'No CES Standards Hold' }}
|
|
24
|
-
</span>
|
|
25
|
-
<span v-else-if="error" class="text-error">
|
|
26
|
-
<font-awesome-icon :icon="holdIcon" />
|
|
27
|
-
Error checking CES Standards Hold
|
|
28
|
-
</span>
|
|
29
|
-
<span v-else class="text-gray">
|
|
30
|
-
<font-awesome-icon :icon="spinner" spin />
|
|
31
|
-
Loading...
|
|
18
|
+
<span :class="statusClass">
|
|
19
|
+
<font-awesome-icon :icon="flagIcon" />
|
|
20
|
+
|
|
21
|
+
{{cesHoldStatus}}
|
|
32
22
|
</span>
|
|
33
23
|
</div>
|
|
34
24
|
</template>
|
|
35
25
|
<script>
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
|
27
|
+
import { faCheck, faExclamationTriangle, faSquare, faMinus, faHourglassHalf, faQuestionCircle } from '@fortawesome/free-solid-svg-icons'
|
|
38
28
|
|
|
39
|
-
|
|
29
|
+
import { mapGetters } from 'vuex'
|
|
40
30
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
computed: {
|
|
64
|
-
...mapState({
|
|
65
|
-
env: 'environment',
|
|
66
|
-
applicantId: state => state.application.applicantId,
|
|
67
|
-
applicantFirstName: state => state.application.basic.preferredFirstName,
|
|
68
|
-
applicantSurname: state => state.application.basic.surname,
|
|
69
|
-
applicantDob: state => state.application.personalRecords.dateOfBirth
|
|
70
|
-
}),
|
|
71
|
-
spinner () { return faSpinner },
|
|
72
|
-
holdIcon () {
|
|
73
|
-
return this.holdSet ? faExclamationTriangle : this.error ? faQuestionCircle : faCheck
|
|
31
|
+
export default {
|
|
32
|
+
name: 'DetailsCesHold',
|
|
33
|
+
components: {
|
|
34
|
+
FontAwesomeIcon
|
|
35
|
+
},
|
|
36
|
+
computed: {
|
|
37
|
+
...mapGetters([ 'flagByValue' ]),
|
|
38
|
+
flag() { return this.flagByValue('cesHolds') },
|
|
39
|
+
statusClass() {
|
|
40
|
+
if (this.flag != null){
|
|
41
|
+
switch(this.flag.state.toLowerCase()){
|
|
42
|
+
case 'pass':
|
|
43
|
+
return { 'text-success': true }
|
|
44
|
+
case 'fail':
|
|
45
|
+
return { 'text-danger': true }
|
|
46
|
+
case 'error':
|
|
47
|
+
return { 'text-danger': true, 'font-weight-bold': true }
|
|
48
|
+
case 'indeterminate':
|
|
49
|
+
return { 'text-dark': true }
|
|
50
|
+
default:
|
|
51
|
+
return { 'text-danger': true, 'font-weight-bold': true }
|
|
52
|
+
}
|
|
74
53
|
}
|
|
75
54
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
|
55
|
+
flagIcon() {
|
|
56
|
+
if (this.flag != null) {
|
|
57
|
+
switch (this.flag.state.toLowerCase()) {
|
|
58
|
+
case 'pass':
|
|
59
|
+
return faCheck
|
|
60
|
+
case 'fail':
|
|
61
|
+
return faMinus
|
|
62
|
+
case 'error':
|
|
63
|
+
return faExclamationTriangle
|
|
64
|
+
case 'indeterminate':
|
|
65
|
+
return faSquare
|
|
66
|
+
default:
|
|
67
|
+
return faExclamationTriangle
|
|
103
68
|
}
|
|
104
69
|
}
|
|
105
70
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return
|
|
111
|
-
}
|
|
112
|
-
try {
|
|
113
|
-
const url = this.env !== 'development'
|
|
114
|
-
? `https://api.byu.edu/recordsYAPI/v1.0/student/byuId/${applicantId.trim()}/CESflagsHolds`
|
|
115
|
-
: `https://api-sandbox.byu.edu/recordsYAPI/v1.0/student/byuId/${applicantId.trim()}/CESflagsHolds`
|
|
116
|
-
const { body, status } = await window.byu.auth.request({ url })
|
|
117
|
-
if (status >= 400) {
|
|
118
|
-
this.error = true
|
|
119
|
-
return
|
|
71
|
+
cesHoldStatus() {
|
|
72
|
+
if (this.flag != null) {
|
|
73
|
+
if (this.flag.message != null && this.flag.message.length > 0) {
|
|
74
|
+
return this.flag.message
|
|
120
75
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
76
|
+
else {
|
|
77
|
+
switch (this.flag.state.toLowerCase()) {
|
|
78
|
+
case 'pass':
|
|
79
|
+
return 'Everything looks good!'
|
|
80
|
+
case 'fail':
|
|
81
|
+
return 'Requires additional attention.'
|
|
82
|
+
case 'error':
|
|
83
|
+
return 'An error occurred. Try again later.'
|
|
84
|
+
case 'indeterminate':
|
|
85
|
+
return 'No data available.'
|
|
86
|
+
default:
|
|
87
|
+
return 'An error occurred. Try again later.'
|
|
88
|
+
}
|
|
129
89
|
}
|
|
130
|
-
|
|
131
|
-
this.loaded = true
|
|
132
|
-
} catch (err) {
|
|
133
|
-
console.error(err)
|
|
134
|
-
this.error = true
|
|
135
90
|
}
|
|
136
91
|
}
|
|
137
92
|
}
|
|
93
|
+
}
|
|
138
94
|
</script>
|
|
139
95
|
<style scoped>
|
|
140
96
|
</style>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byu-oit/vue-decision-processing-components",
|
|
3
|
-
"version": "8.37.0-
|
|
3
|
+
"version": "8.37.0-1",
|
|
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",
|
|
@@ -34,6 +34,21 @@ const endorseVirtualFlag = flags => {
|
|
|
34
34
|
return { value, name, type, isActive: false, isSet: false, isCleared: false, isBlocking: true, state: 'indeterminate' }
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
const cesHoldsVirtualFlag = flags => {
|
|
38
|
+
const cesHoldsFlag = flags.filter(f => f.value === 'cesHolds')
|
|
39
|
+
if (cesHoldsFlag.length > 0) return cesHoldsFlag[0]
|
|
40
|
+
|
|
41
|
+
const cesFlags = flags.find(f => f.value === 'CES')
|
|
42
|
+
if (cesFlags != null) {
|
|
43
|
+
return { ...cesFlags, state: 'fail' }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const value = 'cesHolds'
|
|
47
|
+
const name = 'CES Standard Hold'
|
|
48
|
+
const type = 'Process'
|
|
49
|
+
return { value, name, type, isActive: false, isSet: false, isCleared: false, isBlocking: true, state: 'indeterminate' }
|
|
50
|
+
}
|
|
51
|
+
|
|
37
52
|
// getters
|
|
38
53
|
export const getters = {
|
|
39
54
|
flags (state) {
|
|
@@ -47,6 +62,8 @@ export const getters = {
|
|
|
47
62
|
return blockingVirtualFlag(flags)
|
|
48
63
|
} else if (flagValue === 'endorsement') {
|
|
49
64
|
return endorseVirtualFlag(flags)
|
|
65
|
+
} else if (flagValue === 'cesHolds') {
|
|
66
|
+
return cesHoldsVirtualFlag(flags)
|
|
50
67
|
}
|
|
51
68
|
const flag = flags.find(({ value }) => value === flagValue)
|
|
52
69
|
return flag || { value: flagValue, name: flagValueToName(flagValue), isSet: false, isCleared: false, isActive: false }
|