@byu-oit/vue-decision-processing-components 8.27.1 → 8.27.4

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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [8.27.4](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.27.3...v8.27.4) (2022-07-13)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * sorting of test scores (was comparing strings instead of dates) ([308fb72](https://github.com/byu-oit/vue-decision-processing-components/commit/308fb728f1a5eb525472d2e438d5ddd787f09771))
11
+
12
+ ### [8.27.3](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.27.2...v8.27.3) (2022-06-29)
13
+
14
+ ### [8.27.2](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.27.1...v8.27.2) (2022-06-24)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * some applications have a 3rd field for GPA ([e18e15f](https://github.com/byu-oit/vue-decision-processing-components/commit/e18e15fe8a64303c92691e8e4b2cded06dfd9586))
20
+
5
21
  ### [8.27.1](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.27.0...v8.27.1) (2022-06-15)
6
22
 
7
23
 
@@ -87,7 +87,7 @@
87
87
  return highSchool.gpaCalculated
88
88
  }
89
89
  } else {
90
- return highSchool.highSchoolGpa
90
+ return highSchool.highSchoolGpa || highSchool.officialGpa
91
91
  }
92
92
  } else {
93
93
  return ''
@@ -25,7 +25,7 @@
25
25
  </tr>
26
26
  </thead>
27
27
  <tbody>
28
- <tr v-for="(ts, i) in testScores">
28
+ <tr v-for="(ts, i) in orderedTestScores">
29
29
  <td>
30
30
  {{ts.testName}}
31
31
  <template v-if="ts.selfReported">
@@ -45,7 +45,7 @@
45
45
  <span class="bold">({{ts.compositeScore | sat2ActFilter}} ACT)</span>
46
46
  </td>
47
47
  <td v-else class="composite">
48
- <span class="badge badge-primary x-lg">{{ts.compositeScore}}</span>
48
+ <span class="badge badge-primary x-lg">{{ts.compositeScore | removeLeadingZeros}}</span>
49
49
  </td>
50
50
  <td>
51
51
  <table class="table table-borderless table-sm" v-if="ts.testComponents.length > 0">
@@ -53,7 +53,7 @@
53
53
  <th v-for="sub in ts.testComponents" :key="sub.name">{{sub.name}}</th>
54
54
  </thead>
55
55
  <tbody>
56
- <td v-for="sub in ts.testComponents" :key="sub.name">{{sub.score}}</td>
56
+ <td v-for="sub in ts.testComponents" :key="sub.name">{{sub.score | removeLeadingZeros}}</td>
57
57
  </tbody>
58
58
  </table>
59
59
  </td>
@@ -69,14 +69,50 @@ import { mapGetters } from 'vuex'
69
69
  import { dateFormat } from './dateTimeFormat'
70
70
  import { sat2ActFilter } from './sat2Act'
71
71
 
72
+ function yearMonth2Date (yearMonth) {
73
+ if (!/^[0-9]{4}-[0-9]{2}$/.test(yearMonth)) {
74
+ return yearMonth
75
+ }
76
+ const year = yearMonth.slice(0, 4)
77
+ const month = yearMonth.slice(5, 7)
78
+ return new Date(year, parseInt(month) - 1)
79
+ }
80
+
72
81
  export default {
73
82
  name: 'DetailsTestScores',
74
83
  computed: {
75
- ...mapGetters([ 'testScores' ])
84
+ ...mapGetters([ 'testScores' ]),
85
+
86
+ orderedTestScores() {
87
+ // sort test scores by test date
88
+ const scores = this.testScores.slice().sort((a, b) => {
89
+ const dt1 = yearMonth2Date(a.testDate)
90
+ const dt2 = yearMonth2Date(b.testDate)
91
+ if (!dt1 instanceof Date && !dt2 instanceof Date) return 0
92
+ if (!dt1 instanceof Date) return 1
93
+ if (!dt2 instanceof Date) return -1
94
+
95
+ return dt1 < dt2 ? 1 : -1
96
+ })
97
+
98
+ // sort 'reading' before 'listening' for TOEFL test
99
+ for (let score of scores) {
100
+ if (!score.testComponents || score.testName !== 'TOEFL') continue
101
+ score.testComponents = score.testComponents.sort((a, b) => {
102
+ if (a.name === 'listening' && b.name === 'reading') return 1
103
+ return 0
104
+ })
105
+ }
106
+ return scores
107
+ }
76
108
  },
77
109
  filters: {
78
110
  dateFormat,
79
- sat2ActFilter
111
+ sat2ActFilter,
112
+ removeLeadingZeros: function (value) {
113
+ if ( (!value) || !(/^\d+$/.test(value)) ) return value // leave as is if not a string of numbers
114
+ return parseInt(value, 10) // remove leading zeros
115
+ }
80
116
  }
81
117
  }
82
118
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byu-oit/vue-decision-processing-components",
3
- "version": "8.27.1",
3
+ "version": "8.27.4",
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",
@@ -185,6 +185,7 @@ export const parseHighSchoolSummaries = a => {
185
185
  graduationStatus: get(h, 'graduation_status.value'),
186
186
  graduationDate: get(h, 'graduation_date.value'),
187
187
  highSchoolGpa: get(h, 'high_school_gpa.value'),
188
+ officialGpa: get(h, 'official_gpa.value'),
188
189
  gpaCalculated: get(h, 'gpa_calculated.value'),
189
190
  concurrentEnrollment: get(h, 'concurrent_enrollment.value'),
190
191
  updatedDateTime: get(h, 'updated_date_time.value'),
@@ -9,6 +9,7 @@
9
9
  * graduationStatus: '',
10
10
  * graduationDate: '',
11
11
  * highSchoolGpa: '',
12
+ * officialGpa: '',
12
13
  * gpaCalculated: '',
13
14
  * concurrentEnrollment: '',
14
15
  * updatedDateTime: '',