@byu-oit/vue-decision-processing-components 9.4.0 → 9.5.0

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.
@@ -14,7 +14,7 @@ jobs:
14
14
  runs-on: ubuntu-latest
15
15
  steps:
16
16
  - name: Check out
17
- uses: actions/checkout@v3
17
+ uses: actions/checkout@v4
18
18
 
19
19
  - name: Set up Node.js
20
20
  uses: actions/setup-node@v4
@@ -0,0 +1,54 @@
1
+ <template>
2
+ <byu-control-date-selector
3
+ ref="selector"
4
+ :value="value"
5
+ @change="onChange"
6
+ :date-type="dateType"
7
+ :prior-terms="priorTerms"
8
+ :subsequent-terms="subsequentTerms"
9
+ ></byu-control-date-selector>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ name: 'ByuDateSelector',
15
+ props: {
16
+ value: String,
17
+ dateType: {
18
+ type: String,
19
+ default: 'CURRENT_YYT'
20
+ },
21
+ priorTerms: {
22
+ type: Number,
23
+ default: 3
24
+ },
25
+ subsequentTerms: {
26
+ type: Number,
27
+ default: 4
28
+ }
29
+ },
30
+ watch: {
31
+ value(newVal) {
32
+ const element = this.$refs.selector
33
+ if (element && newVal && element.value !== newVal) {
34
+ element.value = newVal
35
+ element.dispatchEvent(new Event('input', { bubbles: true }))
36
+ }
37
+ }
38
+ },
39
+ mounted() {
40
+ if (this.value) {
41
+ const element = this.$refs.selector
42
+ if (element && element.value !== this.value) {
43
+ element.value = this.value
44
+ element.dispatchEvent(new Event('input', { bubbles: true }))
45
+ }
46
+ }
47
+ },
48
+ methods: {
49
+ onChange(e) {
50
+ this.$emit('input', e.target.value)
51
+ }
52
+ }
53
+ }
54
+ </script>
package/Report.vue CHANGED
@@ -1,334 +1,368 @@
1
- <!--
2
- Copyright 2018 Brigham Young University
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License")
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- -->
16
- <template>
17
- <div class="report" v-if="metadata">
18
- <ReportSvg
19
- v-if="chart"
20
- v-bind="$attrs"
21
- v-on="$listeners"
22
- :svgContent="svgContent"
23
- :loaded="loaded"
24
- :error="error"/>
25
- <template v-if="!hideDescription">
26
- <h1 v-if="metadata.description">{{metadata.description}}</h1>
27
- <h4 v-if="metadata.long_description" class="no-uppercase">{{metadata.long_description}}</h4>
28
- <byu-control-date-selector
29
- v-if="metadata.parameters.includes('admitPeriod')"
30
- :value="selectedAdmitPeriod"
31
- @change="selectedAdmitPeriod = $event.target.value"
32
- date-type="CURRENT_YYT"
33
- prior-terms="3"
34
- subsequent-terms="4"
35
- ></byu-control-date-selector>
36
- <date-picker
37
- v-if="metadata.parameters.includes('date_start') && metadata.parameters.includes('date_end')"
38
- v-model="dateRange"
39
- range
40
- :not-after="new Date()"
41
- lang="en"
42
- />
43
- </template>
44
- <template v-if="detail && photoLink">
45
- <div>
46
- <input type="checkbox" v-model="showPhotos" id="components-Report-showPhotos">
47
- <label for="components-Report-showPhotos">Show Photos</label>
48
- </div>
49
- <ReportPhotos
50
- v-if="showPhotos"
51
- :rows="rows"
52
- :column-metadata="metadata.columns"
53
- :loading="loading"
54
- :error="error"/>
55
- <ReportDetail
56
- v-else
57
- :csv="csvContent"
58
- :column-metadata="metadata.columns"
59
- :rows="rows"
60
- :loading="loading"
61
- :error="error"
62
- :detailPath="detailPath"
63
- :newTab="newTab"/>
64
- </template>
65
- <template v-else>
66
- <ReportDetail
67
- v-if="detail"
68
- :csv="csvContent"
69
- :column-metadata="metadata.columns"
70
- :rows="rows"
71
- :loading="loading"
72
- :error="error"
73
- :detailPath="detailPath"
74
- :newTab="newTab" />
75
- </template>
76
- <router-link v-else-if="to" :to="to">View Details</router-link>
77
- </div>
78
- </template>
79
-
80
- <script>
81
- import { parse } from 'csv-string'
82
- import ReportDetail from './ReportDetail.vue'
83
- import ReportPhotos from './ReportPhotos.vue'
84
- import ReportSvg from './ReportSvg.vue'
85
- import Reports from './vuexModules/reports'
86
- import DatePicker from 'vue2-datepicker'
87
-
88
- let tabHiddenState = document.hidden
89
-
90
- export default {
91
- name: 'Report',
92
- components: { DatePicker, ReportDetail, ReportPhotos, ReportSvg },
93
- props: {
94
- reportName: {
95
- type: String,
96
- required: true
97
- },
98
- baseUrl: {
99
- type: String,
100
- required: true
101
- },
102
- chart: Boolean,
103
- detail: Boolean,
104
- to: [String, Object],
105
- detailPath: {
106
- type: String,
107
- default: '/report'
108
- },
109
- loadData: Boolean,
110
- admitPeriod: {
111
- type: String
112
- },
113
- paginationParameter: {
114
- type: String
115
- },
116
- limit: {
117
- type: String
118
- },
119
- hideDescription: Boolean,
120
- newTab: Boolean,
121
- autoRefresh: Boolean,
122
- setById: {
123
- type: String,
124
- default: ''
125
- }
126
- },
127
- data () {
128
- return {
129
- loading: false,
130
- loaded: false,
131
- error: false,
132
- svgContent: null,
133
- csvContent: null,
134
- rows: null,
135
- selectedAdmitPeriod: this.admitPeriod,
136
- dateRange: null,
137
- showPhotos: false,
138
- paginateReport: this.paginationParameter,
139
- newCursor: 'null'
140
- }
141
- },
142
- computed: {
143
- metadata () {
144
- return this.$store.getters.reportMetadata(this.reportName)
145
- },
146
- photoLink () {
147
- const columnMetadata = this.metadata.columns
148
- return columnMetadata && columnMetadata.find(m => m.qualifier.includes('link_photo'))
149
- }
150
- },
151
- methods: {
152
- async loadReports () {
153
- if(!this.metadata) {
154
- // wait for metadata before trying to load report
155
- return
156
- }
157
- this.loaded = false
158
- this.error = false
159
- this.loading = true
160
- this.$emit('loading')
161
- window.scrollTo(0, 0)
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
-
192
- const url = this.baseUrl + '?' + q.toString()
193
- const loadRequested = () => {
194
- let promises = []
195
- if (this.chart) {
196
- promises.push(this.loadSvg(url))
197
- }
198
- if (this.detail || this.loadData) {
199
- promises.push(this.loadCsv(url))
200
- }
201
- return promises
202
- }
203
- const promises = loadRequested()
204
- try {
205
- await Promise.all(promises)
206
- this.loaded = true
207
- this.loading = false
208
- } catch (err) {
209
- console.error(err)
210
- this.error = true
211
- this.loading = false
212
- }
213
- },
214
- async loadSvg (url) {
215
- const svg = await this.loadReport(url, 'image/svg+xml')
216
- this.svgContent = svg
217
- },
218
- async loadCsv (url) {
219
- let csv = ''
220
- do {
221
- const reportResponse = await this.loadReport(url, 'text/csv')
222
- csv = csv + reportResponse
223
- const q = this.getQuery()
224
- url = this.baseUrl + '?' + q.toString()
225
- } while (this.newCursor && this.newCursor !== 'null')
226
-
227
- if (csv && csv.length > 0 && /\n/.test(csv)) {
228
- this.csvContent = csv
229
- const [headData, ...data] = parse(csv)
230
- this.rows = data
231
- this.$emit('csvLoaded', csv)
232
- this.$emit('reportData', { data })
233
- } else {
234
- this.headData = []
235
- this.rows = []
236
- this.$emit('csvLoaded', csv)
237
- this.$emit('reportData', { headers: [], data: [] })
238
- }
239
- },
240
- async loadReport (url, acceptHeader) {
241
- try {
242
- const response = await fetch(url, {
243
- headers: { accept: acceptHeader },
244
- cache: 'no-store'
245
- })
246
- if (!response.ok) {
247
- this.error = true
248
- const err = Error(`Error ${response.status}-'${response.statusText}' while fetching report from ${url}`)
249
- console.error(err)
250
- return null
251
- }
252
- this.newCursor = response.headers.get('Cursor')
253
- return await response.text()
254
- } catch (err) {
255
- this.error = true
256
- console.error(err)
257
- }
258
- },
259
- reloadOnPageBackIntoFocus () {
260
- if (tabHiddenState != document.hidden) {
261
- if (!document.hidden) {
262
- this.loadReports()
263
- }
264
- }
265
- tabHiddenState = document.hidden
266
- },
267
- getQuery() {
268
- const q = new URLSearchParams()
269
- q.append('name', this.reportName)
270
- if (this.selectedAdmitPeriod) {
271
- q.append('admit_period', this.selectedAdmitPeriod)
272
- } else if(this.metadata.parameters.includes('admitPeriod')) {
273
- // Don't attempt to load report if we're missing the admit period
274
- return
275
- }
276
- if (this.paginateReport && this.paginateReport !== 'null') {
277
- q.append('pagination_parameter', this.paginateReport)
278
- q.append('limit', this.limit)
279
- q.append('cursor', this.newCursor)
280
- }
281
- if (this.dateRange) {
282
- const toYYYYMMDD = dt => dt.toISOString().substr(0, 10)
283
- const startDate = toYYYYMMDD(this.dateRange[0])
284
- const endDate = toYYYYMMDD(this.dateRange[1])
285
- q.append('date_start', startDate)
286
- q.append('date_end', endDate)
287
- }
288
- if (this.metadata.parameters.includes('setById') && this.setById) {
289
- q.append('set_by_id', this.setById)
290
- }
291
- // appends institution if available to url search params
292
- if(this.metadata.parameters.includes('institutions')) {
293
- if(this.metadata.parameters.institutions.includes(state.institution))
294
- q.append('institution', state.institution)
295
- }
296
- return q
297
- }
298
- },
299
- watch: {
300
- metadata: {
301
- handler: 'loadReports'
302
- },
303
- baseUrl: {
304
- handler: 'loadReports',
305
- immediate: true
306
- },
307
- reportName: {
308
- handler: 'loadReports'
309
- },
310
- admitPeriod(newValue) {
311
- this.selectedAdmitPeriod = newValue
312
- },
313
- selectedAdmitPeriod: 'loadReports',
314
- dateRange: 'loadReports'
315
- },
316
- mounted () {
317
- if (this.autoRefresh) {
318
- document.addEventListener('visibilitychange', this.reloadOnPageBackIntoFocus)
319
- }
320
- },
321
- beforeDestroy () {
322
- if (this.autoRefresh) {
323
- document.removeEventListener('visibilitychange', this.reloadOnPageBackIntoFocus)
324
- }
325
- }
326
- }
327
- </script>
328
- <style scoped>
329
- .no-uppercase {
330
- text-transform: none;
331
- color: var(--gray, gray);
332
- font-size: 1rem;
333
- }
334
- </style>
1
+ <!--
2
+ Copyright 2018 Brigham Young University
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License")
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ -->
16
+ <template>
17
+ <div class="report" v-if="metadata">
18
+ <ReportSvg
19
+ v-if="chart"
20
+ v-bind="$attrs"
21
+ v-on="$listeners"
22
+ :svgContent="svgContent"
23
+ :loaded="loaded"
24
+ :error="error"/>
25
+ <template v-if="!hideDescription">
26
+ <h1 v-if="metadata.description">{{metadata.description}}</h1>
27
+ <h4 v-if="metadata.long_description" class="no-uppercase">{{metadata.long_description}}</h4>
28
+ <ByuDateSelector
29
+ v-if="metadata.parameters.includes('admitPeriod')"
30
+ v-model="selectedAdmitPeriod"
31
+ />
32
+ <date-picker
33
+ v-if="metadata.parameters.includes('date_start') && metadata.parameters.includes('date_end')"
34
+ v-model="dateRange"
35
+ range
36
+ :not-after="new Date()"
37
+ lang="en"
38
+ />
39
+ </template>
40
+ <template v-if="detail && photoLink">
41
+ <div>
42
+ <input type="checkbox" v-model="showPhotos" id="components-Report-showPhotos">
43
+ <label for="components-Report-showPhotos">Show Photos</label>
44
+ </div>
45
+ <ReportPhotos
46
+ v-if="showPhotos"
47
+ :rows="rows"
48
+ :column-metadata="metadata.columns"
49
+ :loading="loading"
50
+ :error="error"/>
51
+ <ReportDetail
52
+ v-else
53
+ :csv="csvContent"
54
+ :column-metadata="metadata.columns"
55
+ :rows="rows"
56
+ :loading="loading"
57
+ :error="error"
58
+ :detailPath="detailPath"
59
+ :newTab="newTab"/>
60
+ </template>
61
+ <template v-else>
62
+ <ReportDetail
63
+ v-if="detail"
64
+ :csv="csvContent"
65
+ :column-metadata="metadata.columns"
66
+ :rows="rows"
67
+ :loading="loading"
68
+ :error="error"
69
+ :detailPath="detailPath"
70
+ :newTab="newTab" />
71
+ </template>
72
+ <router-link v-else-if="to" :to="to">View Details</router-link>
73
+ </div>
74
+ </template>
75
+
76
+ <script>
77
+ import { parse } from 'csv-string'
78
+ import ReportDetail from './ReportDetail.vue'
79
+ import ReportPhotos from './ReportPhotos.vue'
80
+ import ReportSvg from './ReportSvg.vue'
81
+ import Reports from './vuexModules/reports'
82
+ import DatePicker from 'vue2-datepicker'
83
+ import ByuDateSelector from "./ByuDateSelector.vue"
84
+
85
+ let tabHiddenState = document.hidden
86
+
87
+ export default {
88
+ name: 'Report',
89
+ components: { ByuDateSelector, DatePicker, ReportDetail, ReportPhotos, ReportSvg },
90
+ props: {
91
+ reportName: {
92
+ type: String,
93
+ required: true
94
+ },
95
+ baseUrl: {
96
+ type: String,
97
+ required: true
98
+ },
99
+ chart: Boolean,
100
+ detail: Boolean,
101
+ to: [String, Object],
102
+ detailPath: {
103
+ type: String,
104
+ default: '/report'
105
+ },
106
+ loadData: Boolean,
107
+ admitPeriod: {
108
+ type: String
109
+ },
110
+ paginationParameter: {
111
+ type: String
112
+ },
113
+ limit: {
114
+ type: String
115
+ },
116
+ hideDescription: Boolean,
117
+ newTab: Boolean,
118
+ autoRefresh: Boolean,
119
+ setById: {
120
+ type: String,
121
+ default: ''
122
+ },
123
+ configs: {
124
+ type: Array,
125
+ default: () => []
126
+ }
127
+ },
128
+ data () {
129
+ return {
130
+ loading: false,
131
+ loaded: false,
132
+ error: false,
133
+ svgContent: null,
134
+ csvContent: null,
135
+ rows: null,
136
+ selectedAdmitPeriod: this.admitPeriod,
137
+ dateRange: null,
138
+ showPhotos: false,
139
+ paginateReport: this.paginationParameter,
140
+ newCursor: 'null'
141
+ }
142
+ },
143
+ computed: {
144
+ metadata () {
145
+ return this.$store.getters.reportMetadata(this.reportName)
146
+ },
147
+ photoLink () {
148
+ const columnMetadata = this.metadata.columns
149
+ return columnMetadata && columnMetadata.find(m => m.qualifier.includes('link_photo'))
150
+ }
151
+ },
152
+ methods: {
153
+ async loadReports () {
154
+ if(!this.metadata) {
155
+ // wait for metadata before trying to load report
156
+ return
157
+ }
158
+ this.loaded = false
159
+ this.error = false
160
+ this.loading = true
161
+ this.$emit('loading')
162
+ window.scrollTo(0, 0)
163
+
164
+ const q = new URLSearchParams()
165
+ q.append('name', this.reportName)
166
+ if (this.selectedAdmitPeriod) {
167
+ q.append('admit_period', this.selectedAdmitPeriod)
168
+ } else if(this.metadata.parameters.includes('admitPeriod')) {
169
+ // Don't attempt to load report if we're missing the admit period
170
+ return
171
+ }
172
+ if (this.paginateReport && this.paginateReport !== 'null') {
173
+ q.append('pagination_parameter', this.paginateReport)
174
+ q.append('limit', this.limit)
175
+ q.append('cursor', this.newCursor)
176
+ }
177
+ if (this.dateRange) {
178
+ const toYYYYMMDD = dt => dt.toISOString().substr(0, 10)
179
+ const startDate = toYYYYMMDD(this.dateRange[0])
180
+ const endDate = toYYYYMMDD(this.dateRange[1])
181
+ q.append('date_start', startDate)
182
+ q.append('date_end', endDate)
183
+ }
184
+ if (this.metadata.parameters.includes('setById') && this.setById) {
185
+ q.append('set_by_id', this.setById)
186
+ }
187
+ // appends institution if available to url search params
188
+ if(this.metadata.parameters.includes('institutions')) {
189
+ if(this.metadata.parameters.institutions.includes(state.institution))
190
+ q.append('institution', state.institution)
191
+ }
192
+
193
+ const url = this.baseUrl + '?' + q.toString()
194
+ const loadRequested = () => {
195
+ let promises = []
196
+ if (this.chart) {
197
+ promises.push(this.loadSvg(url))
198
+ }
199
+ if (this.detail || this.loadData) {
200
+ promises.push(this.loadCsv(url))
201
+ }
202
+ return promises
203
+ }
204
+ const promises = loadRequested()
205
+ try {
206
+ await Promise.all(promises)
207
+ this.loaded = true
208
+ this.loading = false
209
+ } catch (err) {
210
+ console.error(err)
211
+ this.error = true
212
+ this.loading = false
213
+ }
214
+ },
215
+ async loadSvg (url) {
216
+ const svg = await this.loadReport(url, 'image/svg+xml')
217
+ this.svgContent = svg
218
+ },
219
+ async loadCsv (url) {
220
+ let csv = ''
221
+ do {
222
+ const reportResponse = await this.loadReport(url, 'text/csv')
223
+ csv = csv + reportResponse
224
+ const q = this.getQuery()
225
+ url = this.baseUrl + '?' + q.toString()
226
+ } while (this.newCursor && this.newCursor !== 'null')
227
+
228
+ if (csv && csv.length > 0 && /\n/.test(csv)) {
229
+ this.csvContent = csv
230
+ const [headData, ...data] = parse(csv)
231
+ this.rows = data
232
+ this.$emit('csvLoaded', csv)
233
+ this.$emit('reportData', { data })
234
+ } else {
235
+ this.headData = []
236
+ this.rows = []
237
+ this.$emit('csvLoaded', csv)
238
+ this.$emit('reportData', { headers: [], data: [] })
239
+ }
240
+ },
241
+ async loadReport (url, acceptHeader) {
242
+ try {
243
+ const response = await fetch(url, {
244
+ headers: { accept: acceptHeader },
245
+ cache: 'no-store'
246
+ })
247
+ if (!response.ok) {
248
+ this.error = true
249
+ const err = Error(`Error ${response.status}-'${response.statusText}' while fetching report from ${url}`)
250
+ console.error(err)
251
+ return null
252
+ }
253
+ this.newCursor = response.headers.get('Cursor')
254
+ return await response.text()
255
+ } catch (err) {
256
+ this.error = true
257
+ console.error(err)
258
+ }
259
+ },
260
+ reloadOnPageBackIntoFocus () {
261
+ if (tabHiddenState != document.hidden) {
262
+ if (!document.hidden) {
263
+ this.loadReports()
264
+ }
265
+ }
266
+ tabHiddenState = document.hidden
267
+ },
268
+ getQuery() {
269
+ const q = new URLSearchParams()
270
+ q.append('name', this.reportName)
271
+ if (this.selectedAdmitPeriod) {
272
+ q.append('admit_period', this.selectedAdmitPeriod)
273
+ } else if(this.metadata.parameters.includes('admitPeriod')) {
274
+ // Don't attempt to load report if we're missing the admit period
275
+ return
276
+ }
277
+ if (this.paginateReport && this.paginateReport !== 'null') {
278
+ q.append('pagination_parameter', this.paginateReport)
279
+ q.append('limit', this.limit)
280
+ q.append('cursor', this.newCursor)
281
+ }
282
+ if (this.dateRange) {
283
+ const toYYYYMMDD = dt => dt.toISOString().substr(0, 10)
284
+ const startDate = toYYYYMMDD(this.dateRange[0])
285
+ const endDate = toYYYYMMDD(this.dateRange[1])
286
+ q.append('date_start', startDate)
287
+ q.append('date_end', endDate)
288
+ }
289
+ if (this.metadata.parameters.includes('setById') && this.setById) {
290
+ q.append('set_by_id', this.setById)
291
+ }
292
+ // appends institution if available to url search params
293
+ if(this.metadata.parameters.includes('institutions')) {
294
+ if(this.metadata.parameters.institutions.includes(state.institution))
295
+ q.append('institution', state.institution)
296
+ }
297
+ return q
298
+ },
299
+ async fetchConfigs() {
300
+ try {
301
+ const base = this.env === 'development'
302
+ ? 'https://api-sandbox.byu.edu'
303
+ : 'https://api.byu.edu'
304
+ const institution = state.institution
305
+ const response = await fetch(`${base}/domain/applications/${institution}/admission/v1/configs`)
306
+ const json = await response.json()
307
+ this.configs = [...json.closed, ...json.open]
308
+ } catch (err) {
309
+ console.error('Failed to fetch admit period configs:', err)
310
+ }
311
+ },
312
+ setDefaultAdmitPeriod() {
313
+ const today = new Date()
314
+ const future = this.configs
315
+ .filter(p => new Date(p.close) >= today)
316
+ .sort((a, b) => new Date(a.close) - new Date(b.close))
317
+
318
+ if (future.length > 0) {
319
+ this.selectedAdmitPeriod = future[0].admit_period
320
+ }
321
+ },
322
+ },
323
+ watch: {
324
+ metadata: {
325
+ handler: 'loadReports'
326
+ },
327
+ baseUrl: {
328
+ handler: 'loadReports',
329
+ immediate: true
330
+ },
331
+ reportName: {
332
+ handler: 'loadReports'
333
+ },
334
+ admitPeriod(newValue) {
335
+ this.selectedAdmitPeriod = newValue
336
+ },
337
+ selectedAdmitPeriod: 'loadReports',
338
+ dateRange: 'loadReports'
339
+ },
340
+ mounted () {
341
+ if (this.autoRefresh) {
342
+ document.addEventListener('visibilitychange', this.reloadOnPageBackIntoFocus)
343
+ }
344
+ // Only fetch configs if none were passed in
345
+ if (this.configs.length === 0) {
346
+ this.fetchConfigs()
347
+ }
348
+ // Only set the default admit period if we have configs, else keep the original default
349
+ if (this.configs.length > 0) {
350
+ this.setDefaultAdmitPeriod()
351
+ } else {
352
+ console.warn('No admit period configs found. Using original default admit period.')
353
+ }
354
+ },
355
+ beforeDestroy () {
356
+ if (this.autoRefresh) {
357
+ document.removeEventListener('visibilitychange', this.reloadOnPageBackIntoFocus)
358
+ }
359
+ }
360
+ }
361
+ </script>
362
+ <style scoped>
363
+ .no-uppercase {
364
+ text-transform: none;
365
+ color: var(--gray, gray);
366
+ font-size: 1rem;
367
+ }
368
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byu-oit/vue-decision-processing-components",
3
- "version": "9.4.0",
3
+ "version": "9.5.0",
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",