Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #496 from lognaturel/prep-5.0.0
Browse files Browse the repository at this point in the history
Prepare 5.0.0 release
  • Loading branch information
eyelidlessness authored Dec 7, 2022
2 parents c7d92bb + a191c32 commit ad78c86
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 54 deletions.
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## 4.1.5 - 2022-11-28
## 5.0.0 - 2022-12-06

**BREAKING CHANGE**: widgets for integers and decimal inputs have been made into Enketo Core widgets. If you [specify widgets in your `config.json`](https://enketo.github.io/enketo-express/tutorial-10-configure.html#widgets), you **MUST** add `integer` and `decimal`.

- Dockerfile: use npm ci (#471)
- Improve error messages for revoked forms/public access links (#487)
- Fix: validate number input values (enketo/enketo-core#926)
- Fix: allow arbitrary precision decimal values (enketo/enketo-core#932)
- Add number widgets by default (#493)

## 4.1.5 - 2022-11-28 DO NOT USE: breaks numeric input

- Fix: use simpler selector for geopicker widgets (enketo/enketo-core#922)
- fix toggle or-appearance-compact with dynamic nested repeat group (enketo/enketo-core#914)
- Fix: validate number input values (enketo/enketo-core#926)

## 4.1.4 - 2022-11-28

Expand Down
30 changes: 29 additions & 1 deletion docs/app_controllers_transformation-controller.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ <h1 class="page-title">app/controllers/transformation-controller.js</h1>

const transformer = require('enketo-transformer');
const communicator = require('../lib/communicator');
const { TranslatedError } = require('../lib/custom-error');
const surveyModel = require('../models/survey-model');
const cacheModel = require('../models/cache-model');
const account = require('../models/account-model');
Expand Down Expand Up @@ -96,18 +97,30 @@ <h1 class="page-title">app/controllers/transformation-controller.js</h1>
* @param {Function} next - Express callback
*/
async function getSurveyParts(req, res, next) {
/** @type {string | null} */
let formId = null;

/** @type {string | null} */
let formFileName = null;

try {
let survey = await _getSurveyParams(req);

// A request with "xformUrl" body parameter was used (unlaunched form)
if (survey.info != null) {
formFileName = survey.info.downloadUrl.replace(
/.*\/([^/]+)$/,
'$1'
);
survey = await _getFormDirectly(survey);

_respond(res, survey);

return;
}

formId = survey.openRosaId;

const authenticated = await _authenticate(survey);
const cached = await _getFormFromCache(authenticated);

Expand All @@ -127,7 +140,22 @@ <h1 class="page-title">app/controllers/transformation-controller.js</h1>
media,
});
} catch (error) {
next(error);
if (error.status === 403) {
const notFoundError =
formId == null
? new TranslatedError('error.notfounddirectformurl', {
formFileName,
})
: new TranslatedError('error.notfoundinformlist', {
formId,
});

notFoundError.status = 404;

next(notFoundError);
} else {
next(error);
}
}
}

Expand Down
24 changes: 12 additions & 12 deletions docs/module-transformation-controller.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ <h4 class="name" id="~_addMediaHash"><span class="type-signature">(inner) </span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line189">line 189</a>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line217">line 217</a>
</li></ul></dd>


Expand Down Expand Up @@ -252,7 +252,7 @@ <h4 class="name" id="~_authenticate"><span class="type-signature">(inner) </span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line123">line 123</a>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line151">line 151</a>
</li></ul></dd>


Expand Down Expand Up @@ -406,7 +406,7 @@ <h4 class="name" id="~_checkQuota"><span class="type-signature">(inner) </span>_

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line200">line 200</a>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line228">line 228</a>
</li></ul></dd>


Expand Down Expand Up @@ -560,7 +560,7 @@ <h4 class="name" id="~_getCombinedHash"><span class="type-signature">(inner) </s

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line246">line 246</a>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line274">line 274</a>
</li></ul></dd>


Expand Down Expand Up @@ -716,7 +716,7 @@ <h4 class="name" id="~_getFormDirectly"><span class="type-signature">(inner) </s

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line114">line 114</a>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line142">line 142</a>
</li></ul></dd>


Expand Down Expand Up @@ -870,7 +870,7 @@ <h4 class="name" id="~_getFormFromCache"><span class="type-signature">(inner) </

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line132">line 132</a>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line160">line 160</a>
</li></ul></dd>


Expand Down Expand Up @@ -1024,7 +1024,7 @@ <h4 class="name" id="~_getSurveyParams"><span class="type-signature">(inner) </s

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line282">line 282</a>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line310">line 310</a>
</li></ul></dd>


Expand Down Expand Up @@ -1178,7 +1178,7 @@ <h4 class="name" id="~_respond"><span class="type-signature">(inner) </span>_res

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line222">line 222</a>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line250">line 250</a>
</li></ul></dd>


Expand Down Expand Up @@ -1333,7 +1333,7 @@ <h4 class="name" id="~_setCookieAndCredentials"><span class="type-signature">(in

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line269">line 269</a>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line297">line 297</a>
</li></ul></dd>


Expand Down Expand Up @@ -1510,7 +1510,7 @@ <h4 class="name" id="~_updateCache"><span class="type-signature">(inner) </span>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line143">line 143</a>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line171">line 171</a>
</li></ul></dd>


Expand Down Expand Up @@ -1668,7 +1668,7 @@ <h4 class="name" id="~getSurveyHash"><span class="type-signature">(inner) </span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line92">line 92</a>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line120">line 120</a>
</li></ul></dd>


Expand Down Expand Up @@ -1850,7 +1850,7 @@ <h4 class="name" id="~getSurveyParts"><span class="type-signature">(async, inner

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line49">line 49</a>
<a href="app_controllers_transformation-controller.js.html">app/controllers/transformation-controller.js</a>, <a href="app_controllers_transformation-controller.js.html#line50">line 50</a>
</li></ul></dd>


Expand Down
62 changes: 24 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "enketo-express",
"description": "Webforms evolved.",
"homepage": "https://enketo.org",
"version": "4.1.5",
"version": "5.0.0",
"main": "./app.js",
"engines": {
"node": ">=14.8.0 <17",
Expand Down

0 comments on commit ad78c86

Please sign in to comment.