Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update fields to match toolkit changes #401

Merged
merged 8 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@hapi/boom": "^9.1.1",
"@hapi/hapi": "^20.0.1",
"@hapi/inert": "^6.0.3",
"@opencrvs/toolkit": "0.0.34-rr",
"@opencrvs/toolkit": "0.0.37-ml",
"@types/chalk": "^2.2.0",
"@types/csv2json": "^1.4.0",
"@types/fhir": "^0.0.30",
Expand Down Expand Up @@ -105,7 +105,7 @@
"ts-node": "^10.9.1",
"tsconfig-paths": "^3.8.0",
"typescript": "^5.1.6",
"zod": "^3.17.3"
"zod": "^3.24.1"
},
"lint-staged": {
"src/**/*.{ts,graphql}": [
Expand Down
14 changes: 7 additions & 7 deletions src/form/tennis-club-membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -791,14 +791,13 @@ export const tennisClubMembershipEvent = defineConfig({
{
id: 'correction.requester.relationship',
type: 'RADIO_GROUP',
options: {},
label: {
id: 'v2.correction.corrector.title',
defaultMessage: 'Who is requesting a change to this record?',
description: 'The title for the corrector form'
},
initialValue: '',
optionValues: [
options: [
{
value: 'INFORMANT',
label: {
Expand Down Expand Up @@ -860,15 +859,14 @@ export const tennisClubMembershipEvent = defineConfig({
{
id: 'correction.identity-check.verified',
type: 'RADIO_GROUP',
options: {},
label: {
id: 'v2.correction.corrector.identity.verified.label',
defaultMessage: 'Identity verified',
description: 'The title for the corrector form'
},
initialValue: '',
required: true,
optionValues: [
options: [
{
value: 'VERIFIED',
label: {
Expand Down Expand Up @@ -920,10 +918,12 @@ export const tennisClubMembershipEvent = defineConfig({
description: 'The title for the corrector form'
},
initialValue: '',
options: {
size: 'NORMAL'
configuration: {
styles: {
size: 'NORMAL'
}
},
optionValues: [
options: [
{
value: 'ATTEST',
label: {
Expand Down
2,366 changes: 2,057 additions & 309 deletions src/form/v2/birth/__snapshots__/birth.test.ts.snap

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/form/v2/birth/forms/child.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export const childPage = defineFormPage({
description: 'This is the label for the field',
id: 'v2.event.birth.action.declare.form.section.child.field.weightAtBirth.label'
},
options: {
configuration: {
type: 'number',
postfix: {
defaultMessage: 'Kilograms (kg)',
Expand Down
2 changes: 1 addition & 1 deletion src/form/v2/birth/forms/declare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export const BIRTH_DECLARE_FORM = defineForm({
description: 'This is the label for the field',
id: `event.birth.action.declare.form.section.documents.field.helper.label`
},
options: { fontVariant: 'reg16' }
configuration: { styles: { fontVariant: 'reg16' } }
},
{
id: 'documents.proofOfBirth',
Expand Down
2 changes: 1 addition & 1 deletion src/form/v2/birth/forms/informant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export const informantPage = defineFormPage({
description: 'This is the label for the field',
id: 'v2.event.birth.action.declare.form.section.informant.field.email.label'
},
options: {
configuration: {
type: 'email'
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/form/v2/birth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ export const birthEvent = defineConfig({
}
],
actions: [
{
type: 'CREATE',
label: {
defaultMessage: 'Create',
description:
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.birth.action.create.label'
},
forms: []
},
{
type: 'DECLARE',
label: {
Expand Down
5 changes: 2 additions & 3 deletions src/form/v2/person/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,9 @@ export const getAddressFields = (person: AddressType): FieldConfig[] => {
},
{
id: `${prefix}.urbanOrRural`,
// @TODO: Change to SELECT
type: 'RADIO_GROUP',
optionValues: urbanRuralRadioOptions,
options: {},
flexDirection: 'row',
options: urbanRuralRadioOptions,
required: false,
label: {
defaultMessage: 'Urban or Rural',
Expand Down
7 changes: 3 additions & 4 deletions src/form/v2/person/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export const getPersonInputCommonFields = (
description: 'This is the label for the field',
id: `v2.event.birth.action.declare.form.section.person.field.age.text.label`
},
options: {
configuration: {
postfix: {
defaultMessage: 'years',
description: 'This is the postfix for age field',
Expand Down Expand Up @@ -341,7 +341,7 @@ export const getPersonInputCommonFields = (
description: 'This is the label for the field',
id: `v2.event.birth.action.declare.form.section.person.field.addressHelper.label`
},
options: { fontVariant: 'h3' }
configuration: { styles: { fontVariant: 'h3' } }
}
]

Expand All @@ -351,8 +351,7 @@ const fatherAddressFields = [
{
id: `${PersonType.father}.addressSameAs`,
type: 'RADIO_GROUP',
optionValues: yesNoRadioOptions,
options: {},
options: yesNoRadioOptions,
required: true,
label: {
defaultMessage: "Same as mother's usual place of residence?",
Expand Down
36 changes: 26 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -834,10 +834,10 @@
dependencies:
"@octokit/openapi-types" "^18.0.0"

"@opencrvs/[email protected].34-rr":
version "0.0.34-rr"
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-0.0.34-rr.tgz#4d111eb21e7460034bd813b9c01f177937f16893"
integrity sha512-7m8C8Q9RyJBnVCr3UW3ACzb2GsTFtc6cy/Z0u4EaoKwr5VJ3JN5s/KoSwtw6BUdjJdKwfVl4Bvb1+fCTf1/LuQ==
"@opencrvs/[email protected].37-ml":
version "0.0.37-ml"
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-0.0.37-ml.tgz#b127bf47ca4300f4ceb89c7b80bf0bc72603b6e8"
integrity sha512-TUI3feu2pu7dQx8r6PotmM4sNSddAkHlJnOHX7vJmL6pTIoaiBSpdCyLYAgl4dn03OaAjBDzIBesaXJKvw/3FA==
dependencies:
"@trpc/client" "^11.0.0-rc.648"
"@trpc/server" "^11.0.0-rc.532"
Expand Down Expand Up @@ -5055,7 +5055,7 @@ string-argv@^0.0.2:
resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736"
integrity sha512-p6/Mqq0utTQWUeGMi/m0uBtlLZEwXSY3+mXzeRRqw7fz5ezUb28Wr0R99NlfbWaMmL/jCyT9be4jpn7Yz8IO8w==

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand All @@ -5081,6 +5081,15 @@ string-width@^2.1.1:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0"

string-width@^4.1.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^5.0.1, string-width@^5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
Expand All @@ -5106,7 +5115,7 @@ stringify-object@^3.2.2:
is-obj "^1.0.1"
is-regexp "^1.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand All @@ -5127,6 +5136,13 @@ strip-ansi@^4.0.0:
dependencies:
ansi-regex "^3.0.0"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^7.0.1:
version "7.1.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
Expand Down Expand Up @@ -5685,7 +5701,7 @@ yocto-queue@^0.1.0:
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==

zod@^3.17.3:
version "3.22.4"
resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff"
integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==
zod@^3.24.1:
version "3.24.1"
resolved "https://registry.yarnpkg.com/zod/-/zod-3.24.1.tgz#27445c912738c8ad1e9de1bea0359fa44d9d35ee"
integrity sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==
Loading