@byu-oit/vue-decision-processing-components 8.33.1 → 8.34.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.
@@ -24,6 +24,19 @@ import { faCalendar } from '@fortawesome/free-solid-svg-icons'
24
24
 
25
25
  import { mapState, mapMutations, mapActions } from 'vuex'
26
26
 
27
+ function semesterCodeToDescription(semesterCode) {
28
+ switch (semesterCode) {
29
+ case '1':
30
+ return 'Winter'
31
+ case '3':
32
+ return 'Spring'
33
+ case '4':
34
+ return 'Summer'
35
+ case '5':
36
+ return 'Fall'
37
+ }
38
+ }
39
+
27
40
  export default {
28
41
  name: 'AdmitPeriodConfig',
29
42
  components: {
@@ -36,6 +49,12 @@ export default {
36
49
  validator (value) {
37
50
  return ['byu', 'byui', 'byuh', 'byupw', 'ldsbc'].includes(value)
38
51
  }
52
+ },
53
+ config: {
54
+ type: Array,
55
+ validator (value) {
56
+ return value.length > 0
57
+ }
39
58
  }
40
59
  },
41
60
  computed: {
@@ -56,52 +75,32 @@ export default {
56
75
  ...mapMutations(['selectAdmitPeriod']),
57
76
  ...mapActions(['preserveUiSettings']),
58
77
  async fetchConfig() {
59
- const self = this
60
- const headers = {
61
- accept: 'application/json',
62
- 'content-type': 'application/json'
63
- }
64
- // This config is hosted in the domain-common-admit-periods repository
65
- const url = `https://admit-period-vocab-cdn.ces-admissionssupport-prd.amazon.byu.edu/${this.school}-admit-periods.json`
66
- const options = { headers, url }
67
- const r = await window.byu.auth.request(options)
68
- const { status, body } = r
69
- if (status === 0) {
70
- console.error('Something went wrong! CORS?')
71
- }else if (status < 400) {
72
- const response = JSON.parse(body)
73
- console.log(response)
74
- this.admitPeriodList = Object.entries(response).map(([key, value]) => value).sort((a, b) => {
75
- if (!a.dp_close || !b.dp_close) {
76
- // don't modify order if dp_close isn't provided
77
- return 0
78
- }
79
- const da = Date.parse(a.dp_close)
80
- const db = Date.parse(b.dp_close)
81
- return da - db
78
+ const admitPeriods = []
79
+ for (const admitPeriod of this.config) {
80
+ // isolate semester code and semester year
81
+ const semesterYear = admitPeriod.admit_period.substring(0, admitPeriod.admit_period.length - 1)
82
+ const semesterCode = admitPeriod.admit_period.substring(admitPeriod.admit_period.length - 1)
83
+ // add another object to admitPeriods with information from configuration
84
+ admitPeriods.push({
85
+ period: semesterYear + semesterCode,
86
+ description: semesterYear + ' ' + semesterCodeToDescription(semesterCode),
87
+ long_description: semesterCodeToDescription(semesterCode) + ' ' + semesterYear,
88
+ school: 'byuh',
89
+ application_open: admitPeriod.open,
90
+ application_close: admitPeriod.close
82
91
  })
83
- if (!this.selectedAdmitPeriod) {
84
- const mostCurrent = this.admitPeriodList.find(p => {
85
- if (p.dp_close) {
86
- const closeDate = new Date(Date.parse(p.dp_close))
87
- return new Date() < closeDate
88
- } else {
89
- return false
90
- }
91
- })
92
- if (mostCurrent) {
93
- this.selectAdmitPeriod(mostCurrent.period)
94
- }
95
- }
96
- } else if (status === 404) {
97
- console.log('AdmitPeriodConfig - not found for ' + this.school)
98
- } else {
99
- console.error(`Error ${status} while fetching admit period config`)
92
+ }
93
+
94
+ this.admitPeriodList = admitPeriods
95
+ // select the most recent admit period if none selected
96
+ if (!this.selectedAdmitPeriod) {
97
+ this.selectedAdmitPeriod(this.admitPeriodList[this.admitPeriodList.length - 1])
100
98
  }
101
99
  },
102
100
  chooseAdmitPeriod (admitPeriod) {
103
101
  this.selectAdmitPeriod(admitPeriod)
104
102
  this.preserveUiSettings()
103
+ this.showList = false
105
104
  }
106
105
  },
107
106
  mounted () {
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
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.34.0](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.33.2...v8.34.0) (2023-08-01)
6
+
7
+
8
+ ### Features
9
+
10
+ * support new format of config data ([5627044](https://github.com/byu-oit/vue-decision-processing-components/commit/5627044847830ba9370b4a2ed26f09a09aab0ba5))
11
+
12
+ ### [8.33.2](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.33.1...v8.33.2) (2023-07-25)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * include a sign-in link on the noauth page ([fadc2af](https://github.com/byu-oit/vue-decision-processing-components/commit/fadc2af37cb70238dffb383a01e220b093565695))
18
+ * use hardcoded admit period config ([f7bbaf3](https://github.com/byu-oit/vue-decision-processing-components/commit/f7bbaf3b99b02ee94e01e4bdc76423ac4decdb12))
19
+
5
20
  ### [8.33.1](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.33.0...v8.33.1) (2023-07-20)
6
21
 
7
22
 
package/NoAuth.vue CHANGED
@@ -2,6 +2,9 @@
2
2
  <section class="m-auto">
3
3
  <p>You do not currently have access to this system. If you are an employee in the admissions
4
4
  office, please contact your supervisor.</p>
5
+ <p class="mt-3">
6
+ You may have an expired session. Try <a href="/login">Logging in</a> again.
7
+ </p>
5
8
  </section>
6
9
  </template>
7
10
  <script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byu-oit/vue-decision-processing-components",
3
- "version": "8.33.1",
3
+ "version": "8.34.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",