Skip to content

Commit

Permalink
chore: remove flagCreator flag (#7807)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew authored Aug 8, 2024
1 parent ce30c06 commit 3fe385e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ const FeatureOverviewMetaData = () => {
const [showDelDialog, setShowDelDialog] = useState(false);
const [showMarkCompletedDialogue, setShowMarkCompletedDialogue] =
useState(false);
const flagCreatorEnabled = useUiFlag('flagCreator');

const { locationSettings } = useLocationSettings();
const showDependentFeatures = useShowDependentFeatures(feature.project);
Expand Down Expand Up @@ -225,9 +224,7 @@ const FeatureOverviewMetaData = () => {
</StyledDetailsContainer>
</BodyItemWithIcon>
<ConditionallyRender
condition={
Boolean(feature.createdBy) && flagCreatorEnabled
}
condition={Boolean(feature.createdBy)}
show={() => (
<BodyItemWithIcon>
<StyledDetailsContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const ProjectFeatureToggles = ({
}: IPaginatedProjectFeatureTogglesProps) => {
const projectId = useRequiredPathParam('projectId');
const featureLifecycleEnabled = useUiFlag('featureLifecycle');
const flagCreatorEnabled = useUiFlag('flagCreator');

const {
features,
Expand All @@ -76,7 +75,7 @@ export const ProjectFeatureToggles = ({
createdAt: tableState.createdAt,
type: tableState.type,
state: tableState.state,
...(flagCreatorEnabled ? { createdBy: tableState.createdBy } : {}),
createdBy: tableState.createdBy,
};

const { favorite, unfavorite } = useFavoriteFeaturesApi();
Expand Down Expand Up @@ -168,20 +167,16 @@ export const ProjectFeatureToggles = ({
width: '1%',
},
}),
...(flagCreatorEnabled
? [
columnHelper.accessor('createdBy', {
id: 'createdBy',
header: 'By',
cell: AvatarCell(onAvatarClick),
enableSorting: false,
meta: {
width: '1%',
align: 'center',
},
}),
]
: []),
columnHelper.accessor('createdBy', {
id: 'createdBy',
header: 'By',
cell: AvatarCell(onAvatarClick),
enableSorting: false,
meta: {
width: '1%',
align: 'center',
},
}),
columnHelper.accessor('lastSeenAt', {
id: 'lastSeenAt',
header: 'Last seen',
Expand Down Expand Up @@ -425,16 +420,11 @@ export const ProjectFeatureToggles = ({
id: 'createdAt',
isVisible: columnVisibility.createdAt,
},
...(flagCreatorEnabled
? [
{
header: 'By',
id: 'createdBy',
isVisible:
columnVisibility.createdBy,
},
]
: []),
{
header: 'By',
id: 'createdBy',
isVisible: columnVisibility.createdBy,
},
{
header: 'Last seen',
id: 'lastSeenAt',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ 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;
Expand All @@ -22,7 +21,6 @@ export const ProjectOverviewFilters: VFC<IProjectOverviewFilters> = ({
const { tags } = useAllTags();
const { flagCreators } = useProjectFlagCreators(project);
const [availableFilters, setAvailableFilters] = useState<IFilterItem[]>([]);
const flagCreatorEnabled = useUiFlag('flagCreator');

useEffect(() => {
const tagsOptions = (tags || []).map((tag) => ({
Expand Down Expand Up @@ -89,24 +87,18 @@ export const ProjectOverviewFilters: VFC<IProjectOverviewFilters> = ({
singularOperators: ['IS', 'IS_NOT'],
pluralOperators: ['IS_ANY_OF', 'IS_NONE_OF'],
},
];
if (flagCreatorEnabled) {
availableFilters.push({
{
label: 'Created by',
icon: 'person',
options: flagCreatorsOptions,
filterKey: 'createdBy',
singularOperators: ['IS', 'IS_NOT'],
pluralOperators: ['IS_ANY_OF', 'IS_NONE_OF'],
});
}
},
];

setAvailableFilters(availableFilters);
}, [
JSON.stringify(tags),
JSON.stringify(flagCreators),
flagCreatorEnabled,
]);
}, [JSON.stringify(tags), JSON.stringify(flagCreators)]);

return (
<Filters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from 'utils/serializeQueryParams';
import { usePersistentTableState } from 'hooks/usePersistentTableState';
import mapValues from 'lodash.mapvalues';
import { useUiFlag } from 'hooks/useUiFlag';
import type { SearchFeaturesParams } from 'openapi';

type Attribute =
Expand All @@ -28,7 +27,6 @@ export const useProjectFeatureSearch = (
storageKey = 'project-overview-v2',
refreshInterval = 15 * 1000,
) => {
const flagCreatorEnabled = useUiFlag('flagCreator');
const stateConfig = {
offset: withDefault(NumberParam, 0),
limit: withDefault(NumberParam, DEFAULT_PAGE_LIMIT),
Expand All @@ -41,7 +39,7 @@ export const useProjectFeatureSearch = (
state: FilterItemParam,
createdAt: FilterItemParam,
type: FilterItemParam,
...(flagCreatorEnabled ? { createdBy: FilterItemParam } : {}),
createdBy: FilterItemParam,
};
const [tableState, setTableState] = usePersistentTableState(
`${storageKey}-${projectId}`,
Expand Down
1 change: 0 additions & 1 deletion src/lib/__snapshots__/create-config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ exports[`should create default config 1`] = `
},
},
"filterInvalidClientMetrics": false,
"flagCreator": false,
"googleAuthEnabled": false,
"improveCreateFlagFlow": false,
"insightsV2": false,
Expand Down
5 changes: 0 additions & 5 deletions src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export type IFlagKey =
| 'enableLegacyVariants'
| 'navigationSidebar'
| 'commandBarUI'
| 'flagCreator'
| 'anonymizeProjectOwners'
| 'resourceLimits'
| 'extendedMetrics'
Expand Down Expand Up @@ -292,10 +291,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_COMMAND_BAR_UI,
false,
),
flagCreator: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_FLAG_CREATOR,
false,
),
anonymizeProjectOwners: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_ANONYMIZE_PROJECT_OWNERS,
false,
Expand Down
1 change: 0 additions & 1 deletion src/server-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ process.nextTick(async () => {
manyStrategiesPagination: true,
enableLegacyVariants: false,
commandBarUI: true,
flagCreator: true,
resourceLimits: true,
extendedMetrics: true,
insightsV2: true,
Expand Down

0 comments on commit 3fe385e

Please sign in to comment.