Skip to content

Commit

Permalink
Survey: clean up, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannaPeanut committed May 22, 2024
1 parent 619919f commit c1d5145
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
12 changes: 6 additions & 6 deletions src/survey-public/components/feedback/Feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ export const Feedback: React.FC<Props> = ({
}

const handleSubmit = (values: Record<string, any>, submitterId?: string) => {
if (values[isUserLocationQuestionId!] === "2") values[userLocationQuestionId!] = "" // if "no location" is chosen, set location value to empty string
delete values[isUserLocationQuestionId!] // delete map ja/nein response
if (values[`single-${isUserLocationQuestionId}`] === "2")
values[`map-${userLocationQuestionId}`] = "" // if "no location" is chosen, set location value to empty string
values = transformValues(values)
delete values[isUserLocationQuestionId!] // delete map ja/nein response
onSubmit({ ...values }, submitterId)
}

Expand Down Expand Up @@ -138,14 +139,13 @@ export const Feedback: React.FC<Props> = ({
],
)

// show map: inital value of is location is set to true
const initialValuesKey = `single-${isUserLocationQuestionId}`

return (
<PublicSurveyForm
onSubmit={handleSubmit}
// inital value of is location is set to true
initialValues={{ [initialValuesKey]: "1" }}
initialValues={{
[`single-${isUserLocationQuestionId}`]: "1",
}}
onChangeValues={handleChange}
>
{/* clean up BB remove setIsCompleted from FeedbackFirstPage props */}
Expand Down
1 change: 0 additions & 1 deletion src/survey-public/components/maps/SurveyMapLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export const SurveyMapLine: React.FC<SurveyMapProps> = ({
layers: ["Netzentwurf"],
})[0]
: undefined
console.log(line?.properties)
const lineId = line?.properties["Verbindungs_ID"]
const lineGeometry = line?.geometry

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions src/survey-public/rs8/data/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ export const feedbackDefinition: TFeedback = {
],
},
},
],
buttons: [
{ label: { de: "Weiter" }, color: "primaryColor", onClick: { action: "nextPage" } },
{ label: { de: "Zurück" }, color: "white", onClick: { action: "previousPage" } },
],
},
{
id: 2,
title: { de: "Ihr Hinweis" },
description: {
de: "Formulieren Sie hier Ihre Gedanken, Ideen, Anregungen oder Wünsche *",
},
questions: [
{
id: 23,

Expand All @@ -57,19 +70,6 @@ export const feedbackDefinition: TFeedback = {
},
},
},
],
buttons: [
{ label: { de: "Weiter" }, color: "primaryColor", onClick: { action: "nextPage" } },
{ label: { de: "Zurück" }, color: "white", onClick: { action: "previousPage" } },
],
},
{
id: 2,
title: { de: "Ihr Hinweis" },
description: {
de: "Formulieren Sie hier Ihre Gedanken, Ideen, Anregungen oder Wünsche *",
},
questions: [
{
id: 31,
label: { de: "Kategorie" },
Expand Down

0 comments on commit c1d5145

Please sign in to comment.