From 903eb3d79480ecc054346319b93382992acc3bd2 Mon Sep 17 00:00:00 2001 From: Leon Vreling Date: Tue, 17 Sep 2024 19:50:13 +0200 Subject: [PATCH 1/6] fix(network): Only display table after all loading is done --- src/views/network/AntennaCriteriaCheck.vue | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/views/network/AntennaCriteriaCheck.vue b/src/views/network/AntennaCriteriaCheck.vue index c1ade1e09..fbeaba8c1 100644 --- a/src/views/network/AntennaCriteriaCheck.vue +++ b/src/views/network/AntennaCriteriaCheck.vue @@ -164,7 +164,8 @@ export default { events: [], statutoryEvents: [], summerUniversities: [], - isLoading: false + isLoading: false, + isLoadingAgora: false } }, computed: { @@ -213,7 +214,7 @@ export default { this.hideSafeLocals = !this.hideSafeLocals }, fetchAgorae () { - this.isLoading = true + this.isLoadingAgora = true this.axios.get(this.services['statutory'], { params: { type: 'agora' } }).then((response) => { this.agorae = response.data.data if (this.agorae.length === 0) { @@ -222,9 +223,9 @@ export default { // Automatically set the most recent Agora as the selected one this.selectedAgora = this.agorae[0] this.fetchData() - this.isLoading = false + this.isLoadingAgora = false }).catch((err) => { - this.isLoading = false + this.isLoadingAgora = false this.$root.showError('Could not fetch statutory data', err) }) }, @@ -282,7 +283,6 @@ export default { await this.axios.get(this.services['events'] + '/recents', { params: { ends: this.selectedAgora.ends } }).then((response) => { this.events = response.data.data }).catch((err) => { - this.isLoading = false this.$root.showError('Could not fetch event data', err) }) }, @@ -290,7 +290,6 @@ export default { await this.axios.get(this.services['statutory'] + '/recents', { params: { ends: this.selectedAgora.ends } }).then((response) => { this.statutoryEvents = response.data.data }).catch((err) => { - this.isLoading = false this.$root.showError('Could not fetch statutory event data', err) }) }, @@ -298,7 +297,6 @@ export default { await this.axios.get(this.services['summeruniversity'] + '/recents', { params: { ends: this.selectedAgora.ends } }).then((response) => { this.summerUniversities = response.data.data }).catch((err) => { - this.isLoading = false this.$root.showError('Could not fetch Summer University data', err) }) }, @@ -350,7 +348,6 @@ export default { if (this.bodies[body].latest_election !== undefined) this.bodies[body].latest_election = moment(this.bodies[body].latest_election).format('D[/]M[/]YYYY') } }).catch((err) => { - this.isLoading = false this.$root.showError('Could not fetch boards data', err) }) }, @@ -360,7 +357,6 @@ export default { this.bodies[body].antennaCriteria.membersList = this.bodies[body].id in membersListResponse.data.data.map(x => x.id) } }).catch((err) => { - this.isLoading = false this.$root.showError('Could not fetch members list data', err) }) }, @@ -376,7 +372,6 @@ export default { body.comments[criterionName] = criterion.comment } }).catch((err) => { - this.isLoading = false this.$root.showError('Could not fetch manual Antenna Criteria fulfilment', err) }) } From 0b631582b2585f3a076b0fa5560b4c403450c2a8 Mon Sep 17 00:00:00 2001 From: Leon Vreling Date: Tue, 17 Sep 2024 20:26:22 +0200 Subject: [PATCH 2/6] fix(network): Correctly display Locals submitted memberslists --- src/views/network/AntennaCriteriaCheck.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/network/AntennaCriteriaCheck.vue b/src/views/network/AntennaCriteriaCheck.vue index fbeaba8c1..11252f380 100644 --- a/src/views/network/AntennaCriteriaCheck.vue +++ b/src/views/network/AntennaCriteriaCheck.vue @@ -352,9 +352,10 @@ export default { }) }, async checkMembersList () { - await this.axios.get(this.services['statutory'] + '/events/' + this.selectedAgora.id + '/memberslists/missing').then((membersListResponse) => { - for (const body in this.bodies) { - this.bodies[body].antennaCriteria.membersList = this.bodies[body].id in membersListResponse.data.data.map(x => x.id) + await this.axios.get(this.services['statutory'] + '/events/' + this.selectedAgora.id + '/memberslists').then((membersListsResponse) => { + for (const membersList of membersListsResponse.data.data) { + const body = this.bodies.find(x => x.id === membersList.body_id) + body.antennaCriteria.membersList = true } }).catch((err) => { this.$root.showError('Could not fetch members list data', err) From cffb51e5ff9f5f5f0c4241f1f309fb0252a07b7f Mon Sep 17 00:00:00 2001 From: Leon Vreling Date: Tue, 17 Sep 2024 22:30:36 +0200 Subject: [PATCH 3/6] fix(network): Allow handling Locals with no comments set --- src/views/network/AntennaCriteriaCheck.vue | 2 +- src/views/network/AntennaCriteriaInfo.vue | 13 +++++++++++-- src/views/network/AntennaCriteriaModal.vue | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/views/network/AntennaCriteriaCheck.vue b/src/views/network/AntennaCriteriaCheck.vue index 11252f380..5fae2edba 100644 --- a/src/views/network/AntennaCriteriaCheck.vue +++ b/src/views/network/AntennaCriteriaCheck.vue @@ -235,7 +235,7 @@ export default { this.axios.get(this.services['core'] + '/bodies').then(async (bodiesResponse) => { this.bodies = bodiesResponse.data.data this.bodies = this.bodies.filter(x => ['antenna', 'contact antenna', 'contact'].includes(x.type)) - this.bodies.forEach(body => { body.antennaCriteria = {} }) + this.bodies.forEach(body => { body.antennaCriteria = {}, body.comments = {} }) const promises = [] promises.push(this.checkBoardCriterium()) diff --git a/src/views/network/AntennaCriteriaInfo.vue b/src/views/network/AntennaCriteriaInfo.vue index 2139c3b16..2278683dc 100644 --- a/src/views/network/AntennaCriteriaInfo.vue +++ b/src/views/network/AntennaCriteriaInfo.vue @@ -6,7 +6,7 @@