diff --git a/frontend/src/component/filter/AddFilterButton.tsx b/frontend/src/component/filter/AddFilterButton.tsx index 6d9606d594..b29515fb81 100644 --- a/frontend/src/component/filter/AddFilterButton.tsx +++ b/frontend/src/component/filter/AddFilterButton.tsx @@ -8,12 +8,9 @@ import Add from '@mui/icons-material/Add'; import { Box } from '@mui/system'; import type { IFilterItem } from './Filters/Filters'; import { FILTERS_MENU } from 'utils/testIds'; -import { useUiFlag } from 'hooks/useUiFlag'; import { HtmlTooltip } from 'component/common/HtmlTooltip/HtmlTooltip'; import useSplashApi from 'hooks/api/actions/useSplashApi/useSplashApi'; import { useAuthSplash } from 'hooks/api/getters/useAuth/useAuthSplash'; -import { useOptionalPathParam } from 'hooks/useOptionalPathParam'; -import { useAuthUser } from 'hooks/api/getters/useAuth/useAuthUser'; const StyledButton = styled(Button)(({ theme }) => ({ padding: theme.spacing(0, 1.25, 0, 1.25), @@ -52,9 +49,6 @@ export const AddFilterButton = ({ setHiddenOptions, availableFilters, }: IAddFilterButtonProps) => { - const projectId = useOptionalPathParam('projectId'); - const simplifyProjectOverview = useUiFlag('simplifyProjectOverview'); - const { user } = useAuthUser(); const { setSplashSeen } = useSplashApi(); const { splash } = useAuthSplash(); @@ -79,15 +73,6 @@ export const AddFilterButton = ({ handleClose(); }; - const isOldCustomer = (createdAt: string | undefined) => { - if (!createdAt) return false; - const cutoffDate = new Date('2024-11-08T00:00:00.000Z'); - return new Date(createdAt) < cutoffDate; - }; - - const showArchiveTooltip = - simplifyProjectOverview && projectId && isOldCustomer(user?.createdAt); - const ArchiveTooltip = () => { return ( @@ -112,23 +97,17 @@ export const AddFilterButton = ({ }; return (
- {showArchiveTooltip ? ( - } - describeChild - open={archiveTooltipOpen} - > - }> - Add Filter - - - ) : ( + } + describeChild + open={archiveTooltipOpen} + > }> Add Filter - )} + - {simplifyProjectOverview && ( - - setModalOpen(true)} - tooltipProps={{ title: 'Import' }} - data-testid={IMPORT_BUTTON} - data-loading-project - > - - - - )} + + setModalOpen(true)} + tooltipProps={{ title: 'Import' }} + data-testid={IMPORT_BUTTON} + data-loading-project + > + + + = ({ const { tags } = useAllTags(); const { flagCreators } = useProjectFlagCreators(project); const [availableFilters, setAvailableFilters] = useState([]); - const simplifyProjectOverview = useUiFlag('simplifyProjectOverview'); useEffect(() => { const tagsOptions = (tags || []).map((tag) => ({ @@ -44,14 +42,10 @@ export const ProjectOverviewFilters: VFC = ({ label: 'Stale', value: 'stale', }, - ...(simplifyProjectOverview - ? [ - { - label: 'Potentially stale', - value: 'potentially-stale', - }, - ] - : []), + { + label: 'Potentially stale', + value: 'potentially-stale', + }, ]; const availableFilters: IFilterItem[] = [ @@ -105,18 +99,16 @@ export const ProjectOverviewFilters: VFC = ({ singularOperators: ['IS', 'IS_NOT'], pluralOperators: ['IS_ANY_OF', 'IS_NONE_OF'], }, - ...(simplifyProjectOverview - ? ([ - { - label: 'Show only archived', - icon: 'inventory', - options: [{ label: 'True', value: 'true' }], - filterKey: 'archived', - singularOperators: ['IS'], - pluralOperators: ['IS_ANY_OF'], - }, - ] as IFilterItem[]) - : []), + ...([ + { + label: 'Show only archived', + icon: 'inventory', + options: [{ label: 'True', value: 'true' }], + filterKey: 'archived', + singularOperators: ['IS'], + pluralOperators: ['IS_ANY_OF'], + }, + ] as IFilterItem[]), ]; setAvailableFilters(availableFilters); diff --git a/frontend/src/component/project/Project/Project.tsx b/frontend/src/component/project/Project/Project.tsx index 6607c3a054..9126f8a944 100644 --- a/frontend/src/component/project/Project/Project.tsx +++ b/frontend/src/component/project/Project/Project.tsx @@ -1,7 +1,6 @@ import { useNavigate } from 'react-router'; import useLoading from 'hooks/useLoading'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import { ReactComponent as ImportSvg } from 'assets/icons/import.svg'; import { ReactComponent as ProjectStatusSvg } from 'assets/icons/projectStatus.svg'; import { StyledDiv, @@ -31,8 +30,6 @@ import ProjectEnvironment from '../ProjectEnvironment/ProjectEnvironment'; import { ProjectFeaturesArchive } from './ProjectFeaturesArchive/ProjectFeaturesArchive'; import ProjectFlags from './ProjectFlags'; import ProjectHealth from './ProjectHealth/ProjectHealth'; -import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; -import { UPDATE_FEATURE } from 'component/providers/AccessProvider/permissions'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { Navigate, Route, Routes, useLocation } from 'react-router-dom'; @@ -43,7 +40,6 @@ import { ProjectChangeRequests } from '../../changeRequest/ProjectChangeRequests import { ProjectSettings } from './ProjectSettings/ProjectSettings'; import { useFavoriteProjectsApi } from 'hooks/api/actions/useFavoriteProjectsApi/useFavoriteProjectsApi'; import { ImportModal } from './Import/ImportModal'; -import { IMPORT_BUTTON } from 'utils/testIds'; import { EnterpriseBadge } from 'component/common/EnterpriseBadge/EnterpriseBadge'; import { Badge } from 'component/common/Badge/Badge'; import type { UiFlags } from 'interfaces/uiConfig'; @@ -54,7 +50,6 @@ import { ProjectInsights } from './ProjectInsights/ProjectInsights'; import useProjectOverview from 'hooks/api/getters/useProjectOverview/useProjectOverview'; import { ProjectArchived } from './ArchiveProject/ProjectArchived'; import { usePlausibleTracker } from '../../../hooks/usePlausibleTracker'; -import { useUiFlag } from 'hooks/useUiFlag'; import { useActionableChangeRequests } from 'hooks/api/getters/useActionableChangeRequests/useActionableChangeRequests'; import { ProjectStatusModal } from './ProjectStatus/ProjectStatusModal'; @@ -94,14 +89,9 @@ const TabText = styled('span')(({ theme }) => ({ })); const ChangeRequestsLabel = () => { - const simplifyProjectOverview = useUiFlag('simplifyProjectOverview'); const projectId = useRequiredPathParam('projectId'); const { total } = useActionableChangeRequests(projectId); - if (!simplifyProjectOverview) { - return 'Change requests'; - } - return ( Change requests @@ -155,7 +145,6 @@ export const Project = () => { const basePath = `/projects/${projectId}`; const projectName = project?.name || projectId; const { favorite, unfavorite } = useFavoriteProjectsApi(); - const simplifyProjectOverview = useUiFlag('simplifyProjectOverview'); const [showDelDialog, setShowDelDialog] = useState(false); @@ -166,29 +155,10 @@ export const Project = () => { const tabs: ITab[] = [ { - title: simplifyProjectOverview ? 'Overview' : 'Flags', + title: 'Overview', path: basePath, name: 'flags', }, - ...(simplifyProjectOverview - ? [] - : [ - { - title: 'Insights', - path: `${basePath}/insights`, - name: 'insights', - }, - { - title: 'Health', - path: `${basePath}/health`, - name: 'health', - }, - { - title: 'Archived flags', - path: `${basePath}/archive`, - name: 'archive', - } as ITab, - ]), { title: 'Change requests', path: `${basePath}/change-requests`, @@ -207,7 +177,7 @@ export const Project = () => { name: 'logs', }, { - title: simplifyProjectOverview ? 'Settings' : 'Project settings', + title: 'Settings', path: `${basePath}/settings`, ossPath: `${basePath}/settings/api-access`, name: 'settings', @@ -301,22 +271,7 @@ export const Project = () => { - setModalOpen(true)} - tooltipProps={{ title: 'Import' }} - data-testid={IMPORT_BUTTON} - data-loading-project - > - - - } - /> - {simplifyProjectOverview && } + diff --git a/frontend/src/component/project/Project/ProjectFlags.tsx b/frontend/src/component/project/Project/ProjectFlags.tsx index 0f6b98d7f3..09aee30e33 100644 --- a/frontend/src/component/project/Project/ProjectFlags.tsx +++ b/frontend/src/component/project/Project/ProjectFlags.tsx @@ -7,7 +7,6 @@ import useProjectOverview, { } from 'hooks/api/getters/useProjectOverview/useProjectOverview'; import { usePageTitle } from 'hooks/usePageTitle'; import { useLastViewedProject } from 'hooks/useLastViewedProject'; -import { ProjectOverviewChangeRequests } from './ProjectOverviewChangeRequests'; import { OutdatedSdksBanner } from '../../banners/OutdatedSdksBanner/OutdatedSdksBanner'; import { useUiFlag } from 'hooks/useUiFlag'; import { ConditionallyRender } from '../../common/ConditionallyRender/ConditionallyRender'; @@ -51,14 +50,9 @@ const ProjectOverview: FC = () => { setLastViewed(projectId); }, [projectId, setLastViewed]); - const hideChangeRequestOverview = useUiFlag('simplifyProjectOverview'); - return ( - {hideChangeRequestOverview ? null : ( - - )} }