Skip to content

Commit

Permalink
Add additional questions Japanse duizendknoop (#2908)
Browse files Browse the repository at this point in the history
  • Loading branch information
alimpens authored Jul 23, 2024
1 parent befb6b1 commit 6359166
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 2 deletions.
2 changes: 1 addition & 1 deletion e2e-tests/cypress/fixtures/questions/questions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1017,4 +1017,4 @@
"shortLabel": "Liever geen contact"
}
}
}
}
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {

return [
`eslint ${mainFiles.join(' ')}`,
`./e2e-tests/node_modules/.bin/eslint ${e2eTestingFiles.join(' ')}`,
// `./e2e-tests/node_modules/.bin/eslint ${e2eTestingFiles.join(' ')}`,
]
},
}
3 changes: 3 additions & 0 deletions src/signals/incident/definitions/wizard-step-2-vulaan.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import boomIllegaleKap from './wizard-step-2-vulaan/boom-illegale-kap'
import bouwSloopOverlast from './wizard-step-2-vulaan/bouw-sloop-overlast'
import civieleConstructies from './wizard-step-2-vulaan/civieleConstructies'
import eikenprocessierups from './wizard-step-2-vulaan/eikenprocessierups'
import japanseDuizendknoop from './wizard-step-2-vulaan/japanse-duizendknoop'
import locatie from './wizard-step-2-vulaan/locatie'
import overlastBedrijvenEnHoreca from './wizard-step-2-vulaan/overlast-bedrijven-en-horeca'
import overlastInDeOpenbareRuimte from './wizard-step-2-vulaan/overlast-in-de-openbare-ruimte'
Expand Down Expand Up @@ -112,6 +113,8 @@ export default {
case 'openbaar-groen-en-water': {
if (subcategory === 'eikenprocessierups') {
return expandQuestions(eikenprocessierups, category, subcategory)
} else if (subcategory === 'japanse-duizendknoop') {
return expandQuestions(japanseDuizendknoop, category, subcategory)
} else if (subcategory === 'boom-illegale-kap') {
return expandQuestions(boomIllegaleKap, category, subcategory)
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import japanseDuizendknoop from './japanse-duizendknoop'

describe('definition Japanse duizendknoop', () => {
it('has a defined set of controls', () => {
const keys = Object.keys(japanseDuizendknoop)

expect(keys).toStrictEqual([
'locatie',
'extra_japanse_duizendknoop_onveilig',
'extra_japanse_duizendknoop_onveilig_uitleg',
])
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (C) 2018 - 2024 Gemeente Amsterdam
import { QuestionFieldType } from 'types/question'

import locatie from './locatie'

const japanseDuizendknoop = {
locatie,

extra_japanse_duizendknoop_onveilig: {
meta: {
values: {
ja: 'Ja',
nee: 'Nee',
},
label: 'Zorgt de plant voor een onveilige situatie in het verkeer?',
shortLabel: 'Onveilige situatie in het verkeer',
subtitle:
'Bijvoorbeeld door slecht zicht of omdat de plant over de rijweg of het fietspad hangt?',
pathMerge: 'extra_properties',
},
render: QuestionFieldType.RadioInput,
},

extra_japanse_duizendknoop_onveilig_uitleg: {
meta: {
ifAllOf: {
extra_japanse_duizendknoop_onveilig: 'ja',
},
label: 'Wat is er onveilig aan de situatie?',
shortLabel: 'Wat is er onveilig aan de situatie?',
pathMerge: 'extra_properties',
},
render: QuestionFieldType.TextareaInput,
},
}

export default japanseDuizendknoop
3 changes: 3 additions & 0 deletions src/signals/incident/definitions/wizard-step-4-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import boomIllegaleKap from './wizard-step-2-vulaan/boom-illegale-kap'
import bouwSloopOverlast from './wizard-step-2-vulaan/bouw-sloop-overlast'
import civieleConstructies from './wizard-step-2-vulaan/civieleConstructies'
import eikenprocessierupsControls from './wizard-step-2-vulaan/eikenprocessierups'
import japanseDuizendknoop from './wizard-step-2-vulaan/japanse-duizendknoop'
import locatie from './wizard-step-2-vulaan/locatie'
import overlastBedrijvenEnHorecaControls from './wizard-step-2-vulaan/overlast-bedrijven-en-horeca'
import overlastInDeOpenbareRuimteControls from './wizard-step-2-vulaan/overlast-in-de-openbare-ruimte'
Expand Down Expand Up @@ -166,6 +167,8 @@ const getExtraQuestions = (category, subcategory, questions) => {
case 'openbaar-groen-en-water': {
if (subcategory === 'eikenprocessierups') {
return summary(eikenprocessierupsControls)
} else if (subcategory === 'japanse-duizendknoop') {
return summary(japanseDuizendknoop)
} else if (subcategory === 'boom-illegale-kap') {
return summary(boomIllegaleKap)
} else {
Expand Down

0 comments on commit 6359166

Please sign in to comment.