Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link al ticket
Descripción del requerimiento
translateSectionLabel, translateGroupLabel y translateCheckboxLabel
, como bolleano como siempre pero ahora también stringDescripción de la solución
Cómo se puede probar?
El caso de tests/mocks/schemas/edit.yml
El caso tests/mocks/schemas/expected/edit.json
EN ambos casos se utiliza el componente llamado ChecklistThree
En todos los casos, para probar todos los test, ejecutar npm run test
Para probara individualmente los cambios, ejecutamos
yml:
node index.js validate -i tests/mocks/schemas/edit.yml
json:
node index.js validate -i tests/mocks/schemas/expected/edit.json
Para probarlo podemos cambiar en ambos lugares el valor de los checklist, casos de prueba
Llega string con un solo nivel
json
{ "name": "checklistThree", "component": "CheckList", "componentAttributes": { "optionsSource": { "service": "sac", "namespace": "claim-motive", "method": "list", "resolve": false }, "sectionField": "claimMotiveName", "groupField": "statusName", "labelField": "name", "valueField": "id", "translateSectionLabel": true, "translateGroupLabel": "levelone", "translateCheckboxLabel": false } },
yml
- name: checklistThree component: CheckList componentAttributes: optionsSource: service: sac namespace: claim-motive method: list resolve: false sectionField: claimMotiveName groupField: statusName labelField: name valueField: id translateSectionLabel: true translateGroupLabel: levelone translateCheckboxLabel: false
Llega string con un tres niveles
json
{ "name": "checklistThree", "component": "CheckList", "componentAttributes": { "optionsSource": { "service": "sac", "namespace": "claim-motive", "method": "list", "resolve": false }, "sectionField": "claimMotiveName", "groupField": "statusName", "labelField": "name", "valueField": "id", "translateSectionLabel": true, "translateGroupLabel": "levelone.leveltwo.levelthree", "translateCheckboxLabel": false } },
yml
- name: checklistThree component: CheckList componentAttributes: optionsSource: service: sac namespace: claim-motive method: list resolve: false sectionField: claimMotiveName groupField: statusName labelField: name valueField: id translateSectionLabel: true translateGroupLabel: levelone.leveltwo.levelthree translateCheckboxLabel: false
Llega string con views como primer nivel
json
{ "name": "checklistThree", "component": "CheckList", "componentAttributes": { "optionsSource": { "service": "sac", "namespace": "claim-motive", "method": "list", "resolve": false }, "sectionField": "claimMotiveName", "groupField": "statusName", "labelField": "name", "valueField": "id", "translateSectionLabel": true, "translateGroupLabel": "views.leveltwo", "translateCheckboxLabel": false } },
yml
- name: checklistThree component: CheckList componentAttributes: optionsSource: service: sac namespace: claim-motive method: list resolve: false sectionField: claimMotiveName groupField: statusName labelField: name valueField: id translateSectionLabel: true translateGroupLabel: views.leveltwo translateCheckboxLabel: false
Llega string con un el primer nivel como common
json
{ "name": "checklistThree", "component": "CheckList", "componentAttributes": { "optionsSource": { "service": "sac", "namespace": "claim-motive", "method": "list", "resolve": false }, "sectionField": "claimMotiveName", "groupField": "statusName", "labelField": "name", "valueField": "id", "translateSectionLabel": true, "translateGroupLabel": "common.leveltwo", "translateCheckboxLabel": false } },
yml
- name: checklistThree component: CheckList componentAttributes: optionsSource: service: sac namespace: claim-motive method: list resolve: false sectionField: claimMotiveName groupField: statusName labelField: name valueField: id translateSectionLabel: true translateGroupLabel: common.leveltwo translateCheckboxLabel: false
En todos estos casos debería tirar un error admeas de la posibilidad de ser booleano:
'should match pattern "^(?!views|common)[a-zA-Z]+\.[a-zA-Z]+$"'
ya que no cumple con el requisito de que sean 2 niveles y el primero no sea ni views ni common
Link a la documentación
Datos extra a tener en cuenta
Changelog