Skip to content

Commit

Permalink
Merge pull request #546 from bcgov/release/v1.15.0
Browse files Browse the repository at this point in the history
Release/v1.15.0
  • Loading branch information
suzalflueck authored Mar 4, 2024
2 parents 289d76a + d8e834b commit 35d0117
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
18 changes: 15 additions & 3 deletions frontend/src/components/Codes/CareerPrograms.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</p>
<DisplayTable
title="Career Programs"
v-bind:items="careerPrograms"
v-bind:items="sortedCareerPrograms"
v-bind:fields="careerProgramFields"
id="code"
showFilter="true"
Expand Down Expand Up @@ -36,6 +36,9 @@ export default {
ProgramManagementService.getCareerPrograms()
.then((response) => {
this.careerPrograms = response.data;
this.sortedCareerPrograms = this.careerPrograms.sort(
(a, b) => a.displayOrder - b.displayOrder
);
})
// eslint-disable-next-line
.catch((error) => {
Expand All @@ -49,7 +52,16 @@ export default {
data: function () {
return {
careerPrograms: [],
sortedCareerPrograms: [],
careerProgramFields: [
{
key: "displayOrder",
label: "Display Order",
sortable: true,
sortDirection: "asc",
thClass: "d-none",
tdClass: "d-none",
},
{
key: "code",
label: "Code",
Expand All @@ -64,12 +76,12 @@ export default {
},
{
key: "startDate",
label: "Start Date",
label: "Effective Date",
sortable: true,
},
{
key: "endDate",
label: "End Date",
label: "Expiry Date",
sortable: true,
},
],
Expand Down
21 changes: 13 additions & 8 deletions frontend/src/components/DisplayTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
</b-table>

<b-pagination
v-if="totalRows"
v-model="currentPage"
:total-rows="totalRows"
:per-page="perPage"
Expand Down Expand Up @@ -245,7 +246,8 @@ export default {
],
onMounted() {
// Set the initial number of items
this.totalRows = this.items.length;
// this.totalRows = this.items.length;
// this.rows = this.items.length;
},
data() {
return {
Expand Down Expand Up @@ -302,11 +304,11 @@ export default {
editableFields() {
return this.fields.filter((field) => field.editable);
},
// totalRows: function () {
// if (this.items?.length) {
// return this.items.length;
// } else return this.totalRows;
// },
totalRows: function () {
if (this.items?.length && !this.filter) {
return this.items.length;
} else return this.totalRows;
},
sortOptions() {
return this.fields
.filter((f) => f.sortable)
Expand Down Expand Up @@ -344,8 +346,11 @@ export default {
},
onFiltered(filteredItems) {
// Trigger pagination to update the number of buttons/pages due to filtering
this.totalRows = filteredItems.length;
this.currentPage = 1;
if (this.filter) {
this.totalRows = filteredItems.length;
}
this.currentPage = 0;
},
},
};
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/components/StudentProfile/StudentAssessments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ export default {
sortable: true,
sortDirection: "desc",
},
{
key: "wroteFlag",
label: "Wrote Flag",
sortable: true,
sortDirection: "desc",
},
{
key: "exceededWriteFlag",
label: "Exceeded Writes",
Expand Down

0 comments on commit 35d0117

Please sign in to comment.