Skip to main content

EditQuestionModal

packages/engagement/components/molecules/EditQuestionModal.js · Tier: molecule · Module: engagement · Rendering: Client Component ('use client')

Purpose​

A modal form for admin/backoffice users to edit a future civic consultation. It submits via the updateQuestion server action. Text fields (title, description, objectives) are multilingual, and the location is chosen by zone → neighbourhood.

Props​

PropTypeRequiredDefaultDescription
questionobjectyes—The consultation being edited (with translations, objectives, neighbourhoodId).
tobjectyes—Localized form copy.
onClose() => voidyes—Close handler.

Behaviour​

Initialises multilingual { es, en, fr } fields from question.translations, sorts objectives by sortOrder, and resolves the initial zone from the neighbourhoods config. Submits updateQuestion and refreshes.

Composition​

  • Uses: molecules/core/Modal, MultilingualFields, atoms/core/FormField, atoms/core/Button, the neighbourhoods config, updateQuestion action.
  • Used by: molecules/engagement/EditQuestionButton.

Internationalisation​

Translatable fields via MultilingualFields; labels via t.

Accessibility​

The accessible core/Modal; fields via FormField.

molecules/engagement/EditQuestionButton, organisms/engagement/CreateQuestionForm, molecules/core/MultilingualFields.