Middleware for oragnisation (LPA) overview page
module:middleware-lpa-overview
Organisation (LPA) overview page middleware chain.
Members
(static, constant) addNoticesToDatasets
This middleware function adds notices to datasets based on the notice flags.
It modifies the req.datasets and req.notices properties.
(static, constant) datasetSubmissionDeadlineCheck
This middleware function checks if a dataset has been submitted within a certain timeframe and sets flags for due and overdue notices accordingly.
Does not work and not used currently, TODO: fix or delete
(static, constant) prepareAuthorityBatch
Batch version of prepareAuthority for LPA overview dashboard Checks authority status for all datasets in parallel
(inner, constant) fetchEntityIssueCountsPerformanceDb
Middleware. Updates req with 'entityIssueCounts' same as fetchEntityIssueCounts so not to be used together!
Functionally equivalent (for the utilization of the LPA Dashboard) to fetchEntityIssueCounts but using performanceDb
Methods
(static) prepareDatasetObjects(req, res, next)
Updates req.datasets objects with endpoint status and error information.
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
req |
Object |
Properties
|
|||||||||||||||||||||||||||||||||
res |
* | ||||||||||||||||||||||||||||||||||
next |
* |
(static) prepareOverviewTemplateParams(req, res, next) → {void}
Prepares overview template parameters.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
req |
Object | Express request object Properties
|
||||||||||||||||||||||||||||||||||||
res |
Object | Express response object |
||||||||||||||||||||||||||||||||||||
next |
function | Express next function |
Returns:
- Type
- void
(inner) orgStatsReducer(accumulator, dataset) → {Array.<number>}
Calculates overall "health" of the datasets (not)provided by an organisation.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
accumulator |
Array.<number> | Array containing counts [withEndpoints, needsFixing, hasErrors] |
||||||||||||||||||||||||
dataset |
Object | Dataset information Properties
|
Returns:
Updated accumulator
- Type
- Array.<number>