populatetools / gobierto Goto Github PK
View Code? Open in Web Editor NEWPlataforma de gobierno abierto open source
Home Page: https://gobierto.es
License: GNU Affero General Public License v3.0
Plataforma de gobierno abierto open source
Home Page: https://gobierto.es
License: GNU Affero General Public License v3.0
TBD
Here's a brief checklist:
Admin
modeladmin
namespaceadmin
layoutTBD
Now that we have some foundations in place, we can start measuring how much of the codebase is not exercised when running tests, so that we can identify and mitigate risks when making changes.
simplecov
gem as a dependency: https://github.com/colszowka/simplecov.test/test_helper.rb
.CI
env variable.As we discussed, it would be handy to include some fixtures providing a basic amount of data to populate™ the gobierto-budgets
Elasticsearch indices, to be able to perform some end-to-end testing against them.
It could be also loaded in development environment as part of the script/setup
command.
/cc @ferblape
TBD
Check-list:
Budget categories need to be localized. In order to achieve that we need to follow the follwing steps:
1 - use a collection from the big indexer, instead of a local index
2 - parameterize the collection depending on the site locale (each locale has a collection)
Implement a reusable user control. It can be found here, and looks like in this screenshot:
Site entity association will be available, for the moment, just for municipalities.
To get the list of municipalities we are going to use The Big Indexer municipalities collection.
The endpoint to obtain the suggestions is to a given query is https://tbi.populate.tools/gobierto/collections/c-municipios-espanya/suggestions
.
It requires a parameter query
and an authorization header:
query
: contains the query argument to the suggestions.authorization: Bearer <TOKEN_BODY>
(I'll provide the token body in private). Maybe it'll make sense to set that token as an installation setting, because I suspect we are going to use The Big Indexer in some places in the future.
In javascript you can do this:
var settings = {
"crossDomain": true,
"url": "https://tbi.populate.tools/gobierto/collections/c-municipios-espanya/suggestions",
"method": "GET",
"dataType": "json",
"data": { "query": "foo"},
"headers": {
"authorization": "Bearer <TOKEN_BODY>"
}
}
$.ajax(settings).done(function(response) {
console.log(response);
});
The output of the endpoint is an object with a key suggestions
and all the suggestions, composed of a value, and a raw data object:
{
"suggestions": [
{
"value": "Abarán",
"data": {
"id": "30002",
"name": "Abarán",
"slug": "abaran",
"municipality_id": 30002,
"province_id": 30,
"autonomous_region_id": 14
}
},
{
"value": "Abárzuza/Abartzuza",
"data": {
"id": "31002",
"name": "Abárzuza/Abartzuza",
"slug": "abarzuza-abartzuza",
"municipality_id": 31002,
"province_id": 31,
"autonomous_region_id": 15
}
},
{
"value": "Abarca de Campos",
"data": {
"id": "34001",
"name": "Abarca de Campos",
"slug": "abarca-de-campos",
"municipality_id": 34001,
"province_id": 34,
"autonomous_region_id": 7
}
}
]}
This comes from #56.
Let's think about notifying verification processes results or changes to the users. i.e.
Make it look and behave like the prototype.
TBD
Just to keep in mind, I'd say that abstracting the search engine's internals would be a good move in terms of architecture. That way, the actual search engine back-end (Elasticsearch) is never reached directly so the querying interfaces can be aligned to our business logic instead.
We could go from this:
GobiertoBudgets::SearchEngine.client.search(
index: GobiertoBudgets::SearchEngineConfiguration::BudgetLine.index_forecast,
type: @conditions[:area_name],
body: query
)
To something like:
GobiertoBudgets::BudgetLine::Forecast.where(area_name: params[:area_name])
GobiertoBudgets::BudgetLine::Forecast.find_by(code: params[:code])
This comes from #56.
TBD
TBD
After having prepared the codebase to accept new modules, it feels like some Admin-related resources are not properly namespaced or could be out of context, so I'd say it's perfect time to refactor the current implementation and make it behave like a built-in module for consistency.
This comes from #56.
If there's only one active consultation, skip the consultations home page and redirect to it.
GobiertoBudgets module doesn't have any test right now that checks if the module is working.
Create a minimum test suite to cover at least:
The sandbox files come from #11.
We have decided to keep routes static, without localization.
Provide a unique URL to share any Consultation response anonymously.
These activities that affect an admin need to be tracked
TBD
Since the latest features are pretty much stabilized, cover any missing translations within the GobiertoAdmin
module's UI.
Also, consider enabling the config.action_view.raise_on_missing_translations
setting to ensure everything is localized.
Depends on #55.
Check-list:
For the moment we just need a simple upload to S3, without changing or cropping the image.
The result of the upload will be an attribute in the SiteConfiguration
.
after_sign_in_path
./cc @ferblape
Make it look and behave like the prototype.
Check-list:
In the new indicators page we plan to use D3 v4, so we should migrate the old two visualizations we have in GobiertoBudgets module:
Treemap: theoretically it should work as it is, so nothing to do here
Line graph: probably just update the scales and domains, and the rest will work
As seen today in the Staging environment, some User namespace-specific logic is defined at ApplicationController
level so any other controllers are inheriting them.
In example, the authenticate_user_in_site
callback should not be triggered in other namespaces but the User one.
Let's just write it down for a possible refactor.
Here's a quick check-list:
Improvements:
This is a follow up of #55
Site google analytics code shouldn't be a mandatory field.
I'd start playing with Rubocop in our case.
We are going to change a bit the links because we want a bit of flexibility, so instaead of an array of links we are going to store a raw HTML field.
Every action that updates the database (creates, updates or destroys a record) must be tracked in the system.
These actions need to reflect:
site.created
or user.updated
There are three kinds of actions:
1 - actions performed by regular users (citiziens) in the public or private site. I.e.: follow a budget line, vote for a comment, or update her personal data
2 - actions performed by an admin in a site, such as create a new participatory process
3 - actions performed by an admin not linked to a site, such as create a new admin, enable a site module, or disable a user account
The activity log will be displayed in different parts of the admin UI, not totally defined yet. For the moment:
Codecov is reporting 89.11% of coverage, so let's take a look and try to cover the most obvious cases to increase it above ~92%, for now.
In the consultation item page, we are shoing a lot of budget items to the user, and it's a bit complex to pick a specific budget line.
Change the behaviour and implement a typeahead (auto-suggest) that suggest budgets while the user is typing.
Pretty much like #82, it'd be good to properly namespace every single independent piece in Gobierto as modules for ease and portability. In this case I was thinking of a gobierto-core
built-in module to hold what is the User namespace now.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.