{"_id":"hof-confirm-controller","_rev":"57-e8f933f525761d9459d986d092efc88b","name":"hof-confirm-controller","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"hof-confirm-controller","version":"1.0.0","author":"","license":"MIT","_id":"hof-confirm-controller@1.0.0","maintainers":[{"name":"lennym","email":"leonard.martin@gmail.com"}],"homepage":"https://github.com/UKHomeOfficeForms/hof-confirm-controller#readme","bugs":{"url":"https://github.com/UKHomeOfficeForms/hof-confirm-controller/issues"},"dist":{"shasum":"d3fb41fb5c237bad61fb2b7ed49e868ca7d716c9","tarball":"https://registry.npmjs.org/hof-confirm-controller/-/hof-confirm-controller-1.0.0.tgz","integrity":"sha512-9+d7EWkEZF4FlTKA0pjzsePAMuEfu5TFqXtsBQbm7lmnXajwBb/5GyiJIEChCTclxB80fKkN/51YYl1Yrh9iGQ==","signatures":[{"sig":"MEYCIQCWrmO5z/a6rvTi1jTGyivdePrW61wig1poikQ9kKNR9AIhAKYLlloWvs5URteUa7qXkaemyK5Q02S4+qz/5+VHizZO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"d3fb41fb5c237bad61fb2b7ed49e868ca7d716c9","gitHead":"6403706cb12385c043fb2bb7a0d7e3ce07a5f98a","scripts":{"test":"npm run test:lint && npm run test:unit","test:lint":"eslint .","test:unit":"istanbul cover _mocha"},"_npmUser":{"name":"lennym","email":"leonard.martin@gmail.com"},"repository":{"url":"git+https://github.com/UKHomeOfficeForms/hof-confirm-controller.git","type":"git"},"_npmVersion":"4.1.2","description":"HOF Controller for showing summary pages","directories":{},"_nodeVersion":"6.9.4","dependencies":{"hof-controllers":"^6.0.2"},"devDependencies":{"chai":"^3.5.0","mocha":"^3.2.0","sinon":"^1.17.7","eslint":"^3.14.1","reqres":"^1.2.2","istanbul":"^0.4.5","hof-model":"^2.0.0","sinon-chai":"^2.8.0","eslint-config-homeoffice":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/hof-confirm-controller-1.0.0.tgz_1486636333375_0.15726406476460397","host":"packages-12-west.internal.npmjs.com"}},"1.0.1":{"name":"hof-confirm-controller","version":"1.0.1","author":"","license":"MIT","_id":"hof-confirm-controller@1.0.1","maintainers":[{"name":"lennym","email":"leonard.martin@gmail.com"}],"homepage":"https://github.com/UKHomeOfficeForms/hof-confirm-controller#readme","bugs":{"url":"https://github.com/UKHomeOfficeForms/hof-confirm-controller/issues"},"dist":{"shasum":"0f7dc80412cf88c9bb10c37471a5b7565ba51e05","tarball":"https://registry.npmjs.org/hof-confirm-controller/-/hof-confirm-controller-1.0.1.tgz","integrity":"sha512-d/KG0fxe0y8Sjc4zwTp7d+4xSPg1E3tV4KCFG0Lu85xKIDa6Q4czupBBIW6XKV9IcjEKgERr02RMkUlZKLO9Jg==","signatures":[{"sig":"MEUCIFUWib5UZkThApHd+BMddqEWRm1sjzuWZ0OF0ry3uRd6AiEApAgfSTNqjtr3zoiwlKpRey9munAvZtbbEJQFPuhEAs0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"0f7dc80412cf88c9bb10c37471a5b7565ba51e05","gitHead":"cc3a9f6a66b83b71aca6e8b3a61d490f84e29105","scripts":{"test":"npm run test:lint && npm run test:unit","test:lint":"eslint .","test:unit":"istanbul cover _mocha"},"_npmUser":{"name":"lennym","email":"leonard.martin@gmail.com"},"repository":{"url":"git+https://github.com/UKHomeOfficeForms/hof-confirm-controller.git","type":"git"},"_npmVersion":"4.1.2","description":"HOF Controller for showing summary pages","directories":{},"_nodeVersion":"6.9.4","dependencies":{"hof-controllers":"^6.0.2"},"devDependencies":{"chai":"^3.5.0","mocha":"^3.2.0","sinon":"^1.17.7","eslint":"^3.14.1","reqres":"^1.2.2","istanbul":"^0.4.5","hof-model":"^2.0.0","sinon-chai":"^2.8.0","eslint-config-homeoffice":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/hof-confirm-controller-1.0.1.tgz_1486636442431_0.6660133127588779","host":"packages-12-west.internal.npmjs.com"}},"1.0.2":{"name":"hof-confirm-controller","version":"1.0.2","author":"","license":"MIT","_id":"hof-confirm-controller@1.0.2","maintainers":[{"name":"lennym","email":"leonard.martin@gmail.com"}],"homepage":"https://github.com/UKHomeOfficeForms/hof-confirm-controller#readme","bugs":{"url":"https://github.com/UKHomeOfficeForms/hof-confirm-controller/issues"},"dist":{"shasum":"d3753fe4bd560a1c7378cebba012aab66f36fdd9","tarball":"https://registry.npmjs.org/hof-confirm-controller/-/hof-confirm-controller-1.0.2.tgz","integrity":"sha512-1cRLXnuIN3PHAzZ+/QnQ1+UQAdi0fcWTUYlOtuc50PLo0PLoWGhQX7C5NbDe94SLdDb5wTj0IHDbjoWedoNmaA==","signatures":[{"sig":"MEYCIQCfZKhWeKHGAu0vHaYyzl9gftw+G5FqGIjsjUd7dZ5AlAIhALRoiwcTPAwnDNrkcUIobewnDHzzIKhW49j46TOGvdt/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"d3753fe4bd560a1c7378cebba012aab66f36fdd9","gitHead":"646aefab32c6ed95b54c200973e684282ab08005","scripts":{"test":"npm run test:lint && npm run test:unit","test:lint":"eslint .","test:unit":"istanbul cover _mocha"},"_npmUser":{"name":"lennym","email":"leonard.martin@gmail.com"},"repository":{"url":"git+https://github.com/UKHomeOfficeForms/hof-confirm-controller.git","type":"git"},"_npmVersion":"4.1.2","description":"HOF Controller for showing summary pages","directories":{},"_nodeVersion":"6.9.4","dependencies":{"lodash":"^4.17.4","hof-controllers":"^6.0.2"},"devDependencies":{"chai":"^3.5.0","mocha":"^3.2.0","sinon":"^1.17.7","eslint":"^3.14.1","reqres":"^1.2.2","istanbul":"^0.4.5","hof-model":"^2.0.0","sinon-chai":"^2.8.0","eslint-config-homeoffice":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/hof-confirm-controller-1.0.2.tgz_1486740936325_0.28982457984238863","host":"packages-18-east.internal.npmjs.com"}}},"time":{"created":"2017-02-09T10:32:15.254Z","modified":"2026-09-21T15:12:50.807Z","1.0.0":"2017-02-09T10:32:15.254Z","1.0.1":"2017-02-09T10:34:04.285Z","1.0.2":"2017-02-10T15:35:36.744Z"},"bugs":{"url":"https://github.com/UKHomeOfficeForms/hof-confirm-controller/issues"},"license":"MIT","homepage":"https://github.com/UKHomeOfficeForms/hof-confirm-controller#readme","repository":{"url":"git+https://github.com/UKHomeOfficeForms/hof-confirm-controller.git","type":"git"},"description":"HOF Controller for showing summary pages","maintainers":[{"email":"aaron.russell@digital.homeoffice.gov.uk","name":"aaronrussellho"},{"email":"sas-hof-test@digital.homeoffice.gov.uk","name":"hof-bot-user"},{"email":"dk4g.blob@gmail.com","name":"dk4g"},{"email":"gregory.wolverson@digital.homeoffice.gov.uk","name":"greg_wolverson_ho"},{"email":"vinodha.samiyappan@digital.homeoffice.gov.uk","name":"vinodha.s"},{"email":"megan.john@digital.homeoffice.gov.uk","name":"meganjohn"},{"email":"nese.zorba@digital.homeoffice.gov.uk","name":"nzorba"},{"email":"rayhannur.rohman@digital.homeoffice.gov.uk","name":"rayhannurrohmanho"},{"email":"vivek.kumar1@digital.homeoffice.gov.uk","name":"vivekkumar-ho"},{"email":"leonard.martin@gmail.com","name":"lennym"}],"readme":"# hof-confirm-controller\n\nHOF Controller for showing summary pages\n\nThe controller will create a set of \"locals\" data which is compatible with [the `confirm` view from `hof-template-partials`](https://github.com/UKHomeOfficeForms/hof-template-partials/blob/master/views/confirm.html).\n\n## Usage\n\nIf no sections config is passed, then the controller will create a section for each step that has fields, and a row within each section for each field on that step.\n\n```js\n'/confirm': {\n  controller: require('hof-confirm-controller'),\n  ...\n}\n```\n\n\nAlternatively, sections can be defined manually as follows:\n\n```js\n'/confirm': {\n  controller: require('hof-confirm-controller'),\n  sections: {\n    'museum-details': [\n      'name',\n      {\n        field: 'exhibit-addresses',\n        parse: (value) => value.map(a => a.address),\n        step: '/exhibit-add-another-address'\n      }\n    ],\n    'contact': [\n      'contact-name',\n      'contact-email',\n      'contact-phone',\n      {\n        field: 'contact-address',\n        step: '/contact-address'\n      }\n    ]\n  },\n  ...\n}\n```\n\n## Configuration\n\nThe `sections` configuration should be a map of arrays, where the entries in the array are the fields that should be shown within that section.\n\n### Field configuration\n\nFields can be defined as simple strings of the field key, in which case all default configuration will be used.\n\nAlternatively, a field can be passed as an object with a `field` property defining the field key, and any additional properties as follows:\n\n* `step` - `String` defines the step which the user is returned to to edit the field value. By default this is the first step in the form's steps configuration which contains the field.\n* `parse` - `Function` can parse the value for the field from the session into a value for display.\n\n## Translations\n\nThe content for section headings and field labels will be loaded from translation files based on the keys.\n\n### Section headings\n\nTranslations for section headings are looked for in the following order:\n\n* `pages.confirm.sections.${key}.header`\n* `pages.${key}.header`\n\n### Field labels\n\nTranslations for field labels are looked for in the following order:\n\n* `pages.confirm.fields.${key}.label`\n* `fields.${key}.label`\n* `fields.${key}.legend`\n","readmeFilename":"README.md"}