Export initiatives
There are two ways to export initiative.
From Django admin
See Django Admin features for admin exports.
From application
ListExport component
The ListExport is a renderless component that after parsing the selected initiatives (projects), passes back the parsed data to the parent component via the default scope slot.
The export is handled by the JS to XLXS components group that is part of the vue-xlsx package.
The export workflow
user selects a project
the
ListExportcomponent runs the parsing immediatelly which triggersxlsx-workbookandxlsx-sheetto be “rendered”, ready to be downloadeddownload link pressed, the
xlsx-downloadinitiates the download
Parsing projects
The raw project list from the backend doesn’t contain all the data that is displayed throughout the application, it needs to be prepared or converted on the frontend for the actual purpose. We call this preparation parsing.
In order to parse the projects, a field map (colKeyValues) needed to be defined with properties and a parse function. There are some general fields, but there are some special ones, like health_focus_areas.
{
id: '10',
label: 'Health Focus Areas',
key: 'health_focus_areas',
parse: (health_focus_areas) =>
this.parseHealthFocusAreas(health_focus_areas),
}
Inventory
The inventory list export used the simple parsed scoped slot, but further features have been added to the ListExport components, so now it’s obsolete, the parsedScores scoped slot is used throughout the application.
Portfolio
In the portfolio manager the initiatives can be in three different state:
Inventory
As the name implies, it’s the same as the Inventory list.For review
This list displays the review scores (Scoring) and Questionnaires Assigned if there is any. These are complex data structures, that needs special handling when parsing the project list. The vertical data is parsed into horizontal data.Portfolio
From export point of view, it is the same as theFor reviewlist, it contains