Skip to main content

Cookie settings

We use cookies to ensure the basic functionalities of the website and to enhance your online experience. You can choose for each category to opt-in/out whenever you want.

Essential

Preferences

Analytics and statistics

Marketing

This proposal has been accepted

This proposal is accepted by the Product Team to be submitted to the main repository. But due to the current volume of Pull Requests on GitHub, we cannot ensure that this contribution will be reviewed and merged for the next release. We kindly ask you not to send the PR until we notify you.

We'll let you know in the comments when the situation improves and we can review and accept your contributions again. Thanks for your help building together Decidim.

Import projects into a budget from a file

Avatar: Open Source Politics Open Source Politics Accepted / In progress

Is your feature request related to a problem? Please describe.
Currently, to create projects in the Budget component, the admin has to go to the edit page and click on "New Project", fill in the form (title, description, budget, category, related proposal(s), image) and finally validate. 

Generally, a budget contains more than 3 projects. In most cases, these projects have been already created by the admin in an external file or on a test platform. The fact that the admin has to redo the creation process for each project when he already has an existing document makes the task waste his time and energy. 

As an admin, I would like to be able to create several projects at the same time by importing these projects from a file in the Budget component.

Describe the solution you'd like

In order to harmonize the solution with what already exists in the other components of the platform (proposals for example), here is what we propose: 

  • On the project management page of a budget (manage/budgets/n/projects) : 
  • Change “Import proposals to projects “ button to a dropdown menu
  • Rename it to “import” 
  • Add two elements to the dropdown list : 
  • Import proposals to projects -> Redirect to the existing page projects/proposals_import/new
  • Import projects to budget
  • Add a page to enable admins to import projects, with:
  • help text to give guidelines on the required file formatting “The file must have column names title/en , description/en (or another locale which you prefer eg. title/ca and body/ca) and budget. Also scope/id, category/id , proposals/id and image/url columns are supported.”
  • uploader working with csv, xls and json files. 
  • button to import projects
  • The import document should contain the following columns (mandatory): 
  • title/en
  • description/en 
  • budget
  • The import document could also contain the following columns: (optional)
  • scope/id
  • category/id
  • proposals/id
  • image/url
  • Other locales should be accepted (example /fr) 
  • Separator of the columns should be a semicolon (";")
  • The Title and Description could contain semicolon 
  • Proposals/id could contain ids of many proposals : in this case, the ids should be in an array [‘1’, ‘2’, ‘3’]
  • Test cases : 
  • scope/id not found : upload the file and put : 
  • “Global scope” : if scopes are enabled
  • Null : if scopes are disabled
  • category/id not found : don’t upload the file -> error message “Found an error in the import file on line n. Please check that these lines are formatted correctly and contain valid records.”
  • proposals/id not found : don’t upload the file -> error message “Found an error in the import file on line n. Please check that these lines are formatted correctly and contain valid records.”
  • image/url not found : upload the file -> ignore the column and upload the file.

We would like the solution to be implemented in the core of Decidim.

Additional context

  • Category and proposal

The category/id and the proposal/id are optional. However, if a wrong id is entered the file isn’t uploaded (this is how it works with the category in the proposal component). I think that this behavior is not logical since the fields are optional, why not just ignore them in case of error and leave the value null? 

  • Upload new file 

In case a new file is uploaded and there are already projects created in the budget, I think that the projects with the same names should be overwritten (in proposals for example a new proposal with the same name is created). What do you think the behavior should be? 

  • Error message

When we import and the file contains an error, an error message is displayed. I think that the message is not explicit and does not give any indication (except the line) about the place and the type of the problem. I think that we can at least display the name of the column that has the problem. 

  • Interface

When we were looking for the best location to implement the button “import”, we looked at what has already been done on the other components (proposals, accountability, meetings, etc).Then we noticed a disorder of the "export", "import" and "new" buttons. Indeed, if we compare two components buttons order, for example: 

  • proposals: "export all", "import" and then "new proposal". 
  • budget: "import", "export" and then "new project"

Changing the order of these buttons can mislead admins. It would be good to charter on a single order and apply it on all components. Maybe this has already been programmed in the Decidim Redesign?


Does this issue could impact on users private data?
No

Funded by
Funded by Département de Loire-Atlantique.

Comment

Confirm

Please log in

The password is too short.

Share