globaleaks / globaleaks-whistleblowing-software

GlobaLeaks is a free and open-source whistleblowing software enabling anyone to easily set up and maintain a secure reporting platform.
https://www.globaleaks.org
Other
1.26k stars 276 forks source link

Expose status variables of the whistleblowing process making them available to possible templates #1362

Open fpietrosanti opened 9 years ago

fpietrosanti commented 9 years ago

This ticket is to expose globally accessible variable of file upload progress to enable third party UI/theme.

That way Goldilocks, for PubLeaks theme, can just read a set of information coming from Flow.js and design/handle dynamically their own progress bar for file upload.

evilaliv3 commented 9 years ago

This ticket should be more generalized as:

Given the results of the publeaks hackaton that shown how easily would be to create a globaleaks template for a single page app that would appear in total like what the adopter wants by simply creating an html template file with some css and js it would be interesting to export some variables in a global scope to make them availalbe to such a graphic template.

this would be interesting for a certain number of variables/function quite all related to the submission process:

marceloomens commented 9 years ago

I would like to see if we can come up with a cleaner solution after taking the new Publeaks design into production. Rather than exposing these status indicators in the global scope, you can expose them through an Angular provider (or factory or service, these all follow the singleton pattern).

See https://docs.angularjs.org/guide/providers

I'd be happy to take it upon myself to have a look at GLClient to see where we can improve on the existing implementation through some common design patterns and tighter integration between front-end and Angular module (i.e. refactor and trash JQuery in favour of a solution only dependent on Angular.)

evilaliv3 commented 9 years ago

@marceloomens this is exactly what i was thinking to! nice to see that we are so aligned.

in general the template (the code of goldilocks in this particular use case) will be anyhow included by us considering it an angular template, this way the $scope is propagated along with all the angular public services/providers/directives that we will provide), so yep this is for sure the good way to go.

evilaliv3 commented 9 years ago

ops wrong ference here, the right reference was 1173

evilaliv3 commented 9 years ago

@lagon1 @marceloomens: with previous commit i've prototyped the feature.

now you should have a global scope variable "submission_step_stage" that would have the following values:

0: receiver selection step 1 - last: the form steps 1 - last+1: a virtual step indicating that the user has completed the submission (anyway for this same aim you can look at the change of the url that will be pointing to /#/receipt