From 74bd40e0ff5fb1fc071203bcc037770f21da04f5 Mon Sep 17 00:00:00 2001 From: Johannes <72809645+jobenjada@users.noreply.github.com> Date: Mon, 4 Nov 2024 23:07:27 -0800 Subject: [PATCH] feat: Update Insight category, document sentiment and archive insights (#4038) Co-authored-by: Matthias Nannt --- .../[surveyId]/edit/components/Placement.tsx | 2 +- .../edit/components/SavedActionsTab.tsx | 2 +- .../edit/components/WhenToSendCard.tsx | 2 +- .../(people)/people/loading.tsx | 8 +- .../product/api-keys/loading.tsx | 4 +- .../look/components/EditPlacementForm.tsx | 2 +- .../summary/components/RankingSummary.tsx | 4 +- .../summary/components/ShareEmbedSurvey.tsx | 2 +- .../surveys/components/CopySurveyForm.tsx | 2 +- .../auth/components/BackToLoginButton.tsx | 2 +- apps/web/app/api/v1/og/route.tsx | 4 +- .../app/setup/(fresh-instance)/intro/page.tsx | 2 +- .../components/insight-sheet/actions.ts | 28 ++++ .../components/insight-sheet/index.tsx | 138 +++++++++--------- .../components/insight-sheet/lib/documents.ts | 56 ++++++- .../ee/insights/components/insights-view.tsx | 29 ++-- .../insights/components/sentiment-select.tsx | 63 ++++++++ .../modules/ee/insights/experience/actions.ts | 55 ++++++- .../experience/components/category-select.tsx | 70 +++++++++ .../experience/components/dashboard.tsx | 14 +- .../experience/components/insight-loading.tsx | 32 ++-- .../experience/components/insight-view.tsx | 105 ++++++------- .../insights/experience/components/stats.tsx | 24 +-- .../ee/insights/experience/lib/insights.ts | 19 +++ .../ee/insights/experience/lib/stats.ts | 3 +- .../ee/insights/experience/types/stats.ts | 2 +- .../components/language-select.tsx | 2 +- .../components/preview-email-template.tsx | 2 +- .../emails/survey/response-finished-email.tsx | 6 +- .../live-survey-notification.tsx | 2 +- packages/lib/messages/de-DE.json | 2 +- packages/lib/messages/en-US.json | 8 +- packages/lib/messages/pt-BR.json | 2 +- .../src/components/general/QuestionMedia.tsx | 2 +- .../components/questions/MatrixQuestion.tsx | 2 +- .../questions/PictureSelectionQuestion.tsx | 2 +- .../surveys/src/components/wrappers/Modal.tsx | 2 +- packages/ui/components/BadgeSelect/index.tsx | 117 +++++++++++++++ packages/ui/components/BadgeSelect/stories.ts | 119 +++++++++++++++ .../components/FileUploadResponse/index.tsx | 2 +- packages/ui/components/Input/stories.tsx | 2 +- .../ui/components/IntegrationCard/index.tsx | 2 +- .../components/LimitsReachedBanner/index.tsx | 6 +- .../ui/components/LoadingSpinner/index.tsx | 6 +- .../PendingDowngradeBanner/index.tsx | 6 +- .../PreviewSurvey/components/Modal.tsx | 2 +- .../ui/components/QuestionFormInput/index.tsx | 2 +- .../ui/components/RankingResponse/index.tsx | 4 +- .../ui/components/ShareSurveyLink/index.tsx | 2 + packages/ui/components/Sheet/index.tsx | 18 +-- .../ui/components/SignupOptions/index.tsx | 2 +- packages/ui/components/StylingTabs/index.tsx | 2 +- 52 files changed, 764 insertions(+), 234 deletions(-) create mode 100644 apps/web/modules/ee/insights/components/sentiment-select.tsx create mode 100644 apps/web/modules/ee/insights/experience/components/category-select.tsx create mode 100644 packages/ui/components/BadgeSelect/index.tsx create mode 100644 packages/ui/components/BadgeSelect/stories.ts diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/Placement.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/Placement.tsx index 8b85cd7923..bd4a9baa95 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/Placement.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/Placement.tsx @@ -34,7 +34,7 @@ export const Placement = ({ }: TPlacementProps) => { const t = useTranslations(); const overlayStyle = - currentPlacement === "center" && overlay === "dark" ? "bg-gray-700/80" : "bg-slate-200"; + currentPlacement === "center" && overlay === "dark" ? "bg-slate-700/80" : "bg-slate-200"; return ( <>
diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SavedActionsTab.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SavedActionsTab.tsx index 41ba98a223..eca53ae9e4 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SavedActionsTab.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SavedActionsTab.tsx @@ -78,7 +78,7 @@ export const SavedActionsTab = ({

{action.name}

-

{action.description}

+

{action.description}

))} diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/WhenToSendCard.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/WhenToSendCard.tsx index acbe04689d..c81f5032c3 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/WhenToSendCard.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/WhenToSendCard.tsx @@ -205,7 +205,7 @@ export const WhenToSendCard = ({

{trigger.actionClass.name}

-
+
{trigger.actionClass.description && ( {trigger.actionClass.description} )} diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/loading.tsx index 53200dc889..d3d3addc30 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/loading.tsx @@ -24,17 +24,17 @@ const Loading = async () => { className="m-2 grid h-16 grid-cols-7 content-center rounded-lg transition-colors ease-in-out hover:bg-slate-100">
-
{" "} +
{" "}
-
+
{" "}
-
+
-
+
))} diff --git a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/loading.tsx index cf2e1d4bcb..6216a2e72f 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/loading.tsx @@ -10,8 +10,8 @@ const LoadingCard = () => { return (
-

-

+

+

diff --git a/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditPlacementForm.tsx b/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditPlacementForm.tsx index e6a14379d0..29618e2299 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditPlacementForm.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditPlacementForm.tsx @@ -51,7 +51,7 @@ export const EditPlacementForm = ({ product }: EditPlacementProps) => { const clickOutsideClose = form.watch("clickOutsideClose"); const isSubmitting = form.formState.isSubmitting; - const overlayStyle = currentPlacement === "center" && darkOverlay ? "bg-gray-700/80" : "bg-slate-200"; + const overlayStyle = currentPlacement === "center" && darkOverlay ? "bg-slate-700/80" : "bg-slate-200"; const onSubmit: SubmitHandler = async (data) => { try { diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/RankingSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/RankingSummary.tsx index b881deabe9..20e97b3582 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/RankingSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/RankingSummary.tsx @@ -40,8 +40,8 @@ export const RankingSummary = ({
- #{resultsIdx + 1} -
{result.value}
+ #{resultsIdx + 1} +
{result.value}
#{convertFloatToNDecimal(result.avgRanking, 2)} diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ShareEmbedSurvey.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ShareEmbedSurvey.tsx index 61f354f324..38bbed9bd3 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ShareEmbedSurvey.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ShareEmbedSurvey.tsx @@ -93,7 +93,7 @@ export const ShareEmbedSurvey = ({

- {t("environments.surveys.summary.results_are_public")} 🎉 + {t("environments.surveys.summary.your_survey_is_public")} 🎉

diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/components/CopySurveyForm.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/components/CopySurveyForm.tsx index d2199a87b8..6e3cbe6ab9 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/components/CopySurveyForm.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/components/CopySurveyForm.tsx @@ -105,7 +105,7 @@ export const CopySurveyForm = ({ field.onChange([...field.value, environment.id]); } }} - className="mr-2 h-4 w-4 appearance-none border-gray-300 checked:border-transparent checked:bg-slate-500 checked:after:bg-slate-500 checked:hover:bg-slate-500 focus:ring-2 focus:ring-slate-500 focus:ring-opacity-50" + className="mr-2 h-4 w-4 appearance-none border-slate-300 checked:border-transparent checked:bg-slate-500 checked:after:bg-slate-500 checked:hover:bg-slate-500 focus:ring-2 focus:ring-slate-500 focus:ring-opacity-50" id={environment.id} />