Skip to content

Commit

Permalink
chore: project overview refactor feedback behind a flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Apr 3, 2024
1 parent a664a44 commit b9d9192
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
9 changes: 8 additions & 1 deletion frontend/src/component/project/Project/ProjectOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,18 @@ const useDelayedFeedbackPrompt = () => {
'newProjectOverview',
'manual',
);
const projectOverviewRefactorFeedback = useUiFlag(
'projectOverviewRefactorFeedback',
);

const [seenFeedback, setSeenFeedback] = useState(false);
useEffect(() => {
const timer = setTimeout(() => {
if (!seenFeedback && !hasSubmittedFeedback) {
if (
projectOverviewRefactorFeedback &&
!seenFeedback &&
!hasSubmittedFeedback
) {
openFeedback({
title: 'How easy was it to work with the project overview in Unleash?',
positiveLabel:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/interfaces/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export type UiFlags = {
collectTrafficDataUsage?: boolean;
newContextFieldsUI?: boolean;
variantDependencies?: boolean;
projectOverviewRefactorFeedback?: boolean;
};

export interface IVersionInfo {
Expand Down
1 change: 1 addition & 0 deletions src/lib/__snapshots__/create-config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ exports[`should create default config 1`] = `
"outdatedSdksBanner": false,
"personalAccessTokensKillSwitch": false,
"projectOverviewRefactor": false,
"projectOverviewRefactorFeedback": false,
"queryMissingTokens": false,
"responseTimeMetricsFix": false,
"responseTimeWithAppNameKillSwitch": false,
Expand Down
7 changes: 6 additions & 1 deletion src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export type IFlagKey =
| 'projectOverviewRefactor'
| 'variantDependencies'
| 'newContextFieldsUI'
| 'bearerTokenMiddleware';
| 'bearerTokenMiddleware'
| 'projectOverviewRefactorFeedback';

export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;

Expand Down Expand Up @@ -277,6 +278,10 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_BEARER_TOKEN_MIDDLEWARE,
false,
),
projectOverviewRefactorFeedback: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_PROJECT_OVERVIEW_REFACTOR_FEEDBACK,
false,
),
};

export const defaultExperimentalOptions: IExperimentalOptions = {
Expand Down
1 change: 1 addition & 0 deletions src/server-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ process.nextTick(async () => {
projectOverviewRefactor: true,
newContextFieldsUI: true,
variantDependencies: true,
projectOverviewRefactorFeedback: true,
},
},
authentication: {
Expand Down

0 comments on commit b9d9192

Please sign in to comment.