@byu-oit/vue-decision-processing-components 8.32.2 → 8.32.3

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,14 @@
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.32.3](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.32.2...v8.32.3) (2022-12-21)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * put pagination param in header so that csv/svg can be returned and not a JSON object ([1159dc1](https://github.com/byu-oit/vue-decision-processing-components/commit/1159dc14c0a31fa2ad24c77f11a2907517a01855))
11
+ * put pagination param in header so that csv/svg can be returned and not a JSON object ([dbed445](https://github.com/byu-oit/vue-decision-processing-components/commit/dbed445e5fdf3639cf1ad0b0a1b1838d8c0cf774))
12
+
5
13
  ### [8.32.2](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.32.1...v8.32.2) (2022-12-15)
6
14
 
7
15
  ### [8.32.1](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.32.0...v8.32.1) (2022-12-06)
package/Report.vue CHANGED
@@ -159,7 +159,36 @@ export default {
159
159
  this.loading = true
160
160
  this.$emit('loading')
161
161
  window.scrollTo(0, 0)
162
- const q = this.getQuery()
162
+
163
+ const q = new URLSearchParams()
164
+ q.append('name', this.reportName)
165
+ if (this.selectedAdmitPeriod) {
166
+ q.append('admit_period', this.selectedAdmitPeriod)
167
+ } else if(this.metadata.parameters.includes('admitPeriod')) {
168
+ // Don't attempt to load report if we're missing the admit period
169
+ return
170
+ }
171
+ if (this.paginateReport && this.paginateReport !== 'null') {
172
+ q.append('pagination_parameter', this.paginateReport)
173
+ q.append('limit', this.limit)
174
+ q.append('cursor', this.newCursor)
175
+ }
176
+ if (this.dateRange) {
177
+ const toYYYYMMDD = dt => dt.toISOString().substr(0, 10)
178
+ const startDate = toYYYYMMDD(this.dateRange[0])
179
+ const endDate = toYYYYMMDD(this.dateRange[1])
180
+ q.append('date_start', startDate)
181
+ q.append('date_end', endDate)
182
+ }
183
+ if (this.metadata.parameters.includes('setById') && this.setById) {
184
+ q.append('set_by_id', this.setById)
185
+ }
186
+ // appends institution if available to url search params
187
+ if(this.metadata.parameters.includes('institutions')) {
188
+ if(this.metadata.parameters.institutions.includes(state.institution))
189
+ q.append('institution', state.institution)
190
+ }
191
+
163
192
  const url = this.baseUrl + '?' + q.toString()
164
193
  const loadRequested = () => {
165
194
  let promises = []
@@ -190,11 +219,10 @@ export default {
190
219
  let csv = ''
191
220
  do {
192
221
  const reportResponse = await this.loadReport(url, 'text/csv')
193
- csv = csv + reportResponse.body
194
- this.newCursor = reportResponse.cursor
222
+ csv = csv + reportResponse
195
223
  const q = this.getQuery()
196
224
  url = this.baseUrl + '?' + q.toString()
197
- } while (this.newCursor !== 'null')
225
+ } while (this.newCursor && this.newCursor !== 'null')
198
226
 
199
227
  if (csv && csv.length > 0 && /\n/.test(csv)) {
200
228
  this.csvContent = csv
@@ -226,7 +254,8 @@ export default {
226
254
  console.error(err.stack)
227
255
  return null
228
256
  }
229
- return JSON.parse(await response.text())
257
+ this.newCursor = response.headers.get('Cursor')
258
+ return await response.text()
230
259
  } catch (err) {
231
260
  this.error = true
232
261
  console.error(err)
@@ -250,7 +279,7 @@ export default {
250
279
  // Don't attempt to load report if we're missing the admit period
251
280
  return
252
281
  }
253
- if (this.paginateReport !== 'null') {
282
+ if (this.paginateReport && this.paginateReport !== 'null') {
254
283
  q.append('pagination_parameter', this.paginateReport)
255
284
  q.append('limit', this.limit)
256
285
  q.append('cursor', this.newCursor)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byu-oit/vue-decision-processing-components",
3
- "version": "8.32.2",
3
+ "version": "8.32.3",
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",