Skip to content

Commit

Permalink
add explore more results button
Browse files Browse the repository at this point in the history
  • Loading branch information
liyiy committed Feb 13, 2024
1 parent cf1d0fa commit dcf83ad
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
26 changes: 25 additions & 1 deletion frontend/src/scenes/surveys/SurveyView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import { LemonTabs } from 'lib/lemon-ui/LemonTabs'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { capitalizeFirstLetter, pluralize } from 'lib/utils'
import { useEffect, useState } from 'react'
import { urls } from 'scenes/urls'

import { Query } from '~/queries/Query/Query'
import { NodeKind } from '~/queries/schema'
import { PropertyFilterType, PropertyOperator, Survey, SurveyQuestionType, SurveyType } from '~/types'
import { InsightType, PropertyFilterType, PropertyOperator, Survey, SurveyQuestionType, SurveyType } from '~/types'

import { SURVEY_EVENT_NAME } from './constants'
import { SurveyReleaseSummary } from './Survey'
Expand Down Expand Up @@ -316,6 +317,29 @@ export function SurveyResult({ disableEventsTable }: { disableEventsTable?: bool
}
})}
</>
<div className="max-w-40 mb-4">
<LemonButton
type="primary"
to={urls.insightNew({
insight: InsightType.TRENDS,
events: [
{ id: 'survey sent', name: 'survey sent', type: 'events' },
{ id: 'survey shown', name: 'survey shown', type: 'events' },
{ id: 'survey dismissed', name: 'survey dismissed', type: 'events' },
],
properties: [
{
key: '$survey_id',
value: survey.id,
operator: PropertyOperator.Exact,
type: PropertyFilterType.Event,
},
],
})}
>
Explore results
</LemonButton>
</div>
{!disableEventsTable && (surveyLoading ? <LemonSkeleton /> : <Query query={dataTableQuery} />)}
</>
)
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/scenes/surveys/surveyViewViz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const formatCount = (count: number, total: number): string => {
export function UsersCount({ surveyUserStats }: { surveyUserStats: SurveyUserStats }): JSX.Element {
const { seen, dismissed, sent } = surveyUserStats
const total = seen + dismissed + sent
const labelTotal = total === 1 ? 'Unique user viewed' : 'Unique users viewed'
const labelSent = sent === 1 ? 'Response submitted' : 'Responses submitted'
const labelTotal = total === 1 ? 'Unique user shown' : 'Unique users shown'
const labelSent = sent === 1 ? 'Response sent' : 'Responses sent'

return (
<div className="inline-flex mb-4">
Expand Down

0 comments on commit dcf83ad

Please sign in to comment.