1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00

chore: remove strategy form feedback (#6769)

This commit is contained in:
Jaanus Sellin 2024-04-03 13:16:58 +03:00 committed by GitHub
parent e0ea257f07
commit a664a449ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 2 additions and 43 deletions

View File

@ -45,8 +45,6 @@ import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
import { formatStrategyName } from 'utils/strategyNames';
import { Badge } from 'component/common/Badge/Badge';
import EnvironmentIcon from 'component/common/EnvironmentIcon/EnvironmentIcon';
import { useFeedback } from 'component/feedbackNew/useFeedback';
import { useUiFlag } from 'hooks/useUiFlag';
interface IFeatureStrategyFormProps {
feature: IFeatureToggle;
@ -187,8 +185,6 @@ const StyledBadge = styled(Badge)(({ theme }) => ({
marginLeft: theme.spacing(1),
}));
const feedbackCategory = 'newStrategyForm';
export const FeatureStrategyForm = ({
projectId,
feature,
@ -207,10 +203,6 @@ export const FeatureStrategyForm = ({
setTab,
StrategyVariants,
}: IFeatureStrategyFormProps) => {
const { openFeedback, hasSubmittedFeedback } = useFeedback(
feedbackCategory,
'manual',
);
const { trackEvent } = usePlausibleTracker();
const [showProdGuard, setShowProdGuard] = useState(false);
const hasValidConstraints = useConstraintsValidation(strategy.constraints);
@ -221,9 +213,6 @@ export const FeatureStrategyForm = ({
environmentId,
);
const { strategyDefinition } = useStrategy(strategy?.name);
const newStrategyConfigurationFeedback = useUiFlag(
'newStrategyConfigurationFeedback',
);
useEffect(() => {
trackEvent('new-strategy-form', {
@ -312,15 +301,6 @@ export const FeatureStrategyForm = ({
navigate(formatFeaturePath(feature.project, feature.name));
};
const createFeedbackContext = () => {
openFeedback({
title: 'How easy was it to work with the new strategy form?',
positiveLabel: 'What do you like most about the new strategy form?',
areasForImprovementsLabel:
'What should be improved the new strategy form?',
});
};
const onSubmitWithValidation = async (event: React.FormEvent) => {
if (Array.isArray(strategy.variants) && strategy.variants?.length > 0) {
trackEvent('strategy-variants', {
@ -343,19 +323,7 @@ export const FeatureStrategyForm = ({
if (enableProdGuard && !isChangeRequest) {
setShowProdGuard(true);
} else {
await onSubmitWithFeedback();
}
};
const onSubmitWithFeedback = async () => {
try {
await onSubmit();
if (newStrategyConfigurationFeedback && !hasSubmittedFeedback) {
createFeedbackContext();
}
} catch (e) {
console.error(e);
onSubmit();
}
};
@ -584,7 +552,7 @@ export const FeatureStrategyForm = ({
<FeatureStrategyProdGuard
open={showProdGuard}
onClose={() => setShowProdGuard(false)}
onClick={onSubmitWithFeedback}
onClick={onSubmit}
loading={loading}
label='Save strategy'
/>

View File

@ -2,7 +2,6 @@ import { createLocalStorage } from '../utils/createLocalStorage';
export type IFeedbackCategory =
| 'search'
| 'newStrategyForm'
| 'insights'
| 'applicationOverview'
| 'newProjectOverview';

View File

@ -67,7 +67,6 @@ export type UiFlags = {
celebrateUnleash?: boolean;
featureSearchFeedback?: Variant;
enableLicense?: boolean;
newStrategyConfigurationFeedback?: boolean;
adminTokenKillSwitch?: boolean;
executiveDashboardUI?: boolean;
feedbackComments?: Variant;

View File

@ -130,7 +130,6 @@ exports[`should create default config 1`] = `
},
"migrationLock": true,
"newContextFieldsUI": false,
"newStrategyConfigurationFeedback": false,
"outdatedSdksBanner": false,
"personalAccessTokensKillSwitch": false,
"projectOverviewRefactor": false,

View File

@ -32,7 +32,6 @@ export type IFlagKey =
| 'celebrateUnleash'
| 'featureSearchFeedback'
| 'featureSearchFeedbackPosting'
| 'newStrategyConfigurationFeedback'
| 'edgeBulkMetrics'
| 'extendedUsageMetrics'
| 'adminTokenKillSwitch'
@ -165,10 +164,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_FEATURE_SEARCH_FEEDBACK_POSTING,
false,
),
newStrategyConfigurationFeedback: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_NEW_STRATEGY_CONFIGURATION_FEEDBACK,
false,
),
encryptEmails: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_ENCRYPT_EMAILS,
false,

View File

@ -43,7 +43,6 @@ process.nextTick(async () => {
stripClientHeadersOn304: true,
stripHeadersOnAPI: true,
celebrateUnleash: true,
newStrategyConfigurationFeedback: true,
featureSearchFeedbackPosting: true,
executiveDashboard: true,
executiveDashboardUI: true,