Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 37 additions & 3 deletions src/views/Voting/BallotLeaders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ export default {
Vue.set(this.pageData, key, value);
}
}
const items = result.items.filter(i => i.disqualified === null).sort((a, b) => {
return a.numVotes < b.numVotes ? 1 : -1;
});
const items = result.items
.filter(i => i.disqualified === null)
.sort((a, b) => {
return a.numVotes < b.numVotes ? 1 : -1;
});
this.$emit("input", items.length);
items.splice(3, items.length - 3);
Vue.set(this.pageData, "items", items);
Expand All @@ -89,6 +91,38 @@ export default {
async loadPage() {
this.requestCount++;

// for testing
if (this.$route.path === "/testing/vote") {
Vue.set(this.pageData, "items", [
{
display: "TedW",
firstName: "Ted",
id: 12345,
lastName: "Smith",
numVotes: 48,
text: "Not sure what goes here?",
username: "Ted456",
value: "This must be where the code goes.",
initials: "TW"
},
{
display: "something",
firstName: "Blahblahblah",
id: 123453,
lastName: "Smith",
numVotes: 45,
text: "Not sure what goes here?",
username: "MyUserName",
value: "Code stuff",
initials: "TW"
}
]);

this.requestCount--;
return;
}
// end for testing

const results = await voting.getBallot(this.pageData.page, this.per);
await this.setResult(results);

Expand Down