future: add the guided tour future flag (#23832)

This commit is contained in:
markkaylor 2025-06-27 15:06:40 +02:00 committed by GitHub
parent bdbc9ea979
commit 07ae8e84c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,5 @@
module.exports = ({ env }) => ({ module.exports = ({ env }) => ({
future: {}, future: {
unstableGuidedTour: false,
},
}); });

View File

@ -97,9 +97,12 @@ const UnstableGuidedTourTooltip = ({
requiredActions?.every((action) => { requiredActions?.every((action) => {
return guidedTourMeta?.data?.completedActions.includes(action); return guidedTourMeta?.data?.completedActions.includes(action);
}) ?? true; }) ?? true;
const hasFutureFlag = window.strapi.future.isEnabled('unstableGuidedTour');
const isEnabled = const isEnabled =
guidedTourMeta?.data?.isFirstSuperAdminUser && !state.tours[tourName].isCompleted; guidedTourMeta?.data?.isFirstSuperAdminUser &&
!state.tours[tourName].isCompleted &&
hasFutureFlag;
const isPopoverOpen = isEnabled && isCurrentStep && hasCompletedRequiredActions; const isPopoverOpen = isEnabled && isCurrentStep && hasCompletedRequiredActions;
// Lock the scroll // Lock the scroll

View File

@ -1,5 +1,7 @@
export interface FeaturesConfig { export interface FeaturesConfig {
future?: object; future?: {
unstableGuidedTour?: boolean;
};
} }
export interface FeaturesService { export interface FeaturesService {
@ -9,5 +11,6 @@ export interface FeaturesService {
config: FeaturesConfig | undefined; config: FeaturesConfig | undefined;
future: { future: {
isEnabled: (futureFlagName: string) => boolean; isEnabled: (futureFlagName: string) => boolean;
unstableGuidedTour?: boolean;
}; };
} }