Skip to content

Commit

Permalink
fix(surveys): small bug fixes (#17327)
Browse files Browse the repository at this point in the history
  • Loading branch information
liyiy authored Sep 5, 2023
1 parent 7b65dd3 commit e576e52
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/src/scenes/surveys/SurveyView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ export function SurveyView({ id }: { id: string }): JSX.Element {
</LemonButton>
<LemonDivider />
</>
<LemonButton onClick={() => archiveSurvey()} fullWidth>
Archive
</LemonButton>
{survey.end_date && !survey.archived && (
<LemonButton onClick={() => archiveSurvey()} fullWidth>
Archive
</LemonButton>
)}
<LemonButton status="danger" fullWidth onClick={() => deleteSurvey(id)}>
Delete survey
</LemonButton>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/scenes/surveys/surveysLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { urls } from 'scenes/urls'
import type { surveysLogicType } from './surveysLogicType'
import { lemonToast } from '@posthog/lemon-ui'
import { userLogic } from 'scenes/userLogic'
import { router } from 'kea-router'

export function getSurveyStatus(survey: Survey): ProgressStatus {
if (!survey.start_date) {
Expand Down Expand Up @@ -40,6 +41,7 @@ export const surveysLogic = kea<surveysLogicType>([
listeners(() => ({
deleteSurveySuccess: () => {
lemonToast.success('Survey deleted')
router.actions.push(urls.surveys())
},
updateSurveySuccess: () => {
lemonToast.success('Survey updated')
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e576e52

Please sign in to comment.