mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
remove feature flag: toggle tag filtering (#2668)
https://linear.app/unleash/issue/2-482/clean-up-feature-flag-after-this-goes-ga Relevant discussion: https://unleash-internal.slack.com/archives/C046LV6HH6W/p1670837328201169
This commit is contained in:
parent
a3fdef11ab
commit
e8d0fdba1f
@ -43,6 +43,7 @@ import { ColumnsMenu } from './ColumnsMenu/ColumnsMenu';
|
||||
import { useStyles } from './ProjectFeatureToggles.styles';
|
||||
import { usePinnedFavorites } from 'hooks/usePinnedFavorites';
|
||||
import { useFavoriteFeaturesApi } from 'hooks/api/actions/useFavoriteFeaturesApi/useFavoriteFeaturesApi';
|
||||
import { FeatureTagCell } from 'component/common/Table/cells/FeatureTagCell/FeatureTagCell';
|
||||
|
||||
interface IProjectFeatureTogglesProps {
|
||||
features: IProject['features'];
|
||||
@ -239,20 +240,18 @@ export const ProjectFeatureToggles = ({
|
||||
sortType: 'alphanumeric',
|
||||
searchable: true,
|
||||
},
|
||||
// FIXME: no tags on project feature toggles from backend
|
||||
// {
|
||||
// id: 'tags',
|
||||
// Header: 'Tags',
|
||||
// accessor: (row: IFeatureToggleListItem) =>
|
||||
// row.tags
|
||||
// ?.map(({ type, value }) => `${type}:${value}`)
|
||||
// .join('\n') || '',
|
||||
// Cell: FeatureTagCell,
|
||||
// width: 80,
|
||||
// hideInMenu: true,
|
||||
// searchable: true,
|
||||
// isVisible: false,
|
||||
// },
|
||||
{
|
||||
id: 'tags',
|
||||
Header: 'Tags',
|
||||
accessor: (row: IFeatureToggleListItem) =>
|
||||
row.tags
|
||||
?.map(({ type, value }) => `${type}:${value}`)
|
||||
.join('\n') || '',
|
||||
Cell: FeatureTagCell,
|
||||
width: 80,
|
||||
hideInMenu: true,
|
||||
searchable: true,
|
||||
},
|
||||
{
|
||||
Header: 'Created',
|
||||
accessor: 'createdAt',
|
||||
@ -429,16 +428,15 @@ export const ProjectFeatureToggles = ({
|
||||
useSortBy
|
||||
);
|
||||
|
||||
// TODO: update after tags are added, move to other useEffect
|
||||
// useEffect(() => {
|
||||
// if (!features.some(({ tags }) => tags?.length)) {
|
||||
// setHiddenColumns(hiddenColumns => [...hiddenColumns, 'tags']);
|
||||
// } else {
|
||||
// setHiddenColumns(hiddenColumns =>
|
||||
// hiddenColumns.filter(column => column !== 'tags')
|
||||
// );
|
||||
// }
|
||||
// }, [setHiddenColumns, features]);
|
||||
useEffect(() => {
|
||||
if (!features.some(({ tags }) => tags?.length)) {
|
||||
setHiddenColumns(hiddenColumns => [...hiddenColumns, 'tags']);
|
||||
} else {
|
||||
setHiddenColumns(hiddenColumns =>
|
||||
hiddenColumns.filter(column => column !== 'tags')
|
||||
);
|
||||
}
|
||||
}, [setHiddenColumns, features]);
|
||||
|
||||
useEffect(() => {
|
||||
if (loading) {
|
||||
|
@ -77,7 +77,6 @@ exports[`should create default config 1`] = `
|
||||
"networkView": false,
|
||||
"proxyReturnAllToggles": false,
|
||||
"responseTimeWithAppName": false,
|
||||
"toggleTagFiltering": false,
|
||||
"tokensLastSeen": false,
|
||||
"variantsPerEnvironment": false,
|
||||
},
|
||||
@ -94,7 +93,6 @@ exports[`should create default config 1`] = `
|
||||
"networkView": false,
|
||||
"proxyReturnAllToggles": false,
|
||||
"responseTimeWithAppName": false,
|
||||
"toggleTagFiltering": false,
|
||||
"tokensLastSeen": false,
|
||||
"variantsPerEnvironment": false,
|
||||
},
|
||||
|
@ -427,7 +427,8 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
|
||||
'environments',
|
||||
'feature_environments.environment',
|
||||
'environments.name',
|
||||
);
|
||||
)
|
||||
.leftJoin('feature_tag as ft', 'ft.feature_name', 'features.name');
|
||||
|
||||
let selectColumns = [
|
||||
'features.name as feature_name',
|
||||
@ -439,20 +440,10 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
|
||||
'feature_environments.environment as environment',
|
||||
'environments.type as environment_type',
|
||||
'environments.sort_order as environment_sort_order',
|
||||
'ft.tag_value as tag_value',
|
||||
'ft.tag_type as tag_type',
|
||||
] as (string | Raw<any>)[];
|
||||
|
||||
if (this.flagResolver.isEnabled('toggleTagFiltering')) {
|
||||
query = query.leftJoin(
|
||||
'feature_tag as ft',
|
||||
'ft.feature_name',
|
||||
'features.name',
|
||||
);
|
||||
selectColumns = [
|
||||
...selectColumns,
|
||||
'ft.tag_value as tag_value',
|
||||
'ft.tag_type as tag_type',
|
||||
];
|
||||
}
|
||||
if (userId && this.flagResolver.isEnabled('favorites')) {
|
||||
query = query.leftJoin(`favorite_features`, function () {
|
||||
this.on('favorite_features.feature', 'features.name').andOnVal(
|
||||
|
@ -135,18 +135,16 @@ export default class FeatureToggleClientStore
|
||||
.leftJoin('segments', `segments.id`, `fss.segment_id`);
|
||||
|
||||
if (isAdmin) {
|
||||
if (this.flagResolver.isEnabled('toggleTagFiltering')) {
|
||||
query = query.leftJoin(
|
||||
'feature_tag as ft',
|
||||
'ft.feature_name',
|
||||
'features.name',
|
||||
);
|
||||
selectColumns = [
|
||||
...selectColumns,
|
||||
'ft.tag_value as tag_value',
|
||||
'ft.tag_type as tag_type',
|
||||
];
|
||||
}
|
||||
query = query.leftJoin(
|
||||
'feature_tag as ft',
|
||||
'ft.feature_name',
|
||||
'features.name',
|
||||
);
|
||||
selectColumns = [
|
||||
...selectColumns,
|
||||
'ft.tag_value as tag_value',
|
||||
'ft.tag_type as tag_type',
|
||||
];
|
||||
|
||||
if (userId && this.flagResolver.isEnabled('favorites')) {
|
||||
query = query.leftJoin(`favorite_features`, function () {
|
||||
|
@ -26,10 +26,6 @@ export const defaultExperimentalOptions = {
|
||||
process.env.UNLEASH_EXPERIMENTAL_RESPONSE_TIME_WITH_APP_NAME,
|
||||
false,
|
||||
),
|
||||
toggleTagFiltering: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_EXPERIMENTAL_TOGGLE_TAG_FILTERING,
|
||||
false,
|
||||
),
|
||||
proxyReturnAllToggles: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_EXPERIMENTAL_PROXY_RETURN_ALL_TOGGLES,
|
||||
false,
|
||||
|
@ -40,7 +40,6 @@ process.nextTick(async () => {
|
||||
anonymiseEventLog: false,
|
||||
responseTimeWithAppName: true,
|
||||
changeRequests: true,
|
||||
toggleTagFiltering: true,
|
||||
favorites: true,
|
||||
variantsPerEnvironment: true,
|
||||
networkView: true,
|
||||
|
Loading…
Reference in New Issue
Block a user