Skip to content

Commit

Permalink
Hide Add Open-Ended Choice button behind feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ssoonmi committed Nov 21, 2023
1 parent 983ff10 commit 5f6e616
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 37 deletions.
1 change: 1 addition & 0 deletions frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export const FEATURE_FLAGS = {
MULTI_PROJECT_FEATURE_FLAGS: 'multi-project-feature-flags', // owner: @jurajmajerik #team-feature-success
NETWORK_PAYLOAD_CAPTURE: 'network-payload-capture', // owner: #team-monitoring
INSIGHT_HORIZONTAL_CONTROLS: 'insight-horizontal-controls', // owner: @benjackwhite
SURVEYS_OPEN_CHOICE: 'surveys-open-choice', // owner: @ssoonmi, #team-feature-success
} as const
export type FeatureFlagKey = (typeof FEATURE_FLAGS)[keyof typeof FEATURE_FLAGS]

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/scenes/surveys/EditSurvey.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
bottom: -5px;
left: 6px;
font-size: 10px;
background-color: white;
padding: 0px 5px;
background-color: var(--bg-3000);
padding: 0 5px;
}
74 changes: 39 additions & 35 deletions frontend/src/scenes/surveys/SurveyEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -583,42 +583,46 @@ export default function SurveyEdit(): JSX.Element {
>
Add choice
</LemonButton>
{!hasOpenChoice && (
<LemonButton
icon={
<IconPlusMini />
}
type="secondary"
fullWidth={
false
}
onClick={() => {
if (
!value
) {
onChange(
[
'Other',
]
)
} else {
onChange(
[
...value,
'Other',
]
)
{featureFlags[
FEATURE_FLAGS
.SURVEYS_OPEN_CHOICE
] &&
!hasOpenChoice && (
<LemonButton
icon={
<IconPlusMini />
}
toggleHasOpenChoice(
true
)
}}
>
Add
open-ended
choice
</LemonButton>
)}
type="secondary"
fullWidth={
false
}
onClick={() => {
if (
!value
) {
onChange(
[
'Other',
]
)
} else {
onChange(
[
...value,
'Other',
]
)
}
toggleHasOpenChoice(
true
)
}}
>
Add
open-ended
choice
</LemonButton>
)}
</>
)}
</div>
Expand Down

0 comments on commit 5f6e616

Please sign in to comment.