Skip to content

Commit

Permalink
🐞 Trustees struggle to respond to director (#415) (#421)
Browse files Browse the repository at this point in the history
Parent issue: sequentech/meta#402
  • Loading branch information
Findeton authored Apr 24, 2024
1 parent 5972465 commit 7457cc8
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion avAdmin/admin-alerts-directive/admin-alerts-directive.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="alert alert-danger alert-dismissible" role="alert" ng-if="error">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<span ng-if="error.payload">{{ error.payload }}</span>
<span ng-if="!error.payload">{{ error }}</span>
<span ng-if="!error.payload" ng-i18next="{{ error }}"></span>
</div>

<div class="alert alert-success alert-dismissible" role="alert" ng-if="msg">
Expand Down
17 changes: 11 additions & 6 deletions avAdmin/admin-directives/create/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -1248,10 +1248,11 @@ angular.module('avAdmin')
ElectionsApi.getElection(id, true)
.then(function(el) {
var deferred = $q.defer();
if (scope.createElectionBool && el.status === 'created' ||
!scope.createElectionBool && el.status === 'registered')
if ((scope.createElectionBool && el.status === 'created') ||
(!scope.createElectionBool && el.status === 'registered') ||
'create_error' === el.status)
{
f();
f(el);
} else {
setTimeout(function() { waitForCreated(id, f); }, 5000);
}
Expand All @@ -1277,9 +1278,13 @@ angular.module('avAdmin')
.then(createElection)
.then(function(election) {
console.log("waiting for election " + election.title);
waitForCreated(election.id, function () {
DraftElection.eraseDraft();
secondElectionsStage(electionIndex + 1);
waitForCreated(election.id, function (newEl) {
if ('create_error' === newEl.status) {
logError($i18next.t('avAdmin.create.createError', {title: election.title, id: election.id}));
} else {
DraftElection.eraseDraft();
secondElectionsStage(electionIndex + 1);
}
});
})
.catch(function(error) {
Expand Down
3 changes: 3 additions & 0 deletions avAdmin/admin-directives/dashboard/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,9 @@ angular.module('avAdmin')
) {
ElectionsApi.results(el);
}
if ('tally_error' === el.tally_state && !scope.error) {
scope.error = 'avAdmin.dashboard.tallyError';
}
}
}
);
Expand Down
1 change: 1 addition & 0 deletions avAdmin/elections-api-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ angular.module('avAdmin')
var conf = electionsapi.templateEl();
conf = _.extend(conf, election.configuration);
conf.status = election.state;
conf.tally_state = election.tally_state;
conf.startDate = election.startDate;
conf.endDate = election.endDate;
conf.stats = {};
Expand Down
2 changes: 2 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
"start": "Start voting",
"stop": "Stop voting",
"tally": "Tally",
"tallyError": "Error during tally",
"calculate": "Calculate results",
"publish": "Publish results",
"calculateAgain": "Calculate results again",
Expand Down Expand Up @@ -936,6 +937,7 @@
"summary__plural": "Summary: creating __num__ elections",
"checkingTrustees": "Checking trustees status for election __title__",
"create": "Create the elections",
"createError": "Error creating the election (id: __id__) __title__",
"creating": "Creating the authentication for election __title__",
"setChildrenElectionInfo": "Setting the children election info for election (id: __id__) __title__",
"addBallotBoxes": "Creating ballot boxes for election (id: __id__) __title__",
Expand Down
2 changes: 2 additions & 0 deletions locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@
"start": "Comenzar votación",
"stop": "Terminar votación",
"tally": "Hacer recuento",
"tallyError": "Error durante el recuento",
"calculate": "Calcular resultados",
"publish": "Publicar resultados",
"calculateAgain": "Calcular resultados de nuevo",
Expand Down Expand Up @@ -823,6 +824,7 @@
"summary__plural": "Resumen: creando __num__ votaciones",
"checkingTrustees": "Checking trustees status for election __title__",
"create": "Crear las votaciones",
"createError": "Error creando la votación (id: __id__) __title__",
"create__plural": "Crear las votaciones",
"creating": "Creando la autenticación de la votación __title__",
"census": "Añadiendo el censo (id: __id__) __title__",
Expand Down

0 comments on commit 7457cc8

Please sign in to comment.