Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: A/B test search feedback variants #6085

Merged
merged 5 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useCallback, useEffect, useMemo, useState, VFC } from 'react';
import {
Box,
Button,
IconButton,
Link,
Tooltip,
Expand Down Expand Up @@ -352,19 +353,69 @@ export const FeatureToggleListTable: VFC = () => {
<FeatureToggleListActions
onExportClick={() => setShowExportDialog(true)}
/>
<ConditionallyRender
condition={featureSearchFeedback}
show={
<Tooltip title='Provide feedback' arrow>
<IconButton
onClick={createFeedbackContext}
size='large'
>
<ReviewsOutlined />
</IconButton>
</Tooltip>
}
/>
{featureSearchFeedback !== false &&
featureSearchFeedback?.enabled && (
<>
<ConditionallyRender
condition={
featureSearchFeedback.name ===
'withoutText'
}
show={
<Tooltip
title='Provide feedback'
arrow
>
<IconButton
onClick={
createFeedbackContext
}
size='large'
>
<ReviewsOutlined />
</IconButton>
</Tooltip>
}
/>
<ConditionallyRender
condition={
featureSearchFeedback.name ===
'withText'
}
show={
<Button
startIcon={
<ReviewsOutlined />
}
onClick={
createFeedbackContext
}
>
Provide feedback
</Button>
}
/>{' '}
<ConditionallyRender
condition={
featureSearchFeedback.name ===
'withTextOutlined'
}
show={
<Button
startIcon={
<ReviewsOutlined />
}
onClick={
createFeedbackContext
}
variant='outlined'
>
Provide feedback
</Button>
}
/>
</>
)}
</>
}
>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/interfaces/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export type UiFlags = {
automatedActions?: boolean;
celebrateUnleash?: boolean;
increaseUnleashWidth?: boolean;
featureSearchFeedback?: boolean;
featureSearchFeedback?: Variant;
enableLicense?: boolean;
newStrategyConfigurationFeedback?: boolean;
extendedUsageMetricsUI?: boolean;
Expand Down
9 changes: 8 additions & 1 deletion src/lib/__snapshots__/create-config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,14 @@ exports[`should create default config 1`] = `
"executiveDashboard": false,
"extendedUsageMetrics": false,
"extendedUsageMetricsUI": false,
"featureSearchFeedback": false,
"featureSearchFeedback": {
"enabled": true,
"name": "withText",
"payload": {
"type": "json",
"value": "",
},
},
"featureSearchFeedbackPosting": false,
"featuresExportImport": true,
"feedbackComments": {
Expand Down
17 changes: 13 additions & 4 deletions src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,19 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_INCREASE_UNLEASH_WIDTH,
false,
),
featureSearchFeedback: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_FEATURE_SEARCH_FEEDBACK,
false,
),
featureSearchFeedback: {
name: 'withText',
enabled: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_FEATURE_SEARCH_FEEDBACK,
true,
),
payload: {
type: PayloadType.JSON,
value:
process.env
.UNLEASH_EXPERIMENTAL_FEATURE_SEARCH_FEEDBACK_PAYLOAD ?? '',
},
},
featureSearchFeedbackPosting: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_FEATURE_SEARCH_FEEDBACK_POSTING,
false,
Expand Down
1 change: 0 additions & 1 deletion src/server-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ process.nextTick(async () => {
stripHeadersOnAPI: true,
celebrateUnleash: true,
increaseUnleashWidth: true,
featureSearchFeedback: true,
newStrategyConfigurationFeedback: true,
extendedUsageMetricsUI: true,
executiveDashboard: true,
Expand Down
Loading