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:
parent
e0ea257f07
commit
a664a449ef
@ -45,8 +45,6 @@ import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
|||||||
import { formatStrategyName } from 'utils/strategyNames';
|
import { formatStrategyName } from 'utils/strategyNames';
|
||||||
import { Badge } from 'component/common/Badge/Badge';
|
import { Badge } from 'component/common/Badge/Badge';
|
||||||
import EnvironmentIcon from 'component/common/EnvironmentIcon/EnvironmentIcon';
|
import EnvironmentIcon from 'component/common/EnvironmentIcon/EnvironmentIcon';
|
||||||
import { useFeedback } from 'component/feedbackNew/useFeedback';
|
|
||||||
import { useUiFlag } from 'hooks/useUiFlag';
|
|
||||||
|
|
||||||
interface IFeatureStrategyFormProps {
|
interface IFeatureStrategyFormProps {
|
||||||
feature: IFeatureToggle;
|
feature: IFeatureToggle;
|
||||||
@ -187,8 +185,6 @@ const StyledBadge = styled(Badge)(({ theme }) => ({
|
|||||||
marginLeft: theme.spacing(1),
|
marginLeft: theme.spacing(1),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const feedbackCategory = 'newStrategyForm';
|
|
||||||
|
|
||||||
export const FeatureStrategyForm = ({
|
export const FeatureStrategyForm = ({
|
||||||
projectId,
|
projectId,
|
||||||
feature,
|
feature,
|
||||||
@ -207,10 +203,6 @@ export const FeatureStrategyForm = ({
|
|||||||
setTab,
|
setTab,
|
||||||
StrategyVariants,
|
StrategyVariants,
|
||||||
}: IFeatureStrategyFormProps) => {
|
}: IFeatureStrategyFormProps) => {
|
||||||
const { openFeedback, hasSubmittedFeedback } = useFeedback(
|
|
||||||
feedbackCategory,
|
|
||||||
'manual',
|
|
||||||
);
|
|
||||||
const { trackEvent } = usePlausibleTracker();
|
const { trackEvent } = usePlausibleTracker();
|
||||||
const [showProdGuard, setShowProdGuard] = useState(false);
|
const [showProdGuard, setShowProdGuard] = useState(false);
|
||||||
const hasValidConstraints = useConstraintsValidation(strategy.constraints);
|
const hasValidConstraints = useConstraintsValidation(strategy.constraints);
|
||||||
@ -221,9 +213,6 @@ export const FeatureStrategyForm = ({
|
|||||||
environmentId,
|
environmentId,
|
||||||
);
|
);
|
||||||
const { strategyDefinition } = useStrategy(strategy?.name);
|
const { strategyDefinition } = useStrategy(strategy?.name);
|
||||||
const newStrategyConfigurationFeedback = useUiFlag(
|
|
||||||
'newStrategyConfigurationFeedback',
|
|
||||||
);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
trackEvent('new-strategy-form', {
|
trackEvent('new-strategy-form', {
|
||||||
@ -312,15 +301,6 @@ export const FeatureStrategyForm = ({
|
|||||||
navigate(formatFeaturePath(feature.project, feature.name));
|
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) => {
|
const onSubmitWithValidation = async (event: React.FormEvent) => {
|
||||||
if (Array.isArray(strategy.variants) && strategy.variants?.length > 0) {
|
if (Array.isArray(strategy.variants) && strategy.variants?.length > 0) {
|
||||||
trackEvent('strategy-variants', {
|
trackEvent('strategy-variants', {
|
||||||
@ -343,19 +323,7 @@ export const FeatureStrategyForm = ({
|
|||||||
if (enableProdGuard && !isChangeRequest) {
|
if (enableProdGuard && !isChangeRequest) {
|
||||||
setShowProdGuard(true);
|
setShowProdGuard(true);
|
||||||
} else {
|
} else {
|
||||||
await onSubmitWithFeedback();
|
onSubmit();
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const onSubmitWithFeedback = async () => {
|
|
||||||
try {
|
|
||||||
await onSubmit();
|
|
||||||
|
|
||||||
if (newStrategyConfigurationFeedback && !hasSubmittedFeedback) {
|
|
||||||
createFeedbackContext();
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -584,7 +552,7 @@ export const FeatureStrategyForm = ({
|
|||||||
<FeatureStrategyProdGuard
|
<FeatureStrategyProdGuard
|
||||||
open={showProdGuard}
|
open={showProdGuard}
|
||||||
onClose={() => setShowProdGuard(false)}
|
onClose={() => setShowProdGuard(false)}
|
||||||
onClick={onSubmitWithFeedback}
|
onClick={onSubmit}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
label='Save strategy'
|
label='Save strategy'
|
||||||
/>
|
/>
|
||||||
|
@ -2,7 +2,6 @@ import { createLocalStorage } from '../utils/createLocalStorage';
|
|||||||
|
|
||||||
export type IFeedbackCategory =
|
export type IFeedbackCategory =
|
||||||
| 'search'
|
| 'search'
|
||||||
| 'newStrategyForm'
|
|
||||||
| 'insights'
|
| 'insights'
|
||||||
| 'applicationOverview'
|
| 'applicationOverview'
|
||||||
| 'newProjectOverview';
|
| 'newProjectOverview';
|
||||||
|
@ -67,7 +67,6 @@ export type UiFlags = {
|
|||||||
celebrateUnleash?: boolean;
|
celebrateUnleash?: boolean;
|
||||||
featureSearchFeedback?: Variant;
|
featureSearchFeedback?: Variant;
|
||||||
enableLicense?: boolean;
|
enableLicense?: boolean;
|
||||||
newStrategyConfigurationFeedback?: boolean;
|
|
||||||
adminTokenKillSwitch?: boolean;
|
adminTokenKillSwitch?: boolean;
|
||||||
executiveDashboardUI?: boolean;
|
executiveDashboardUI?: boolean;
|
||||||
feedbackComments?: Variant;
|
feedbackComments?: Variant;
|
||||||
|
@ -130,7 +130,6 @@ exports[`should create default config 1`] = `
|
|||||||
},
|
},
|
||||||
"migrationLock": true,
|
"migrationLock": true,
|
||||||
"newContextFieldsUI": false,
|
"newContextFieldsUI": false,
|
||||||
"newStrategyConfigurationFeedback": false,
|
|
||||||
"outdatedSdksBanner": false,
|
"outdatedSdksBanner": false,
|
||||||
"personalAccessTokensKillSwitch": false,
|
"personalAccessTokensKillSwitch": false,
|
||||||
"projectOverviewRefactor": false,
|
"projectOverviewRefactor": false,
|
||||||
|
@ -32,7 +32,6 @@ export type IFlagKey =
|
|||||||
| 'celebrateUnleash'
|
| 'celebrateUnleash'
|
||||||
| 'featureSearchFeedback'
|
| 'featureSearchFeedback'
|
||||||
| 'featureSearchFeedbackPosting'
|
| 'featureSearchFeedbackPosting'
|
||||||
| 'newStrategyConfigurationFeedback'
|
|
||||||
| 'edgeBulkMetrics'
|
| 'edgeBulkMetrics'
|
||||||
| 'extendedUsageMetrics'
|
| 'extendedUsageMetrics'
|
||||||
| 'adminTokenKillSwitch'
|
| 'adminTokenKillSwitch'
|
||||||
@ -165,10 +164,6 @@ const flags: IFlags = {
|
|||||||
process.env.UNLEASH_EXPERIMENTAL_FEATURE_SEARCH_FEEDBACK_POSTING,
|
process.env.UNLEASH_EXPERIMENTAL_FEATURE_SEARCH_FEEDBACK_POSTING,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
newStrategyConfigurationFeedback: parseEnvVarBoolean(
|
|
||||||
process.env.UNLEASH_EXPERIMENTAL_NEW_STRATEGY_CONFIGURATION_FEEDBACK,
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
encryptEmails: parseEnvVarBoolean(
|
encryptEmails: parseEnvVarBoolean(
|
||||||
process.env.UNLEASH_EXPERIMENTAL_ENCRYPT_EMAILS,
|
process.env.UNLEASH_EXPERIMENTAL_ENCRYPT_EMAILS,
|
||||||
false,
|
false,
|
||||||
|
@ -43,7 +43,6 @@ process.nextTick(async () => {
|
|||||||
stripClientHeadersOn304: true,
|
stripClientHeadersOn304: true,
|
||||||
stripHeadersOnAPI: true,
|
stripHeadersOnAPI: true,
|
||||||
celebrateUnleash: true,
|
celebrateUnleash: true,
|
||||||
newStrategyConfigurationFeedback: true,
|
|
||||||
featureSearchFeedbackPosting: true,
|
featureSearchFeedbackPosting: true,
|
||||||
executiveDashboard: true,
|
executiveDashboard: true,
|
||||||
executiveDashboardUI: true,
|
executiveDashboardUI: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user