@byu-oit/vue-decision-processing-components 8.36.2 → 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/DetailsEndorsement.vue +52 -1
- package/DetailsFlagSection.vue +44 -4
- package/package.json +1 -1
- package/parsers/packet.js +5 -1
- package/vuexModules/packet/flags.js +33 -5
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/DetailsEndorsement.vue
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
<script>
|
|
31
31
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
|
32
|
-
import { faCheck,
|
|
32
|
+
import { faCheck, faExclamationTriangle, faSquare, faMinus, faHourglassHalf } from '@fortawesome/free-solid-svg-icons'
|
|
33
33
|
import { mapState, mapGetters } from 'vuex'
|
|
34
34
|
|
|
35
35
|
export default {
|
|
@@ -44,19 +44,70 @@
|
|
|
44
44
|
endorsementPendingFlag () { return this.flagByValue('EP') },
|
|
45
45
|
endorsementDeniedFlag () { return this.flagByValue('ED') },
|
|
46
46
|
endorsementIssuesFlag () { return this.flagByValue('EI') },
|
|
47
|
+
endorsementNewFlag () { return this.flagByValue('endorsement')},
|
|
47
48
|
icon () {
|
|
49
|
+
if (this.endorsementNewFlag != null){
|
|
50
|
+
switch(this.endorsementNewFlag.state.toLowerCase()){
|
|
51
|
+
case 'pass':
|
|
52
|
+
return faCheck
|
|
53
|
+
case 'fail':
|
|
54
|
+
return faMinus
|
|
55
|
+
case 'error':
|
|
56
|
+
return faExclamationTriangle
|
|
57
|
+
case 'indeterminate':
|
|
58
|
+
return faSquare
|
|
59
|
+
default:
|
|
60
|
+
return faExclamationTriangle
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//BELOW THIS IS THE OLD SYSTEM'S FLAG LOGIC (before the 'state' column was added)
|
|
48
64
|
if (this.endorsementDeniedFlag.isActive) return faExclamationTriangle
|
|
49
65
|
else if (this.endorsementIssuesFlag.isActive) return faExclamationTriangle
|
|
50
66
|
else if (this.endorsementPendingFlag.isActive) return faHourglassHalf
|
|
51
67
|
return faCheck
|
|
52
68
|
},
|
|
53
69
|
statusClass () {
|
|
70
|
+
if (this.endorsementNewFlag != null){
|
|
71
|
+
switch(this.endorsementNewFlag.state.toLowerCase()){
|
|
72
|
+
case 'pass':
|
|
73
|
+
return { 'text-success': true }
|
|
74
|
+
case 'fail':
|
|
75
|
+
return { 'text-danger': true }
|
|
76
|
+
case 'error':
|
|
77
|
+
return { 'text-danger': true, 'font-weight-bold': true }
|
|
78
|
+
case 'indeterminate':
|
|
79
|
+
return { 'text-dark': true }
|
|
80
|
+
default:
|
|
81
|
+
return { 'text-danger': true, 'font-weight-bold': true }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//BELOW THIS IS THE OLD SYSTEM'S FLAG LOGIC (before the 'state' column was added)
|
|
54
85
|
if (this.endorsementDeniedFlag.isActive) return { 'text-danger': true }
|
|
55
86
|
else if (this.endorsementIssuesFlag.isActive) return { 'text-danger': true }
|
|
56
87
|
else if (this.endorsementPendingFlag.isActive) return { 'text-dark': true, 'font-weight-bold': true }
|
|
57
88
|
return { 'text-success': true }
|
|
58
89
|
},
|
|
59
90
|
endorsementStatus () {
|
|
91
|
+
if (this.endorsementNewFlag != null) {
|
|
92
|
+
if (this.endorsementNewFlag.message != null && this.endorsementNewFlag.message.length > 0) {
|
|
93
|
+
return this.endorsementNewFlag.message
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
switch (this.endorsementNewFlag.state.toLowerCase()) {
|
|
97
|
+
case 'pass':
|
|
98
|
+
return 'Everything looks good!'
|
|
99
|
+
case 'fail':
|
|
100
|
+
return 'Requires additional attention.'
|
|
101
|
+
case 'error':
|
|
102
|
+
return 'An error occurred. Try again later.'
|
|
103
|
+
case 'indeterminate':
|
|
104
|
+
return 'No data available.'
|
|
105
|
+
default:
|
|
106
|
+
return 'An error occurred. Try again later.'
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//BELOW THIS IS THE OLD SYSTEM'S FLAG LOGIC (before the 'state' column was added)
|
|
60
111
|
if (this.endorsementDeniedFlag.isActive) return `Endorsement Denied`
|
|
61
112
|
else if (this.endorsementIssuesFlag.isActive) return `Endorsement Issues`
|
|
62
113
|
else if (this.endorsementPendingFlag.isActive) return `Endorsement Pending`
|
package/DetailsFlagSection.vue
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
<button :class="btnClass" @click="flagModal">
|
|
24
24
|
{{btnText}}
|
|
25
25
|
</button>
|
|
26
|
+
<!-- <slot name="refreshButton"></slot>-->
|
|
26
27
|
</div>
|
|
27
28
|
<div v-if="hasSummary" class="summary">
|
|
28
29
|
<slot name="summary"></slot>
|
|
@@ -32,13 +33,11 @@
|
|
|
32
33
|
<slot></slot>
|
|
33
34
|
</div>
|
|
34
35
|
</div>
|
|
35
|
-
</span>
|
|
36
36
|
</template>
|
|
37
37
|
<script>
|
|
38
38
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
|
39
|
-
import { faCheck,
|
|
39
|
+
import { faCheck,faExclamationTriangle,faSquare,faMinus } from '@fortawesome/free-solid-svg-icons'
|
|
40
40
|
import { mapGetters } from 'vuex'
|
|
41
|
-
|
|
42
41
|
import ExpandIndicator from './ExpandIndicator'
|
|
43
42
|
|
|
44
43
|
export default {
|
|
@@ -58,7 +57,11 @@
|
|
|
58
57
|
},
|
|
59
58
|
'flagActiveColor': { type: String },
|
|
60
59
|
'flagInactiveColor': { type: String },
|
|
61
|
-
'hideIfUnset': { type: Boolean }
|
|
60
|
+
'hideIfUnset': { type: Boolean },
|
|
61
|
+
'flagPassColor': { type: String, default: 'success' },
|
|
62
|
+
'flagErrorColor': { type: String, default: 'dark' },
|
|
63
|
+
'flagFailColor': { type: String, default: 'danger' },
|
|
64
|
+
'flagIndeterminateColor': { type: String, default: 'secondary' }
|
|
62
65
|
},
|
|
63
66
|
data () {
|
|
64
67
|
return {
|
|
@@ -83,9 +86,46 @@
|
|
|
83
86
|
return this.flag.isActive ? 'clear flag' : 'set flag'
|
|
84
87
|
},
|
|
85
88
|
flagIcon () {
|
|
89
|
+
//If there is no flag set, the state is 'indeterminate'
|
|
90
|
+
if (this.flag == null){
|
|
91
|
+
return faSquare
|
|
92
|
+
}
|
|
93
|
+
if (this.flag.state != null){
|
|
94
|
+
switch (this.flag.state.toLowerCase()){
|
|
95
|
+
case 'pass':
|
|
96
|
+
return faCheck
|
|
97
|
+
case 'fail':
|
|
98
|
+
return faMinus
|
|
99
|
+
case 'error':
|
|
100
|
+
return faExclamationTriangle
|
|
101
|
+
case 'indeterminate':
|
|
102
|
+
return faSquare
|
|
103
|
+
default:
|
|
104
|
+
return faExclamationTriangle
|
|
105
|
+
}
|
|
106
|
+
}
|
|
86
107
|
return this.flag.isActive ? faExclamationTriangle : faCheck
|
|
87
108
|
},
|
|
88
109
|
flagBg () {
|
|
110
|
+
//If there is no flag set, the state is 'indeterminate'
|
|
111
|
+
if (this.flag == null){
|
|
112
|
+
return `bg-${this.flagIndeterminateColor}`
|
|
113
|
+
}
|
|
114
|
+
if (this.flag.state != null){
|
|
115
|
+
switch (this.flag.state.toLowerCase()){
|
|
116
|
+
case 'pass':
|
|
117
|
+
return `bg-${this.flagPassColor}`
|
|
118
|
+
case 'fail':
|
|
119
|
+
return `bg-${this.flagFailColor}`
|
|
120
|
+
case 'error':
|
|
121
|
+
return `bg-${this.flagErrorColor}`
|
|
122
|
+
case 'indeterminate':
|
|
123
|
+
return `bg-${this.flagIndeterminateColor}`
|
|
124
|
+
default:
|
|
125
|
+
return `bg-${this.flagErrorColor}`
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
89
129
|
const stateAware = this.flagActiveColor && this.flagInactiveColor
|
|
90
130
|
if (!stateAware) return `bg-${this.flagType}`
|
|
91
131
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byu-oit/vue-decision-processing-components",
|
|
3
|
-
"version": "8.
|
|
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",
|
package/parsers/packet.js
CHANGED
|
@@ -12,6 +12,8 @@ export const parseFlag = f => {
|
|
|
12
12
|
const clearedBy = get(f, 'id_cleared_by.description')
|
|
13
13
|
const clearedById = get(f, 'id_cleared_by.value')
|
|
14
14
|
const type = get(f, 'type.value')
|
|
15
|
+
const state = get(f, 'state.value')
|
|
16
|
+
const message = get(f, 'message.value')
|
|
15
17
|
return {
|
|
16
18
|
dateTimeCleared,
|
|
17
19
|
setBy,
|
|
@@ -21,7 +23,9 @@ export const parseFlag = f => {
|
|
|
21
23
|
dateTimeSet,
|
|
22
24
|
clearedBy,
|
|
23
25
|
clearedById,
|
|
24
|
-
type
|
|
26
|
+
type,
|
|
27
|
+
state,
|
|
28
|
+
message
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
|
|
@@ -17,14 +17,36 @@ const blockingVirtualFlag = flags => {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const endorseVirtualFlag = flags => {
|
|
20
|
+
// Get new endorsement flag data
|
|
21
|
+
const endorsementNewFlag = flags.filter(f => f.value === 'endorsement')
|
|
22
|
+
if(endorsementNewFlag.length > 0) return endorsementNewFlag[0]
|
|
23
|
+
|
|
24
|
+
// Maintain old functionality
|
|
20
25
|
const edFlag = flags.filter(f => f.value === 'ED').filter(f => f.isActive)
|
|
21
26
|
const eiFlag = flags.filter(f => f.value === 'EI').filter(f => f.isActive)
|
|
22
27
|
const allFlags = edFlag.concat(eiFlag)
|
|
23
28
|
if (allFlags.length > 0) return allFlags[0]
|
|
24
|
-
|
|
29
|
+
|
|
30
|
+
// Default if no flag data is found
|
|
31
|
+
const value = 'endorsement'
|
|
25
32
|
const name = 'Endorsement Problem'
|
|
26
33
|
const type = 'Process'
|
|
27
|
-
return { value, name, type, isActive: false, isSet: false, isCleared: false, isBlocking: true }
|
|
34
|
+
return { value, name, type, isActive: false, isSet: false, isCleared: false, isBlocking: true, state: 'indeterminate' }
|
|
35
|
+
}
|
|
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' }
|
|
28
50
|
}
|
|
29
51
|
|
|
30
52
|
// getters
|
|
@@ -38,8 +60,10 @@ export const getters = {
|
|
|
38
60
|
const flags = getters.flags
|
|
39
61
|
if (flagValue === 'blocking') {
|
|
40
62
|
return blockingVirtualFlag(flags)
|
|
41
|
-
} else if (flagValue === '
|
|
63
|
+
} else if (flagValue === 'endorsement') {
|
|
42
64
|
return endorseVirtualFlag(flags)
|
|
65
|
+
} else if (flagValue === 'cesHolds') {
|
|
66
|
+
return cesHoldsVirtualFlag(flags)
|
|
43
67
|
}
|
|
44
68
|
const flag = flags.find(({ value }) => value === flagValue)
|
|
45
69
|
return flag || { value: flagValue, name: flagValueToName(flagValue), isSet: false, isCleared: false, isActive: false }
|
|
@@ -86,7 +110,9 @@ export const convertFlag = flag => {
|
|
|
86
110
|
dateTimeSet,
|
|
87
111
|
setBy,
|
|
88
112
|
dateTimeCleared,
|
|
89
|
-
clearedBy
|
|
113
|
+
clearedBy,
|
|
114
|
+
state,
|
|
115
|
+
message
|
|
90
116
|
} = flag
|
|
91
117
|
const isBlocking = /process|wait/i.test(type)
|
|
92
118
|
return {
|
|
@@ -100,7 +126,9 @@ export const convertFlag = flag => {
|
|
|
100
126
|
setBy,
|
|
101
127
|
dateTimeCleared,
|
|
102
128
|
clearedBy,
|
|
103
|
-
isBlocking
|
|
129
|
+
isBlocking,
|
|
130
|
+
state,
|
|
131
|
+
message
|
|
104
132
|
}
|
|
105
133
|
}
|
|
106
134
|
|