From aa485dedf8bf63a3c3f48221da87931404f4153a Mon Sep 17 00:00:00 2001 From: sjaanus Date: Fri, 1 Dec 2023 13:42:06 +0200 Subject: [PATCH] Updates --- .../FeatureToggleFilters/FeatureToggleFilters.tsx | 1 - .../project/Project/ProjectInfo/FlagTypesWidget.tsx | 3 +-- .../project/Project/ProjectInfo/ProjectInfo.tsx | 3 +-- .../ProjectApiAccess/ProjectApiAccess.tsx | 3 ++- .../ProjectDefaultStrategySettings.tsx | 10 ++++------ .../Project/ProjectSettings/Settings/Settings.tsx | 3 +-- 6 files changed, 9 insertions(+), 14 deletions(-) diff --git a/frontend/src/component/feature/FeatureToggleList/FeatureToggleFilters/FeatureToggleFilters.tsx b/frontend/src/component/feature/FeatureToggleList/FeatureToggleFilters/FeatureToggleFilters.tsx index d8cd4862ae05..8a665d5cbc55 100644 --- a/frontend/src/component/feature/FeatureToggleList/FeatureToggleFilters/FeatureToggleFilters.tsx +++ b/frontend/src/component/feature/FeatureToggleList/FeatureToggleFilters/FeatureToggleFilters.tsx @@ -3,7 +3,6 @@ import { Box } from '@mui/material'; import { FilterItem } from 'component/common/FilterItem/FilterItem'; import useProjects from 'hooks/api/getters/useProjects/useProjects'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import { useTableState } from 'hooks/useTableState'; export type FeatureTogglesListFilters = { projectId?: string; diff --git a/frontend/src/component/project/Project/ProjectInfo/FlagTypesWidget.tsx b/frontend/src/component/project/Project/ProjectInfo/FlagTypesWidget.tsx index 1b454653f252..f0e0cc35a9a5 100644 --- a/frontend/src/component/project/Project/ProjectInfo/FlagTypesWidget.tsx +++ b/frontend/src/component/project/Project/ProjectInfo/FlagTypesWidget.tsx @@ -1,6 +1,5 @@ import { useMemo } from 'react'; import { styled, SvgIconTypeMap } from '@mui/material'; -import type { IFeatureToggleListItem } from 'interfaces/featureToggle'; import { getFeatureTypeIcons } from 'utils/getFeatureTypeIcons'; import { StyledCount, @@ -8,7 +7,7 @@ import { StyledWidgetTitle, } from './ProjectInfo.styles'; import { OverridableComponent } from '@mui/material/OverridableComponent'; -import { FeatureTypeCount } from '../../../../interfaces/project'; +import { FeatureTypeCount } from 'interfaces/project'; export interface IFlagTypesWidgetProps { featureTypeCounts: FeatureTypeCount[]; diff --git a/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.tsx b/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.tsx index 942de23ec9bd..64e747a9b310 100644 --- a/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.tsx +++ b/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.tsx @@ -1,6 +1,5 @@ import { Box, styled, useMediaQuery, useTheme } from '@mui/material'; import type { ProjectStatsSchema } from 'openapi/models/projectStatsSchema'; -import type { IFeatureToggleListItem } from 'interfaces/featureToggle'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { DEFAULT_PROJECT_ID } from 'hooks/api/getters/useDefaultProject/useDefaultProjectId'; import { HealthWidget } from './HealthWidget'; @@ -11,7 +10,7 @@ import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { ChangeRequestsWidget } from './ChangeRequestsWidget'; import { flexRow } from 'themes/themeStyles'; import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled'; -import { FeatureTypeCount } from '../../../../interfaces/project'; +import { FeatureTypeCount } from 'interfaces/project'; interface IProjectInfoProps { id: string; diff --git a/frontend/src/component/project/Project/ProjectSettings/ProjectApiAccess/ProjectApiAccess.tsx b/frontend/src/component/project/Project/ProjectSettings/ProjectApiAccess/ProjectApiAccess.tsx index 660f636da29b..d48c03b5495e 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ProjectApiAccess/ProjectApiAccess.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ProjectApiAccess/ProjectApiAccess.tsx @@ -24,10 +24,11 @@ import { ActionCell } from 'component/common/Table/cells/ActionCell/ActionCell'; import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; import useProjectApiTokensApi from 'hooks/api/actions/useProjectApiTokensApi/useProjectApiTokensApi'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; +import { useProjectOverviewNameOrId } from 'hooks/api/getters/useProjectOverview/useProjectOverview'; export const ProjectApiAccess = () => { const projectId = useRequiredPathParam('projectId'); - const projectName = useProjectNameOrId(projectId); + const projectName = useProjectOverviewNameOrId(projectId); const { hasAccess } = useContext(AccessContext); const { tokens, diff --git a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectDefaultStrategySettings.tsx b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectDefaultStrategySettings.tsx index 7c8d25cde3ad..64b77b58122d 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectDefaultStrategySettings.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectDefaultStrategySettings.tsx @@ -1,8 +1,5 @@ import React, { useContext } from 'react'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; -import useProject, { - useProjectNameOrId, -} from 'hooks/api/getters/useProject/useProject'; import AccessContext from 'contexts/AccessContext'; import { usePageTitle } from 'hooks/usePageTitle'; import { PageContent } from 'component/common/PageContent/PageContent'; @@ -11,17 +8,18 @@ import { UPDATE_PROJECT } from 'component/providers/AccessProvider/permissions'; import { Alert, styled } from '@mui/material'; import ProjectEnvironment from './ProjectEnvironment/ProjectEnvironment'; import { Route, Routes, useNavigate } from 'react-router-dom'; -import { SidebarModal } from '../../../../common/SidebarModal/SidebarModal'; +import { SidebarModal } from 'component/common/SidebarModal/SidebarModal'; import EditDefaultStrategy from './ProjectEnvironment/ProjectEnvironmentDefaultStrategy/EditDefaultStrategy'; +import useProjectOverview, { useProjectOverviewNameOrId } from 'hooks/api/getters/useProjectOverview/useProjectOverview'; const StyledAlert = styled(Alert)(({ theme }) => ({ marginBottom: theme.spacing(4), })); export const ProjectDefaultStrategySettings = () => { const projectId = useRequiredPathParam('projectId'); - const projectName = useProjectNameOrId(projectId); + const projectName = useProjectOverviewNameOrId(projectId); const { hasAccess } = useContext(AccessContext); - const { project } = useProject(projectId); + const { project } = useProjectOverview(projectId); const navigate = useNavigate(); usePageTitle(`Project default strategy configuration – ${projectName}`); diff --git a/frontend/src/component/project/Project/ProjectSettings/Settings/Settings.tsx b/frontend/src/component/project/Project/ProjectSettings/Settings/Settings.tsx index 6ace0dc283c4..6a2cbae9d97a 100644 --- a/frontend/src/component/project/Project/ProjectSettings/Settings/Settings.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/Settings/Settings.tsx @@ -6,11 +6,10 @@ import AccessContext from 'contexts/AccessContext'; import { UPDATE_PROJECT } from 'component/providers/AccessProvider/permissions'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import { usePageTitle } from 'hooks/usePageTitle'; -import { useProjectNameOrId } from 'hooks/api/getters/useProject/useProject'; import EditProject from './EditProject/EditProject'; import { PremiumFeature } from 'component/common/PremiumFeature/PremiumFeature'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; -import { useProjectOverviewNameOrId } from '../../../../../hooks/api/getters/useProjectOverview/useProjectOverview'; +import { useProjectOverviewNameOrId } from 'hooks/api/getters/useProjectOverview/useProjectOverview'; export const Settings = () => { const projectId = useRequiredPathParam('projectId');