@byu-oit/vue-decision-processing-components 8.35.7 → 8.35.8
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/.github/workflows/deploy.yml +51 -0
- package/.repo-meta.yml +55 -55
- package/AdmitPeriodConfig.vue +115 -115
- package/ApiCallButton.vue +91 -91
- package/ApplicantInfo.vue +100 -100
- package/AssignmentBulkDialog.vue +153 -153
- package/AssignmentDialog.vue +117 -117
- package/AssignmentSummary.vue +75 -75
- package/BackgroundBadge.vue +83 -83
- package/BackgroundDetailCrime.vue +78 -78
- package/BackgroundDetailPluralMarriage.vue +43 -43
- package/BackgroundDetailSexRegistry.vue +43 -43
- package/BackgroundDetailUniversity.vue +37 -37
- package/CHANGELOG.md +676 -670
- package/Dashboard.vue +201 -201
- package/DashboardApplicationList.vue +50 -50
- package/DecisionDialog.vue +178 -178
- package/Details.vue +124 -124
- package/DetailsActivity.vue +59 -59
- package/DetailsBackground.vue +143 -143
- package/DetailsBackgroundDetail.vue +47 -47
- package/DetailsBackgroundSummary.vue +66 -66
- package/DetailsCesHold.vue +107 -107
- package/DetailsCollege.vue +93 -93
- package/DetailsContact.vue +65 -65
- package/DetailsDecision.vue +183 -183
- package/DetailsDecisionHistory.vue +56 -56
- package/DetailsEndorsement.vue +74 -74
- package/DetailsEssay.vue +59 -59
- package/DetailsFilenote.vue +62 -62
- package/DetailsFilenoteList.vue +109 -109
- package/DetailsFlagSection.vue +176 -176
- package/DetailsHeader.vue +263 -263
- package/DetailsHighSchool.vue +99 -99
- package/DetailsHsTranscript.vue +100 -100
- package/DetailsInstitute.vue +90 -90
- package/DetailsMission.vue +88 -88
- package/DetailsNewAppHistory.vue +50 -50
- package/DetailsNotes.vue +83 -83
- package/DetailsPathway.vue +45 -45
- package/DetailsScoringSection.vue +128 -128
- package/DetailsSection.vue +116 -116
- package/DetailsSeminary.vue +184 -184
- package/DetailsSrs.vue +52 -52
- package/DetailsSubnav.vue +54 -54
- package/DetailsTestScores.vue +131 -131
- package/ExpandIndicator.vue +75 -75
- package/ExternalLink.vue +34 -34
- package/FilterBreadcrumb.vue +85 -85
- package/FilterButton.vue +86 -86
- package/FilterButtonAdmitPeriod.vue +104 -109
- package/FilterButtonAppType.vue +103 -103
- package/FilterButtonAssignedTo.vue +96 -96
- package/FilterButtonClearFilters.vue +65 -65
- package/FilterButtonSex.vue +105 -105
- package/FlagButton.vue +59 -59
- package/FlagDialog.vue +129 -129
- package/Footer.vue +432 -432
- package/Header.vue +132 -132
- package/HighSchoolSummary.vue +60 -60
- package/InternationalIndicator.vue +44 -44
- package/InternationalStatus.vue +48 -48
- package/LICENSE +201 -201
- package/LoadingBadge.vue +58 -58
- package/ManageAssignments.vue +123 -123
- package/NoAuth.vue +14 -14
- package/NoteDialog.vue +106 -106
- package/ObjectViewer.vue +49 -49
- package/Queues.vue +268 -268
- package/QuickLinks.vue +25 -25
- package/README.md +2 -2
- package/RecentApplications.vue +53 -53
- package/Report.vue +340 -340
- package/ReportDetail.vue +279 -279
- package/ReportList.vue +87 -87
- package/ReportPhotos.vue +65 -65
- package/ReportSvg.vue +78 -78
- package/ReportViewer.vue +165 -165
- package/RequestAccess.vue +14 -14
- package/RequestAccessList.vue +45 -45
- package/RoleSelector.vue +29 -29
- package/Search.vue +22 -22
- package/ShowApplicantIds.vue +100 -100
- package/SortableHeader.vue +53 -53
- package/Spinner.vue +34 -34
- package/StarredIndicator.vue +36 -36
- package/StatBox.vue +73 -73
- package/StatCharts.vue +196 -196
- package/SupportDialog.vue +172 -172
- package/UserInfo.vue +52 -52
- package/YesNoIndicator.vue +48 -48
- package/dateTimeFormat.js +67 -67
- package/gpaCalculation.js +162 -162
- package/gpaFilter.js +5 -5
- package/hsSummary.json +2019 -2019
- package/package.json +36 -36
- package/parsers/application.js +396 -396
- package/parsers/decisionHistory.js +27 -27
- package/parsers/filenotes.js +27 -27
- package/parsers/notes.js +49 -49
- package/parsers/packet.js +88 -88
- package/parsers/packetList.js +57 -57
- package/parsers/reports.js +13 -13
- package/sat2Act.js +46 -46
- package/test.js +48 -48
- package/themes/ByuiFooter.vue +38 -38
- package/themes/ByuiHeader.vue +96 -96
- package/themes/LdsbcFooter.vue +38 -38
- package/themes/LdsbcHeader.vue +100 -100
- package/vuexModules/application/activity.js +32 -32
- package/vuexModules/application/applicationList.js +71 -71
- package/vuexModules/application/background.js +47 -47
- package/vuexModules/application/bio.js +38 -38
- package/vuexModules/application/citizenship.js +30 -30
- package/vuexModules/application/collegeSummaries.js +32 -32
- package/vuexModules/application/essay.js +26 -26
- package/vuexModules/application/highSchoolSummaries.js +40 -40
- package/vuexModules/application/index.js +157 -157
- package/vuexModules/application/institute.js +30 -30
- package/vuexModules/application/mission.js +48 -48
- package/vuexModules/application/personalRecords.js +24 -24
- package/vuexModules/application/questions.js +23 -23
- package/vuexModules/application/seminary.js +39 -39
- package/vuexModules/application/testScores.js +26 -26
- package/vuexModules/notes/index.js +22 -22
- package/vuexModules/packet/decision.js +43 -43
- package/vuexModules/packet/decisionHistory.js +28 -28
- package/vuexModules/packet/flags.js +174 -174
- package/vuexModules/packet/index.js +52 -52
- package/vuexModules/packet/packetList.js +127 -127
- package/vuexModules/packet/processes.js +28 -28
- package/vuexModules/reports/index.js +32 -32
- package/vuexModules/ui/index.js +56 -56
- package/vuexModules/users/index.js +46 -46
- package/yyyyMmFilter.js +7 -7
package/Queues.vue
CHANGED
|
@@ -1,268 +1,268 @@
|
|
|
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
|
+
</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>
|
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.
|