Module: middleware-lpa-overview

Middleware for oragnisation (LPA) overview page

Source:

module:middleware-lpa-overview

Organisation (LPA) overview page middleware chain.

Source:

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.

Source:

(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.

Source:

(inner, constant) fetchDatasetErrorStatus

Middleware. Updates req with 'datasetErrorStatus'.

Fetches datasets which have active endpoints in error state.

Source:

Methods

(static) prepareDatasetObjects(req, res, next)

Updates req.datasets objects with endpoint status and error information.

Parameters:
Name Type Description
req Object
Properties
Name Type Attributes Description
issues Object
endpoints Object
expectationOutOfBounds Array.<Object> <optional>
Properties
Name Type Description
dataset string
passed boolean

did the exepectation pass

availableDatasets Array.<string>
datasets Array.<Object> <optional>

OUT param

res *
next *
Source:

(static) prepareOverviewTemplateParams(req, res, next) → {void}

Prepares overview template parameters.

Parameters:
Name Type Description
req Object

Express request object

Properties
Name Type Attributes Description
orgInfo Object

Organization information

availableDatasets Array.<string>

list of available datasets

provisions Array.<Object> <optional>

Array of provision objects

Properties
Name Type Description
dataset string

Dataset name

provision_reason string

Reason for provision

project string

Project name

datasets Array.<Object>

Array of dataset objects

templateParams Object <optional>

OUT parameter

res Object

Express response object

next function

Express next function

Source:
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
Name Type Attributes Description
endpoint string <optional>

Optional endpoint URL

status string

Dataset status

endpointCount number

Number of endpoints

endpointErrorCount number

Number of endpoints with error

issueCount number

Number of issues

Source:
Returns:

Updated accumulator

Type
Array.<number>