1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-31 13:47:02 +02:00

feat: hide archive UI behind flag (#8591)

This new UI needs more work and we are soon making 6.4 release, I do not
want to release it without flag. Putting it behind flag.
This commit is contained in:
Jaanus Sellin 2024-10-30 11:52:01 +02:00 committed by GitHub
parent c1dcbde8d9
commit 65c7f77980
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 22 additions and 9 deletions

View File

@ -6,6 +6,7 @@ import {
type IFilterItem,
} from 'component/filter/Filters/Filters';
import { useProjectFlagCreators } from 'hooks/api/getters/useProjectFlagCreators/useProjectFlagCreators';
import { useUiFlag } from 'hooks/useUiFlag';
interface IProjectOverviewFilters {
state: FilterItemParamHolder;
@ -21,6 +22,7 @@ export const ProjectOverviewFilters: VFC<IProjectOverviewFilters> = ({
const { tags } = useAllTags();
const { flagCreators } = useProjectFlagCreators(project);
const [availableFilters, setAvailableFilters] = useState<IFilterItem[]>([]);
const simplifyProjectOverview = useUiFlag('simplifyProjectOverview');
useEffect(() => {
const tagsOptions = (tags || []).map((tag) => ({
@ -95,14 +97,18 @@ export const ProjectOverviewFilters: VFC<IProjectOverviewFilters> = ({
singularOperators: ['IS', 'IS_NOT'],
pluralOperators: ['IS_ANY_OF', 'IS_NONE_OF'],
},
{
label: 'Show only archived',
icon: 'inventory',
options: [{ label: 'True', value: 'true' }],
filterKey: 'archived',
singularOperators: ['IS'],
pluralOperators: ['IS_ANY_OF'],
},
...(simplifyProjectOverview
? ([
{
label: 'Show only archived',
icon: 'inventory',
options: [{ label: 'True', value: 'true' }],
filterKey: 'archived',
singularOperators: ['IS'],
pluralOperators: ['IS_ANY_OF'],
},
] as IFilterItem[])
: []),
];
setAvailableFilters(availableFilters);

View File

@ -91,6 +91,7 @@ export type UiFlags = {
purchaseAdditionalEnvironments?: boolean;
unleashAI?: boolean;
releasePlans?: boolean;
simplifyProjectOverview?: boolean;
};
export interface IVersionInfo {

View File

@ -61,7 +61,8 @@ export type IFlagKey =
| 'addonUsageMetrics'
| 'releasePlans'
| 'navigationSidebar'
| 'productivityReportEmail';
| 'productivityReportEmail'
| 'simplifyProjectOverview';
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
@ -306,6 +307,10 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_PRODUCTIVITY_REPORT_EMAIL,
false,
),
simplifyProjectOverview: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_SIMPLIFY_PROJECT_OVERVIEW,
false,
),
};
export const defaultExperimentalOptions: IExperimentalOptions = {

View File

@ -57,6 +57,7 @@ process.nextTick(async () => {
webhookDomainLogging: true,
addonUsageMetrics: true,
releasePlans: false,
simplifyProjectOverview: true,
},
},
authentication: {