Merge pull request #2920 from emanuelschuetze/fixAssignmentVoteOrder
Fixed wrong order of assignment votes caused by redis cache.
This commit is contained in:
commit
f5fab05388
@ -33,7 +33,8 @@ angular.module('OpenSlidesApp.assignments', [])
|
||||
|
||||
_.forEach(this.votes, function (vote) {
|
||||
// Initial values for the vote
|
||||
var value = '',
|
||||
var order = '',
|
||||
value = '',
|
||||
percentStr = '',
|
||||
percentNumber;
|
||||
|
||||
@ -52,6 +53,19 @@ angular.module('OpenSlidesApp.assignments', [])
|
||||
value = 0; // Vote was not defined. Set value to 0.
|
||||
}
|
||||
}
|
||||
switch (vote.value) {
|
||||
case "Yes":
|
||||
order = 1;
|
||||
break;
|
||||
case "No":
|
||||
order = 2;
|
||||
break;
|
||||
case "Abstain":
|
||||
order = 3;
|
||||
break;
|
||||
default:
|
||||
order = 0;
|
||||
}
|
||||
|
||||
// Special case where to skip percents
|
||||
var skipPercents = config === 'YES_NO' && vote.value === 'Abstain';
|
||||
@ -61,13 +75,14 @@ angular.module('OpenSlidesApp.assignments', [])
|
||||
percentStr = "(" + percentNumber + "%)";
|
||||
}
|
||||
votes.push({
|
||||
'order': order,
|
||||
'label': gettextCatalog.getString(vote.value),
|
||||
'value': value,
|
||||
'percentStr': percentStr,
|
||||
'percentNumber': percentNumber
|
||||
});
|
||||
});
|
||||
return votes;
|
||||
return _.sortBy(votes, 'order');
|
||||
},
|
||||
|
||||
// Returns 0 or positive integer if quorum is reached or surpassed.
|
||||
|
@ -48,11 +48,11 @@
|
||||
<div ng-init="votes = option.getVotes()">
|
||||
<div ng-show="poll.pollmethod == 'yna' || poll.pollmethod == 'yn'">
|
||||
<span ng-show="poll.pollmethod == 'yna'">
|
||||
{{ votes[0].label }}: <strong>{{ votes[0].value }}</strong> ·
|
||||
{{ votes[0].label }}: {{ votes[0].value }} ·
|
||||
{{ votes[1].label }}: {{ votes[1].value }} ·
|
||||
{{ votes[2].label }}: {{ votes[2].value }} </span>
|
||||
<span ng-show="poll.pollmethod == 'yn'">
|
||||
{{ votes[0].label }}: <strong>{{ votes[0].value }}</strong> ·
|
||||
{{ votes[0].label }}: {{ votes[0].value }} ·
|
||||
{{ votes[1].label }}: {{ votes[1].value }}</span>
|
||||
<uib-progress ng-if="votes[0].percentNumber>=0">
|
||||
<uib-bar value="votes[0].percentNumber" type="success">
|
||||
|
Loading…
Reference in New Issue
Block a user