Skip to content

Commit 42f5f4a

Browse files
committed
Merge branch 'develop' into merge-v19-to-dev
2 parents 8058bd4 + 3346e7b commit 42f5f4a

File tree

8 files changed

+158
-49
lines changed

8 files changed

+158
-49
lines changed

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 1.9.1
4+
5+
### Breaking changes
6+
7+
- **Remove Unused Scopes**: Removed `RECORD_PRINT_RECORDS_SUPPORTING_DOCUMENTS` and `RECORD_EXPORT_RECORDS` scopes from `REGISTRATION_AGENT`, `LOCAL_REGISTRAR` and `NATIONAL_REGISTRAR`
8+
9+
### Improvements
10+
11+
- Make encryption step optional [#1123](https://github.com/opencrvs/opencrvs-countryconfig/pull/1123)
12+
313
## 1.9.0
414

515
### New features
@@ -24,15 +34,13 @@
2434
- Store system monitoring data for 1 month [#10515](https://github.com/opencrvs/opencrvs-core/issues/10515)
2535

2636
- Restricted filesystem usage for journal service and file rotation strategy [#10518](https://github.com/opencrvs/opencrvs-core/issues/10518))
27-
2837
- Tiltfile: Improved Kubernetes support for development environment [#10672](https://github.com/opencrvs/opencrvs-core/issues/10672)
2938

3039
### Bug fixes
3140

3241
- Allow non-interactive upgrades with apt [#10204](https://github.com/opencrvs/opencrvs-core/issues/10204)
3342
- Don't restart events service after data cleanup [#10704](https://github.com/opencrvs/opencrvs-core/issues/10704)
3443

35-
3644
## 1.8.1
3745

3846
### Bug fixes

infrastructure/environments/setup-environment.ts

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ const countryQuestions = [
386386
}
387387
]
388388

389-
const infrastructureQuestions = [
389+
const diskQuestions = [
390390
{
391391
name: 'diskSpace',
392392
type: 'text' as const,
@@ -397,8 +397,10 @@ const infrastructureQuestions = [
397397
validate: notEmpty,
398398
valueLabel: 'DISK_SPACE',
399399
initial: process.env.DISK_SPACE || '200g',
400-
scope: 'ENVIRONMENT' as const
400+
scope: 'ENVIRONMENT' as const,
401401
},
402+
]
403+
const infrastructureQuestions = [
402404
{
403405
name: 'domain',
404406
type: 'text' as const,
@@ -780,6 +782,7 @@ ALL_QUESTIONS.push(
780782
...dockerhubQuestions,
781783
...sshQuestions,
782784
...sshKeyQuestions,
785+
...diskQuestions,
783786
...infrastructureQuestions,
784787
...countryQuestions,
785788
...databaseAndMonitoringQuestions,
@@ -887,7 +890,7 @@ const SPECIAL_NON_APPLICATION_ENVIRONMENTS = ['jump', 'backup']
887890
...existingRepositoryVariable,
888891
...existingEnvironmentSecrets
889892
]
890-
893+
let enableEncryption = true
891894
if (
892895
existingEnvironmentVariables.length > 0 ||
893896
existingEnvironmentSecrets.length > 0
@@ -967,7 +970,32 @@ const SPECIAL_NON_APPLICATION_ENVIRONMENTS = ['jump', 'backup']
967970
)
968971
}
969972
} else {
970-
log('\n', kleur.bold().underline('Server setup'))
973+
log('\n', kleur.bold().underline('Server setup'), '\n')
974+
const encryption_key_defined = findExistingValue(
975+
'ENCRYPTION_KEY',
976+
'SECRET',
977+
'ENVIRONMENT',
978+
existingValues
979+
)
980+
981+
if (!encryption_key_defined) {
982+
const answers_enable_encryption = await prompts(
983+
[
984+
{
985+
name: 'enableEncryption',
986+
type: 'confirm' as const,
987+
message: 'Do you want to enable disk encryption?',
988+
scope: 'ENVIRONMENT' as const,
989+
initial: Boolean(process.env.ENABLE_ENCRYPTION)
990+
}
991+
].map(questionToPrompt)
992+
)
993+
enableEncryption = answers_enable_encryption.enableEncryption
994+
}
995+
if (enableEncryption) {
996+
console.log('\n', kleur.bold().green('✔'), kleur.bold().yellow(' Disk encryption is enabled'))
997+
await promptAndStoreAnswer(environment, diskQuestions, existingValues)
998+
}
971999
const { domain } = await promptAndStoreAnswer(
9721000
environment,
9731001
infrastructureQuestions,
@@ -1101,6 +1129,26 @@ const SPECIAL_NON_APPLICATION_ENVIRONMENTS = ['jump', 'backup']
11011129
}
11021130
]
11031131

1132+
if (enableEncryption){
1133+
derivedUpdates.push({
1134+
name: 'ENCRYPTION_KEY',
1135+
type: 'SECRET' as const,
1136+
didExist: findExistingValue(
1137+
'ENCRYPTION_KEY',
1138+
'SECRET',
1139+
'ENVIRONMENT',
1140+
existingValues
1141+
),
1142+
value: findExistingOrDefine(
1143+
'ENCRYPTION_KEY',
1144+
'SECRET',
1145+
'ENVIRONMENT',
1146+
generateLongPassword()
1147+
),
1148+
scope: 'ENVIRONMENT' as const
1149+
})
1150+
}
1151+
11041152
if (['production', 'staging'].includes(environment)) {
11051153
derivedUpdates.push({
11061154
name: 'BACKUP_ENCRYPTION_PASSPHRASE',
@@ -1275,23 +1323,6 @@ const SPECIAL_NON_APPLICATION_ENVIRONMENTS = ['jump', 'backup']
12751323
),
12761324
scope: 'ENVIRONMENT' as const
12771325
},
1278-
{
1279-
name: 'ENCRYPTION_KEY',
1280-
type: 'SECRET' as const,
1281-
didExist: findExistingValue(
1282-
'ENCRYPTION_KEY',
1283-
'SECRET',
1284-
'ENVIRONMENT',
1285-
existingValues
1286-
),
1287-
value: findExistingOrDefine(
1288-
'ENCRYPTION_KEY',
1289-
'SECRET',
1290-
'ENVIRONMENT',
1291-
generateLongPassword()
1292-
),
1293-
scope: 'ENVIRONMENT' as const
1294-
},
12951326
{
12961327
type: 'VARIABLE' as const,
12971328
name: 'ACTIVATE_USERS',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"@hapi/boom": "^9.1.1",
7070
"@hapi/hapi": "^20.0.1",
7171
"@hapi/inert": "^6.0.3",
72-
"@opencrvs/toolkit": "1.9.0",
72+
"@opencrvs/toolkit": "1.9.0-rc.891a767",
7373
"@types/chalk": "^2.2.0",
7474
"@types/csv2json": "^1.4.0",
7575
"@types/fhir": "^0.0.30",

src/data-seeding/roles/roles.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ export const roles: Role[] = [
154154
SCOPES.RECORD_DECLARATION_ARCHIVE,
155155
SCOPES.RECORD_DECLARATION_REINSTATE,
156156
SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION,
157-
SCOPES.RECORD_PRINT_RECORDS_SUPPORTING_DOCUMENTS,
158-
SCOPES.RECORD_EXPORT_RECORDS,
159157
SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES,
160158
SCOPES.PERFORMANCE_READ,
161159
SCOPES.PERFORMANCE_READ_DASHBOARDS,
@@ -198,8 +196,6 @@ export const roles: Role[] = [
198196
SCOPES.RECORD_DECLARATION_REINSTATE,
199197
SCOPES.RECORD_REGISTER,
200198
SCOPES.RECORD_REGISTRATION_CORRECT,
201-
SCOPES.RECORD_PRINT_RECORDS_SUPPORTING_DOCUMENTS,
202-
SCOPES.RECORD_EXPORT_RECORDS,
203199
SCOPES.RECORD_UNASSIGN_OTHERS,
204200
SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES,
205201
SCOPES.RECORD_CONFIRM_REGISTRATION,
@@ -300,8 +296,6 @@ export const roles: Role[] = [
300296
SCOPES.RECORD_DECLARATION_REINSTATE,
301297
SCOPES.RECORD_REGISTER,
302298
SCOPES.RECORD_REGISTRATION_CORRECT,
303-
SCOPES.RECORD_PRINT_RECORDS_SUPPORTING_DOCUMENTS,
304-
SCOPES.RECORD_EXPORT_RECORDS,
305299
SCOPES.RECORD_UNASSIGN_OTHERS,
306300
SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES,
307301
SCOPES.RECORD_CONFIRM_REGISTRATION,

src/form/tennis-club-membership.ts

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import {
2121
field,
2222
event,
2323
user,
24-
or
24+
or,
25+
defineConditional,
26+
never
2527
} from '@opencrvs/toolkit/events'
2628
import { Event } from './types/types'
2729
import { MAX_NAME_LENGTH } from './v2/birth/validators'
@@ -220,11 +222,81 @@ const TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
220222
id: 'event.tennis-club-membership.action.declare.form.section.recommender.field.none.label'
221223
}
222224
},
225+
{
226+
id: 'recommender.search',
227+
type: FieldType.SEARCH,
228+
label: {
229+
defaultMessage: 'Registration Number of recommender',
230+
description: 'This is the label for the field',
231+
id: 'event.tennis-club-membership.action.declare.form.section.recommender.field.search.label'
232+
},
233+
configuration: {
234+
query: {
235+
type: 'or',
236+
clauses: [
237+
{
238+
'legalStatuses.REGISTERED.registrationNumber': {
239+
term: '{term}',
240+
type: 'exact'
241+
}
242+
}
243+
]
244+
},
245+
limit: 10,
246+
offset: 0,
247+
validation: {
248+
validator: defineConditional({
249+
type: 'string',
250+
pattern: '^[A-Za-z0-9]{12}$',
251+
description: 'Must be alpha-numeric and 12 characters long'
252+
}),
253+
message: {
254+
defaultMessage:
255+
'Invalid value: Must be alpha-numeric and 12 characters long',
256+
description: 'Error message for invalid value',
257+
id: 'tennis-club-membership.searchField.validation.invalid'
258+
}
259+
},
260+
indicators: {
261+
ok: {
262+
defaultMessage: 'Recommender found',
263+
description: 'OK button text',
264+
id: 'tennis-club-membership.searchField.indicators.ok'
265+
},
266+
clearModal: {
267+
title: {
268+
defaultMessage: 'Clear recommender?',
269+
description: 'Title for the clear confirmation modal',
270+
id: 'tennis-club-membership.searchField.indicators.clearModal.title'
271+
},
272+
description: {
273+
defaultMessage:
274+
'This will remove the details of the current recommender.',
275+
description: 'Description for the clear confirmation modal',
276+
id: 'tennis-club-membership.searchField.indicators.clearModal.description'
277+
}
278+
}
279+
}
280+
},
281+
conditionals: [
282+
{
283+
type: ConditionalType.DISPLAY_ON_REVIEW,
284+
conditional: never()
285+
}
286+
]
287+
},
223288
{
224289
id: 'recommender.name',
225290
configuration: { maxLength: MAX_NAME_LENGTH },
226291
type: FieldType.NAME,
227292
required: true,
293+
parent: field('recommender.search'),
294+
value: field('recommender.search').getByPath([
295+
'data',
296+
'firstResult',
297+
'declaration',
298+
'applicant.name'
299+
]),
228300
conditionals: [
229301
{
230302
type: ConditionalType.SHOW,
@@ -242,6 +314,10 @@ const TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
242314
id: 'recommender.id',
243315
type: 'TEXT',
244316
required: true,
317+
parent: field('recommender.search'),
318+
value: field('recommender.search').get(
319+
'data.firstResult.legalStatuses.REGISTERED.registrationNumber'
320+
),
245321
conditionals: [
246322
{
247323
type: ConditionalType.SHOW,

0 commit comments

Comments
 (0)