diff --git a/cypress/e2e/surveys.cy.ts b/cypress/e2e/surveys.cy.ts index 17805c09a8684..641f9b7a9a2b3 100644 --- a/cypress/e2e/surveys.cy.ts +++ b/cypress/e2e/surveys.cy.ts @@ -165,4 +165,58 @@ describe('Surveys', () => { cy.get('[data-attr=delete-survey]').click() cy.get('.Toastify__toast-body').contains('Survey deleted').should('be.visible') }) + + it('creates a new multiple choice survey with an open-ended choice', () => { + cy.get('h1').should('contain', 'Surveys') + cy.get('[data-attr=new-survey]').click() + cy.get('[data-attr=new-blank-survey]').click() + + // add a multiple choice question with an open-ended question + cy.get('[data-attr=survey-name]').focus().type(name).should('have.value', name) + cy.get('[data-attr="survey-question-type-0"]').click() + cy.contains('Multiple choice select').click() + cy.get('button').contains('Add open-ended choice').click() + + // check default open-ended choice form input and appearance after + // open-ended choice was added + cy.get('.LemonInput__input[value="Other"]') + cy.get('.choice-option').eq(3).contains('Other:') + cy.get('.choice-option').eq(3).find('input[type="text"]').should('have.value', '') + + // typing in open-ended question's appearance automatically checks the + // checkbox + cy.get('.choice-option').eq(3).find('input[type="checkbox"]').should('not.be.checked') + cy.get('.choice-option').eq(3).find('input[type="text"]').type('Outreach') + cy.get('.choice-option').eq(3).find('input[type="checkbox"]').should('be.checked') + + // clicking on open-ended question's appearance label unchecks or checks + // the checkbox + cy.get('.choice-option').eq(3).click() + cy.get('.choice-option').eq(3).find('input[type="checkbox"]').should('not.be.checked') + cy.get('.choice-option').eq(3).click() + cy.get('.choice-option').eq(3).find('input[type="checkbox"]').should('be.checked') + + // removing text in open-ended question's appearance automatically + // unchecks the checkbox + cy.get('.choice-option').eq(3).find('input[type="text"]').clear() + + // open-ended question label doesn't change even if appearance input + // changes + cy.get('.LemonInput__input[value="Other"]') + + // change open-ended choice after the label was added + cy.contains('Choices').parent().find('input[type="text"]').eq(3).clear() + cy.contains('Choices').parent().find('input[type="text"]').eq(3).type('First Choice') + cy.get('.choice-option').eq(3).contains('First Choice:') + + // attempt to create and save survey + cy.get('[data-attr=save-survey]').first().click() + + // after save there should be a launch button + cy.get('button[data-attr="launch-survey"]').should('have.text', 'Launch') + + cy.clickNavMenu('surveys') + cy.get('[data-attr=surveys-table]').should('contain', name) + cy.get(`[data-row-key="${name}"]`).contains(name).click() + }) }) diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index b2ce0bb71285c..ce2feaa10d600 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -33,6 +33,7 @@ beforeEach(() => { 'surveys-new-creation-flow': true, 'surveys-results-visualizations': true, 'auto-redirect': true, + 'surveys-open-choice': true, notebooks: true, }) ) diff --git a/frontend/__snapshots__/components-compact-list--compact-list.png b/frontend/__snapshots__/components-compact-list--compact-list.png index 4a4b5e8704410..49cbfb2048571 100644 Binary files a/frontend/__snapshots__/components-compact-list--compact-list.png and b/frontend/__snapshots__/components-compact-list--compact-list.png differ diff --git a/frontend/__snapshots__/exporter-exporter--trends-number-insight.png b/frontend/__snapshots__/exporter-exporter--trends-number-insight.png index e661eaa4de199..67b2a70ddeb75 100644 Binary files a/frontend/__snapshots__/exporter-exporter--trends-number-insight.png and b/frontend/__snapshots__/exporter-exporter--trends-number-insight.png differ diff --git a/frontend/__snapshots__/lemon-ui-textfit--basic.png b/frontend/__snapshots__/lemon-ui-textfit--basic.png new file mode 100644 index 0000000000000..269bfc9cfad86 Binary files /dev/null and b/frontend/__snapshots__/lemon-ui-textfit--basic.png differ diff --git a/frontend/__snapshots__/posthog-3000-navigation--navigation-3000.png b/frontend/__snapshots__/posthog-3000-navigation--navigation-3000.png index bf6d08b1cb083..cb3513e97394d 100644 Binary files a/frontend/__snapshots__/posthog-3000-navigation--navigation-3000.png and b/frontend/__snapshots__/posthog-3000-navigation--navigation-3000.png differ diff --git a/frontend/__snapshots__/posthog-3000-navigation--navigation-base.png b/frontend/__snapshots__/posthog-3000-navigation--navigation-base.png index 87cd957353f8c..d42c385e3c023 100644 Binary files a/frontend/__snapshots__/posthog-3000-navigation--navigation-base.png and b/frontend/__snapshots__/posthog-3000-navigation--navigation-base.png differ diff --git a/frontend/__snapshots__/scenes-app-feature-flags--edit-multi-variate-feature-flag.png b/frontend/__snapshots__/scenes-app-feature-flags--edit-multi-variate-feature-flag.png index 45cc7c6c7b4d5..4638e3c252629 100644 Binary files a/frontend/__snapshots__/scenes-app-feature-flags--edit-multi-variate-feature-flag.png and b/frontend/__snapshots__/scenes-app-feature-flags--edit-multi-variate-feature-flag.png differ diff --git a/frontend/__snapshots__/scenes-app-insights--trends-number--webkit.png b/frontend/__snapshots__/scenes-app-insights--trends-number--webkit.png index a4feb23317dd1..2615d368706cd 100644 Binary files a/frontend/__snapshots__/scenes-app-insights--trends-number--webkit.png and b/frontend/__snapshots__/scenes-app-insights--trends-number--webkit.png differ diff --git a/frontend/__snapshots__/scenes-app-insights--trends-number-edit--webkit.png b/frontend/__snapshots__/scenes-app-insights--trends-number-edit--webkit.png index a34e6e1d5e272..635203fb3d413 100644 Binary files a/frontend/__snapshots__/scenes-app-insights--trends-number-edit--webkit.png and b/frontend/__snapshots__/scenes-app-insights--trends-number-edit--webkit.png differ diff --git a/frontend/__snapshots__/scenes-app-insights--trends-number-edit.png b/frontend/__snapshots__/scenes-app-insights--trends-number-edit.png index d9cf620c1a161..6924135553179 100644 Binary files a/frontend/__snapshots__/scenes-app-insights--trends-number-edit.png and b/frontend/__snapshots__/scenes-app-insights--trends-number-edit.png differ diff --git a/frontend/__snapshots__/scenes-app-insights--trends-number.png b/frontend/__snapshots__/scenes-app-insights--trends-number.png index 03b2456ee4782..693dd022b93e9 100644 Binary files a/frontend/__snapshots__/scenes-app-insights--trends-number.png and b/frontend/__snapshots__/scenes-app-insights--trends-number.png differ diff --git a/frontend/__snapshots__/scenes-app-project-homepage--project-homepage.png b/frontend/__snapshots__/scenes-app-project-homepage--project-homepage.png index 5850c12954b74..84eb120b096bf 100644 Binary files a/frontend/__snapshots__/scenes-app-project-homepage--project-homepage.png and b/frontend/__snapshots__/scenes-app-project-homepage--project-homepage.png differ diff --git a/frontend/__snapshots__/scenes-app-saved-insights--list-view.png b/frontend/__snapshots__/scenes-app-saved-insights--list-view.png index ae911ef6d0319..8bfe21cb3985b 100644 Binary files a/frontend/__snapshots__/scenes-app-saved-insights--list-view.png and b/frontend/__snapshots__/scenes-app-saved-insights--list-view.png differ diff --git a/frontend/src/layout/navigation-3000/Navigation.scss b/frontend/src/layout/navigation-3000/Navigation.scss index cccca30bc0e4b..74236f4e9a7fc 100644 --- a/frontend/src/layout/navigation-3000/Navigation.scss +++ b/frontend/src/layout/navigation-3000/Navigation.scss @@ -57,14 +57,9 @@ z-index: var(--z-main-nav); .LemonButton { - min-height: 2.25rem !important; // Reduce minimum height - - > span { + .LemonButton__chrome { padding: 0.25rem !important; - } - - .LemonButton__content { - font-size: 0.813rem; + font-size: 0.8125rem; } } @@ -77,7 +72,7 @@ } li + li { - margin-top: 0.25rem; + margin-top: -1px; } } } diff --git a/frontend/src/layout/navigation-3000/components/Breadcrumbs.scss b/frontend/src/layout/navigation-3000/components/Breadcrumbs.scss index 0cf4e5a260384..51124686f5429 100644 --- a/frontend/src/layout/navigation-3000/components/Breadcrumbs.scss +++ b/frontend/src/layout/navigation-3000/components/Breadcrumbs.scss @@ -37,7 +37,7 @@ .Breadcrumbs3000__crumbs { height: 1rem; - margin-top: 0.25rem; + margin-top: calc(0.25rem * (1 - var(--breadcrumbs-compaction-rate))); display: flex; align-items: center; overflow: visible; diff --git a/frontend/src/layout/navigation-3000/components/Navbar.tsx b/frontend/src/layout/navigation-3000/components/Navbar.tsx index 33f73e869b6fa..c620d0c9b927f 100644 --- a/frontend/src/layout/navigation-3000/components/Navbar.tsx +++ b/frontend/src/layout/navigation-3000/components/Navbar.tsx @@ -3,7 +3,6 @@ import { LemonBadge } from '@posthog/lemon-ui' import { useActions, useValues } from 'kea' import { commandBarLogic } from 'lib/components/CommandBar/commandBarLogic' import { Resizer } from 'lib/components/Resizer/Resizer' -import { useFeatureFlag } from 'lib/hooks/useFeatureFlag' import { Popover } from 'lib/lemon-ui/Popover' import { ProfilePicture } from 'lib/lemon-ui/ProfilePicture' import { featureFlagLogic } from 'lib/logic/featureFlagLogic' @@ -14,7 +13,6 @@ import { userLogic } from 'scenes/userLogic' import { navigationLogic } from '~/layout/navigation/navigationLogic' import { SitePopoverOverlay } from '~/layout/navigation/TopBar/SitePopover' -import { KeyboardShortcut } from '~/layout/navigation-3000/components/KeyboardShortcut' import { navigation3000Logic } from '../navigationLogic' import { themeLogic } from '../themeLogic' @@ -47,7 +45,6 @@ export function Navbar(): JSX.Element { const { toggleSearchBar } = useActions(commandBarLogic) const containerRef = useRef(null) - const isUsingNewNav = useFeatureFlag('POSTHOG_3000_NAV') return (