@byu-oit/vue-decision-processing-components 8.27.3 → 8.28.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/CHANGELOG.md CHANGED
@@ -2,6 +2,33 @@
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.28.1](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.28.0...v8.28.1) (2022-07-26)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * assign the filter/map chain to use later ([2818502](https://github.com/byu-oit/vue-decision-processing-components/commit/2818502414017f8a53dd11c804ffc0e38a2155e6))
11
+
12
+ ## [8.28.0](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.27.4...v8.28.0) (2022-07-20)
13
+
14
+
15
+ ### Features
16
+
17
+ * filter reports from new app svc based on institution -- WIP ([b64110a](https://github.com/byu-oit/vue-decision-processing-components/commit/b64110af2bef04c2185e3d96ee47aaf4aeda5339))
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * make a spot for institution in the vuex store ([bbf1e45](https://github.com/byu-oit/vue-decision-processing-components/commit/bbf1e45aeaa78bd62250e1af018c488b9b7ccb97))
23
+ * reports in the new application service that are requested through a proxy call have a different url pattern ([d781980](https://github.com/byu-oit/vue-decision-processing-components/commit/d7819803dde7cc8ba4104355f8f54005be4a1126))
24
+
25
+ ### [8.27.4](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.27.3...v8.27.4) (2022-07-13)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * sorting of test scores (was comparing strings instead of dates) ([308fb72](https://github.com/byu-oit/vue-decision-processing-components/commit/308fb728f1a5eb525472d2e438d5ddd787f09771))
31
+
5
32
  ### [8.27.3](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.27.2...v8.27.3) (2022-06-29)
6
33
 
7
34
  ### [8.27.2](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.27.1...v8.27.2) (2022-06-24)
@@ -69,6 +69,15 @@ 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: {
@@ -76,10 +85,14 @@ export default {
76
85
 
77
86
  orderedTestScores() {
78
87
  // sort test scores by test date
79
- const scores = this.testScores.sort((a, b) => {
80
- if (!a.testDate) return 1
81
- if (a.testDate > b.testDate) return 1
82
- else return 0
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
83
96
  })
84
97
 
85
98
  // sort 'reading' before 'listening' for TOEFL test
package/Report.vue CHANGED
@@ -169,6 +169,12 @@ export default {
169
169
  if (this.metadata.parameters.includes('setById')) {
170
170
  q.append('set_by_id', this.setById)
171
171
  }
172
+ // appends institution if available to url search params
173
+ if(this.metadata.parameters.includes('institutions')) {
174
+ if(this.metadata.parameters.institutions.includes(state.institution))
175
+ q.append('institution', state.institution)
176
+ }
177
+
172
178
  const url = this.baseUrl + '?' + q.toString()
173
179
  const loadRequested = () => {
174
180
  let promises = []
package/ReportList.vue CHANGED
@@ -53,20 +53,21 @@ export default {
53
53
  },
54
54
  computed: {
55
55
  ...mapState({
56
- reports: state => state.reports.list
56
+ reports: state => state.reports.list,
57
+ institution: state => state.ui.institution
57
58
  }),
58
59
  categories () {
59
- const reports = this.reports
60
+ // Filters reports to have reports specefic to dp institution
61
+ const reports = this.reports.filter(ins => ins.institution.includes(state.institution)).map(ins => ins.institution)
60
62
  const allObjectCategories = reports.map(o => o.category)
61
- const addToSet = (set, o) => set.add(o)
62
- const uniqueCategories = Array.from(allObjectCategories.reduce(addToSet, new Set()))
63
+ let uniqueCategories = new Set()
64
+ allObjectCategories.forEach((category) => uniqueCategories.add(category))
63
65
  return uniqueCategories.filter(c => c && c !== 'system')
64
66
  }
65
67
  },
66
68
  methods: {
67
69
  reportsWithCategory(category) {
68
- const allReports = Object.values(this.reports)
69
- return allReports.filter(o => o.category === category)
70
+ return this.reports.filter(o => o.category === category)
70
71
  }
71
72
  }
72
73
  }
package/ReportViewer.vue CHANGED
@@ -40,7 +40,7 @@
40
40
  <Report
41
41
  v-if="selectedReport"
42
42
  :report-name="selectedReport.name"
43
- :base-url="selectedReport.appService ? appBaseUrl : packetBaseUrl"
43
+ :base-url="calculatedBaseUrl"
44
44
  :detail="showDetail"
45
45
  :chart="showChart"
46
46
  />
@@ -94,6 +94,18 @@ export default {
94
94
  } else {
95
95
  return false
96
96
  }
97
+ },
98
+ calculatedBaseUrl () {
99
+ let reportUrl = ''
100
+ if (this.selectedReport.appService) {
101
+ reportUrl = this.appBaseUrl
102
+ } else {
103
+ reportUrl = this.packetBaseUrl
104
+ }
105
+ if (this.selectedReport.proxy) {
106
+ reportUrl = reportUrl + '/proxy'
107
+ }
108
+ return reportUrl + '/report'
97
109
  }
98
110
  },
99
111
  methods: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byu-oit/vue-decision-processing-components",
3
- "version": "8.27.3",
3
+ "version": "8.28.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",
@@ -1,13 +1,13 @@
1
1
  'use strict'
2
2
  /*
3
- * Converts array of reportMetadata objects into an object with the report name as their key.
4
- * example reports.admitCandidates = metadata for the admitCandidates report.
5
- *
6
- * use case: to retrieve meta-data from state for a single report.
3
+ * Add a field to each report metadata item that remembers if it's part
4
+ * of the application service (so that we can call the right service
5
+ * when we retrieve the report data)
7
6
  */
8
- export default function parse (reportMetadata, appService) {
7
+ export default function parse (reportMetadata, appService = false, proxy = false) {
9
8
  reportMetadata.values.forEach(function (element) {
10
- element['appService'] = appService
9
+ element.appService = appService
10
+ element.proxy = proxy
11
11
  })
12
12
  return reportMetadata.values
13
13
  }
@@ -2,13 +2,15 @@ const KEY = 'edu.byu.dp.hawaii.ui'
2
2
 
3
3
  export const state = {
4
4
  viewedApplications: [],
5
- admitPeriod: ''
5
+ admitPeriod: '',
6
+ institution: ''
6
7
  }
7
8
 
8
9
  export const mutations = {
9
10
  resetUi (state) {
10
11
  state.viewedApplications = []
11
12
  state.admitPeriod = ''
13
+ state.institution = ''
12
14
  },
13
15
  setUi (state, ui) {
14
16
  if (Array.isArray(ui.viewedApplications)) {
@@ -17,6 +19,9 @@ export const mutations = {
17
19
  if (ui.admitPeriod !== undefined) {
18
20
  state.admitPeriod = ui.admitPeriod
19
21
  }
22
+ if (ui.institution !== undefined) {
23
+ state.institution = ui.institution
24
+ }
20
25
  },
21
26
  viewApplication (state, { appId, name }) {
22
27
  if (state.viewedApplications.find(i => i.appId === appId)) {
@@ -30,6 +35,9 @@ export const mutations = {
30
35
  },
31
36
  selectAdmitPeriod (state, admitPeriod) {
32
37
  state.admitPeriod = admitPeriod
38
+ },
39
+ setInstitution (state, institution) {
40
+ state.institution = institution
33
41
  }
34
42
  }
35
43