Add Note in Readme concerning variable naming

This commit is contained in:
Christoph Lienhard 2020-07-13 21:40:33 +02:00
parent 498a02bf1d
commit 5512955af4
3 changed files with 11 additions and 4 deletions

View file

@ -1,6 +1,6 @@
# CANDYMAT # CANDYMAT
A Vue.js powered, progressive web voting application for upcoming internal elections of Bündnis90/Die Grünen. Candymat is hosted as a service of netzbegruenung e.V. A Vue.js powered, progressive web voting application for upcoming internal elections of Bündnis90/Die Grünen. Candymat is hosted as a service of netzbegruenung e.V.
## Calculation Model ## Calculation Model
@ -20,5 +20,11 @@ This is a Vue.js progressive web application, developed with [`@vue/cli`](https:
| `npm run svg` | Creates all SVG files used in the application | | `npm run svg` | Creates all SVG files used in the application |
| `npm run admin` | Creates `config.yml` for Netlify CMS admin UI | | `npm run admin` | Creates `config.yml` for Netlify CMS admin UI |
### Notes
* To keep the diff to the original euromat source as small as possible certain variables follow a naming convention
which may seem weird at first.
These include
* `party` (better description would be `person`)
## Props ## Props
This user app is based on source code of EUROMAT targeted at european elections. This user app is based on source code of EUROMAT targeted at european elections.

View file

@ -38,7 +38,7 @@
<div class="party-results-national"> <div class="party-results-national">
<span> <span>
{{ person.name }} {{ party.name }}
</span> </span>
</div> </div>
</li> </li>
@ -122,7 +122,8 @@
const partiesWithScores = getPartiesWithScores(answers, emphasized, parties) const partiesWithScores = getPartiesWithScores(answers, emphasized, parties)
this.parties = partiesWithScores.map(party => ({ this.parties = partiesWithScores.map(party => ({
token: party.token, token: party.token,
score: party.score score: party.score,
name: party.name
})) }))
.sort((a, b) => a.score - b.score) .sort((a, b) => a.score - b.score)
.reverse() .reverse()

View file

@ -50,7 +50,7 @@
<script> <script>
import { options } from '@/data' import { options } from '@/data'
import { getTranslatedUrl } from '@/i18n/helper' import { getTranslatedUrl } from '@/i18n/helper'
import { apolloTheses, apolloThesesCount } from '@/app/euromat/helper' import { apolloTheses, apolloThesesCount } from '@/app/euromat/graphqlQueries'
export default { export default {
name: 'EuroMat', name: 'EuroMat',