mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-27 01:19:00 +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:
parent
a86b8d36b3
commit
3621c7282d
@ -43,6 +43,7 @@ import { UiFlags } from 'interfaces/uiConfig';
|
|||||||
import { HiddenProjectIconWithTooltip } from './HiddenProjectIconWithTooltip/HiddenProjectIconWithTooltip';
|
import { HiddenProjectIconWithTooltip } from './HiddenProjectIconWithTooltip/HiddenProjectIconWithTooltip';
|
||||||
import { ChangeRequestPlausibleProvider } from 'component/changeRequest/ChangeRequestContext';
|
import { ChangeRequestPlausibleProvider } from 'component/changeRequest/ChangeRequestContext';
|
||||||
import { ProjectApplications } from '../ProjectApplications/ProjectApplications';
|
import { ProjectApplications } from '../ProjectApplications/ProjectApplications';
|
||||||
|
import { useUiFlag } from 'hooks/useUiFlag';
|
||||||
|
|
||||||
const StyledBadge = styled(Badge)(({ theme }) => ({
|
const StyledBadge = styled(Badge)(({ theme }) => ({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
@ -76,6 +77,8 @@ export const Project = () => {
|
|||||||
const projectName = project?.name || projectId;
|
const projectName = project?.name || projectId;
|
||||||
const { favorite, unfavorite } = useFavoriteProjectsApi();
|
const { favorite, unfavorite } = useFavoriteProjectsApi();
|
||||||
|
|
||||||
|
const projectOverviewRefactor = useUiFlag('projectOverviewRefactor');
|
||||||
|
|
||||||
const [showDelDialog, setShowDelDialog] = useState(false);
|
const [showDelDialog, setShowDelDialog] = useState(false);
|
||||||
|
|
||||||
const [
|
const [
|
||||||
@ -129,6 +132,14 @@ export const Project = () => {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (projectOverviewRefactor) {
|
||||||
|
tabs.splice(1, 0, {
|
||||||
|
title: 'Insights',
|
||||||
|
path: `${basePath}/insights`,
|
||||||
|
name: 'insights',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const filteredTabs = tabs
|
const filteredTabs = tabs
|
||||||
.filter((tab) => {
|
.filter((tab) => {
|
||||||
if (tab.flag) {
|
if (tab.flag) {
|
||||||
@ -299,6 +310,9 @@ export const Project = () => {
|
|||||||
/>
|
/>
|
||||||
<Route path='environments' element={<ProjectEnvironment />} />
|
<Route path='environments' element={<ProjectEnvironment />} />
|
||||||
<Route path='archive' element={<ProjectFeaturesArchive />} />
|
<Route path='archive' element={<ProjectFeaturesArchive />} />
|
||||||
|
{Boolean(projectOverviewRefactor) && (
|
||||||
|
<Route path='insights' element={<div>Hello world</div>} />
|
||||||
|
)}
|
||||||
<Route path='logs' element={<ProjectLog />} />
|
<Route path='logs' element={<ProjectLog />} />
|
||||||
<Route
|
<Route
|
||||||
path='change-requests'
|
path='change-requests'
|
||||||
|
@ -79,6 +79,7 @@ export type UiFlags = {
|
|||||||
userAccessUIEnabled?: boolean;
|
userAccessUIEnabled?: boolean;
|
||||||
sdkReporting?: boolean;
|
sdkReporting?: boolean;
|
||||||
outdatedSdksBanner?: boolean;
|
outdatedSdksBanner?: boolean;
|
||||||
|
projectOverviewRefactor?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IVersionInfo {
|
export interface IVersionInfo {
|
||||||
|
@ -132,6 +132,7 @@ exports[`should create default config 1`] = `
|
|||||||
"newStrategyConfigurationFeedback": false,
|
"newStrategyConfigurationFeedback": false,
|
||||||
"outdatedSdksBanner": false,
|
"outdatedSdksBanner": false,
|
||||||
"personalAccessTokensKillSwitch": false,
|
"personalAccessTokensKillSwitch": false,
|
||||||
|
"projectOverviewRefactor": false,
|
||||||
"queryMissingTokens": false,
|
"queryMissingTokens": false,
|
||||||
"responseTimeMetricsFix": false,
|
"responseTimeMetricsFix": false,
|
||||||
"responseTimeWithAppNameKillSwitch": false,
|
"responseTimeWithAppNameKillSwitch": false,
|
||||||
|
@ -55,7 +55,8 @@ export type IFlagKey =
|
|||||||
| 'scimApi'
|
| 'scimApi'
|
||||||
| 'displayEdgeBanner'
|
| 'displayEdgeBanner'
|
||||||
| 'globalFrontendApiCache'
|
| 'globalFrontendApiCache'
|
||||||
| 'returnGlobalFrontendApiCache';
|
| 'returnGlobalFrontendApiCache'
|
||||||
|
| 'projectOverviewRefactor';
|
||||||
|
|
||||||
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
|
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,
|
process.env.UNLEASH_EXPERIMENTAL_RETURN_GLOBAL_FRONTEND_API_CACHE,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
|
projectOverviewRefactor: parseEnvVarBoolean(
|
||||||
|
process.env.UNLEASH_EXPERIMENTAL_PROJECT_OVERVIEW_REFACTOR,
|
||||||
|
false,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
export const defaultExperimentalOptions: IExperimentalOptions = {
|
export const defaultExperimentalOptions: IExperimentalOptions = {
|
||||||
|
@ -53,6 +53,7 @@ process.nextTick(async () => {
|
|||||||
outdatedSdksBanner: true,
|
outdatedSdksBanner: true,
|
||||||
globalFrontendApiCache: true,
|
globalFrontendApiCache: true,
|
||||||
returnGlobalFrontendApiCache: false,
|
returnGlobalFrontendApiCache: false,
|
||||||
|
projectOverviewRefactor: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
authentication: {
|
authentication: {
|
||||||
|
Loading…
Reference in New Issue
Block a user