dga_feedback
5 sites
No security coverage
DGA Feedback Module
The feedback page is designed to gather user insights. It includes a brief introduction encouraging feedback, followed by sections for rating, comments, and suggestions. Clear prompts guide users to share their opinions, making the process simple and inviting.
Features
- Yes/No Feedback Widget: Simple binary feedback system (Was this page useful?)
- Reason Selection: Dedicated reason lists for both Yes and No responses (multi-select)
- Optional Feedback Text: Free-form textarea for additional comments
- Demographic Data: Optional gender selection (Male, Female, or Prefer not to say)
- Live Statistics: Real-time display of feedback (percentage + total count)
- UI-Based Translations: Manage all English & Arabic strings via the admin UI (no .po files)
- Inline Validation: Friendly inline error messages for each required field
- Auto Refresh: Widget resets automatically after submission (configurable delay)
- Custom Admin Navigation: DGA Feedback → Feedback Dashboard, Settings, Translations (SVG icon in toolbar)
- Admin Dashboard: Full submissions dashboard with filters, bulk actions, and statistics
- Role-Based Access Control: Separate permissions for viewing the dashboard, moderating submissions, and managing settings
- DGA Design System Compliant & Accessible
Installation
- Place the module in web/modules/custom/dga_feedback/
- Enable the module via Drush: drush en dga_feedback
- Or enable via the Drupal admin interface: Extend > Custom > DGA Feedback
Configuration
Menu Structure
-
DGA Feedback (main menu with custom SVG icon)
- Feedback Dashboard – View submissions and statistics
- Settings – Configure widget behavior, rate limiting, and refresh delay
- Translations – Manage English & Arabic text for the widget, validation, and menu items
Configure Translations
- Navigate to DGA Feedback > Translations (/admin/content/dga-feedback/translations)
-
Each section provides bilingual (EN/AR) fields displayed side-by-side:
- Closed State: Question text, Yes/No buttons, statistics template
- Feedback Form: Close button, reasons title, reasons instruction, reason lists (multi-line input for Yes / No), feedback label/placeholder, gender labels (Male, Female, Prefer not to say)
- Submitted State: Success message
- Validation Messages: All error messages (Yes/No required, reason required, feedback required, submission failed, unknown error)
- API & Backend Messages: Method not allowed, invalid JSON, rate limit, save failed, success message
- Menu Items: DGA Feedback, Feedback Dashboard, Settings, Translations titles
- Note: Reasons instruction field should not include parentheses (they are added automatically by the template)
- Save to apply instantly (no cache clear required)
Configure Widget Behavior
- Navigate to DGA Feedback > Settings (/admin/config/dga-feedback/settings)
-
Configure:
- Widget refresh delay (seconds) after successful submission
- Rate limiting (maximum submissions per IP + time window)
- Feedback length constraints and reason length/count limits
- Save configuration
Permissions
- Navigate to People → Roles → Edit for the relevant role
-
Under DGA Feedback, assign the desired capability:
- view dga feedback dashboard – view statistics and submissions without edit/delete access
- manage dga feedback submissions – edit, delete, or bulk delete submissions
- administer dga feedback settings – change widget configuration and translations
- Save the role to apply the permission changes
Block Placement
- Go to Structure > Block layout
- Add the "DGA Feedback Widget" block to your desired region
-
Use the block's Visibility settings to choose where it appears:
- Content types: limit the widget to specific node types (e.g., Service pages only)
- Pages / paths: specify node/*, /services/*, or other URL patterns to include/exclude
- Roles / languages: optionally restrict the widget to certain audiences
- Save the block placement once the desired rules are configured
Usage
Frontend Widget
The widget displays:
- Closed State: Question with Yes/No buttons and statistics summary
- Open State: Full form with reasons, feedback textarea, and optional gender selection
-
Inline Validation: Required fields show inline red error messages (red text under each field) if missing
- Yes/No selection required
- At least one reason must be selected
- Feedback text is required
- Gender selection is optional (can be left blank, or choose Male, Female, or Prefer not to say)
- Submitted State: Success message displayed, followed by automatic widget refresh after configurable delay (returns to closed state, updates statistics)
Validation Behavior
- All validation errors display as red text under the relevant field label
- Error messages are fully translatable via the Translations form
- Errors automatically clear when the user corrects the field
- Form does not submit until all required fields are filled
Admin Interface
Navigate to Admin > Content > DGA Feedback to:
- View all submissions with filters and pagination
- Edit individual submissions
- Delete single or bulk submissions
- View overall statistics and distribution