mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 18:30:32 -06:00
This commit introduces several enhancements to the NPS and Rating survey summary views. **NPS Summary:** - Implemented a tabbed interface to switch between "grouped" and "individual" views. - The "grouped" view displays the breakdown of promoters, passives, and detractors. - The "individual" view shows a bar chart of responses for each NPS score (0-10). - Added tooltips for better user guidance. **Rating Summary:** - Integrated CSAT (Customer Satisfaction) score calculation and display. - Added tooltips for CSAT information. **Backend/Logic Changes:** - Updated `getQuestionSummary` to calculate and include CSAT data for Rating questions. - Modified `getQuestionSummary` to include an array of `choices` for NPS questions, detailing individual score counts and percentages. - Added new tests to cover CSAT calculations for various rating scales and NPS individual score breakdowns. - Updated type definitions for `TSurveyQuestionSummaryRating` and `TSurveyQuestionSummaryNps` to accommodate the new data structures. Co-authored-by: johannes <johannes@formbricks.com>