diff --git a/e2e-tests/cypress/cypress/e2e/kaytonvalvonta/kaytonvalvonta.cy.js b/e2e-tests/cypress/cypress/e2e/kaytonvalvonta/kaytonvalvonta.cy.js index fa3924e68..b2e7dc861 100644 --- a/e2e-tests/cypress/cypress/e2e/kaytonvalvonta/kaytonvalvonta.cy.js +++ b/e2e-tests/cypress/cypress/e2e/kaytonvalvonta/kaytonvalvonta.cy.js @@ -728,8 +728,10 @@ context('Käytönvalvonta', () => { submitToimenpide(); now.setDate(desired); + // This works for december, setting month to January and incrementing year + now.setMonth(now.getMonth() + 1); cy.get('[data-cy="deadline"]').contains( - `${now.getDate()}.${now.getMonth() + 2}.${now.getFullYear()}` + `${now.getDate()}.${now.getMonth() + 1}.${now.getFullYear()}` ); }); }); diff --git a/etp-front/__snapshots__/checkbox--with-label-and-checked-disabled.png b/etp-front/__snapshots__/checkbox--with-label-and-checked-disabled.png index dc582e9b6..f8424a39f 100644 Binary files a/etp-front/__snapshots__/checkbox--with-label-and-checked-disabled.png and b/etp-front/__snapshots__/checkbox--with-label-and-checked-disabled.png differ diff --git a/etp-front/__snapshots__/checkbox--with-label-and-checked.png b/etp-front/__snapshots__/checkbox--with-label-and-checked.png index 9fa26ca0a..128b5bdb7 100644 Binary files a/etp-front/__snapshots__/checkbox--with-label-and-checked.png and b/etp-front/__snapshots__/checkbox--with-label-and-checked.png differ diff --git a/etp-front/__snapshots__/checkbox--with-label-disabled.png b/etp-front/__snapshots__/checkbox--with-label-disabled.png index dff4705c7..350ed8707 100644 Binary files a/etp-front/__snapshots__/checkbox--with-label-disabled.png and b/etp-front/__snapshots__/checkbox--with-label-disabled.png differ diff --git a/etp-front/__snapshots__/checkbox--with-label.png b/etp-front/__snapshots__/checkbox--with-label.png index 01a9c120b..fb423f72c 100644 Binary files a/etp-front/__snapshots__/checkbox--with-label.png and b/etp-front/__snapshots__/checkbox--with-label.png differ diff --git a/etp-front/__snapshots__/footer--with-text.png b/etp-front/__snapshots__/footer--with-text.png index 583f6e914..8f976dfde 100644 Binary files a/etp-front/__snapshots__/footer--with-text.png and b/etp-front/__snapshots__/footer--with-text.png differ diff --git a/etp-front/__snapshots__/h1--with-text.png b/etp-front/__snapshots__/h1--with-text.png index 8f92d9b38..4bf0f6d4f 100644 Binary files a/etp-front/__snapshots__/h1--with-text.png and b/etp-front/__snapshots__/h1--with-text.png differ diff --git a/etp-front/__snapshots__/input--with-caret.png b/etp-front/__snapshots__/input--with-caret.png index efc24ac3d..80448b0bb 100644 Binary files a/etp-front/__snapshots__/input--with-caret.png and b/etp-front/__snapshots__/input--with-caret.png differ diff --git a/etp-front/__snapshots__/input--with-failed-validation.png b/etp-front/__snapshots__/input--with-failed-validation.png index 91fadaf81..8fdbc3252 100644 Binary files a/etp-front/__snapshots__/input--with-failed-validation.png and b/etp-front/__snapshots__/input--with-failed-validation.png differ diff --git a/etp-front/__snapshots__/input--with-required.png b/etp-front/__snapshots__/input--with-required.png index 6c7a1e954..65790eb2f 100644 Binary files a/etp-front/__snapshots__/input--with-required.png and b/etp-front/__snapshots__/input--with-required.png differ diff --git a/etp-front/__snapshots__/input--with-text.png b/etp-front/__snapshots__/input--with-text.png index 91fadaf81..8fdbc3252 100644 Binary files a/etp-front/__snapshots__/input--with-text.png and b/etp-front/__snapshots__/input--with-text.png differ diff --git a/etp-front/__snapshots__/radio--with-label.png b/etp-front/__snapshots__/radio--with-label.png index 8c5ede36e..db10172e7 100644 Binary files a/etp-front/__snapshots__/radio--with-label.png and b/etp-front/__snapshots__/radio--with-label.png differ diff --git a/etp-front/__snapshots__/radio--with-selected.png b/etp-front/__snapshots__/radio--with-selected.png index ea252d804..d98e4e65b 100644 Binary files a/etp-front/__snapshots__/radio--with-selected.png and b/etp-front/__snapshots__/radio--with-selected.png differ diff --git a/etp-front/__snapshots__/toimintaalueetchecklist--with-toimintaalueet.png b/etp-front/__snapshots__/toimintaalueetchecklist--with-toimintaalueet.png index 4b5551634..29f2e9937 100644 Binary files a/etp-front/__snapshots__/toimintaalueetchecklist--with-toimintaalueet.png and b/etp-front/__snapshots__/toimintaalueetchecklist--with-toimintaalueet.png differ diff --git a/etp-front/src/pages/energiatodistus/signing/signature-api.js b/etp-front/src/pages/energiatodistus/signing/signature-api.js index 85564698f..5233a60e0 100644 --- a/etp-front/src/pages/energiatodistus/signing/signature-api.js +++ b/etp-front/src/pages/energiatodistus/signing/signature-api.js @@ -6,8 +6,8 @@ const mpolluxUrl = 'https://localhost:53952'; const mpolluxVersionUrl = `${mpolluxUrl}/version`; const mpolluxSignUrl = `${mpolluxUrl}/sign`; -const signatureOptions = { - version: '1.1', +const signatureOptions = version => ({ + version: version, selector: { keyusages: ['nonrepudiation'], keyalgorithms: ['rsa'] @@ -15,22 +15,28 @@ const signatureOptions = { contentType: 'data', hashAlgorithm: 'SHA256', signatureType: 'signature' -}; +}); +// Example of mPollux response can be found in etp-core/docker/mpollux/api/version export const versionInfo = fetch => Fetch.getJson(fetch, mpolluxVersionUrl); +const getSignatureOptions = fetch => + R.map(R.compose(signatureOptions, R.prop('version')), versionInfo(fetch)); + export const isValidSignatureResponse = R.compose( R.equals('ok'), R.prop('status') ); export const getSignature = R.curry((fetch, content) => - R.compose( - R.map(R.pick(['signature', 'chain'])), - Future.filter(isValidSignatureResponse, 'error'), - Fetch.responseAsJson, - Future.encaseP(Fetch.fetchWithMethod(fetch, 'post', mpolluxSignUrl)), - R.assoc('content', R.__, signatureOptions), - R.prop('digest') - )(content) + R.chain( + R.compose( + R.map(R.pick(['signature', 'chain'])), + Future.filter(isValidSignatureResponse, 'error'), + Fetch.responseAsJson, + Future.encaseP(Fetch.fetchWithMethod(fetch, 'post', mpolluxSignUrl)), + R.assoc('content', R.prop('digest', content)) + ), + getSignatureOptions(fetch) + ) );