Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@hapi/boom": "^9.1.1",
"@hapi/hapi": "^20.0.1",
"@hapi/inert": "^6.0.3",
"@opencrvs/toolkit": "1.8.1-rc.c8c6227",
"@opencrvs/toolkit": "1.8.1-rc.85aa435",
"@types/chalk": "^2.2.0",
"@types/csv2json": "^1.4.0",
"@types/fhir": "^0.0.30",
Expand Down
71 changes: 70 additions & 1 deletion src/form/tennis-club-membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import {
field,
event,
user,
or
or,
defineConditional,
never
} from '@opencrvs/toolkit/events'
import { Event } from './types/types'
import { MAX_NAME_LENGTH } from './v2/birth/validators'
Expand Down Expand Up @@ -220,11 +222,71 @@ const TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
id: 'event.tennis-club-membership.action.declare.form.section.recommender.field.none.label'
}
},
{
id: 'recommender.search',
type: FieldType.SEARCH,
label: {
defaultMessage: 'Registration Number of recommender',
description: 'This is the label for the field',
id: 'event.tennis-club-membership.action.declare.form.section.recommender.field.search.label'
},
configuration: {
query: {
type: 'or',
clauses: [
{
'legalStatuses.REGISTERED.registrationNumber': {
term: '{term}',
type: 'exact'
}
}
]
},
limit: 10,
offset: 0,
validation: {
validator: defineConditional({
type: 'string',
pattern: '^[A-Za-z0-9]{12}$',
description: 'Must be alpha-numeric and 12 characters long'
}),
message: {
defaultMessage:
'Invalid value: Must be alpha-numeric and 12 characters long',
description: 'Error message for invalid value',
id: 'tennis-club-membership.searchField.validation.invalid'
}
},
indicators: {
ok: {
defaultMessage: 'Valid',
description: 'OK button text',
id: 'tennis-club-membership.searchField.indicators.ok'
}
}
},
conditionals: [
{
type: ConditionalType.DISPLAY_ON_REVIEW,
conditional: never()
}
]
},
{
id: 'recommender.name',
configuration: { maxLength: MAX_NAME_LENGTH },
type: FieldType.NAME,
required: true,
parent: field('recommender.search'),
value: [
field('recommender.search').getByPath([
'data',
'results',
'declaration',
'applicant.name'
]),
field('recommender.name')
],
conditionals: [
{
type: ConditionalType.SHOW,
Expand All @@ -242,6 +304,13 @@ const TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
id: 'recommender.id',
type: 'TEXT',
required: true,
parent: field('recommender.search'),
value: [
field('recommender.search').get(
'data.results.legalStatuses.REGISTERED.registrationNumber'
),
field('recommender.id')
],
conditionals: [
{
type: ConditionalType.SHOW,
Expand Down
11 changes: 6 additions & 5 deletions src/translations/client.csv
Original file line number Diff line number Diff line change
Expand Up @@ -875,8 +875,6 @@ event.death.action.certificate.form.cancel.confirmation.title,This is the title
event.death.action.certificate.form.label,This is what this form is referred as in the system,Death certificate collector,Collecteur de certificat de décès
event.death.action.certificate.form.section.collectPayment.data.label,Title for the data section,Payment details,Détails du paiement
event.death.action.certificate.form.section.collectPayment.fee.label,Title for the data entry,Fee,Frais
event.death.action.certificate.form.section.collectPayment.fee.label,Title for the data entry,Fee,Frais
event.death.action.certificate.form.section.collectPayment.service.label,Title for the data entry,Service,Service
event.death.action.certificate.form.section.collectPayment.service.label,Title for the data entry,Service,Service
event.death.action.certificate.form.section.collectPayment.service.label.afterRegistrationTarget,Death registration after 45 days of date of death message,Death registration after 45 days of date of death,Enregistrement du décès après 45 jours de la date du décès
event.death.action.certificate.form.section.collectPayment.service.label.beforeRegistrationTarget,Death registration before 45 days of date of death message,Death registration before 45 days of date of death,Enregistrement du décès avant 45 jours de la date du décès
Expand Down Expand Up @@ -934,8 +932,6 @@ event.death.action.correction.reason.option.other.label,Label for the other opti
event.death.action.correction.reason.other.label,Label for the reason,Specify reason,Préciser la raison
event.death.action.declare.form.label,This is what this form is referred as in the system,Death declaration form,Formulaire de déclaration de décès
event.death.action.declare.form.nid.unique,This is the error message for non-unique ID Number,National id must be unique,L'identifiant national doit être unique
event.death.action.declare.form.nid.unique,This is the error message for non-unique ID Number,National id must be unique,L'identifiant national doit être unique
event.death.action.declare.form.nid.unique,This is the error message for non-unique ID Number,National id must be unique,L'identifiant national doit être unique
event.death.action.declare.form.review.comment.label,Label for the comment field in the review section,Comment,Commentaire
event.death.action.declare.form.review.signature.label,Label for the signature field in the review section,Signature of informant,Signature de l'informateur
event.death.action.declare.form.review.title,Title of the form to show in review page,"{deceased.name.firstname, select, __EMPTY__ {Death declaration} other {{deceased.name.surname, select, __EMPTY__ {Death declaration for {deceased.name.firstname}} other {Death declaration for {deceased.name.firstname} {deceased.name.surname}}}}}","{deceased.name.firstname, select, __EMPTY__ {Déclaration de décès} other {{deceased.name.surname, select, __EMPTY__ {Déclaration de décès de {deceased.name.firstname}} other {Déclaration de décès de {deceased.name.firstname} {deceased.name.surname}}}}}"
Expand Down Expand Up @@ -1073,7 +1069,6 @@ event.tennis-club-membership.action.collect-certificate.label,This is shown as t
event.tennis-club-membership.action.declare.form.label,This is what this form is referred as in the system,Tennis club membership application,Tennis club membership application
event.tennis-club-membership.action.declare.form.review.title,Title of the form to show in review page,"{applicant.name.firstname, select, __EMPTY__ {Member declaration} other {{applicant.name.surname, select, __EMPTY__ {Member declaration for {applicant.name.firstname}} other {Member declaration for {applicant.name.firstname} {applicant.name.surname}}}}}","{applicant.name.firstname, select, __EMPTY__ {Déclaration des membres} other {{applicant.name.surname, select, __EMPTY__ {Déclaration des membres pour {applicant.name.firstname}} other {Déclaration des membres pour {applicant.name.firstname} {applicant.name.surname}}}}}"
event.tennis-club-membership.action.declare.form.section.recommender.field.firstname.label,This is the label for the field,Recommender's first name,Recommender's first name
event.tennis-club-membership.action.declare.form.section.recommender.field.firstname.label,This is the label for the field,Recommender's name,Nom du recommandataire
event.tennis-club-membership.action.declare.form.section.recommender.field.id.label,This is the label for the field,Recommender's membership ID,Recommender's membership ID
event.tennis-club-membership.action.declare.form.section.recommender.field.none.label,This is the label for the field,No recommender,No recommender
event.tennis-club-membership.action.declare.form.section.recommender.title,This is the title of the section,Who is recommending the applicant?,Who is recommending the applicant?
Expand Down Expand Up @@ -2011,6 +2006,12 @@ search.searchResultFor,The search result text,Search result for “{param}”,r
search.searchingFor,The searching for text,Searching for “{param}”,Recherche de “{param}”
search.totalResultText,The total result text,"{total, plural, =0 {} one {# record found} other {# records found}} ","{total, plural, =0 {} one {# record found} other {# records found}}"
search.waitingForConnection,The text when there is no connectivity,Reconnect to load declarations,Se reconnecter pour charger les déclarations
searchField.indicators.confirmButton,Confirm button text,Search,Rechercher
searchField.indicators.httpError,HTTP error indicator,"{statusCode, select, 408{Timed out} other{An error occurred while fetching data}}","{statusCode, select, 408{Délai d'attente dépassé} other{Une erreur s'est produite lors de la récupération des données}}"
searchField.indicators.loading,Loading indicator,Searching...,Recherche en cours...
searchField.indicators.noResultsError,No results found indicator,No record found,Aucun enregistrement trouvé
searchField.indicators.offline,Offline indicator,Search is unavailable while offline,La recherche n'est pas disponible hors ligne
searchField.indicators.ok,OK button text,Found {count} results,{count} résultats trouvés
serviceWorker.cacheKey.WorkBoxRuntime.error.button.logout,Button label for logging out when WorkBox runtime cache key is missing,Log out,Se déconnecter
serviceWorker.cacheKey.WorkBoxRuntime.error.button.reload,Button label for logging out when WorkBox runtime cache key is missing,Reload,Recharger
serviceWorker.cacheKey.WorkBoxRuntime.error.content,Content shown when WorkBox runtime cache key is missing,"Something went wrong with loading the app. Reload this page, or log out and log back in to continue.",Un problème est survenu lors du chargement de l’application. Rechargez cette page ou déconnectez-vous puis reconnectez-vous pour continuer.
Comment on lines 2006 to 2022
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: missing translation keys for the search field: event.tennis-club-membership.action.declare.form.section.recommender.field.search.label, tennis-club-membership.searchField.validation.invalid, and tennis-club-membership.searchField.indicators.ok need to be added to match the configuration in tennis-club-membership.ts:231, tennis-club-membership.ts:257, and tennis-club-membership.ts:264

Expand Down
8 changes: 4 additions & 4 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].c8c6227":
version "1.8.1-rc.c8c6227"
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.8.1-rc.c8c6227.tgz#bac5a80475c4578e6aa802ae70aa4491872c6008"
integrity sha512-RdTYBVgJRc2aSrKuLbDRYpAXu1TOssTra6cTuPwoJV23X48NOWuyrSImHf0PUKyS2puF/6v73G1QYyE5FK38Kg==
"@opencrvs/[email protected].85aa435":
version "1.8.1-rc.85aa435"
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.8.1-rc.85aa435.tgz#6ee49c0b60cd97e74b5d68b3d65fd9634f8bcfc4"
integrity sha512-90EVxdGiKfj1Q8JieOQnCTNuRvj7Bb1+ZH+2ef37dWXRaCmeeatL5vyQlOTaPKZxY8ZgIn2CqJilNnSR+Xgm4A==
dependencies:
"@trpc/client" "11.4.3"
"@trpc/server" "11.4.3"
Expand Down
Loading