@byu-oit/vue-decision-processing-components 9.4.0 → 9.5.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.
@@ -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,372 @@
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
+ import { mapState } from 'vuex'
85
+
86
+ let tabHiddenState = document.hidden
87
+
88
+ export default {
89
+ name: 'Report',
90
+ components: { ByuDateSelector, DatePicker, ReportDetail, ReportPhotos, ReportSvg },
91
+ props: {
92
+ reportName: {
93
+ type: String,
94
+ required: true
95
+ },
96
+ baseUrl: {
97
+ type: String,
98
+ required: true
99
+ },
100
+ chart: Boolean,
101
+ detail: Boolean,
102
+ to: [String, Object],
103
+ detailPath: {
104
+ type: String,
105
+ default: '/report'
106
+ },
107
+ loadData: Boolean,
108
+ admitPeriod: {
109
+ type: String
110
+ },
111
+ paginationParameter: {
112
+ type: String
113
+ },
114
+ limit: {
115
+ type: String
116
+ },
117
+ hideDescription: Boolean,
118
+ newTab: Boolean,
119
+ autoRefresh: Boolean,
120
+ setById: {
121
+ type: String,
122
+ default: ''
123
+ },
124
+ configs: {
125
+ type: Array,
126
+ default: () => []
127
+ }
128
+ },
129
+ data () {
130
+ return {
131
+ loading: false,
132
+ loaded: false,
133
+ error: false,
134
+ svgContent: null,
135
+ csvContent: null,
136
+ rows: null,
137
+ selectedAdmitPeriod: this.admitPeriod,
138
+ dateRange: null,
139
+ showPhotos: false,
140
+ paginateReport: this.paginationParameter,
141
+ newCursor: 'null'
142
+ }
143
+ },
144
+ computed: {
145
+ ...mapState({
146
+ institution: state => state.ui.institution
147
+ }),
148
+ metadata () {
149
+ return this.$store.getters.reportMetadata(this.reportName)
150
+ },
151
+ photoLink () {
152
+ const columnMetadata = this.metadata.columns
153
+ return columnMetadata && columnMetadata.find(m => m.qualifier.includes('link_photo'))
154
+ }
155
+ },
156
+ methods: {
157
+ async loadReports () {
158
+ if(!this.metadata) {
159
+ // wait for metadata before trying to load report
160
+ return
161
+ }
162
+ this.loaded = false
163
+ this.error = false
164
+ this.loading = true
165
+ this.$emit('loading')
166
+ window.scrollTo(0, 0)
167
+
168
+ const q = new URLSearchParams()
169
+ q.append('name', this.reportName)
170
+ if (this.selectedAdmitPeriod) {
171
+ q.append('admit_period', this.selectedAdmitPeriod)
172
+ } else if(this.metadata.parameters.includes('admitPeriod')) {
173
+ // Don't attempt to load report if we're missing the admit period
174
+ return
175
+ }
176
+ if (this.paginateReport && this.paginateReport !== 'null') {
177
+ q.append('pagination_parameter', this.paginateReport)
178
+ q.append('limit', this.limit)
179
+ q.append('cursor', this.newCursor)
180
+ }
181
+ if (this.dateRange) {
182
+ const toYYYYMMDD = dt => dt.toISOString().substr(0, 10)
183
+ const startDate = toYYYYMMDD(this.dateRange[0])
184
+ const endDate = toYYYYMMDD(this.dateRange[1])
185
+ q.append('date_start', startDate)
186
+ q.append('date_end', endDate)
187
+ }
188
+ if (this.metadata.parameters.includes('setById') && this.setById) {
189
+ q.append('set_by_id', this.setById)
190
+ }
191
+ // appends institution if available to url search params
192
+ if(this.metadata.parameters.includes('institutions')) {
193
+ if(this.metadata.parameters.institutions.includes(state.institution))
194
+ q.append('institution', state.institution)
195
+ }
196
+
197
+ const url = this.baseUrl + '?' + q.toString()
198
+ const loadRequested = () => {
199
+ let promises = []
200
+ if (this.chart) {
201
+ promises.push(this.loadSvg(url))
202
+ }
203
+ if (this.detail || this.loadData) {
204
+ promises.push(this.loadCsv(url))
205
+ }
206
+ return promises
207
+ }
208
+ const promises = loadRequested()
209
+ try {
210
+ await Promise.all(promises)
211
+ this.loaded = true
212
+ this.loading = false
213
+ } catch (err) {
214
+ console.error(err)
215
+ this.error = true
216
+ this.loading = false
217
+ }
218
+ },
219
+ async loadSvg (url) {
220
+ const svg = await this.loadReport(url, 'image/svg+xml')
221
+ this.svgContent = svg
222
+ },
223
+ async loadCsv (url) {
224
+ let csv = ''
225
+ do {
226
+ const reportResponse = await this.loadReport(url, 'text/csv')
227
+ csv = csv + reportResponse
228
+ const q = this.getQuery()
229
+ url = this.baseUrl + '?' + q.toString()
230
+ } while (this.newCursor && this.newCursor !== 'null')
231
+
232
+ if (csv && csv.length > 0 && /\n/.test(csv)) {
233
+ this.csvContent = csv
234
+ const [headData, ...data] = parse(csv)
235
+ this.rows = data
236
+ this.$emit('csvLoaded', csv)
237
+ this.$emit('reportData', { data })
238
+ } else {
239
+ this.headData = []
240
+ this.rows = []
241
+ this.$emit('csvLoaded', csv)
242
+ this.$emit('reportData', { headers: [], data: [] })
243
+ }
244
+ },
245
+ async loadReport (url, acceptHeader) {
246
+ try {
247
+ const response = await fetch(url, {
248
+ headers: { accept: acceptHeader },
249
+ cache: 'no-store'
250
+ })
251
+ if (!response.ok) {
252
+ this.error = true
253
+ const err = Error(`Error ${response.status}-'${response.statusText}' while fetching report from ${url}`)
254
+ console.error(err)
255
+ return null
256
+ }
257
+ this.newCursor = response.headers.get('Cursor')
258
+ return await response.text()
259
+ } catch (err) {
260
+ this.error = true
261
+ console.error(err)
262
+ }
263
+ },
264
+ reloadOnPageBackIntoFocus () {
265
+ if (tabHiddenState != document.hidden) {
266
+ if (!document.hidden) {
267
+ this.loadReports()
268
+ }
269
+ }
270
+ tabHiddenState = document.hidden
271
+ },
272
+ getQuery() {
273
+ const q = new URLSearchParams()
274
+ q.append('name', this.reportName)
275
+ if (this.selectedAdmitPeriod) {
276
+ q.append('admit_period', this.selectedAdmitPeriod)
277
+ } else if(this.metadata.parameters.includes('admitPeriod')) {
278
+ // Don't attempt to load report if we're missing the admit period
279
+ return
280
+ }
281
+ if (this.paginateReport && this.paginateReport !== 'null') {
282
+ q.append('pagination_parameter', this.paginateReport)
283
+ q.append('limit', this.limit)
284
+ q.append('cursor', this.newCursor)
285
+ }
286
+ if (this.dateRange) {
287
+ const toYYYYMMDD = dt => dt.toISOString().substr(0, 10)
288
+ const startDate = toYYYYMMDD(this.dateRange[0])
289
+ const endDate = toYYYYMMDD(this.dateRange[1])
290
+ q.append('date_start', startDate)
291
+ q.append('date_end', endDate)
292
+ }
293
+ if (this.metadata.parameters.includes('setById') && this.setById) {
294
+ q.append('set_by_id', this.setById)
295
+ }
296
+ // appends institution if available to url search params
297
+ if(this.metadata.parameters.includes('institutions')) {
298
+ if(this.metadata.parameters.institutions.includes(state.institution))
299
+ q.append('institution', state.institution)
300
+ }
301
+ return q
302
+ },
303
+ async fetchConfigs() {
304
+ try {
305
+ const base = this.env === 'development'
306
+ ? 'https://api-sandbox.byu.edu'
307
+ : 'https://api.byu.edu'
308
+ const institution = state.institution
309
+ const response = await fetch(`${base}/domain/applications/${institution}/admission/v1/configs`)
310
+ const json = await response.json()
311
+ this.configs = [...json.closed, ...json.open]
312
+ } catch (err) {
313
+ console.error('Failed to fetch admit period configs:', err)
314
+ }
315
+ },
316
+ setDefaultAdmitPeriod() {
317
+ const today = new Date()
318
+ const future = this.configs
319
+ .filter(p => new Date(p.close) >= today)
320
+ .sort((a, b) => new Date(a.close) - new Date(b.close))
321
+
322
+ if (future.length > 0) {
323
+ this.selectedAdmitPeriod = future[0].admit_period
324
+ }
325
+ },
326
+ },
327
+ watch: {
328
+ metadata: {
329
+ handler: 'loadReports'
330
+ },
331
+ baseUrl: {
332
+ handler: 'loadReports',
333
+ immediate: true
334
+ },
335
+ reportName: {
336
+ handler: 'loadReports'
337
+ },
338
+ admitPeriod(newValue) {
339
+ this.selectedAdmitPeriod = newValue
340
+ },
341
+ selectedAdmitPeriod: 'loadReports',
342
+ dateRange: 'loadReports'
343
+ },
344
+ mounted () {
345
+ if (this.autoRefresh) {
346
+ document.addEventListener('visibilitychange', this.reloadOnPageBackIntoFocus)
347
+ }
348
+ // Only fetch configs if none were passed in
349
+ if (this.configs.length === 0) {
350
+ this.fetchConfigs()
351
+ }
352
+ // Only set the default admit period if we have configs, else keep the original default
353
+ if (this.configs.length > 0) {
354
+ this.setDefaultAdmitPeriod()
355
+ } else {
356
+ console.warn('No admit period configs found. Using original default admit period.')
357
+ }
358
+ },
359
+ beforeDestroy () {
360
+ if (this.autoRefresh) {
361
+ document.removeEventListener('visibilitychange', this.reloadOnPageBackIntoFocus)
362
+ }
363
+ }
364
+ }
365
+ </script>
366
+ <style scoped>
367
+ .no-uppercase {
368
+ text-transform: none;
369
+ color: var(--gray, gray);
370
+ font-size: 1rem;
371
+ }
372
+ </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.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",