1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-15 01:16:22 +02:00

feat: setup ff (#6532)

Setup feature flag for the new refactoring of the project overview page

---------

Co-authored-by: sjaanus <sellinjaanus@gmail.com>
This commit is contained in:
Fredrik Strand Oseberg 2024-03-18 12:38:59 +01:00 committed by GitHub
parent a86b8d36b3
commit 3621c7282d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 23 additions and 1 deletions

View File

@ -43,6 +43,7 @@ import { UiFlags } from 'interfaces/uiConfig';
import { HiddenProjectIconWithTooltip } from './HiddenProjectIconWithTooltip/HiddenProjectIconWithTooltip';
import { ChangeRequestPlausibleProvider } from 'component/changeRequest/ChangeRequestContext';
import { ProjectApplications } from '../ProjectApplications/ProjectApplications';
import { useUiFlag } from 'hooks/useUiFlag';
const StyledBadge = styled(Badge)(({ theme }) => ({
position: 'absolute',
@ -76,6 +77,8 @@ export const Project = () => {
const projectName = project?.name || projectId;
const { favorite, unfavorite } = useFavoriteProjectsApi();
const projectOverviewRefactor = useUiFlag('projectOverviewRefactor');
const [showDelDialog, setShowDelDialog] = useState(false);
const [
@ -129,6 +132,14 @@ export const Project = () => {
},
];
if (projectOverviewRefactor) {
tabs.splice(1, 0, {
title: 'Insights',
path: `${basePath}/insights`,
name: 'insights',
});
}
const filteredTabs = tabs
.filter((tab) => {
if (tab.flag) {
@ -299,6 +310,9 @@ export const Project = () => {
/>
<Route path='environments' element={<ProjectEnvironment />} />
<Route path='archive' element={<ProjectFeaturesArchive />} />
{Boolean(projectOverviewRefactor) && (
<Route path='insights' element={<div>Hello world</div>} />
)}
<Route path='logs' element={<ProjectLog />} />
<Route
path='change-requests'

View File

@ -79,6 +79,7 @@ export type UiFlags = {
userAccessUIEnabled?: boolean;
sdkReporting?: boolean;
outdatedSdksBanner?: boolean;
projectOverviewRefactor?: string;
};
export interface IVersionInfo {

View File

@ -132,6 +132,7 @@ exports[`should create default config 1`] = `
"newStrategyConfigurationFeedback": false,
"outdatedSdksBanner": false,
"personalAccessTokensKillSwitch": false,
"projectOverviewRefactor": false,
"queryMissingTokens": false,
"responseTimeMetricsFix": false,
"responseTimeWithAppNameKillSwitch": false,

View File

@ -55,7 +55,8 @@ export type IFlagKey =
| 'scimApi'
| 'displayEdgeBanner'
| 'globalFrontendApiCache'
| 'returnGlobalFrontendApiCache';
| 'returnGlobalFrontendApiCache'
| 'projectOverviewRefactor';
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
@ -272,6 +273,10 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_RETURN_GLOBAL_FRONTEND_API_CACHE,
false,
),
projectOverviewRefactor: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_PROJECT_OVERVIEW_REFACTOR,
false,
),
};
export const defaultExperimentalOptions: IExperimentalOptions = {

View File

@ -53,6 +53,7 @@ process.nextTick(async () => {
outdatedSdksBanner: true,
globalFrontendApiCache: true,
returnGlobalFrontendApiCache: false,
projectOverviewRefactor: true,
},
},
authentication: {