@byu-oit/vue-decision-processing-components 8.35.8 → 8.35.10

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.
Files changed (136) hide show
  1. package/.github/CODEOWNERS +1 -0
  2. package/.github/workflows/deploy.yml +40 -50
  3. package/.repo-meta.yml +55 -55
  4. package/AdmitPeriodConfig.vue +115 -115
  5. package/ApiCallButton.vue +91 -91
  6. package/ApplicantInfo.vue +100 -100
  7. package/AssignmentBulkDialog.vue +153 -153
  8. package/AssignmentDialog.vue +117 -117
  9. package/AssignmentSummary.vue +75 -75
  10. package/BackgroundBadge.vue +83 -83
  11. package/BackgroundDetailCrime.vue +78 -78
  12. package/BackgroundDetailPluralMarriage.vue +43 -43
  13. package/BackgroundDetailSexRegistry.vue +43 -43
  14. package/BackgroundDetailUniversity.vue +37 -37
  15. package/CHANGELOG.md +676 -676
  16. package/Dashboard.vue +201 -201
  17. package/DashboardApplicationList.vue +50 -50
  18. package/DecisionDialog.vue +178 -178
  19. package/Details.vue +124 -124
  20. package/DetailsActivity.vue +59 -59
  21. package/DetailsBackground.vue +143 -143
  22. package/DetailsBackgroundDetail.vue +47 -47
  23. package/DetailsBackgroundSummary.vue +66 -66
  24. package/DetailsCesHold.vue +107 -107
  25. package/DetailsCollege.vue +93 -93
  26. package/DetailsContact.vue +65 -65
  27. package/DetailsDecision.vue +183 -183
  28. package/DetailsDecisionHistory.vue +56 -56
  29. package/DetailsEndorsement.vue +74 -74
  30. package/DetailsEssay.vue +59 -59
  31. package/DetailsFilenote.vue +62 -62
  32. package/DetailsFilenoteList.vue +109 -109
  33. package/DetailsFlagSection.vue +176 -176
  34. package/DetailsHeader.vue +263 -263
  35. package/DetailsHighSchool.vue +99 -99
  36. package/DetailsHsTranscript.vue +100 -100
  37. package/DetailsInstitute.vue +90 -90
  38. package/DetailsMission.vue +88 -88
  39. package/DetailsNewAppHistory.vue +50 -50
  40. package/DetailsNotes.vue +83 -83
  41. package/DetailsPathway.vue +45 -45
  42. package/DetailsScoringSection.vue +128 -128
  43. package/DetailsSection.vue +116 -116
  44. package/DetailsSeminary.vue +184 -184
  45. package/DetailsSrs.vue +52 -52
  46. package/DetailsSubnav.vue +54 -54
  47. package/DetailsTestScores.vue +131 -131
  48. package/ExpandIndicator.vue +75 -75
  49. package/ExternalLink.vue +34 -34
  50. package/FilterBreadcrumb.vue +85 -85
  51. package/FilterButton.vue +86 -86
  52. package/FilterButtonAdmitPeriod.vue +104 -104
  53. package/FilterButtonAppType.vue +103 -103
  54. package/FilterButtonAssignedTo.vue +96 -96
  55. package/FilterButtonClearFilters.vue +65 -65
  56. package/FilterButtonSex.vue +105 -105
  57. package/FlagButton.vue +59 -59
  58. package/FlagDialog.vue +129 -129
  59. package/Footer.vue +432 -432
  60. package/Header.vue +132 -132
  61. package/HighSchoolSummary.vue +60 -60
  62. package/InternationalIndicator.vue +44 -44
  63. package/InternationalStatus.vue +48 -48
  64. package/LICENSE +201 -201
  65. package/LoadingBadge.vue +58 -58
  66. package/ManageAssignments.vue +123 -123
  67. package/NoAuth.vue +14 -14
  68. package/NoteDialog.vue +106 -106
  69. package/ObjectViewer.vue +49 -49
  70. package/Queues.vue +278 -268
  71. package/QuickLinks.vue +25 -25
  72. package/README.md +2 -2
  73. package/RecentApplications.vue +53 -53
  74. package/Report.vue +340 -340
  75. package/ReportDetail.vue +279 -279
  76. package/ReportList.vue +87 -87
  77. package/ReportPhotos.vue +65 -65
  78. package/ReportSvg.vue +78 -78
  79. package/ReportViewer.vue +165 -165
  80. package/RequestAccess.vue +14 -14
  81. package/RequestAccessList.vue +45 -45
  82. package/RoleSelector.vue +29 -29
  83. package/Search.vue +22 -22
  84. package/ShowApplicantIds.vue +100 -100
  85. package/SortableHeader.vue +53 -53
  86. package/Spinner.vue +34 -34
  87. package/StarredIndicator.vue +36 -36
  88. package/StatBox.vue +73 -73
  89. package/StatCharts.vue +196 -196
  90. package/SupportDialog.vue +172 -172
  91. package/UserInfo.vue +52 -52
  92. package/YesNoIndicator.vue +48 -48
  93. package/dateTimeFormat.js +67 -67
  94. package/gpaCalculation.js +162 -162
  95. package/gpaFilter.js +5 -5
  96. package/hsSummary.json +2019 -2019
  97. package/package.json +37 -36
  98. package/parsers/application.js +396 -396
  99. package/parsers/decisionHistory.js +27 -27
  100. package/parsers/filenotes.js +27 -27
  101. package/parsers/notes.js +49 -49
  102. package/parsers/packet.js +88 -88
  103. package/parsers/packetList.js +57 -57
  104. package/parsers/reports.js +13 -13
  105. package/sat2Act.js +46 -46
  106. package/test.js +48 -48
  107. package/themes/ByuiFooter.vue +38 -38
  108. package/themes/ByuiHeader.vue +96 -96
  109. package/themes/LdsbcFooter.vue +38 -38
  110. package/themes/LdsbcHeader.vue +100 -100
  111. package/vuexModules/application/activity.js +32 -32
  112. package/vuexModules/application/applicationList.js +71 -71
  113. package/vuexModules/application/background.js +47 -47
  114. package/vuexModules/application/bio.js +38 -38
  115. package/vuexModules/application/citizenship.js +30 -30
  116. package/vuexModules/application/collegeSummaries.js +32 -32
  117. package/vuexModules/application/essay.js +26 -26
  118. package/vuexModules/application/highSchoolSummaries.js +40 -40
  119. package/vuexModules/application/index.js +157 -157
  120. package/vuexModules/application/institute.js +30 -30
  121. package/vuexModules/application/mission.js +48 -48
  122. package/vuexModules/application/personalRecords.js +24 -24
  123. package/vuexModules/application/questions.js +23 -23
  124. package/vuexModules/application/seminary.js +39 -39
  125. package/vuexModules/application/testScores.js +26 -26
  126. package/vuexModules/notes/index.js +22 -22
  127. package/vuexModules/packet/decision.js +43 -43
  128. package/vuexModules/packet/decisionHistory.js +28 -28
  129. package/vuexModules/packet/flags.js +174 -174
  130. package/vuexModules/packet/index.js +52 -52
  131. package/vuexModules/packet/packetList.js +127 -127
  132. package/vuexModules/packet/processes.js +28 -28
  133. package/vuexModules/reports/index.js +32 -32
  134. package/vuexModules/ui/index.js +56 -56
  135. package/vuexModules/users/index.js +46 -46
  136. package/yyyyMmFilter.js +7 -7
package/Queues.vue CHANGED
@@ -1,268 +1,278 @@
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
- <section class="content-padding">
18
- <h1 class="queue-title">
19
- {{packetListName}}
20
- <button class="btn btn-outline-primary" @click="refresh">
21
- <span class="sr-only">Refresh</span>
22
- <font-awesome-icon :icon="syncIcon" />
23
- </button>
24
- </h1>
25
- <div>
26
- <div>
27
- <ul class="pagination">
28
- <li class="page-item" v-if="notFirstPage">
29
- <a class="page-link" href="`?offset=0`" aria-label="First" @click.prevent="loadPage('first')">First</a>
30
- </li>
31
- <li class="page-item" v-if="notFirstPage">
32
- <a class="page-link" :href="`?offset=${prevPageOffset}`" aria-label="Previous" @click.prevent="loadPage('prev')">
33
- <span aria-hidden="true"><font-awesome-icon :icon="prevIcon" /></span>
34
- <span class="sr-only">Previous</span>
35
- </a>
36
- </li>
37
- <li v-for="page in pageCount" :class="{ 'page-item': true, active: isPageActive(page) }">
38
- <a v-if="page !== '...'"
39
- class="page-link"
40
- :href="`?offset=${(page - 1) * query.limit}`"
41
- @click.prevent="loadPage(page)">{{page}}</a>
42
- <span v-else class="page-link disabled">{{page}}</span>
43
- </li>
44
- <li class="page-item" v-if="notLastPage">
45
- <a class="page-link" :href="`?offset=${nextPageOffset}`" aria-label="Next" @click.prevent="loadPage('next')">
46
- <span aria-hidden="true"><font-awesome-icon :icon="nextIcon" /></span>
47
- <span class="sr-only">Next</span>
48
- </a>
49
- </li>
50
- <li class="page-item" v-if="notLastPage">
51
- <a class="page-link" :href="`?offset=${lastPageOffset}`" aria-label="Last" @click.prevent="loadPage('last')">Last</a>
52
- </li>
53
- </ul>
54
- <span class="match-caption">
55
- {{currentPage}} of {{total}}
56
- </span>
57
- <table class="table table-hover table-bordered">
58
- <caption>
59
- {{currentPage}} of {{total}}
60
- </caption>
61
- <thead class="thead-light">
62
- <tr>
63
- <slot name="columns">
64
- <sortable-header @click="sortByName" v-bind="$props" field="applicant_name">Name</sortable-header>
65
- <th>ID</th>
66
- <th>Type</th>
67
- <th>Major</th>
68
- <sortable-header @click="sortByAdmitPeriod" v-bind="$props" field="admit_period">Admit Period</sortable-header>
69
- <sortable-header @click="sortByNextAction" v-bind="$props" field="next_action">Next Action</sortable-header>
70
- </slot>
71
- </tr>
72
- </thead>
73
- <tbody>
74
- <tr v-for="(row, i) of data" :key="row.application_uuid">
75
- <slot v-bind:row="row" v-bind:i="i">
76
- <td><router-link :to="`/detail/${row.application_uuid}`">{{row.applicant_name}}</router-link></td>
77
- <td>{{row.applicant_id}}</td>
78
- <td>{{row.applicant_type}}</td>
79
- <td>{{row.applicant_major}}</td>
80
- <td>{{row.admit_period}}</td>
81
- <td>{{row.next_action_date | dateTime}}</td>
82
- </slot>
83
- </tr>
84
- </tbody>
85
- </table>
86
- <ul class="pagination">
87
- <li class="page-item" v-if="notFirstPage">
88
- <a class="page-link" href="`?offset=0`" aria-label="First" @click.prevent="loadPage('first')">First</a>
89
- </li>
90
- <li class="page-item" v-if="notFirstPage">
91
- <a class="page-link" :href="`?offset=${prevPageOffset}`" aria-label="Previous" @click.prevent="loadPage('prev')">
92
- <span aria-hidden="true"><font-awesome-icon :icon="prevIcon" /></span>
93
- <span class="sr-only">Previous</span>
94
- </a>
95
- </li>
96
- <li v-for="page in pageCount" :class="{ 'page-item': true, active: isPageActive(page) }">
97
- <a v-if="page !== '...'"
98
- class="page-link"
99
- :href="`?offset=${(page - 1) * query.limit}`"
100
- @click.prevent="loadPage(page)">{{page}}</a>
101
- <span v-else class="page-link disabled">{{page}}</span>
102
- </li>
103
- <li class="page-item" v-if="notLastPage">
104
- <a class="page-link" :href="`?offset=${nextPageOffset}`" aria-label="Next" @click.prevent="loadPage('next')">
105
- <span aria-hidden="true"><font-awesome-icon :icon="nextIcon" /></span>
106
- <span class="sr-only">Next</span>
107
- </a>
108
- </li>
109
- <li class="page-item" v-if="notLastPage">
110
- <a class="page-link" :href="`?offset=${lastPageOffset}`" aria-label="Last" @click.prevent="loadPage('last')">Last</a>
111
- </li>
112
- </ul>
113
- </div>
114
- </div>
115
- </section>
116
- </template>
117
- <script>
118
- import SortableHeader from './SortableHeader'
119
- import range from 'lodash.range'
120
- import { mapState, mapGetters, mapActions } from 'vuex'
121
- import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
122
- import { faAngleDoubleLeft, faAngleDoubleRight, faSync } from '@fortawesome/free-solid-svg-icons'
123
- import { dateTimeFormat } from './dateTimeFormat'
124
-
125
- const pageSlice = (curr, total) => {
126
- console.log(`in page Slice\ncurr=${curr}, total=${total}`)
127
- if (curr < 4) {
128
- return range(1, 6).concat(['...'])
129
- } else if (curr > total - 3) {
130
- return ['...'].concat(range(total - 4, total + 1))
131
- }
132
- return ['...'].concat(range(curr - 2, curr + 3)).concat(['...'])
133
- }
134
-
135
- export default {
136
- name: 'Queues',
137
- props: ['listType', 'offset', 'sort', 'order'],
138
- computed: {
139
- currentPage () {
140
- const {offset, limit} = this.query
141
- const firstIndex = offset
142
- const lastIndex = Math.min(firstIndex + limit, this.total)
143
- return Math.min(firstIndex + 1, lastIndex) + ' - ' + (lastIndex)
144
- },
145
- notFirstPage () {
146
- const {offset} = this.query
147
- return offset > 0
148
- },
149
- notLastPage () {
150
- const {offset, limit} = this.query
151
- const total = this.total
152
- return offset + limit < total
153
- },
154
- pageCount () {
155
- const {offset, limit} = this.query
156
- const total = this.total
157
- const pages = Math.ceil(total / limit)
158
- const curr = Math.ceil(offset / limit)
159
- return pages < 2
160
- ? []
161
- : pages > 6
162
- ? pageSlice(curr + 1, pages)
163
- : pages
164
- },
165
- searchOptions () {
166
- return {
167
- listType: this.listType,
168
- offset: this.offset,
169
- sort: this.sort,
170
- order: this.order
171
- }
172
- },
173
- ...mapState({
174
- data: state => state.packetList.data,
175
- total: state => state.packetList.total
176
- }),
177
- ...mapGetters(['packetListName', 'packetListQuery']),
178
- query () { return this.packetListQuery },
179
- syncIcon () { return faSync },
180
- nextIcon () { return faAngleDoubleRight },
181
- prevIcon () { return faAngleDoubleLeft }
182
- },
183
- components: {
184
- FontAwesomeIcon,
185
- SortableHeader
186
- },
187
- filters: {
188
- dateTime: dateTimeFormat
189
- },
190
- watch: {
191
- '$route'() {
192
- this.fetchAndUpdate(this.listType, this.searchOptions)
193
- },
194
- '$props'() {
195
- this.fetchAndUpdate(this.listType, this.searchOptions)
196
- }
197
- },
198
- mounted: function () {
199
- this.fetchAndUpdate(this.listType, this.searchOptions, false)
200
- },
201
- methods: {
202
- ...mapActions(['fetchPacketList']),
203
- nextPageOffset () {
204
- const {offset, limit} = this.query
205
- return offset + limit
206
- },
207
- prevPageOffset () {
208
- const {offset, limit} = this.query
209
- return offset - limit
210
- },
211
- lastPageOffset () {
212
- const {limit} = this.query
213
- const total = this.total
214
- return Math.floor(total / limit) * limit
215
- },
216
- sortBy (query, field) {
217
- const { sort, order } = query
218
- const newSort = field
219
- const newOrder = (sort === field && order === 'asc') ? 'desc' : 'asc'
220
- const routerQuery = { sort: newSort, order: newOrder, offset: 0 }
221
- this.$router.push({path: `/list/${this.listType}`, query: routerQuery})
222
- window.scrollTo(0, 0)
223
- },
224
- sortByName () { this.sortBy(this.query, 'applicant_name') },
225
- sortByAdmitPeriod () { this.sortBy(this.query, 'admit_period') },
226
- sortByNextAction () { this.sortBy(this.query, 'next_action_date') },
227
- fetchAndUpdate (listType, query, force = true) {
228
- this.fetchPacketList({...query, listType, force})
229
- },
230
- refresh () {
231
- this.fetchAndUpdate(this.listType, this.query)
232
- },
233
- loadPage (page) {
234
- const {limit, offset, sort, order} = this.query
235
- const total = this.total
236
- const newOffset = page === 'first' ? 0
237
- : page === 'last' ? this.lastPageOffset()
238
- : page === 'next' ? this.nextPageOffset()
239
- : page === 'prev' ? this.prevPageOffset()
240
- : (page - 1) * limit
241
- this.$router.push({ path: `/list/${this.listType}`, query: {offset: newOffset, sort, order} })
242
- window.scrollTo(0, 0)
243
- },
244
- isPageActive (page) {
245
- if (page === '...') return false
246
-
247
- const { limit, offset } = this.query
248
- const pageOffset = (page - 1) * limit
249
- return pageOffset === offset
250
- }
251
- }
252
- }
253
- </script>
254
- <style scoped>
255
- .queue-title {
256
- display: grid;
257
- grid-template-columns: auto auto 1fr;
258
- grid-gap: 0.5rem;
259
- align-items: center;
260
- }
261
- .sortable {
262
- cursor: pointer;
263
- }
264
- .match-caption {
265
- padding-left: .75rem;
266
- color: var(--gray, #6c757d);
267
- }
268
- </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
+ <section class="content-padding">
18
+ <h1 class="queue-title">
19
+ {{packetListName}}
20
+ <button class="btn btn-outline-primary" @click="refresh">
21
+ <span class="sr-only">Refresh</span>
22
+ <font-awesome-icon :icon="syncIcon" />
23
+ </button>
24
+ <p>{{packetListName}}</p>
25
+ <button vue-if="packetListName == 'Auto Admit'" class="btn btn-outline-primary" @click="SubmitAuto">
26
+ <span class="">Submit Applications</span>
27
+ </button>
28
+ </h1>
29
+ <div>
30
+ <div>
31
+ <ul class="pagination">
32
+ <li class="page-item" v-if="notFirstPage">
33
+ <a class="page-link" href="`?offset=0`" aria-label="First" @click.prevent="loadPage('first')">First</a>
34
+ </li>
35
+ <li class="page-item" v-if="notFirstPage">
36
+ <a class="page-link" :href="`?offset=${prevPageOffset}`" aria-label="Previous" @click.prevent="loadPage('prev')">
37
+ <span aria-hidden="true"><font-awesome-icon :icon="prevIcon" /></span>
38
+ <span class="sr-only">Previous</span>
39
+ </a>
40
+ </li>
41
+ <li v-for="page in pageCount" :class="{ 'page-item': true, active: isPageActive(page) }">
42
+ <a v-if="page !== '...'"
43
+ class="page-link"
44
+ :href="`?offset=${(page - 1) * query.limit}`"
45
+ @click.prevent="loadPage(page)">{{page}}</a>
46
+ <span v-else class="page-link disabled">{{page}}</span>
47
+ </li>
48
+ <li class="page-item" v-if="notLastPage">
49
+ <a class="page-link" :href="`?offset=${nextPageOffset}`" aria-label="Next" @click.prevent="loadPage('next')">
50
+ <span aria-hidden="true"><font-awesome-icon :icon="nextIcon" /></span>
51
+ <span class="sr-only">Next</span>
52
+ </a>
53
+ </li>
54
+ <li class="page-item" v-if="notLastPage">
55
+ <a class="page-link" :href="`?offset=${lastPageOffset}`" aria-label="Last" @click.prevent="loadPage('last')">Last</a>
56
+ </li>
57
+ </ul>
58
+ <span class="match-caption">
59
+ {{currentPage}} of {{total}}
60
+ </span>
61
+ <table class="table table-hover table-bordered">
62
+ <caption>
63
+ {{currentPage}} of {{total}}
64
+ </caption>
65
+ <thead class="thead-light">
66
+ <tr>
67
+ <slot name="columns">
68
+ <sortable-header @click="sortByName" v-bind="$props" field="applicant_name">Name</sortable-header>
69
+ <th>ID</th>
70
+ <th>Type</th>
71
+ <th>Major</th>
72
+ <sortable-header @click="sortByAdmitPeriod" v-bind="$props" field="admit_period">Admit Period</sortable-header>
73
+ <sortable-header @click="sortByNextAction" v-bind="$props" field="next_action">Next Action</sortable-header>
74
+ </slot>
75
+ </tr>
76
+ </thead>
77
+ <tbody>
78
+ <tr v-for="(row, i) of data" :key="row.application_uuid">
79
+ <slot v-bind:row="row" v-bind:i="i">
80
+ <td><router-link :to="`/detail/${row.application_uuid}`">{{row.applicant_name}}</router-link></td>
81
+ <td>{{row.applicant_id}}</td>
82
+ <td>{{row.applicant_type}}</td>
83
+ <td>{{row.applicant_major}}</td>
84
+ <td>{{row.admit_period}}</td>
85
+ <td>{{row.next_action_date | dateTime}}</td>
86
+ </slot>
87
+ </tr>
88
+ </tbody>
89
+ </table>
90
+ <ul class="pagination">
91
+ <li class="page-item" v-if="notFirstPage">
92
+ <a class="page-link" href="`?offset=0`" aria-label="First" @click.prevent="loadPage('first')">First</a>
93
+ </li>
94
+ <li class="page-item" v-if="notFirstPage">
95
+ <a class="page-link" :href="`?offset=${prevPageOffset}`" aria-label="Previous" @click.prevent="loadPage('prev')">
96
+ <span aria-hidden="true"><font-awesome-icon :icon="prevIcon" /></span>
97
+ <span class="sr-only">Previous</span>
98
+ </a>
99
+ </li>
100
+ <li v-for="page in pageCount" :class="{ 'page-item': true, active: isPageActive(page) }">
101
+ <a v-if="page !== '...'"
102
+ class="page-link"
103
+ :href="`?offset=${(page - 1) * query.limit}`"
104
+ @click.prevent="loadPage(page)">{{page}}</a>
105
+ <span v-else class="page-link disabled">{{page}}</span>
106
+ </li>
107
+ <li class="page-item" v-if="notLastPage">
108
+ <a class="page-link" :href="`?offset=${nextPageOffset}`" aria-label="Next" @click.prevent="loadPage('next')">
109
+ <span aria-hidden="true"><font-awesome-icon :icon="nextIcon" /></span>
110
+ <span class="sr-only">Next</span>
111
+ </a>
112
+ </li>
113
+ <li class="page-item" v-if="notLastPage">
114
+ <a class="page-link" :href="`?offset=${lastPageOffset}`" aria-label="Last" @click.prevent="loadPage('last')">Last</a>
115
+ </li>
116
+ </ul>
117
+ </div>
118
+ </div>
119
+ </section>
120
+ </template>
121
+ <script>
122
+ import SortableHeader from './SortableHeader'
123
+ import range from 'lodash.range'
124
+ import { mapState, mapGetters, mapActions } from 'vuex'
125
+ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
126
+ import { faAngleDoubleLeft, faAngleDoubleRight, faSync } from '@fortawesome/free-solid-svg-icons'
127
+ import { dateTimeFormat } from './dateTimeFormat'
128
+ import api from '../../../src/api/index'
129
+ const pageSlice = (curr, total) => {
130
+ console.log(`in page Slice\ncurr=${curr}, total=${total}`)
131
+ if (curr < 4) {
132
+ return range(1, 6).concat(['...'])
133
+ } else if (curr > total - 3) {
134
+ return ['...'].concat(range(total - 4, total + 1))
135
+ }
136
+ return ['...'].concat(range(curr - 2, curr + 3)).concat(['...'])
137
+ }
138
+
139
+ export default {
140
+ name: 'Queues',
141
+ props: ['listType', 'offset', 'sort', 'order'],
142
+ computed: {
143
+ currentPage () {
144
+ const {offset, limit} = this.query
145
+ const firstIndex = offset
146
+ const lastIndex = Math.min(firstIndex + limit, this.total)
147
+ return Math.min(firstIndex + 1, lastIndex) + ' - ' + (lastIndex)
148
+ },
149
+ notFirstPage () {
150
+ const {offset} = this.query
151
+ return offset > 0
152
+ },
153
+ notLastPage () {
154
+ const {offset, limit} = this.query
155
+ const total = this.total
156
+ return offset + limit < total
157
+ },
158
+ pageCount () {
159
+ const {offset, limit} = this.query
160
+ const total = this.total
161
+ const pages = Math.ceil(total / limit)
162
+ const curr = Math.ceil(offset / limit)
163
+ return pages < 2
164
+ ? []
165
+ : pages > 6
166
+ ? pageSlice(curr + 1, pages)
167
+ : pages
168
+ },
169
+ searchOptions () {
170
+ return {
171
+ listType: this.listType,
172
+ offset: this.offset,
173
+ sort: this.sort,
174
+ order: this.order
175
+ }
176
+ },
177
+ ...mapState({
178
+ data: state => state.packetList.data,
179
+ total: state => state.packetList.total
180
+ }),
181
+ ...mapGetters(['packetListName', 'packetListQuery']),
182
+ query () { return this.packetListQuery },
183
+ syncIcon () { return faSync },
184
+ nextIcon () { return faAngleDoubleRight },
185
+ prevIcon () { return faAngleDoubleLeft }
186
+ },
187
+ components: {
188
+ FontAwesomeIcon,
189
+ SortableHeader
190
+ },
191
+ filters: {
192
+ dateTime: dateTimeFormat
193
+ },
194
+ watch: {
195
+ '$route'() {
196
+ this.fetchAndUpdate(this.listType, this.searchOptions)
197
+ },
198
+ '$props'() {
199
+ this.fetchAndUpdate(this.listType, this.searchOptions)
200
+ }
201
+ },
202
+ mounted: function () {
203
+ this.fetchAndUpdate(this.listType, this.searchOptions, false)
204
+ },
205
+ methods: {
206
+ ...mapActions(['fetchPacketList','CallAutoAdmitDecision']),
207
+ nextPageOffset () {
208
+ const {offset, limit} = this.query
209
+ return offset + limit
210
+ },
211
+ prevPageOffset () {
212
+ const {offset, limit} = this.query
213
+ return offset - limit
214
+ },
215
+ lastPageOffset () {
216
+ const {limit} = this.query
217
+ const total = this.total
218
+ return Math.floor(total / limit) * limit
219
+ },
220
+ sortBy (query, field) {
221
+ const { sort, order } = query
222
+ const newSort = field
223
+ const newOrder = (sort === field && order === 'asc') ? 'desc' : 'asc'
224
+ const routerQuery = { sort: newSort, order: newOrder, offset: 0 }
225
+ this.$router.push({path: `/list/${this.listType}`, query: routerQuery})
226
+ window.scrollTo(0, 0)
227
+ },
228
+ sortByName () { this.sortBy(this.query, 'applicant_name') },
229
+ sortByAdmitPeriod () { this.sortBy(this.query, 'admit_period') },
230
+ sortByNextAction () { this.sortBy(this.query, 'next_action_date') },
231
+ fetchAndUpdate (listType, query, force = true) {
232
+ this.fetchPacketList({...query, listType, force})
233
+ },
234
+ refresh () {
235
+ this.fetchAndUpdate(this.listType, this.query)
236
+ },
237
+
238
+ SubmitAuto () {
239
+ console.log('submitAuto')
240
+ this.CallAutoAdmitDecision()
241
+ },
242
+
243
+ loadPage (page) {
244
+ const {limit, offset, sort, order} = this.query
245
+ const total = this.total
246
+ const newOffset = page === 'first' ? 0
247
+ : page === 'last' ? this.lastPageOffset()
248
+ : page === 'next' ? this.nextPageOffset()
249
+ : page === 'prev' ? this.prevPageOffset()
250
+ : (page - 1) * limit
251
+ this.$router.push({ path: `/list/${this.listType}`, query: {offset: newOffset, sort, order} })
252
+ window.scrollTo(0, 0)
253
+ },
254
+ isPageActive (page) {
255
+ if (page === '...') return false
256
+
257
+ const { limit, offset } = this.query
258
+ const pageOffset = (page - 1) * limit
259
+ return pageOffset === offset
260
+ }
261
+ }
262
+ }
263
+ </script>
264
+ <style scoped>
265
+ .queue-title {
266
+ display: grid;
267
+ grid-template-columns: auto auto 1fr;
268
+ grid-gap: 0.5rem;
269
+ align-items: center;
270
+ }
271
+ .sortable {
272
+ cursor: pointer;
273
+ }
274
+ .match-caption {
275
+ padding-left: .75rem;
276
+ color: var(--gray, #6c757d);
277
+ }
278
+ </style>
package/QuickLinks.vue CHANGED
@@ -1,25 +1,25 @@
1
- <template>
2
- <div>
3
- <svg class="corner-cutout" height="25px" width="25px" viewBox="0 0 25 25">
4
- <path d="M0,0 L25,0 0,25 Z" fill="white" />
5
- </svg>
6
- <h3>Quick Links</h3>
7
- <slot></slot>
8
- </div>
9
- </template>
10
- <script>
11
- export default {
12
- name: 'QuickLinks'
13
- }
14
- </script>
15
- <style scoped>
16
- div {
17
- position: relative;
18
- padding: 2rem 0.8rem;
19
- }
20
- .corner-cutout {
21
- position: absolute;
22
- left: -1px;
23
- top: -1px;
24
- }
25
- </style>
1
+ <template>
2
+ <div>
3
+ <svg class="corner-cutout" height="25px" width="25px" viewBox="0 0 25 25">
4
+ <path d="M0,0 L25,0 0,25 Z" fill="white" />
5
+ </svg>
6
+ <h3>Quick Links</h3>
7
+ <slot></slot>
8
+ </div>
9
+ </template>
10
+ <script>
11
+ export default {
12
+ name: 'QuickLinks'
13
+ }
14
+ </script>
15
+ <style scoped>
16
+ div {
17
+ position: relative;
18
+ padding: 2rem 0.8rem;
19
+ }
20
+ .corner-cutout {
21
+ position: absolute;
22
+ left: -1px;
23
+ top: -1px;
24
+ }
25
+ </style>
package/README.md CHANGED
@@ -1,2 +1,2 @@
1
- # vue-decision-processing-components
2
- Vue.js components to be shared between the decision processing applications for the various CES Schools.
1
+ # vue-decision-processing-components
2
+ Vue.js components to be shared between the decision processing applications for the various CES Schools.