From 0292e030b4dc77c4056fdbe318e069dace287e4d Mon Sep 17 00:00:00 2001 From: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:20:14 +0100 Subject: [PATCH] refactor: import frontend permissions from server --- .../src/component/admin/banners/Banners.tsx | 2 +- .../BannersTable/BannersActionsCell.tsx | 2 +- .../src/component/admin/billing/Billing.tsx | 2 +- .../src/component/admin/cors/CorsForm.tsx | 2 +- frontend/src/component/admin/cors/index.tsx | 2 +- .../component/admin/groups/Group/Group.tsx | 2 +- .../admin/groups/GroupsList/GroupsList.tsx | 2 +- .../admin/invoice/InvoiceAdminPage.tsx | 2 +- .../src/component/admin/maintenance/index.tsx | 2 +- frontend/src/component/admin/roles/Roles.tsx | 2 +- .../src/component/admin/roles/RolesPage.tsx | 2 +- .../RolesActionsCell/RolesActionsCell.tsx | 2 +- .../admin/serviceAccounts/ServiceAccounts.tsx | 2 +- .../ServiceAccountsActionsCell.tsx | 2 +- .../admin/users/CreateUser/CreateUser.tsx | 2 +- .../admin/users/EditUser/EditUser.tsx | 2 +- .../InactiveUsersActionCell.tsx | 2 +- .../admin/users/InviteLink/InviteLink.tsx | 2 +- .../src/component/admin/users/UsersAdmin.tsx | 2 +- .../UsersActionsCell/UsersActionsCell.tsx | 2 +- .../src/component/application/Application.tsx | 2 +- .../ApplicationIssues/ApplicationIssues.tsx | 5 +- .../ArchiveTable/ArchiveBatchActions.tsx | 5 +- .../ArchiveTable/ArchiveTable.test.tsx | 5 +- .../ArchivedFeatureActionCell.tsx | 5 +- .../Changes/Change/EditChange.tsx | 2 +- .../ApplyButton/ApplyButton.tsx | 2 +- .../ChangeRequestOverview.test.tsx | 5 +- .../ScheduleChangeRequestDialog.tsx | 2 +- .../changeRequestScheduledDialogs.tsx | 2 +- .../ReviewButton/ReviewButton.tsx | 2 +- .../CreateApiTokenButton.test.tsx | 2 +- .../common/InstanceStatus/InstanceStatus.tsx | 2 +- .../InstanceStatus/InstanceStatusBar.tsx | 2 +- .../context/ContextList/AddContextButton.tsx | 2 +- .../ContextList/ContextActionsCell.tsx | 2 +- .../CreateUnleashContext.tsx | 2 +- .../context/EditContext/EditContext.tsx | 2 +- .../CreateEnvironment.test.tsx | 2 +- .../CreateEnvironment/CreateEnvironment.tsx | 2 +- .../CreateEnvironmentButton.tsx | 2 +- .../EditEnvironment/EditEnvironment.tsx | 2 +- .../EnvironmentActionCellPopover.tsx | 2 +- .../component/events/EventPage/EventPage.tsx | 2 +- .../feature/CopyFeature/CopyFeature.test.tsx | 2 +- .../feature/EditFeature/EditFeature.tsx | 2 +- .../FeatureStrategyConstraints.tsx | 2 +- .../FeatureStrategyCreate.test.tsx | 2 +- .../FeatureStrategyCreate.tsx | 2 +- .../FeatureStrategyEdit.test.tsx | 2 +- .../FeatureStrategyEdit.tsx | 2 +- .../CopyButton/CopyButton.tsx | 2 +- .../FeatureStrategyMenu.tsx | 2 +- .../FeatureToggleListActions.tsx | 2 +- .../FeatureLifecycleTooltip.test.tsx | 5 +- .../FeatureLifecycleTooltip.tsx | 5 +- .../StrategyDraggableItem.test.tsx | 2 +- .../CopyStrategyIconMenu.tsx | 2 +- .../StrategyItem/StrategyItem.tsx | 2 +- .../FeatureOverviewEnvironment.test.tsx | 2 +- .../FeatureOverviewMetaData/DependencyRow.tsx | 2 +- .../OldDependencyRow.tsx | 2 +- .../OldFeatureOverviewMetaData.tsx | 2 +- .../FeatureOverviewMetaData/TagRow.tsx | 2 +- .../FeatureOverviewSidePanelTags.tsx | 2 +- .../FeatureSettingsInformation.tsx | 2 +- .../FeatureSettingsProject.tsx | 2 +- .../EnvironmentVariantsCard.test.tsx | 2 +- .../EnvironmentVariantsModal.tsx | 2 +- .../FeatureEnvironmentVariants.tsx | 2 +- .../feature/FeatureView/FeatureView.tsx | 2 +- .../StrategyTypes/NewStrategyVariants.tsx | 2 +- .../StrategyTypes/StrategyVariants.test.tsx | 2 +- .../StrategyTypes/StrategyVariants.tsx | 2 +- .../FeatureTypeForm/FeatureTypeForm.tsx | 2 +- .../featureTypes/FeatureTypesList.tsx | 2 +- .../IntegrationDelete/IntegrationDelete.tsx | 2 +- .../IntegrationForm/IntegrationForm.tsx | 5 +- .../IntegrationCardMenu.tsx | 6 +-- .../component/loginHistory/LoginHistory.tsx | 2 +- .../LoginHistoryActionsCell.tsx | 2 +- .../InviteLinkButton.test.tsx | 2 +- .../onboarding/flow/ProjectOnboarding.tsx | 2 +- .../CreateProjectDialog.test.tsx | 2 +- .../CreateProjectDialog.tsx | 2 +- .../project/Project/Import/Import.test.tsx | 2 +- .../Import/validate/ValidationStage.tsx | 2 +- .../CreateFeatureDialog.tsx | 2 +- .../ProjectFeatureTogglesHeader.tsx | 2 +- .../src/component/project/Project/Project.tsx | 2 +- .../ActionsCell/ActionsCell.tsx | 2 +- .../EnableEnvironmentDialog.tsx | 2 +- .../FeatureToggleSwitch.tsx | 2 +- .../ArchiveButton.tsx | 2 +- .../ManageTags.tsx | 2 +- .../MoreActions.tsx | 2 +- .../ProjectFeaturesBatchActions.test.tsx | 2 +- .../ChangeRequestConfiguration.tsx | 2 +- .../ChangeRequestTable.tsx | 2 +- .../ProjectActionsTableActionsCell.tsx | 2 +- .../CreateProjectApiTokenForm.tsx | 2 +- .../ProjectDefaultStrategySettings.tsx | 2 +- .../EditDefaultStrategy.tsx | 2 +- .../Settings/ArchiveProject.tsx | 2 +- .../Settings/DeleteProject.tsx | 2 +- .../Settings/EditProject/EditProject.tsx | 2 +- .../EditProject/UpdateEnterpriseSettings.tsx | 2 +- .../Settings/EditProject/UpdateProject.tsx | 2 +- .../ProjectSettings/Settings/Settings.tsx | 2 +- .../project/ProjectAccess/ProjectAccess.tsx | 2 +- .../ProjectAccessAssign.tsx | 2 +- .../ProjectAccessTable/ProjectAccessTable.tsx | 2 +- .../ProjectGroupView/ProjectGroupView.tsx | 2 +- .../ProjectCard/ProjectArchiveCard.tsx | 5 +- .../ProjectEnvironment/ProjectEnvironment.tsx | 2 +- .../ProjectCreationButton.tsx | 2 +- .../project/ProjectList/ProjectList.test.tsx | 2 +- .../providers/AccessProvider/permissions.ts | 49 ------------------- .../ReleaseManagement/ReleaseManagement.tsx | 2 +- .../segments/CreateSegment/CreateSegment.tsx | 2 +- .../CreateSegmentButton.tsx | 2 +- .../segments/EditSegment/EditSegment.tsx | 2 +- .../EditSegmentButton/EditSegmentButton.tsx | 2 +- .../RemoveSegmentButton.tsx | 2 +- .../src/component/segments/SegmentEmpty.tsx | 2 +- .../component/segments/SegmentFormStepTwo.tsx | 2 +- .../SignalEndpointsActionsCell.tsx | 2 +- .../CreateStrategy/CreateStrategy.tsx | 2 +- .../strategies/EditStrategy/EditStrategy.tsx | 2 +- .../AddStrategyButton/AddStrategyButton.tsx | 2 +- .../StrategyDeleteButton.tsx | 2 +- .../StrategyEditButton/StrategyEditButton.tsx | 2 +- .../StrategySwitch/StrategySwitch.tsx | 2 +- .../strategies/StrategyView/StrategyView.tsx | 2 +- .../tags/CreateTagType/CreateTagType.tsx | 2 +- .../tags/EditTagType/EditTagType.tsx | 2 +- .../AddTagTypeButton/AddTagTypeButton.tsx | 2 +- .../tags/TagTypeList/TagTypeList.tsx | 5 +- .../__tests__/TagTypeList.test.tsx | 2 +- .../hooks/useChangeRequestsEnabled.test.tsx | 5 +- .../src/hooks/useChangeRequestsEnabled.ts | 2 +- frontend/src/hooks/useHasAccess.ts | 2 +- frontend/src/utils/projectFilterGenerator.ts | 2 +- 143 files changed, 142 insertions(+), 228 deletions(-) diff --git a/frontend/src/component/admin/banners/Banners.tsx b/frontend/src/component/admin/banners/Banners.tsx index db86315e1495..ea4f26539f48 100644 --- a/frontend/src/component/admin/banners/Banners.tsx +++ b/frontend/src/component/admin/banners/Banners.tsx @@ -1,4 +1,4 @@ -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { PermissionGuard } from 'component/common/PermissionGuard/PermissionGuard'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { PremiumFeature } from 'component/common/PremiumFeature/PremiumFeature'; diff --git a/frontend/src/component/admin/banners/BannersTable/BannersActionsCell.tsx b/frontend/src/component/admin/banners/BannersTable/BannersActionsCell.tsx index 446f7aed10db..c7e05aab3973 100644 --- a/frontend/src/component/admin/banners/BannersTable/BannersActionsCell.tsx +++ b/frontend/src/component/admin/banners/BannersTable/BannersActionsCell.tsx @@ -2,7 +2,7 @@ import Delete from '@mui/icons-material/Delete'; import Edit from '@mui/icons-material/Edit'; import { Box, styled } from '@mui/material'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; const StyledBox = styled(Box)(() => ({ display: 'flex', diff --git a/frontend/src/component/admin/billing/Billing.tsx b/frontend/src/component/admin/billing/Billing.tsx index dc9edee6b4a3..fea3c7d34814 100644 --- a/frontend/src/component/admin/billing/Billing.tsx +++ b/frontend/src/component/admin/billing/Billing.tsx @@ -1,6 +1,6 @@ import { PageContent } from 'component/common/PageContent/PageContent'; import { useEffect } from 'react'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { PermissionGuard } from 'component/common/PermissionGuard/PermissionGuard'; import { useInstanceStatus } from 'hooks/api/getters/useInstanceStatus/useInstanceStatus'; diff --git a/frontend/src/component/admin/cors/CorsForm.tsx b/frontend/src/component/admin/cors/CorsForm.tsx index c3885e8821c5..87b6e8802317 100644 --- a/frontend/src/component/admin/cors/CorsForm.tsx +++ b/frontend/src/component/admin/cors/CorsForm.tsx @@ -1,4 +1,4 @@ -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import type React from 'react'; import { useState } from 'react'; import { TextField, Box } from '@mui/material'; diff --git a/frontend/src/component/admin/cors/index.tsx b/frontend/src/component/admin/cors/index.tsx index ceda3f629c8b..c04aba942194 100644 --- a/frontend/src/component/admin/cors/index.tsx +++ b/frontend/src/component/admin/cors/index.tsx @@ -1,5 +1,5 @@ import { PermissionGuard } from 'component/common/PermissionGuard/PermissionGuard'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { PageContent } from 'component/common/PageContent/PageContent'; import { PageHeader } from 'component/common/PageHeader/PageHeader'; import { Box } from '@mui/material'; diff --git a/frontend/src/component/admin/groups/Group/Group.tsx b/frontend/src/component/admin/groups/Group/Group.tsx index 721a5c6ca91e..8ef5b446aeef 100644 --- a/frontend/src/component/admin/groups/Group/Group.tsx +++ b/frontend/src/component/admin/groups/Group/Group.tsx @@ -26,7 +26,7 @@ import PermissionIconButton from 'component/common/PermissionIconButton/Permissi import Add from '@mui/icons-material/Add'; import Delete from '@mui/icons-material/Delete'; import Edit from '@mui/icons-material/Edit'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { MainHeader } from 'component/common/MainHeader/MainHeader'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import { RemoveGroup } from 'component/admin/groups/RemoveGroup/RemoveGroup'; diff --git a/frontend/src/component/admin/groups/GroupsList/GroupsList.tsx b/frontend/src/component/admin/groups/GroupsList/GroupsList.tsx index d7a9f553e3db..deea333a2c6a 100644 --- a/frontend/src/component/admin/groups/GroupsList/GroupsList.tsx +++ b/frontend/src/component/admin/groups/GroupsList/GroupsList.tsx @@ -13,7 +13,7 @@ import { TablePlaceholder } from 'component/common/Table'; import { GroupCard } from './GroupCard/GroupCard'; import { GroupEmpty } from './GroupEmpty/GroupEmpty'; import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import Add from '@mui/icons-material/Add'; import { NAVIGATE_TO_CREATE_GROUP } from 'utils/testIds'; import { EditGroupUsers } from '../Group/EditGroupUsers/EditGroupUsers'; diff --git a/frontend/src/component/admin/invoice/InvoiceAdminPage.tsx b/frontend/src/component/admin/invoice/InvoiceAdminPage.tsx index 3a79260e8042..bf0c5746f610 100644 --- a/frontend/src/component/admin/invoice/InvoiceAdminPage.tsx +++ b/frontend/src/component/admin/invoice/InvoiceAdminPage.tsx @@ -1,5 +1,5 @@ import InvoiceList from './InvoiceList'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { PermissionGuard } from 'component/common/PermissionGuard/PermissionGuard'; export const InvoiceAdminPage = () => ( diff --git a/frontend/src/component/admin/maintenance/index.tsx b/frontend/src/component/admin/maintenance/index.tsx index 9774adbc312e..e1fd734a5419 100644 --- a/frontend/src/component/admin/maintenance/index.tsx +++ b/frontend/src/component/admin/maintenance/index.tsx @@ -1,5 +1,5 @@ import { PermissionGuard } from 'component/common/PermissionGuard/PermissionGuard'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { PageContent } from 'component/common/PageContent/PageContent'; import { PageHeader } from 'component/common/PageHeader/PageHeader'; import { Box, styled } from '@mui/material'; diff --git a/frontend/src/component/admin/roles/Roles.tsx b/frontend/src/component/admin/roles/Roles.tsx index a0d7d670c5a7..0fab8208f9a8 100644 --- a/frontend/src/component/admin/roles/Roles.tsx +++ b/frontend/src/component/admin/roles/Roles.tsx @@ -1,4 +1,4 @@ -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { PermissionGuard } from 'component/common/PermissionGuard/PermissionGuard'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { PremiumFeature } from 'component/common/PremiumFeature/PremiumFeature'; diff --git a/frontend/src/component/admin/roles/RolesPage.tsx b/frontend/src/component/admin/roles/RolesPage.tsx index 84813c8c94b1..ea926ecebf89 100644 --- a/frontend/src/component/admin/roles/RolesPage.tsx +++ b/frontend/src/component/admin/roles/RolesPage.tsx @@ -1,6 +1,6 @@ import { useState } from 'react'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { RolesTable } from './RolesTable/RolesTable'; import { PageContent } from 'component/common/PageContent/PageContent'; import { Tab, Tabs, styled, useMediaQuery } from '@mui/material'; diff --git a/frontend/src/component/admin/roles/RolesTable/RolesActionsCell/RolesActionsCell.tsx b/frontend/src/component/admin/roles/RolesTable/RolesActionsCell/RolesActionsCell.tsx index 7e6eb518c5ef..9df14bd9422f 100644 --- a/frontend/src/component/admin/roles/RolesTable/RolesActionsCell/RolesActionsCell.tsx +++ b/frontend/src/component/admin/roles/RolesTable/RolesActionsCell/RolesActionsCell.tsx @@ -3,7 +3,7 @@ import Edit from '@mui/icons-material/Edit'; import { Box, styled } from '@mui/material'; import { PREDEFINED_ROLE_TYPES } from '@server/util/constants'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import type { IRole } from 'interfaces/role'; import type { VFC } from 'react'; diff --git a/frontend/src/component/admin/serviceAccounts/ServiceAccounts.tsx b/frontend/src/component/admin/serviceAccounts/ServiceAccounts.tsx index a0b4c4d52fda..38df94befc2a 100644 --- a/frontend/src/component/admin/serviceAccounts/ServiceAccounts.tsx +++ b/frontend/src/component/admin/serviceAccounts/ServiceAccounts.tsx @@ -1,4 +1,4 @@ -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { PermissionGuard } from 'component/common/PermissionGuard/PermissionGuard'; import { ServiceAccountsTable } from './ServiceAccountsTable/ServiceAccountsTable'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; diff --git a/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountsActionsCell/ServiceAccountsActionsCell.tsx b/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountsActionsCell/ServiceAccountsActionsCell.tsx index 5b2b05a86cfd..3ff3bc105cc4 100644 --- a/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountsActionsCell/ServiceAccountsActionsCell.tsx +++ b/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountsActionsCell/ServiceAccountsActionsCell.tsx @@ -2,7 +2,7 @@ import Delete from '@mui/icons-material/Delete'; import Edit from '@mui/icons-material/Edit'; import { Box, styled } from '@mui/material'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import type { VFC } from 'react'; const StyledBox = styled(Box)(() => ({ diff --git a/frontend/src/component/admin/users/CreateUser/CreateUser.tsx b/frontend/src/component/admin/users/CreateUser/CreateUser.tsx index e353313ea113..fd46f99a4209 100644 --- a/frontend/src/component/admin/users/CreateUser/CreateUser.tsx +++ b/frontend/src/component/admin/users/CreateUser/CreateUser.tsx @@ -9,7 +9,7 @@ import ConfirmUserAdded from '../ConfirmUserAdded/ConfirmUserAdded'; import { useState } from 'react'; import { scrollToTop } from 'component/common/util'; import { CreateButton } from 'component/common/CreateButton/CreateButton'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { formatUnknownError } from 'utils/formatUnknownError'; import { GO_BACK } from 'constants/navigate'; import { SeatCostWarning } from './SeatCostWarning/SeatCostWarning'; diff --git a/frontend/src/component/admin/users/EditUser/EditUser.tsx b/frontend/src/component/admin/users/EditUser/EditUser.tsx index 683f9f926589..8ddd6e664dc4 100644 --- a/frontend/src/component/admin/users/EditUser/EditUser.tsx +++ b/frontend/src/component/admin/users/EditUser/EditUser.tsx @@ -5,7 +5,7 @@ import { scrollToTop } from 'component/common/util'; import { useEffect } from 'react'; import { UpdateButton } from 'component/common/UpdateButton/UpdateButton'; import FormTemplate from 'component/common/FormTemplate/FormTemplate'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { EDIT } from 'constants/misc'; import useAdminUsersApi from 'hooks/api/actions/useAdminUsersApi/useAdminUsersApi'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; diff --git a/frontend/src/component/admin/users/InactiveUsersList/InactiveUsersActionCell/InactiveUsersActionCell.tsx b/frontend/src/component/admin/users/InactiveUsersList/InactiveUsersActionCell/InactiveUsersActionCell.tsx index ac338532de41..5740ead5407c 100644 --- a/frontend/src/component/admin/users/InactiveUsersList/InactiveUsersActionCell/InactiveUsersActionCell.tsx +++ b/frontend/src/component/admin/users/InactiveUsersList/InactiveUsersActionCell/InactiveUsersActionCell.tsx @@ -2,7 +2,7 @@ import type React from 'react'; import type { VFC } from 'react'; import { Box, styled } from '@mui/material'; import PermissionIconButton from '../../../../common/PermissionIconButton/PermissionIconButton'; -import { ADMIN } from '../../../../providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import Delete from '@mui/icons-material/Delete'; const StyledBox = styled(Box)(() => ({ diff --git a/frontend/src/component/admin/users/InviteLink/InviteLink.tsx b/frontend/src/component/admin/users/InviteLink/InviteLink.tsx index 6f2b54e609db..d14b4d927e48 100644 --- a/frontend/src/component/admin/users/InviteLink/InviteLink.tsx +++ b/frontend/src/component/admin/users/InviteLink/InviteLink.tsx @@ -4,7 +4,7 @@ import { useSWRConfig } from 'swr'; import { Box, Button, Typography } from '@mui/material'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; import FormTemplate from 'component/common/FormTemplate/FormTemplate'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { url as inviteTokensUrlKey } from 'hooks/api/getters/useInviteTokens/useInviteTokens'; import { add } from 'date-fns'; import GeneralSelect from 'component/common/GeneralSelect/GeneralSelect'; diff --git a/frontend/src/component/admin/users/UsersAdmin.tsx b/frontend/src/component/admin/users/UsersAdmin.tsx index 12213b50fe06..49f93f7ece91 100644 --- a/frontend/src/component/admin/users/UsersAdmin.tsx +++ b/frontend/src/component/admin/users/UsersAdmin.tsx @@ -1,5 +1,5 @@ import UsersList from './UsersList/UsersList'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { PermissionGuard } from 'component/common/PermissionGuard/PermissionGuard'; import { Route, Routes } from 'react-router-dom'; import EditUser from './EditUser/EditUser'; diff --git a/frontend/src/component/admin/users/UsersList/UsersActionsCell/UsersActionsCell.tsx b/frontend/src/component/admin/users/UsersList/UsersActionsCell/UsersActionsCell.tsx index 07f3715d3f40..1fcda3c00ba6 100644 --- a/frontend/src/component/admin/users/UsersList/UsersActionsCell/UsersActionsCell.tsx +++ b/frontend/src/component/admin/users/UsersList/UsersActionsCell/UsersActionsCell.tsx @@ -6,7 +6,7 @@ import LockReset from '@mui/icons-material/LockReset'; import { Box, styled } from '@mui/material'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import type { VFC } from 'react'; const StyledBox = styled(Box)(() => ({ diff --git a/frontend/src/component/application/Application.tsx b/frontend/src/component/application/Application.tsx index df9618063581..4fe8131efcf7 100644 --- a/frontend/src/component/application/Application.tsx +++ b/frontend/src/component/application/Application.tsx @@ -14,7 +14,7 @@ import { import Delete from '@mui/icons-material/Delete'; import LinkIcon from '@mui/icons-material/Link'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import { UPDATE_APPLICATION } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_APPLICATION } from '@server/types/permissions'; import { ConnectedInstances } from './ConnectedInstances/ConnectedInstances'; import { Dialogue } from 'component/common/Dialogue/Dialogue'; import { PageContent } from 'component/common/PageContent/PageContent'; diff --git a/frontend/src/component/application/ApplicationIssues/ApplicationIssues.tsx b/frontend/src/component/application/ApplicationIssues/ApplicationIssues.tsx index 99313c69df40..2f939412c18a 100644 --- a/frontend/src/component/application/ApplicationIssues/ApplicationIssues.tsx +++ b/frontend/src/component/application/ApplicationIssues/ApplicationIssues.tsx @@ -3,10 +3,7 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit import WarningAmberRounded from '@mui/icons-material/WarningAmberRounded'; import type { ApplicationOverviewSchema } from 'openapi'; import { Link } from 'react-router-dom'; -import { - CREATE_FEATURE, - CREATE_STRATEGY, -} from 'component/providers/AccessProvider/permissions'; +import { CREATE_FEATURE, CREATE_STRATEGY } from '@server/types/permissions'; import { useContext } from 'react'; import AccessContext from 'contexts/AccessContext'; diff --git a/frontend/src/component/archive/ArchiveTable/ArchiveBatchActions.tsx b/frontend/src/component/archive/ArchiveTable/ArchiveBatchActions.tsx index 2513f23ca115..d925e57a67ad 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchiveBatchActions.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchiveBatchActions.tsx @@ -2,10 +2,7 @@ import { type FC, useState } from 'react'; import { Button } from '@mui/material'; import Delete from '@mui/icons-material/Delete'; import Undo from '@mui/icons-material/Undo'; -import { - DELETE_FEATURE, - UPDATE_FEATURE, -} from 'component/providers/AccessProvider/permissions'; +import { DELETE_FEATURE, UPDATE_FEATURE } from '@server/types/permissions'; import { PermissionHOC } from 'component/common/PermissionHOC/PermissionHOC'; import { useFeaturesArchive } from 'hooks/api/getters/useFeaturesArchive/useFeaturesArchive'; import { ArchivedFeatureDeleteConfirm } from './ArchivedFeatureActionCell/ArchivedFeatureDeleteConfirm/ArchivedFeatureDeleteConfirm'; diff --git a/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx b/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx index 010d4ee45a95..a6eb175ff319 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx @@ -3,10 +3,7 @@ import { render } from 'utils/testRenderer'; import { useState } from 'react'; import { screen, fireEvent, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { - DELETE_FEATURE, - UPDATE_FEATURE, -} from 'component/providers/AccessProvider/permissions'; +import { DELETE_FEATURE, UPDATE_FEATURE } from '@server/types/permissions'; import ToastRenderer from 'component/common/ToastRenderer/ToastRenderer'; import { testServerRoute, testServerSetup } from 'utils/testServer'; diff --git a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureActionCell.tsx b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureActionCell.tsx index 24857e2b18ae..51913be11764 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureActionCell.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureActionCell.tsx @@ -3,10 +3,7 @@ import { ActionCell } from 'component/common/Table/cells/ActionCell/ActionCell'; import Delete from '@mui/icons-material/Delete'; import Undo from '@mui/icons-material/Undo'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; -import { - DELETE_FEATURE, - UPDATE_FEATURE, -} from 'component/providers/AccessProvider/permissions'; +import { DELETE_FEATURE, UPDATE_FEATURE } from '@server/types/permissions'; interface IReviveArchivedFeatureCell { onRevive: () => void; diff --git a/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/EditChange.tsx b/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/EditChange.tsx index 79b19facbeeb..964945189d0c 100644 --- a/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/EditChange.tsx +++ b/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/EditChange.tsx @@ -5,7 +5,7 @@ import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import { formatUnknownError } from 'utils/formatUnknownError'; import useToast from 'hooks/useToast'; import type { IFeatureStrategy } from 'interfaces/strategy'; -import { UPDATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE_STRATEGY } from '@server/types/permissions'; import type { ISegment } from 'interfaces/segment'; import { useFormErrors } from 'hooks/useFormErrors'; import { useCollaborateData } from 'hooks/useCollaborateData'; diff --git a/frontend/src/component/changeRequest/ChangeRequestOverview/ApplyButton/ApplyButton.tsx b/frontend/src/component/changeRequest/ChangeRequestOverview/ApplyButton/ApplyButton.tsx index ad620994d7a8..cc2629ad8576 100644 --- a/frontend/src/component/changeRequest/ChangeRequestOverview/ApplyButton/ApplyButton.tsx +++ b/frontend/src/component/changeRequest/ChangeRequestOverview/ApplyButton/ApplyButton.tsx @@ -3,7 +3,7 @@ import type { FC } from 'react'; import CheckBox from '@mui/icons-material/Check'; import Today from '@mui/icons-material/Today'; -import { APPLY_CHANGE_REQUEST } from 'component/providers/AccessProvider/permissions'; +import { APPLY_CHANGE_REQUEST } from '@server/types/permissions'; import { MultiActionButton } from 'component/common/MultiActionButton/MultiActionButton'; import { useChangeRequest } from 'hooks/api/getters/useChangeRequest/useChangeRequest'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; diff --git a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.test.tsx b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.test.tsx index 83c35e56aa4f..239e9f3dbdc5 100644 --- a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.test.tsx +++ b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.test.tsx @@ -6,10 +6,7 @@ import type { } from '../changeRequest.types'; import { render } from 'utils/testRenderer'; import { ChangeRequestOverview } from './ChangeRequestOverview'; -import { - ADMIN, - APPLY_CHANGE_REQUEST, -} from 'component/providers/AccessProvider/permissions'; +import { ADMIN, APPLY_CHANGE_REQUEST } from '@server/types/permissions'; import { Route, Routes } from 'react-router-dom'; const server = testServerSetup(); diff --git a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestScheduledDialogs/ScheduleChangeRequestDialog.tsx b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestScheduledDialogs/ScheduleChangeRequestDialog.tsx index fb37f4a809a0..e32f6e9caba9 100644 --- a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestScheduledDialogs/ScheduleChangeRequestDialog.tsx +++ b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestScheduledDialogs/ScheduleChangeRequestDialog.tsx @@ -1,7 +1,7 @@ import { type FC, useState } from 'react'; import { Alert, Box, styled, Typography } from '@mui/material'; import { Dialogue } from 'component/common/Dialogue/Dialogue'; -import { APPLY_CHANGE_REQUEST } from 'component/providers/AccessProvider/permissions'; +import { APPLY_CHANGE_REQUEST } from '@server/types/permissions'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; import { DateTimePicker } from 'component/common/DateTimePicker/DateTimePicker'; import { getBrowserTimezone } from '../ChangeRequestReviewStatus/utils'; diff --git a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestScheduledDialogs/changeRequestScheduledDialogs.tsx b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestScheduledDialogs/changeRequestScheduledDialogs.tsx index e80b98e2dd1c..9c2ed27c2e27 100644 --- a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestScheduledDialogs/changeRequestScheduledDialogs.tsx +++ b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestScheduledDialogs/changeRequestScheduledDialogs.tsx @@ -1,5 +1,5 @@ import type { FC } from 'react'; -import { APPLY_CHANGE_REQUEST } from '../../../providers/AccessProvider/permissions'; +import { APPLY_CHANGE_REQUEST } from '@server/types/permissions'; import PermissionButton from '../../../common/PermissionButton/PermissionButton'; import { ChangeRequestScheduledDialog, diff --git a/frontend/src/component/changeRequest/ChangeRequestOverview/ReviewButton/ReviewButton.tsx b/frontend/src/component/changeRequest/ChangeRequestOverview/ReviewButton/ReviewButton.tsx index 98704c3f7252..064dd840d6fe 100644 --- a/frontend/src/component/changeRequest/ChangeRequestOverview/ReviewButton/ReviewButton.tsx +++ b/frontend/src/component/changeRequest/ChangeRequestOverview/ReviewButton/ReviewButton.tsx @@ -4,7 +4,7 @@ import { type FC, useContext } from 'react'; import CheckBox from '@mui/icons-material/Check'; import Clear from '@mui/icons-material/Clear'; import { MultiActionButton } from 'component/common/MultiActionButton/MultiActionButton'; -import { APPROVE_CHANGE_REQUEST } from 'component/providers/AccessProvider/permissions'; +import { APPROVE_CHANGE_REQUEST } from '@server/types/permissions'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import { useAuthUser } from 'hooks/api/getters/useAuth/useAuthUser'; import AccessContext from 'contexts/AccessContext'; diff --git a/frontend/src/component/common/ApiTokenTable/CreateApiTokenButton/CreateApiTokenButton.test.tsx b/frontend/src/component/common/ApiTokenTable/CreateApiTokenButton/CreateApiTokenButton.test.tsx index 8b627826cd7f..15941e5ee637 100644 --- a/frontend/src/component/common/ApiTokenTable/CreateApiTokenButton/CreateApiTokenButton.test.tsx +++ b/frontend/src/component/common/ApiTokenTable/CreateApiTokenButton/CreateApiTokenButton.test.tsx @@ -2,7 +2,7 @@ import { screen, waitFor } from '@testing-library/react'; import { render } from 'utils/testRenderer'; import { testServerRoute, testServerSetup } from 'utils/testServer'; import { CreateApiTokenButton } from './CreateApiTokenButton'; -import { CREATE_PROJECT_API_TOKEN } from 'component/providers/AccessProvider/permissions'; +import { CREATE_PROJECT_API_TOKEN } from '@server/types/permissions'; const server = testServerSetup(); diff --git a/frontend/src/component/common/InstanceStatus/InstanceStatus.tsx b/frontend/src/component/common/InstanceStatus/InstanceStatus.tsx index b056a6a79450..c5ab6953d276 100644 --- a/frontend/src/component/common/InstanceStatus/InstanceStatus.tsx +++ b/frontend/src/component/common/InstanceStatus/InstanceStatus.tsx @@ -12,7 +12,7 @@ import { Dialogue } from 'component/common/Dialogue/Dialogue'; import { Typography } from '@mui/material'; import { useNavigate } from 'react-router-dom'; import { type IInstanceStatus, InstancePlan } from 'interfaces/instance'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import AccessContext from 'contexts/AccessContext'; import useInstanceStatusApi from 'hooks/api/actions/useInstanceStatusApi/useInstanceStatusApi'; import { trialHasExpired, canExtendTrial } from 'utils/instanceTrial'; diff --git a/frontend/src/component/common/InstanceStatus/InstanceStatusBar.tsx b/frontend/src/component/common/InstanceStatus/InstanceStatusBar.tsx index 27c950139dac..1c9c14172a8e 100644 --- a/frontend/src/component/common/InstanceStatus/InstanceStatusBar.tsx +++ b/frontend/src/component/common/InstanceStatus/InstanceStatusBar.tsx @@ -6,7 +6,7 @@ import WarningAmber from '@mui/icons-material/WarningAmber'; import { useNavigate } from 'react-router-dom'; import { useContext } from 'react'; import AccessContext from 'contexts/AccessContext'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { trialHasExpired, trialExpiresSoon, diff --git a/frontend/src/component/context/ContextList/AddContextButton.tsx b/frontend/src/component/context/ContextList/AddContextButton.tsx index f8a548559f4d..6b9191c01ea8 100644 --- a/frontend/src/component/context/ContextList/AddContextButton.tsx +++ b/frontend/src/component/context/ContextList/AddContextButton.tsx @@ -3,7 +3,7 @@ import { useNavigate } from 'react-router-dom'; import { useMediaQuery } from '@mui/material'; import Add from '@mui/icons-material/Add'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import { CREATE_CONTEXT_FIELD } from 'component/providers/AccessProvider/permissions'; +import { CREATE_CONTEXT_FIELD } from '@server/types/permissions'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; diff --git a/frontend/src/component/context/ContextList/ContextActionsCell.tsx b/frontend/src/component/context/ContextList/ContextActionsCell.tsx index 3aee67a8a1ff..24933bdbf44a 100644 --- a/frontend/src/component/context/ContextList/ContextActionsCell.tsx +++ b/frontend/src/component/context/ContextList/ContextActionsCell.tsx @@ -5,7 +5,7 @@ import Edit from '@mui/icons-material/Edit'; import { DELETE_CONTEXT_FIELD, UPDATE_CONTEXT_FIELD, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; import { ActionCell } from 'component/common/Table/cells/ActionCell/ActionCell'; diff --git a/frontend/src/component/context/CreateUnleashContext/CreateUnleashContext.tsx b/frontend/src/component/context/CreateUnleashContext/CreateUnleashContext.tsx index cde1b4c2bc60..a12df1e93eaa 100644 --- a/frontend/src/component/context/CreateUnleashContext/CreateUnleashContext.tsx +++ b/frontend/src/component/context/CreateUnleashContext/CreateUnleashContext.tsx @@ -2,7 +2,7 @@ import { CreateButton } from 'component/common/CreateButton/CreateButton'; import FormTemplate from 'component/common/FormTemplate/FormTemplate'; import { useContextForm } from '../hooks/useContextForm'; import { ContextForm } from '../ContextForm/ContextForm'; -import { CREATE_CONTEXT_FIELD } from 'component/providers/AccessProvider/permissions'; +import { CREATE_CONTEXT_FIELD } from '@server/types/permissions'; import useContextsApi from 'hooks/api/actions/useContextsApi/useContextsApi'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import useUnleashContext from 'hooks/api/getters/useUnleashContext/useUnleashContext'; diff --git a/frontend/src/component/context/EditContext/EditContext.tsx b/frontend/src/component/context/EditContext/EditContext.tsx index df53207f6f5a..26a320282422 100644 --- a/frontend/src/component/context/EditContext/EditContext.tsx +++ b/frontend/src/component/context/EditContext/EditContext.tsx @@ -1,6 +1,6 @@ import FormTemplate from 'component/common/FormTemplate/FormTemplate'; import { UpdateButton } from 'component/common/UpdateButton/UpdateButton'; -import { UPDATE_CONTEXT_FIELD } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_CONTEXT_FIELD } from '@server/types/permissions'; import useContextsApi from 'hooks/api/actions/useContextsApi/useContextsApi'; import useContext from 'hooks/api/getters/useContext/useContext'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; diff --git a/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.test.tsx b/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.test.tsx index 0765c75cae2a..d4fb601d26a4 100644 --- a/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.test.tsx +++ b/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.test.tsx @@ -2,7 +2,7 @@ import { screen } from '@testing-library/react'; import { render } from 'utils/testRenderer'; import { testServerRoute, testServerSetup } from '../../../utils/testServer'; import CreateEnvironment from './CreateEnvironment'; -import { ADMIN } from '../../providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; const server = testServerSetup(); diff --git a/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.tsx b/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.tsx index 4b8912506a98..b73012466fbd 100644 --- a/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.tsx +++ b/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.tsx @@ -8,7 +8,7 @@ import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import useToast from 'hooks/useToast'; import { useEnvironments } from 'hooks/api/getters/useEnvironments/useEnvironments'; import usePermissions from 'hooks/api/getters/usePermissions/usePermissions'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { formatUnknownError } from 'utils/formatUnknownError'; import { GO_BACK } from 'constants/navigate'; import { Limit } from 'component/common/Limit/Limit'; diff --git a/frontend/src/component/environments/CreateEnvironmentButton/CreateEnvironmentButton.tsx b/frontend/src/component/environments/CreateEnvironmentButton/CreateEnvironmentButton.tsx index aaf692523a34..feeba3d8d2de 100644 --- a/frontend/src/component/environments/CreateEnvironmentButton/CreateEnvironmentButton.tsx +++ b/frontend/src/component/environments/CreateEnvironmentButton/CreateEnvironmentButton.tsx @@ -1,6 +1,6 @@ import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton'; import Add from '@mui/icons-material/Add'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { useNavigate } from 'react-router-dom'; import { ThemeMode } from 'component/common/ThemeMode/ThemeMode'; import { ReactComponent as ProPlanIcon } from 'assets/icons/pro-enterprise-feature-badge.svg'; diff --git a/frontend/src/component/environments/EditEnvironment/EditEnvironment.tsx b/frontend/src/component/environments/EditEnvironment/EditEnvironment.tsx index 7ad42f912699..bcd6c5b9d277 100644 --- a/frontend/src/component/environments/EditEnvironment/EditEnvironment.tsx +++ b/frontend/src/component/environments/EditEnvironment/EditEnvironment.tsx @@ -6,7 +6,7 @@ import usePermissions from 'hooks/api/getters/usePermissions/usePermissions'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import useToast from 'hooks/useToast'; import { useNavigate } from 'react-router-dom'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import EnvironmentForm from '../EnvironmentForm/EnvironmentForm'; import useEnvironmentForm from '../hooks/useEnvironmentForm'; import { formatUnknownError } from 'utils/formatUnknownError'; diff --git a/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentActionCellPopover/EnvironmentActionCellPopover.tsx b/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentActionCellPopover/EnvironmentActionCellPopover.tsx index 77b645b1e21a..bf4ee719641c 100644 --- a/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentActionCellPopover/EnvironmentActionCellPopover.tsx +++ b/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentActionCellPopover/EnvironmentActionCellPopover.tsx @@ -13,8 +13,8 @@ import MoreVertIcon from '@mui/icons-material/MoreVert'; import { useState } from 'react'; import type { IEnvironment } from 'interfaces/environments'; import { PermissionHOC } from 'component/common/PermissionHOC/PermissionHOC'; +import { ADMIN } from '@server/types/permissions'; import { - ADMIN, DELETE_ENVIRONMENT, UPDATE_ENVIRONMENT, } from 'component/providers/AccessProvider/permissions'; diff --git a/frontend/src/component/events/EventPage/EventPage.tsx b/frontend/src/component/events/EventPage/EventPage.tsx index a5155a309bcc..267c4c8211ac 100644 --- a/frontend/src/component/events/EventPage/EventPage.tsx +++ b/frontend/src/component/events/EventPage/EventPage.tsx @@ -1,4 +1,4 @@ -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { PermissionGuard } from 'component/common/PermissionGuard/PermissionGuard'; import { EventLog } from 'component/events/EventLog/EventLog'; diff --git a/frontend/src/component/feature/CopyFeature/CopyFeature.test.tsx b/frontend/src/component/feature/CopyFeature/CopyFeature.test.tsx index f3a47c75b3ca..e3b659956559 100644 --- a/frontend/src/component/feature/CopyFeature/CopyFeature.test.tsx +++ b/frontend/src/component/feature/CopyFeature/CopyFeature.test.tsx @@ -2,7 +2,7 @@ import { render } from 'utils/testRenderer'; import { CopyFeatureToggle } from './CopyFeature'; import { Route, Routes } from 'react-router-dom'; import { screen } from '@testing-library/react'; -import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { CREATE_FEATURE } from '@server/types/permissions'; import { testServerRoute, testServerSetup } from 'utils/testServer'; const server = testServerSetup(); diff --git a/frontend/src/component/feature/EditFeature/EditFeature.tsx b/frontend/src/component/feature/EditFeature/EditFeature.tsx index 043018c58616..5c2928777342 100644 --- a/frontend/src/component/feature/EditFeature/EditFeature.tsx +++ b/frontend/src/component/feature/EditFeature/EditFeature.tsx @@ -4,7 +4,7 @@ import EditFeatureForm from '../FeatureForm/EditFeatureForm'; import useFeatureForm from '../hooks/useFeatureForm'; import * as jsonpatch from 'fast-json-patch'; import { UpdateButton } from 'component/common/UpdateButton/UpdateButton'; -import { UPDATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE } from '@server/types/permissions'; import useFeatureApi from 'hooks/api/actions/useFeatureApi/useFeatureApi'; import { useFeature } from 'hooks/api/getters/useFeature/useFeature'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyConstraints/FeatureStrategyConstraints.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyConstraints/FeatureStrategyConstraints.tsx index 9b06a315ad77..5c95c966d979 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyConstraints/FeatureStrategyConstraints.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyConstraints/FeatureStrategyConstraints.tsx @@ -4,7 +4,7 @@ import { useEffect } from 'react'; import { UPDATE_FEATURE_STRATEGY, CREATE_FEATURE_STRATEGY, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { useHasProjectEnvironmentAccess } from 'hooks/useHasAccess'; import { FeatureStrategyConstraintAccordionList } from './FeatureStrategyConstraintAccordionList/FeatureStrategyConstraintAccordionList'; diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.test.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.test.tsx index b136cf689650..e75465512ba9 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.test.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.test.tsx @@ -7,7 +7,7 @@ import { CREATE_FEATURE_STRATEGY, UPDATE_FEATURE_ENVIRONMENT_VARIANTS, UPDATE_FEATURE_STRATEGY, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { FeatureStrategyCreate } from './FeatureStrategyCreate'; import { setupProjectEndpoint, diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx index f743d7d5e922..953395051d56 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx @@ -18,7 +18,7 @@ import { featureStrategyHelp, formatFeaturePath, } from '../FeatureStrategyEdit/FeatureStrategyEdit'; -import { CREATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { CREATE_FEATURE_STRATEGY } from '@server/types/permissions'; import type { ISegment } from 'interfaces/segment'; import { useFormErrors } from 'hooks/useFormErrors'; import { createFeatureStrategy } from 'utils/createFeatureStrategy'; diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit.test.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit.test.tsx index 7c4642da17ba..54b047d668ae 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit.test.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit.test.tsx @@ -8,7 +8,7 @@ import { CREATE_FEATURE_STRATEGY, UPDATE_FEATURE_ENVIRONMENT_VARIANTS, UPDATE_FEATURE_STRATEGY, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { FeatureStrategyEdit } from './FeatureStrategyEdit'; import { setupContextEndpoint, diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit.tsx index cef2b718569e..b435adae049e 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit.tsx @@ -12,7 +12,7 @@ import type { IFeatureStrategyPayload, IStrategy, } from 'interfaces/strategy'; -import { UPDATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE_STRATEGY } from '@server/types/permissions'; import type { ISegment } from 'interfaces/segment'; import { useSegments } from 'hooks/api/getters/useSegments/useSegments'; import { useFormErrors } from 'hooks/useFormErrors'; diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/CopyButton/CopyButton.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/CopyButton/CopyButton.tsx index 4d849dca5fd4..41a0f66c7316 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/CopyButton/CopyButton.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/CopyButton/CopyButton.tsx @@ -11,7 +11,7 @@ import Lock from '@mui/icons-material/Lock'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import type { IFeatureEnvironment } from 'interfaces/featureToggle'; import AccessContext from 'contexts/AccessContext'; -import { CREATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { CREATE_FEATURE_STRATEGY } from '@server/types/permissions'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; interface ICopyButtonProps { diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyMenu/FeatureStrategyMenu.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyMenu/FeatureStrategyMenu.tsx index e456fa09a127..6f3bf6028b47 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyMenu/FeatureStrategyMenu.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyMenu/FeatureStrategyMenu.tsx @@ -4,7 +4,7 @@ import { useNavigate } from 'react-router-dom'; import PermissionButton, { type IPermissionButtonProps, } from 'component/common/PermissionButton/PermissionButton'; -import { CREATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { CREATE_FEATURE_STRATEGY } from '@server/types/permissions'; import { Popover, styled } from '@mui/material'; import { FeatureStrategyMenuCards } from './FeatureStrategyMenuCards/FeatureStrategyMenuCards'; import { formatCreateStrategyPath } from '../FeatureStrategyCreate/FeatureStrategyCreate'; diff --git a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListActions/FeatureToggleListActions.tsx b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListActions/FeatureToggleListActions.tsx index 49591e6eaad5..9230a678e6af 100644 --- a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListActions/FeatureToggleListActions.tsx +++ b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListActions/FeatureToggleListActions.tsx @@ -13,7 +13,7 @@ import { import Add from '@mui/icons-material/Add'; import MoreVert from '@mui/icons-material/MoreVert'; import { Link } from 'react-router-dom'; -import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { CREATE_FEATURE } from '@server/types/permissions'; import { PermissionHOC } from 'component/common/PermissionHOC/PermissionHOC'; import { useCreateFeaturePath } from 'component/feature/CreateFeatureButton/useCreateFeaturePath'; import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.test.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.test.tsx index 0504e27f78e8..fa2744e2836f 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.test.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.test.tsx @@ -4,10 +4,7 @@ import { render } from 'utils/testRenderer'; import userEvent from '@testing-library/user-event'; import { vi } from 'vitest'; import type { LifecycleStage } from './LifecycleStage'; -import { - DELETE_FEATURE, - UPDATE_FEATURE, -} from 'component/providers/AccessProvider/permissions'; +import { DELETE_FEATURE, UPDATE_FEATURE } from '@server/types/permissions'; const currentTime = '2024-04-25T08:05:00.000Z'; const twoMinutesAgo = '2024-04-25T08:03:00.000Z'; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.tsx index 3e39e9c81848..887bfb990d97 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.tsx @@ -16,10 +16,7 @@ import { StyledIconWrapper } from '../../FeatureEnvironmentSeen/FeatureEnvironme import { useLastSeenColors } from '../../FeatureEnvironmentSeen/useLastSeenColors'; import type { LifecycleStage } from './LifecycleStage'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; -import { - DELETE_FEATURE, - UPDATE_FEATURE, -} from 'component/providers/AccessProvider/permissions'; +import { DELETE_FEATURE, UPDATE_FEATURE } from '@server/types/permissions'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { isSafeToArchive } from './isSafeToArchive'; import { useLocationSettings } from 'hooks/useLocationSettings'; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyDraggableItem.test.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyDraggableItem.test.tsx index e69c17ec232d..421e64b7a287 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyDraggableItem.test.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyDraggableItem.test.tsx @@ -2,7 +2,7 @@ import { testServerRoute, testServerSetup } from 'utils/testServer'; import { render } from 'utils/testRenderer'; import { StrategyDraggableItem } from './StrategyDraggableItem'; import { vi } from 'vitest'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { screen } from '@testing-library/react'; import { Route, Routes } from 'react-router-dom'; import type { diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/CopyStrategyIconMenu/CopyStrategyIconMenu.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/CopyStrategyIconMenu/CopyStrategyIconMenu.tsx index 53af5bbec3d6..1cae9035bbec 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/CopyStrategyIconMenu/CopyStrategyIconMenu.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/CopyStrategyIconMenu/CopyStrategyIconMenu.tsx @@ -12,7 +12,7 @@ import Lock from '@mui/icons-material/Lock'; import type { IFeatureStrategyPayload } from 'interfaces/strategy'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import type { IFeatureEnvironment } from 'interfaces/featureToggle'; -import { CREATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { CREATE_FEATURE_STRATEGY } from '@server/types/permissions'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { useFeature } from 'hooks/api/getters/useFeature/useFeature'; import useFeatureStrategyApi from 'hooks/api/actions/useFeatureStrategyApi/useFeatureStrategyApi'; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem.tsx index 2e7cd133ec74..3d6dfbfcadff 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem.tsx @@ -4,7 +4,7 @@ import { Link } from 'react-router-dom'; import type { IFeatureEnvironment } from 'interfaces/featureToggle'; import type { IFeatureStrategy } from 'interfaces/strategy'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; -import { UPDATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE_STRATEGY } from '@server/types/permissions'; import { formatEditStrategyPath } from 'component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import { StrategyExecution } from './StrategyExecution/StrategyExecution'; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.test.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.test.tsx index 71ed62ce9b88..4b0e43e1459a 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.test.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.test.tsx @@ -2,7 +2,7 @@ import { screen } from '@testing-library/react'; import { render } from 'utils/testRenderer'; import FeatureOverviewEnvironment from './FeatureOverviewEnvironment'; import { Route, Routes } from 'react-router-dom'; -import { CREATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { CREATE_FEATURE_STRATEGY } from '@server/types/permissions'; const environmentWithoutStrategies = { name: 'production', diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/DependencyRow.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/DependencyRow.tsx index cb872ba5059f..a888eab3cc6a 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/DependencyRow.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/DependencyRow.tsx @@ -8,7 +8,7 @@ import { useDependentFeaturesApi } from 'hooks/api/actions/useDependentFeaturesA import { useFeature } from 'hooks/api/getters/useFeature/useFeature'; import { ChildrenTooltip } from './ChildrenTooltip'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; -import { UPDATE_FEATURE_DEPENDENCY } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE_DEPENDENCY } from '@server/types/permissions'; import { useCheckProjectAccess } from 'hooks/useHasAccess'; import { useChangeRequestApi } from 'hooks/api/actions/useChangeRequestApi/useChangeRequestApi'; import { usePendingChangeRequests } from 'hooks/api/getters/usePendingChangeRequests/usePendingChangeRequests'; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/OldDependencyRow.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/OldDependencyRow.tsx index 556f6b555c22..84b6a6672c65 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/OldDependencyRow.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/OldDependencyRow.tsx @@ -13,7 +13,7 @@ import { useDependentFeaturesApi } from 'hooks/api/actions/useDependentFeaturesA import { useFeature } from 'hooks/api/getters/useFeature/useFeature'; import { ChildrenTooltip } from './ChildrenTooltip'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; -import { UPDATE_FEATURE_DEPENDENCY } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE_DEPENDENCY } from '@server/types/permissions'; import { useCheckProjectAccess } from 'hooks/useHasAccess'; import { useChangeRequestApi } from 'hooks/api/actions/useChangeRequestApi/useChangeRequestApi'; import { usePendingChangeRequests } from 'hooks/api/getters/usePendingChangeRequests/usePendingChangeRequests'; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/OldFeatureOverviewMetaData.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/OldFeatureOverviewMetaData.tsx index a6e86dedbce4..39ee297046a1 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/OldFeatureOverviewMetaData.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/OldFeatureOverviewMetaData.tsx @@ -5,7 +5,7 @@ import { getFeatureTypeIcons } from 'utils/getFeatureTypeIcons'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import Edit from '@mui/icons-material/Edit'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; -import { UPDATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE } from '@server/types/permissions'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import { FeatureArchiveDialog } from 'component/common/FeatureArchiveDialog/FeatureArchiveDialog'; import { useState } from 'react'; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/TagRow.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/TagRow.tsx index cd5d942c36fe..b0d9b3a255a6 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/TagRow.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/TagRow.tsx @@ -5,7 +5,7 @@ import useFeatureTags from 'hooks/api/getters/useFeatureTags/useFeatureTags'; import Add from '@mui/icons-material/Add'; import ClearIcon from '@mui/icons-material/Clear'; import { ManageTagsDialog } from 'component/feature/FeatureView/FeatureOverview/ManageTagsDialog/ManageTagsDialog'; -import { UPDATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE } from '@server/types/permissions'; import AccessContext from 'contexts/AccessContext'; import { Dialogue } from 'component/common/Dialogue/Dialogue'; import type { ITag } from 'interfaces/tags'; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewSidePanel/FeatureOverviewSidePanelTags/FeatureOverviewSidePanelTags.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewSidePanel/FeatureOverviewSidePanelTags/FeatureOverviewSidePanelTags.tsx index 6a91257fd21a..d7695d675bf9 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewSidePanel/FeatureOverviewSidePanelTags/FeatureOverviewSidePanelTags.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewSidePanel/FeatureOverviewSidePanelTags/FeatureOverviewSidePanelTags.tsx @@ -5,7 +5,7 @@ import useFeatureTags from 'hooks/api/getters/useFeatureTags/useFeatureTags'; import Add from '@mui/icons-material/Add'; import Cancel from '@mui/icons-material/Cancel'; import { ManageTagsDialog } from 'component/feature/FeatureView/FeatureOverview/ManageTagsDialog/ManageTagsDialog'; -import { UPDATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE } from '@server/types/permissions'; import AccessContext from 'contexts/AccessContext'; import { Dialogue } from 'component/common/Dialogue/Dialogue'; import type { ITag } from 'interfaces/tags'; diff --git a/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsInformation/FeatureSettingsInformation.tsx b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsInformation/FeatureSettingsInformation.tsx index ebc14f02b8be..4012e0a4bed4 100644 --- a/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsInformation/FeatureSettingsInformation.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsInformation/FeatureSettingsInformation.tsx @@ -3,7 +3,7 @@ import Edit from '@mui/icons-material/Edit'; import { useNavigate } from 'react-router-dom'; import { useFeature } from 'hooks/api/getters/useFeature/useFeature'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; -import { UPDATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE } from '@server/types/permissions'; interface IFeatureSettingsInformationProps { projectId: string; diff --git a/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx index ef827e1151a1..972d2755cc9b 100644 --- a/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx @@ -4,7 +4,7 @@ import AccessContext from 'contexts/AccessContext'; import useFeatureApi from 'hooks/api/actions/useFeatureApi/useFeatureApi'; import { useFeature } from 'hooks/api/getters/useFeature/useFeature'; import useToast from 'hooks/useToast'; -import { MOVE_FEATURE_TOGGLE } from 'component/providers/AccessProvider/permissions'; +import { MOVE_FEATURE_TOGGLE } from '@server/types/permissions'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; import FeatureProjectSelect from './FeatureProjectSelect/FeatureProjectSelect'; import FeatureSettingsProjectConfirm from './FeatureSettingsProjectConfirm/FeatureSettingsProjectConfirm'; diff --git a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsCard/EnvironmentVariantsCard.test.tsx b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsCard/EnvironmentVariantsCard.test.tsx index 49c8a721317a..475a51deb155 100644 --- a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsCard/EnvironmentVariantsCard.test.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsCard/EnvironmentVariantsCard.test.tsx @@ -1,6 +1,6 @@ import { testServerRoute, testServerSetup } from 'utils/testServer'; import { render } from 'utils/testRenderer'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { screen } from '@testing-library/react'; import { Route, Routes } from 'react-router-dom'; import type { diff --git a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/EnvironmentVariantsModal.tsx b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/EnvironmentVariantsModal.tsx index b4794a14c2dd..46e1f9998470 100644 --- a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/EnvironmentVariantsModal.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/EnvironmentVariantsModal.tsx @@ -16,7 +16,7 @@ import { useChangeRequestInReviewWarning } from 'hooks/useChangeRequestInReviewW import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled'; import { VariantForm } from './VariantForm/VariantForm'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; -import { UPDATE_FEATURE_ENVIRONMENT_VARIANTS } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE_ENVIRONMENT_VARIANTS } from '@server/types/permissions'; import { WeightType } from 'constants/variantTypes'; import { v4 as uuidv4 } from 'uuid'; import useUnleashContext from 'hooks/api/getters/useUnleashContext/useUnleashContext'; diff --git a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/FeatureEnvironmentVariants.tsx b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/FeatureEnvironmentVariants.tsx index abf8c007028f..fc5a3b9133ae 100644 --- a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/FeatureEnvironmentVariants.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/FeatureEnvironmentVariants.tsx @@ -7,7 +7,7 @@ import { PageHeader } from 'component/common/PageHeader/PageHeader'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; import { Search } from 'component/common/Search/Search'; import { updateWeight } from 'component/common/util'; -import { UPDATE_FEATURE_ENVIRONMENT_VARIANTS } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE_ENVIRONMENT_VARIANTS } from '@server/types/permissions'; import { useFeature } from 'hooks/api/getters/useFeature/useFeature'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import type { diff --git a/frontend/src/component/feature/FeatureView/FeatureView.tsx b/frontend/src/component/feature/FeatureView/FeatureView.tsx index b666ca989087..c0da43545dbb 100644 --- a/frontend/src/component/feature/FeatureView/FeatureView.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureView.tsx @@ -25,7 +25,7 @@ import { CREATE_FEATURE, DELETE_FEATURE, UPDATE_FEATURE, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; import FeatureLog from './FeatureLog/FeatureLog'; import FeatureOverview from './FeatureOverview/FeatureOverview'; diff --git a/frontend/src/component/feature/StrategyTypes/NewStrategyVariants.tsx b/frontend/src/component/feature/StrategyTypes/NewStrategyVariants.tsx index add4389fa196..b951e92eba45 100644 --- a/frontend/src/component/feature/StrategyTypes/NewStrategyVariants.tsx +++ b/frontend/src/component/feature/StrategyTypes/NewStrategyVariants.tsx @@ -4,7 +4,7 @@ import type React from 'react'; import { type FC, useEffect, useState } from 'react'; import type { IFeatureVariantEdit } from '../FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/EnvironmentVariantsModal'; import PermissionButton from '../../common/PermissionButton/PermissionButton'; -import { UPDATE_FEATURE_ENVIRONMENT_VARIANTS } from '../../providers/AccessProvider/permissions'; +import { UPDATE_FEATURE_ENVIRONMENT_VARIANTS } from '@server/types/permissions'; import { v4 as uuidv4 } from 'uuid'; import { WeightType } from '../../../constants/variantTypes'; import { Box, styled, Typography, useTheme } from '@mui/material'; diff --git a/frontend/src/component/feature/StrategyTypes/StrategyVariants.test.tsx b/frontend/src/component/feature/StrategyTypes/StrategyVariants.test.tsx index 78f2aa913c62..207ff8e65a28 100644 --- a/frontend/src/component/feature/StrategyTypes/StrategyVariants.test.tsx +++ b/frontend/src/component/feature/StrategyTypes/StrategyVariants.test.tsx @@ -2,7 +2,7 @@ import { screen, waitFor } from '@testing-library/react'; import { render } from 'utils/testRenderer'; import { StrategyVariants } from './StrategyVariants'; import { Route, Routes } from 'react-router-dom'; -import { UPDATE_FEATURE_ENVIRONMENT_VARIANTS } from '../../providers/AccessProvider/permissions'; +import { UPDATE_FEATURE_ENVIRONMENT_VARIANTS } from '@server/types/permissions'; import type { IFeatureStrategy } from '../../../interfaces/strategy'; import { useState } from 'react'; diff --git a/frontend/src/component/feature/StrategyTypes/StrategyVariants.tsx b/frontend/src/component/feature/StrategyTypes/StrategyVariants.tsx index 33cd56e7dfad..035acb75f4d4 100644 --- a/frontend/src/component/feature/StrategyTypes/StrategyVariants.tsx +++ b/frontend/src/component/feature/StrategyTypes/StrategyVariants.tsx @@ -4,7 +4,7 @@ import type React from 'react'; import { type FC, useEffect, useState } from 'react'; import type { IFeatureVariantEdit } from '../FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/EnvironmentVariantsModal'; import PermissionButton from '../../common/PermissionButton/PermissionButton'; -import { UPDATE_FEATURE_ENVIRONMENT_VARIANTS } from '../../providers/AccessProvider/permissions'; +import { UPDATE_FEATURE_ENVIRONMENT_VARIANTS } from '@server/types/permissions'; import { v4 as uuidv4 } from 'uuid'; import { WeightType } from '../../../constants/variantTypes'; import { Link, styled, Typography, useTheme } from '@mui/material'; diff --git a/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.tsx b/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.tsx index 5bd994bf3178..f167c47b2089 100644 --- a/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.tsx +++ b/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.tsx @@ -6,7 +6,7 @@ import { useFeatureTypeApi } from 'hooks/api/actions/useFeatureTypeApi/useFeatur import FormTemplate from 'component/common/FormTemplate/FormTemplate'; import NotFound from 'component/common/NotFound/NotFound'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { GO_BACK } from 'constants/navigate'; import Input from 'component/common/Input/Input'; import type { FeatureTypeSchema } from 'openapi'; diff --git a/frontend/src/component/featureTypes/FeatureTypesList.tsx b/frontend/src/component/featureTypes/FeatureTypesList.tsx index 9665dcc55945..8c6580854e2f 100644 --- a/frontend/src/component/featureTypes/FeatureTypesList.tsx +++ b/frontend/src/component/featureTypes/FeatureTypesList.tsx @@ -18,7 +18,7 @@ import { getFeatureTypeIcons } from 'utils/getFeatureTypeIcons'; import { IconCell } from 'component/common/Table/cells/IconCell/IconCell'; import { ActionCell } from 'component/common/Table/cells/ActionCell/ActionCell'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import Edit from '@mui/icons-material/Edit'; import { SidebarModal } from 'component/common/SidebarModal/SidebarModal'; import { FeatureTypeEdit } from './FeatureTypeEdit/FeatureTypeEdit'; diff --git a/frontend/src/component/integrations/IntegrationForm/IntegrationDelete/IntegrationDelete.tsx b/frontend/src/component/integrations/IntegrationForm/IntegrationDelete/IntegrationDelete.tsx index 6ab997986f6f..e5c1e5513d38 100644 --- a/frontend/src/component/integrations/IntegrationForm/IntegrationDelete/IntegrationDelete.tsx +++ b/frontend/src/component/integrations/IntegrationForm/IntegrationDelete/IntegrationDelete.tsx @@ -8,7 +8,7 @@ import useAddons from 'hooks/api/getters/useAddons/useAddons'; import useToast from 'hooks/useToast'; import { formatUnknownError } from 'utils/formatUnknownError'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; -import { DELETE_ADDON } from 'component/providers/AccessProvider/permissions'; +import { DELETE_ADDON } from '@server/types/permissions'; import { StyledHelpText, StyledTitle } from '../IntegrationForm.styles'; interface IIntegrationDeleteProps { diff --git a/frontend/src/component/integrations/IntegrationForm/IntegrationForm.tsx b/frontend/src/component/integrations/IntegrationForm/IntegrationForm.tsx index 5942d714c61d..abb799ef82b5 100644 --- a/frontend/src/component/integrations/IntegrationForm/IntegrationForm.tsx +++ b/frontend/src/component/integrations/IntegrationForm/IntegrationForm.tsx @@ -31,10 +31,7 @@ import { IntegrationMultiSelector } from './IntegrationMultiSelector/Integration import FormTemplate from 'component/common/FormTemplate/FormTemplate'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; -import { - CREATE_ADDON, - UPDATE_ADDON, -} from '../../providers/AccessProvider/permissions'; +import { CREATE_ADDON, UPDATE_ADDON } from '@server/types/permissions'; import { StyledForm, StyledAlerts, diff --git a/frontend/src/component/integrations/IntegrationList/IntegrationCard/IntegrationCardMenu/IntegrationCardMenu.tsx b/frontend/src/component/integrations/IntegrationList/IntegrationCard/IntegrationCardMenu/IntegrationCardMenu.tsx index f83b911e9dd3..7012944c875c 100644 --- a/frontend/src/component/integrations/IntegrationList/IntegrationCard/IntegrationCardMenu/IntegrationCardMenu.tsx +++ b/frontend/src/component/integrations/IntegrationList/IntegrationCard/IntegrationCardMenu/IntegrationCardMenu.tsx @@ -13,11 +13,7 @@ import MoreVertIcon from '@mui/icons-material/MoreVert'; import Delete from '@mui/icons-material/Delete'; import PowerSettingsNew from '@mui/icons-material/PowerSettingsNew'; -import { - ADMIN, - DELETE_ADDON, - UPDATE_ADDON, -} from 'component/providers/AccessProvider/permissions'; +import { ADMIN, DELETE_ADDON, UPDATE_ADDON } from '@server/types/permissions'; import { useHasRootAccess } from 'hooks/useHasAccess'; import useAddonsApi from 'hooks/api/actions/useAddonsApi/useAddonsApi'; import type { AddonSchema } from 'openapi'; diff --git a/frontend/src/component/loginHistory/LoginHistory.tsx b/frontend/src/component/loginHistory/LoginHistory.tsx index bbd8b4674a2b..e899b372effd 100644 --- a/frontend/src/component/loginHistory/LoginHistory.tsx +++ b/frontend/src/component/loginHistory/LoginHistory.tsx @@ -1,4 +1,4 @@ -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { PermissionGuard } from 'component/common/PermissionGuard/PermissionGuard'; import { LoginHistoryTable } from './LoginHistoryTable/LoginHistoryTable'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; diff --git a/frontend/src/component/loginHistory/LoginHistoryTable/LoginHistoryActionsCell/LoginHistoryActionsCell.tsx b/frontend/src/component/loginHistory/LoginHistoryTable/LoginHistoryActionsCell/LoginHistoryActionsCell.tsx index e81aeb57829b..2c522a8a866f 100644 --- a/frontend/src/component/loginHistory/LoginHistoryTable/LoginHistoryActionsCell/LoginHistoryActionsCell.tsx +++ b/frontend/src/component/loginHistory/LoginHistoryTable/LoginHistoryActionsCell/LoginHistoryActionsCell.tsx @@ -1,7 +1,7 @@ import Delete from '@mui/icons-material/Delete'; import { Box, styled } from '@mui/material'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; const StyledBox = styled(Box)(() => ({ display: 'flex', diff --git a/frontend/src/component/menu/Header/InviteLink/InviteLinkButton/InviteLinkButton.test.tsx b/frontend/src/component/menu/Header/InviteLink/InviteLinkButton/InviteLinkButton.test.tsx index c6f0658d6c07..50ba51a34822 100644 --- a/frontend/src/component/menu/Header/InviteLink/InviteLinkButton/InviteLinkButton.test.tsx +++ b/frontend/src/component/menu/Header/InviteLink/InviteLinkButton/InviteLinkButton.test.tsx @@ -2,7 +2,7 @@ import { render } from 'utils/testRenderer'; import { screen } from '@testing-library/react'; import InviteLinkButton from './InviteLinkButton'; import { AccessProviderMock } from 'component/providers/AccessProvider/AccessProviderMock'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { testServerRoute, testServerSetup } from 'utils/testServer'; const server = testServerSetup(); diff --git a/frontend/src/component/onboarding/flow/ProjectOnboarding.tsx b/frontend/src/component/onboarding/flow/ProjectOnboarding.tsx index d4f9399edafd..784bd8ab4665 100644 --- a/frontend/src/component/onboarding/flow/ProjectOnboarding.tsx +++ b/frontend/src/component/onboarding/flow/ProjectOnboarding.tsx @@ -3,7 +3,7 @@ import Add from '@mui/icons-material/Add'; import { UPDATE_PROJECT, CREATE_PROJECT_API_TOKEN, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { FlagCreationButton } from '../../project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/ProjectFeatureTogglesHeader'; import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton'; import useProjectOverview from 'hooks/api/getters/useProjectOverview/useProjectOverview'; diff --git a/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.test.tsx b/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.test.tsx index e8ca32bbcc04..5bba2774cc26 100644 --- a/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.test.tsx +++ b/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.test.tsx @@ -2,7 +2,7 @@ import { render } from 'utils/testRenderer'; import { screen, waitFor } from '@testing-library/react'; import { testServerRoute, testServerSetup } from 'utils/testServer'; import { CreateProjectDialog } from './CreateProjectDialog'; -import { CREATE_PROJECT } from '../../../../providers/AccessProvider/permissions'; +import { CREATE_PROJECT } from '@server/types/permissions'; const server = testServerSetup(); diff --git a/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.tsx b/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.tsx index 392de50f21fe..dfbb851dc485 100644 --- a/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.tsx +++ b/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.tsx @@ -6,7 +6,7 @@ import ProjectModeIcon from '@mui/icons-material/Adjust'; import useProjectApi from 'hooks/api/actions/useProjectApi/useProjectApi'; import useToast from 'hooks/useToast'; import FormTemplate from 'component/common/FormTemplate/FormTemplate'; -import { CREATE_PROJECT } from 'component/providers/AccessProvider/permissions'; +import { CREATE_PROJECT } from '@server/types/permissions'; import useProjectForm, { DEFAULT_PROJECT_STICKINESS, } from '../../hooks/useProjectForm'; diff --git a/frontend/src/component/project/Project/Import/Import.test.tsx b/frontend/src/component/project/Project/Import/Import.test.tsx index f6ed505f5dfb..61a6b10f1ac1 100644 --- a/frontend/src/component/project/Project/Import/Import.test.tsx +++ b/frontend/src/component/project/Project/Import/Import.test.tsx @@ -3,7 +3,7 @@ import { fireEvent, screen, waitFor } from '@testing-library/react'; import { ImportModal } from './ImportModal'; import { testServerRoute, testServerSetup } from 'utils/testServer'; import userEvent from '@testing-library/user-event'; -import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { CREATE_FEATURE } from '@server/types/permissions'; const server = testServerSetup(); diff --git a/frontend/src/component/project/Project/Import/validate/ValidationStage.tsx b/frontend/src/component/project/Project/Import/validate/ValidationStage.tsx index 609d6ac11a30..95948f4bf248 100644 --- a/frontend/src/component/project/Project/Import/validate/ValidationStage.tsx +++ b/frontend/src/component/project/Project/Import/validate/ValidationStage.tsx @@ -11,7 +11,7 @@ import { formatUnknownError } from 'utils/formatUnknownError'; import { ActionsContainer } from '../ActionsContainer'; import { IMPORT_CONFIGURATION_BUTTON } from 'utils/testIds'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; -import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { CREATE_FEATURE } from '@server/types/permissions'; import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; const ImportInfoContainer = styled(Box)(({ theme }) => ({ diff --git a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/CreateFeatureDialog.tsx b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/CreateFeatureDialog.tsx index 689879f65003..e096bef77f7e 100644 --- a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/CreateFeatureDialog.tsx +++ b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/CreateFeatureDialog.tsx @@ -1,7 +1,7 @@ import { formatUnknownError } from 'utils/formatUnknownError'; import useToast from 'hooks/useToast'; import FormTemplate from 'component/common/FormTemplate/FormTemplate'; -import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { CREATE_FEATURE } from '@server/types/permissions'; import { type ReactNode, useState, type FormEvent, useMemo } from 'react'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { useNavigate } from 'react-router-dom'; diff --git a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/ProjectFeatureTogglesHeader.tsx b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/ProjectFeatureTogglesHeader.tsx index 844faed9eb72..bd2b3206373e 100644 --- a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/ProjectFeatureTogglesHeader.tsx +++ b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/ProjectFeatureTogglesHeader.tsx @@ -17,7 +17,7 @@ import { styled } from '@mui/material'; import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton'; import { useSearchParams } from 'react-router-dom'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; -import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { CREATE_FEATURE } from '@server/types/permissions'; import { ExportDialog } from 'component/feature/FeatureToggleList/ExportDialog'; import type { FeatureSchema } from 'openapi'; import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; diff --git a/frontend/src/component/project/Project/Project.tsx b/frontend/src/component/project/Project/Project.tsx index 6607c3a05495..cf300c54c1ce 100644 --- a/frontend/src/component/project/Project/Project.tsx +++ b/frontend/src/component/project/Project/Project.tsx @@ -32,7 +32,7 @@ import { ProjectFeaturesArchive } from './ProjectFeaturesArchive/ProjectFeatures 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 { UPDATE_FEATURE } from '@server/types/permissions'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { Navigate, Route, Routes, useLocation } from 'react-router-dom'; diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/ActionsCell/ActionsCell.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/ActionsCell/ActionsCell.tsx index 36367cd99f75..6dd02958c635 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/ActionsCell/ActionsCell.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/ActionsCell/ActionsCell.tsx @@ -23,7 +23,7 @@ import { CREATE_FEATURE, DELETE_FEATURE, UPDATE_FEATURE, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { defaultBorderRadius } from 'themes/themeStyles'; import copy from 'copy-to-clipboard'; import useToast from 'hooks/useToast'; diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/FeatureToggleSwitch/EnableEnvironmentDialog/EnableEnvironmentDialog.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/FeatureToggleSwitch/EnableEnvironmentDialog/EnableEnvironmentDialog.tsx index 7dd8cbf4b64e..21a252a887b0 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/FeatureToggleSwitch/EnableEnvironmentDialog/EnableEnvironmentDialog.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/FeatureToggleSwitch/EnableEnvironmentDialog/EnableEnvironmentDialog.tsx @@ -3,7 +3,7 @@ import { Typography, styled } from '@mui/material'; import { Dialogue } from 'component/common/Dialogue/Dialogue'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; -import { UPDATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE } from '@server/types/permissions'; import { useFeature } from 'hooks/api/getters/useFeature/useFeature'; const StyledList = styled('ul')(({ theme }) => ({ diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/FeatureToggleSwitch/FeatureToggleSwitch.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/FeatureToggleSwitch/FeatureToggleSwitch.tsx index 20bf331e947f..b82150295e42 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/FeatureToggleSwitch/FeatureToggleSwitch.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/FeatureToggleSwitch/FeatureToggleSwitch.tsx @@ -1,7 +1,7 @@ import type { VFC } from 'react'; import { Box, styled } from '@mui/material'; import PermissionSwitch from 'component/common/PermissionSwitch/PermissionSwitch'; -import { UPDATE_FEATURE_ENVIRONMENT } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE_ENVIRONMENT } from '@server/types/permissions'; import { useOptimisticUpdate } from './hooks/useOptimisticUpdate'; import { flexRow } from 'themes/themeStyles'; diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ArchiveButton.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ArchiveButton.tsx index 7396793084f9..d3c5158a912b 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ArchiveButton.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ArchiveButton.tsx @@ -1,7 +1,7 @@ import { useMemo, useState, type VFC } from 'react'; import { Button } from '@mui/material'; import { PermissionHOC } from 'component/common/PermissionHOC/PermissionHOC'; -import { DELETE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { DELETE_FEATURE } from '@server/types/permissions'; import { FeatureArchiveDialog } from 'component/common/FeatureArchiveDialog/FeatureArchiveDialog'; import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; import type { FeatureSchema } from 'openapi'; diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ManageTags.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ManageTags.tsx index cc2bb45d2e8f..34c08697e2e8 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ManageTags.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ManageTags.tsx @@ -7,7 +7,7 @@ import useTagApi from 'hooks/api/actions/useTagApi/useTagApi'; import useToast from 'hooks/useToast'; import { formatUnknownError } from 'utils/formatUnknownError'; import { PermissionHOC } from 'component/common/PermissionHOC/PermissionHOC'; -import { UPDATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE } from '@server/types/permissions'; import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; interface IManageTagsProps { diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/MoreActions.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/MoreActions.tsx index 63117b1c3a0d..ade4f8f07268 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/MoreActions.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/MoreActions.tsx @@ -10,7 +10,7 @@ import { Typography, } from '@mui/material'; import { PermissionHOC } from 'component/common/PermissionHOC/PermissionHOC'; -import { UPDATE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_FEATURE } from '@server/types/permissions'; import MoreVert from '@mui/icons-material/MoreVert'; import WatchLater from '@mui/icons-material/WatchLater'; import type { FeatureSchema } from 'openapi'; diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ProjectFeaturesBatchActions.test.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ProjectFeaturesBatchActions.test.tsx index 1a4a4e42d013..67868d355e62 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ProjectFeaturesBatchActions.test.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ProjectFeaturesBatchActions.test.tsx @@ -1,7 +1,7 @@ import { render } from 'utils/testRenderer'; import { screen, waitFor } from '@testing-library/react'; import { ProjectFeaturesBatchActions } from './ProjectFeaturesBatchActions'; -import { DELETE_FEATURE } from 'component/providers/AccessProvider/permissions'; +import { DELETE_FEATURE } from '@server/types/permissions'; import { testServerRoute, testServerSetup } from 'utils/testServer'; const server = testServerSetup(); diff --git a/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx b/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx index 21bcdb64be55..f849dc7d36b9 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx @@ -7,7 +7,7 @@ import AccessContext from 'contexts/AccessContext'; import { PROJECT_CHANGE_REQUEST_READ, UPDATE_PROJECT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import { usePageTitle } from 'hooks/usePageTitle'; import { ChangeRequestTable } from './ChangeRequestTable'; diff --git a/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestTable.tsx b/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestTable.tsx index 123444e5f795..a0f58b515143 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestTable.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestTable.tsx @@ -30,7 +30,7 @@ import KeyboardArrowDownOutlined from '@mui/icons-material/KeyboardArrowDownOutl import { useTheme } from '@mui/material/styles'; import AccessContext from 'contexts/AccessContext'; import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; -import { PROJECT_CHANGE_REQUEST_WRITE } from '../../../../providers/AccessProvider/permissions'; +import { PROJECT_CHANGE_REQUEST_WRITE } from '@server/types/permissions'; const StyledBox = styled(Box)(({ theme }) => ({ padding: theme.spacing(1), diff --git a/frontend/src/component/project/Project/ProjectSettings/ProjectActions/ProjectActionsTable/ProjectActionsTableActionsCell.tsx b/frontend/src/component/project/Project/ProjectSettings/ProjectActions/ProjectActionsTable/ProjectActionsTableActionsCell.tsx index 53117f78d88c..09edd6356eaf 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ProjectActions/ProjectActionsTable/ProjectActionsTableActionsCell.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ProjectActions/ProjectActionsTable/ProjectActionsTableActionsCell.tsx @@ -16,7 +16,7 @@ import Delete from '@mui/icons-material/Delete'; import Edit from '@mui/icons-material/Edit'; import Visibility from '@mui/icons-material/Visibility'; import { PermissionHOC } from 'component/common/PermissionHOC/PermissionHOC'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { defaultBorderRadius } from 'themes/themeStyles'; const StyledBoxCell = styled(Box)({ diff --git a/frontend/src/component/project/Project/ProjectSettings/ProjectApiAccess/CreateProjectApiTokenForm.tsx b/frontend/src/component/project/Project/ProjectSettings/ProjectApiAccess/CreateProjectApiTokenForm.tsx index 9fcf54190ad9..c4b22fa04753 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ProjectApiAccess/CreateProjectApiTokenForm.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ProjectApiAccess/CreateProjectApiTokenForm.tsx @@ -6,7 +6,7 @@ import { CreateButton } from 'component/common/CreateButton/CreateButton'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import useToast from 'hooks/useToast'; import { useApiTokenForm } from 'component/admin/apiToken/ApiTokenForm/useApiTokenForm'; -import { CREATE_PROJECT_API_TOKEN } from 'component/providers/AccessProvider/permissions'; +import { CREATE_PROJECT_API_TOKEN } from '@server/types/permissions'; import { scrollToTop } from 'component/common/util'; import { formatUnknownError } from 'utils/formatUnknownError'; import { usePageTitle } from 'hooks/usePageTitle'; diff --git a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectDefaultStrategySettings.tsx b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectDefaultStrategySettings.tsx index ae11b1f93ad4..c054140cb5cb 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectDefaultStrategySettings.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectDefaultStrategySettings.tsx @@ -8,7 +8,7 @@ import { PROJECT_DEFAULT_STRATEGY_READ, PROJECT_DEFAULT_STRATEGY_WRITE, UPDATE_PROJECT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { Alert, styled } from '@mui/material'; import ProjectEnvironment from './ProjectEnvironment/ProjectEnvironment'; import { Route, Routes, useNavigate } from 'react-router-dom'; diff --git a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/EditDefaultStrategy.tsx b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/EditDefaultStrategy.tsx index 1e6773bce8d7..e8126f1a55e4 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/EditDefaultStrategy.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/EditDefaultStrategy.tsx @@ -6,7 +6,7 @@ import { useStrategy } from 'hooks/api/getters/useStrategy/useStrategy'; import { useEffect, useState } from 'react'; import { formatUnknownError } from 'utils/formatUnknownError'; import FormTemplate from 'component/common/FormTemplate/FormTemplate'; -import { PROJECT_DEFAULT_STRATEGY_WRITE } from 'component/providers/AccessProvider/permissions'; +import { PROJECT_DEFAULT_STRATEGY_WRITE } from '@server/types/permissions'; import type { IStrategy } from 'interfaces/strategy'; import { useRequiredQueryParam } from 'hooks/useRequiredQueryParam'; import type { ISegment } from 'interfaces/segment'; diff --git a/frontend/src/component/project/Project/ProjectSettings/Settings/ArchiveProject.tsx b/frontend/src/component/project/Project/ProjectSettings/Settings/ArchiveProject.tsx index 0990ce8bc53b..a1a94e357e89 100644 --- a/frontend/src/component/project/Project/ProjectSettings/Settings/ArchiveProject.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/Settings/ArchiveProject.tsx @@ -1,5 +1,5 @@ import { Link, styled } from '@mui/material'; -import { DELETE_PROJECT } from 'component/providers/AccessProvider/permissions'; +import { DELETE_PROJECT } from '@server/types/permissions'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; import { useState } from 'react'; import { useNavigate } from 'react-router'; diff --git a/frontend/src/component/project/Project/ProjectSettings/Settings/DeleteProject.tsx b/frontend/src/component/project/Project/ProjectSettings/Settings/DeleteProject.tsx index 06e68f5e2dee..8f8e91a069c2 100644 --- a/frontend/src/component/project/Project/ProjectSettings/Settings/DeleteProject.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/Settings/DeleteProject.tsx @@ -1,5 +1,5 @@ import { styled } from '@mui/material'; -import { DELETE_PROJECT } from 'component/providers/AccessProvider/permissions'; +import { DELETE_PROJECT } from '@server/types/permissions'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; import { DeleteProjectDialogue } from '../../DeleteProject/DeleteProjectDialogue'; import { useState } from 'react'; diff --git a/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/EditProject.tsx b/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/EditProject.tsx index 56d13e2b3615..397ff8058224 100644 --- a/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/EditProject.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/EditProject.tsx @@ -1,7 +1,7 @@ import { PROJECT_SETTINGS_WRITE, UPDATE_PROJECT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import { useContext } from 'react'; diff --git a/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateEnterpriseSettings.tsx b/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateEnterpriseSettings.tsx index 71c2f44e5c12..12f59c08fb99 100644 --- a/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateEnterpriseSettings.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateEnterpriseSettings.tsx @@ -8,7 +8,7 @@ import { formatUnknownError } from 'utils/formatUnknownError'; import FormTemplate from 'component/common/FormTemplate/FormTemplate'; import ProjectEnterpriseSettingsForm from 'component/project/Project/ProjectEnterpriseSettingsForm/ProjectEnterpriseSettingsForm'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; -import { UPDATE_PROJECT } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_PROJECT } from '@server/types/permissions'; import type { IProjectOverview } from 'component/../interfaces/project'; import { styled } from '@mui/material'; import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; diff --git a/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateProject.tsx b/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateProject.tsx index 28e7594b31eb..546700fa2c37 100644 --- a/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateProject.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateProject.tsx @@ -4,7 +4,7 @@ import PermissionButton from 'component/common/PermissionButton/PermissionButton import { PROJECT_SETTINGS_WRITE, UPDATE_PROJECT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import useProjectForm, { DEFAULT_PROJECT_STICKINESS, } from '../../../hooks/useProjectForm'; diff --git a/frontend/src/component/project/Project/ProjectSettings/Settings/Settings.tsx b/frontend/src/component/project/Project/ProjectSettings/Settings/Settings.tsx index 0fbbe818084f..e5da15b03af2 100644 --- a/frontend/src/component/project/Project/ProjectSettings/Settings/Settings.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/Settings/Settings.tsx @@ -6,7 +6,7 @@ import AccessContext from 'contexts/AccessContext'; import { PROJECT_SETTINGS_READ, UPDATE_PROJECT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import { usePageTitle } from 'hooks/usePageTitle'; import EditProject from './EditProject/EditProject'; diff --git a/frontend/src/component/project/ProjectAccess/ProjectAccess.tsx b/frontend/src/component/project/ProjectAccess/ProjectAccess.tsx index b8ddb8cf44c2..fb5abd7ae29b 100644 --- a/frontend/src/component/project/ProjectAccess/ProjectAccess.tsx +++ b/frontend/src/component/project/ProjectAccess/ProjectAccess.tsx @@ -7,7 +7,7 @@ import AccessContext from 'contexts/AccessContext'; import { PROJECT_USER_ACCESS_READ, UPDATE_PROJECT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import { usePageTitle } from 'hooks/usePageTitle'; import { ProjectAccessTable } from 'component/project/ProjectAccess/ProjectAccessTable/ProjectAccessTable'; diff --git a/frontend/src/component/project/ProjectAccess/ProjectAccessAssign/ProjectAccessAssign.tsx b/frontend/src/component/project/ProjectAccess/ProjectAccessAssign/ProjectAccessAssign.tsx index 87cc5b541758..f483d7276fb7 100644 --- a/frontend/src/component/project/ProjectAccess/ProjectAccessAssign/ProjectAccessAssign.tsx +++ b/frontend/src/component/project/ProjectAccess/ProjectAccessAssign/ProjectAccessAssign.tsx @@ -39,7 +39,7 @@ import type { IServiceAccount } from 'interfaces/service-account'; import { MultipleRoleSelect } from 'component/common/MultipleRoleSelect/MultipleRoleSelect'; import type { IUserProjectRole } from '../../../../interfaces/userProjectRoles'; import { useCheckProjectPermissions } from 'hooks/useHasAccess'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; const StyledForm = styled('form')(() => ({ display: 'flex', diff --git a/frontend/src/component/project/ProjectAccess/ProjectAccessTable/ProjectAccessTable.tsx b/frontend/src/component/project/ProjectAccess/ProjectAccessTable/ProjectAccessTable.tsx index 8ddbd9701b87..aec20a4c48a1 100644 --- a/frontend/src/component/project/ProjectAccess/ProjectAccessTable/ProjectAccessTable.tsx +++ b/frontend/src/component/project/ProjectAccess/ProjectAccessTable/ProjectAccessTable.tsx @@ -19,7 +19,7 @@ import PermissionIconButton from 'component/common/PermissionIconButton/Permissi import { PROJECT_USER_ACCESS_WRITE, UPDATE_PROJECT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { TextCell } from 'component/common/Table/cells/TextCell/TextCell'; import { ActionCell } from 'component/common/Table/cells/ActionCell/ActionCell'; import { SearchHighlightProvider } from 'component/common/Table/SearchHighlightContext/SearchHighlightContext'; diff --git a/frontend/src/component/project/ProjectAccess/ProjectGroupView/ProjectGroupView.tsx b/frontend/src/component/project/ProjectAccess/ProjectGroupView/ProjectGroupView.tsx index 3bcfdade237b..a9ada91496df 100644 --- a/frontend/src/component/project/ProjectAccess/ProjectGroupView/ProjectGroupView.tsx +++ b/frontend/src/component/project/ProjectAccess/ProjectGroupView/ProjectGroupView.tsx @@ -14,7 +14,7 @@ import { TextCell } from 'component/common/Table/cells/TextCell/TextCell'; import { TimeAgoCell } from 'component/common/Table/cells/TimeAgoCell/TimeAgoCell'; import { SearchHighlightProvider } from 'component/common/Table/SearchHighlightContext/SearchHighlightContext'; import { UserAvatar } from 'component/common/UserAvatar/UserAvatar'; -import { UPDATE_PROJECT } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_PROJECT } from '@server/types/permissions'; import { useSearch } from 'hooks/useSearch'; import type { IGroup, IGroupUser } from 'interfaces/group'; import { type VFC, useState } from 'react'; diff --git a/frontend/src/component/project/ProjectCard/ProjectArchiveCard.tsx b/frontend/src/component/project/ProjectCard/ProjectArchiveCard.tsx index 359c1a0372b7..9fdcf2fc4049 100644 --- a/frontend/src/component/project/ProjectCard/ProjectArchiveCard.tsx +++ b/frontend/src/component/project/ProjectCard/ProjectArchiveCard.tsx @@ -16,10 +16,7 @@ import { useLocationSettings } from 'hooks/useLocationSettings'; import { parseISO } from 'date-fns'; import { Box, Link, styled, Tooltip } from '@mui/material'; import { Link as RouterLink } from 'react-router-dom'; -import { - DELETE_PROJECT, - UPDATE_PROJECT, -} from 'component/providers/AccessProvider/permissions'; +import { DELETE_PROJECT, UPDATE_PROJECT } from '@server/types/permissions'; import Undo from '@mui/icons-material/Undo'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; import Delete from '@mui/icons-material/Delete'; diff --git a/frontend/src/component/project/ProjectEnvironment/ProjectEnvironment.tsx b/frontend/src/component/project/ProjectEnvironment/ProjectEnvironment.tsx index b86b5c23d4b5..fcc54bd60bd1 100644 --- a/frontend/src/component/project/ProjectEnvironment/ProjectEnvironment.tsx +++ b/frontend/src/component/project/ProjectEnvironment/ProjectEnvironment.tsx @@ -3,7 +3,7 @@ import { Link as RouterLink } from 'react-router-dom'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { PageContent } from 'component/common/PageContent/PageContent'; import { PageHeader } from 'component/common/PageHeader/PageHeader'; -import { UPDATE_PROJECT } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_PROJECT } from '@server/types/permissions'; import ApiError from 'component/common/ApiError/ApiError'; import useToast from 'hooks/useToast'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; diff --git a/frontend/src/component/project/ProjectList/ProjectCreationButton/ProjectCreationButton.tsx b/frontend/src/component/project/ProjectList/ProjectCreationButton/ProjectCreationButton.tsx index a43030fde561..8e9dffbf2b30 100644 --- a/frontend/src/component/project/ProjectList/ProjectCreationButton/ProjectCreationButton.tsx +++ b/frontend/src/component/project/ProjectList/ProjectCreationButton/ProjectCreationButton.tsx @@ -2,7 +2,7 @@ import { useContext, type FC, type ReactNode } from 'react'; import type { ITooltipResolverProps } from 'component/common/TooltipResolver/TooltipResolver'; import AccessContext from 'contexts/AccessContext'; import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton'; -import { CREATE_PROJECT } from 'component/providers/AccessProvider/permissions'; +import { CREATE_PROJECT } from '@server/types/permissions'; import Add from '@mui/icons-material/Add'; import { PremiumFeature } from 'component/common/PremiumFeature/PremiumFeature'; import { ReactComponent as ProPlanIcon } from 'assets/icons/pro-enterprise-feature-badge.svg'; diff --git a/frontend/src/component/project/ProjectList/ProjectList.test.tsx b/frontend/src/component/project/ProjectList/ProjectList.test.tsx index f9fcac9d4c32..019893690d20 100644 --- a/frontend/src/component/project/ProjectList/ProjectList.test.tsx +++ b/frontend/src/component/project/ProjectList/ProjectList.test.tsx @@ -2,7 +2,7 @@ import { render } from 'utils/testRenderer'; import { ProjectList } from './ProjectList'; import { screen, waitFor } from '@testing-library/react'; import { testServerRoute, testServerSetup } from 'utils/testServer'; -import { CREATE_PROJECT } from '../../providers/AccessProvider/permissions'; +import { CREATE_PROJECT } from '@server/types/permissions'; const server = testServerSetup(); diff --git a/frontend/src/component/providers/AccessProvider/permissions.ts b/frontend/src/component/providers/AccessProvider/permissions.ts index 48eea0687135..47d3e861bb09 100644 --- a/frontend/src/component/providers/AccessProvider/permissions.ts +++ b/frontend/src/component/providers/AccessProvider/permissions.ts @@ -1,52 +1,3 @@ -export const ADMIN = 'ADMIN'; -export const CREATE_FEATURE = 'CREATE_FEATURE'; -export const UPDATE_FEATURE = 'UPDATE_FEATURE'; -export const UPDATE_FEATURE_DEPENDENCY = 'UPDATE_FEATURE_DEPENDENCY'; -export const DELETE_FEATURE = 'DELETE_FEATURE'; -export const CREATE_STRATEGY = 'CREATE_STRATEGY'; -export const UPDATE_STRATEGY = 'UPDATE_STRATEGY'; -export const DELETE_STRATEGY = 'DELETE_STRATEGY'; -export const UPDATE_APPLICATION = 'UPDATE_APPLICATION'; -export const CREATE_CONTEXT_FIELD = 'CREATE_CONTEXT_FIELD'; -export const UPDATE_CONTEXT_FIELD = 'UPDATE_CONTEXT_FIELD'; -export const DELETE_CONTEXT_FIELD = 'DELETE_CONTEXT_FIELD'; -export const CREATE_PROJECT = 'CREATE_PROJECT'; -export const UPDATE_PROJECT = 'UPDATE_PROJECT'; -export const DELETE_PROJECT = 'DELETE_PROJECT'; -export const CREATE_TAG_TYPE = 'CREATE_TAG_TYPE'; -export const UPDATE_TAG_TYPE = 'UPDATE_TAG_TYPE'; -export const DELETE_TAG_TYPE = 'DELETE_TAG_TYPE'; -export const CREATE_ADDON = 'CREATE_ADDON'; -export const UPDATE_ADDON = 'UPDATE_ADDON'; -export const DELETE_ADDON = 'DELETE_ADDON'; export const DELETE_ENVIRONMENT = 'DELETE_ENVIRONMENT'; export const UPDATE_ENVIRONMENT = 'UPDATE_ENVIRONMENT'; -export const CREATE_FEATURE_STRATEGY = 'CREATE_FEATURE_STRATEGY'; -export const UPDATE_FEATURE_STRATEGY = 'UPDATE_FEATURE_STRATEGY'; -export const DELETE_FEATURE_STRATEGY = 'DELETE_FEATURE_STRATEGY'; -export const UPDATE_FEATURE_ENVIRONMENT = 'UPDATE_FEATURE_ENVIRONMENT'; -export const UPDATE_FEATURE_VARIANTS = 'UPDATE_FEATURE_VARIANTS'; -export const UPDATE_FEATURE_ENVIRONMENT_VARIANTS = - 'UPDATE_FEATURE_ENVIRONMENT_VARIANTS'; -export const MOVE_FEATURE_TOGGLE = 'MOVE_FEATURE_TOGGLE'; -export const CREATE_SEGMENT = 'CREATE_SEGMENT'; -export const UPDATE_SEGMENT = 'UPDATE_SEGMENT'; -export const DELETE_SEGMENT = 'DELETE_SEGMENT'; -export const APPLY_CHANGE_REQUEST = 'APPLY_CHANGE_REQUEST'; -export const APPROVE_CHANGE_REQUEST = 'APPROVE_CHANGE_REQUEST'; -export const SKIP_CHANGE_REQUEST = 'SKIP_CHANGE_REQUEST'; -export const READ_PROJECT_API_TOKEN = 'READ_PROJECT_API_TOKEN'; -export const CREATE_PROJECT_API_TOKEN = 'CREATE_PROJECT_API_TOKEN'; -export const DELETE_PROJECT_API_TOKEN = 'DELETE_PROJECT_API_TOKEN'; -export const UPDATE_PROJECT_SEGMENT = 'UPDATE_PROJECT_SEGMENT'; - -export const PROJECT_USER_ACCESS_READ = 'PROJECT_USER_ACCESS_READ'; -export const PROJECT_DEFAULT_STRATEGY_READ = 'PROJECT_DEFAULT_STRATEGY_READ'; -export const PROJECT_CHANGE_REQUEST_READ = 'PROJECT_CHANGE_REQUEST_READ'; -export const PROJECT_SETTINGS_READ = 'PROJECT_SETTINGS_READ'; -export const PROJECT_USER_ACCESS_WRITE = 'PROJECT_USER_ACCESS_WRITE'; -export const PROJECT_DEFAULT_STRATEGY_WRITE = 'PROJECT_DEFAULT_STRATEGY_WRITE'; -export const PROJECT_CHANGE_REQUEST_WRITE = 'PROJECT_CHANGE_REQUEST_WRITE'; -export const PROJECT_SETTINGS_WRITE = 'PROJECT_SETTINGS_WRITE'; - export const CREATE_RELEASE_TEMPLATE = 'CREATE_RELEASE_TEMPLATE'; diff --git a/frontend/src/component/releases/ReleaseManagement/ReleaseManagement.tsx b/frontend/src/component/releases/ReleaseManagement/ReleaseManagement.tsx index 5962d7eaabb7..66082ceb6909 100644 --- a/frontend/src/component/releases/ReleaseManagement/ReleaseManagement.tsx +++ b/frontend/src/component/releases/ReleaseManagement/ReleaseManagement.tsx @@ -5,7 +5,7 @@ import { usePageTitle } from 'hooks/usePageTitle'; import { PageHeader } from 'component/common/PageHeader/PageHeader'; import Add from '@mui/icons-material/Add'; import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton'; -import { CREATE_RELEASE_TEMPLATE } from 'component/providers/AccessProvider/permissions'; +import { CREATE_RELEASE_TEMPLATE } from '@server/types/permissions'; import { useNavigate } from 'react-router-dom'; import { useReleasePlanTemplates } from 'hooks/api/getters/useReleasePlanTemplates/useReleasePlanTemplates'; import { EmptyTemplatesListMessage } from './EmptyTemplatesListMessage'; diff --git a/frontend/src/component/segments/CreateSegment/CreateSegment.tsx b/frontend/src/component/segments/CreateSegment/CreateSegment.tsx index aa54cdfc61fd..5c3404e03a33 100644 --- a/frontend/src/component/segments/CreateSegment/CreateSegment.tsx +++ b/frontend/src/component/segments/CreateSegment/CreateSegment.tsx @@ -5,7 +5,7 @@ import FormTemplate from 'component/common/FormTemplate/FormTemplate'; import { CREATE_SEGMENT, UPDATE_PROJECT_SEGMENT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { useSegmentsApi } from 'hooks/api/actions/useSegmentsApi/useSegmentsApi'; import { useConstraintsValidation } from 'hooks/api/getters/useConstraintsValidation/useConstraintsValidation'; import { useSegments } from 'hooks/api/getters/useSegments/useSegments'; diff --git a/frontend/src/component/segments/CreateSegmentButton/CreateSegmentButton.tsx b/frontend/src/component/segments/CreateSegmentButton/CreateSegmentButton.tsx index 4ececc5016fd..289a1acc0bec 100644 --- a/frontend/src/component/segments/CreateSegmentButton/CreateSegmentButton.tsx +++ b/frontend/src/component/segments/CreateSegmentButton/CreateSegmentButton.tsx @@ -1,7 +1,7 @@ import { CREATE_SEGMENT, UPDATE_PROJECT_SEGMENT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; import { NAVIGATE_TO_CREATE_SEGMENT } from 'utils/testIds'; import { useNavigate } from 'react-router-dom'; diff --git a/frontend/src/component/segments/EditSegment/EditSegment.tsx b/frontend/src/component/segments/EditSegment/EditSegment.tsx index 797674b55f68..645d2afdfba7 100644 --- a/frontend/src/component/segments/EditSegment/EditSegment.tsx +++ b/frontend/src/component/segments/EditSegment/EditSegment.tsx @@ -2,7 +2,7 @@ import FormTemplate from 'component/common/FormTemplate/FormTemplate'; import { UPDATE_PROJECT_SEGMENT, UPDATE_SEGMENT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { useSegmentsApi } from 'hooks/api/actions/useSegmentsApi/useSegmentsApi'; import { useConstraintsValidation } from 'hooks/api/getters/useConstraintsValidation/useConstraintsValidation'; import { useSegment } from 'hooks/api/getters/useSegment/useSegment'; diff --git a/frontend/src/component/segments/EditSegmentButton/EditSegmentButton.tsx b/frontend/src/component/segments/EditSegmentButton/EditSegmentButton.tsx index 651d17bf2717..44a9b0526274 100644 --- a/frontend/src/component/segments/EditSegmentButton/EditSegmentButton.tsx +++ b/frontend/src/component/segments/EditSegmentButton/EditSegmentButton.tsx @@ -4,7 +4,7 @@ import PermissionIconButton from 'component/common/PermissionIconButton/Permissi import { UPDATE_SEGMENT, UPDATE_PROJECT_SEGMENT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { useNavigate } from 'react-router-dom'; import { useOptionalPathParam } from 'hooks/useOptionalPathParam'; diff --git a/frontend/src/component/segments/RemoveSegmentButton/RemoveSegmentButton.tsx b/frontend/src/component/segments/RemoveSegmentButton/RemoveSegmentButton.tsx index 72df0a34b9df..3b73cfa3bc6c 100644 --- a/frontend/src/component/segments/RemoveSegmentButton/RemoveSegmentButton.tsx +++ b/frontend/src/component/segments/RemoveSegmentButton/RemoveSegmentButton.tsx @@ -3,7 +3,7 @@ import PermissionIconButton from 'component/common/PermissionIconButton/Permissi import { DELETE_SEGMENT, UPDATE_PROJECT_SEGMENT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import Delete from '@mui/icons-material/Delete'; import { SEGMENT_DELETE_BTN_ID } from 'utils/testIds'; import { useSegments } from 'hooks/api/getters/useSegments/useSegments'; diff --git a/frontend/src/component/segments/SegmentEmpty.tsx b/frontend/src/component/segments/SegmentEmpty.tsx index 52c2468df315..878d13cfc5d3 100644 --- a/frontend/src/component/segments/SegmentEmpty.tsx +++ b/frontend/src/component/segments/SegmentEmpty.tsx @@ -3,7 +3,7 @@ import { Link } from 'react-router-dom'; import { CREATE_SEGMENT, UPDATE_PROJECT_SEGMENT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import AccessContext from 'contexts/AccessContext'; import { useContext } from 'react'; diff --git a/frontend/src/component/segments/SegmentFormStepTwo.tsx b/frontend/src/component/segments/SegmentFormStepTwo.tsx index cf2285573cc5..c8b17e965165 100644 --- a/frontend/src/component/segments/SegmentFormStepTwo.tsx +++ b/frontend/src/component/segments/SegmentFormStepTwo.tsx @@ -11,7 +11,7 @@ import { CREATE_SEGMENT, UPDATE_PROJECT_SEGMENT, UPDATE_SEGMENT, -} from 'component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import useUnleashContext from 'hooks/api/getters/useUnleashContext/useUnleashContext'; import type { IConstraint } from 'interfaces/strategy'; import { useNavigate } from 'react-router-dom'; diff --git a/frontend/src/component/signals/SignalEndpointsTable/SignalEndpointsActionsCell.tsx b/frontend/src/component/signals/SignalEndpointsTable/SignalEndpointsActionsCell.tsx index d0ba5bbdba84..5bb19a2dfcf7 100644 --- a/frontend/src/component/signals/SignalEndpointsTable/SignalEndpointsActionsCell.tsx +++ b/frontend/src/component/signals/SignalEndpointsTable/SignalEndpointsActionsCell.tsx @@ -17,7 +17,7 @@ import Delete from '@mui/icons-material/Delete'; import Edit from '@mui/icons-material/Edit'; import Visibility from '@mui/icons-material/Visibility'; import { PermissionHOC } from 'component/common/PermissionHOC/PermissionHOC'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import { defaultBorderRadius } from 'themes/themeStyles'; const StyledBoxCell = styled(Box)({ diff --git a/frontend/src/component/strategies/CreateStrategy/CreateStrategy.tsx b/frontend/src/component/strategies/CreateStrategy/CreateStrategy.tsx index f890f3a0fae1..99c2b065267b 100644 --- a/frontend/src/component/strategies/CreateStrategy/CreateStrategy.tsx +++ b/frontend/src/component/strategies/CreateStrategy/CreateStrategy.tsx @@ -4,7 +4,7 @@ import useToast from 'hooks/useToast'; import FormTemplate from 'component/common/FormTemplate/FormTemplate'; import { useStrategyForm } from '../hooks/useStrategyForm'; import { StrategyForm } from '../StrategyForm/StrategyForm'; -import { CREATE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { CREATE_STRATEGY } from '@server/types/permissions'; import useStrategiesApi from 'hooks/api/actions/useStrategiesApi/useStrategiesApi'; import { useStrategies } from 'hooks/api/getters/useStrategies/useStrategies'; import { formatUnknownError } from 'utils/formatUnknownError'; diff --git a/frontend/src/component/strategies/EditStrategy/EditStrategy.tsx b/frontend/src/component/strategies/EditStrategy/EditStrategy.tsx index 4fdaa953dfb7..aa154ec3f4b1 100644 --- a/frontend/src/component/strategies/EditStrategy/EditStrategy.tsx +++ b/frontend/src/component/strategies/EditStrategy/EditStrategy.tsx @@ -5,7 +5,7 @@ import useToast from 'hooks/useToast'; import FormTemplate from 'component/common/FormTemplate/FormTemplate'; import { useStrategyForm } from '../hooks/useStrategyForm'; import { StrategyForm } from '../StrategyForm/StrategyForm'; -import { UPDATE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_STRATEGY } from '@server/types/permissions'; import useStrategiesApi from 'hooks/api/actions/useStrategiesApi/useStrategiesApi'; import { useStrategies } from 'hooks/api/getters/useStrategies/useStrategies'; import { formatUnknownError } from 'utils/formatUnknownError'; diff --git a/frontend/src/component/strategies/StrategiesList/AddStrategyButton/AddStrategyButton.tsx b/frontend/src/component/strategies/StrategiesList/AddStrategyButton/AddStrategyButton.tsx index 933ff22688d0..522ac805137e 100644 --- a/frontend/src/component/strategies/StrategiesList/AddStrategyButton/AddStrategyButton.tsx +++ b/frontend/src/component/strategies/StrategiesList/AddStrategyButton/AddStrategyButton.tsx @@ -2,7 +2,7 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; import { useMediaQuery } from '@mui/material'; -import { CREATE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { CREATE_STRATEGY } from '@server/types/permissions'; import { ADD_NEW_STRATEGY_ID } from 'utils/testIds'; import Add from '@mui/icons-material/Add'; import { useNavigate } from 'react-router-dom'; diff --git a/frontend/src/component/strategies/StrategiesList/StrategyDeleteButton/StrategyDeleteButton.tsx b/frontend/src/component/strategies/StrategiesList/StrategyDeleteButton/StrategyDeleteButton.tsx index 2257e09c5d27..a1692d6e9bfb 100644 --- a/frontend/src/component/strategies/StrategiesList/StrategyDeleteButton/StrategyDeleteButton.tsx +++ b/frontend/src/component/strategies/StrategiesList/StrategyDeleteButton/StrategyDeleteButton.tsx @@ -4,7 +4,7 @@ import PermissionIconButton from 'component/common/PermissionIconButton/Permissi import Delete from '@mui/icons-material/Delete'; import { IconButton, Tooltip } from '@mui/material'; import type { IStrategy } from 'interfaces/strategy'; -import { DELETE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { DELETE_STRATEGY } from '@server/types/permissions'; import { useId } from 'hooks/useId'; interface IStrategyDeleteButtonProps { diff --git a/frontend/src/component/strategies/StrategiesList/StrategyEditButton/StrategyEditButton.tsx b/frontend/src/component/strategies/StrategiesList/StrategyEditButton/StrategyEditButton.tsx index c973057e27b5..923fbf05db52 100644 --- a/frontend/src/component/strategies/StrategiesList/StrategyEditButton/StrategyEditButton.tsx +++ b/frontend/src/component/strategies/StrategiesList/StrategyEditButton/StrategyEditButton.tsx @@ -3,7 +3,7 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; import Edit from '@mui/icons-material/Edit'; import { IconButton, Tooltip } from '@mui/material'; -import { UPDATE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_STRATEGY } from '@server/types/permissions'; import type { IStrategy } from 'interfaces/strategy'; import { useId } from 'hooks/useId'; diff --git a/frontend/src/component/strategies/StrategiesList/StrategySwitch/StrategySwitch.tsx b/frontend/src/component/strategies/StrategiesList/StrategySwitch/StrategySwitch.tsx index c063f1bd25db..28367ce8d0f6 100644 --- a/frontend/src/component/strategies/StrategiesList/StrategySwitch/StrategySwitch.tsx +++ b/frontend/src/component/strategies/StrategiesList/StrategySwitch/StrategySwitch.tsx @@ -1,6 +1,6 @@ import { useMemo, type VFC } from 'react'; import PermissionSwitch from 'component/common/PermissionSwitch/PermissionSwitch'; -import { UPDATE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_STRATEGY } from '@server/types/permissions'; import { Tooltip } from '@mui/material'; import { useId } from 'hooks/useId'; import { useHasRootAccess } from 'hooks/useHasAccess'; diff --git a/frontend/src/component/strategies/StrategyView/StrategyView.tsx b/frontend/src/component/strategies/StrategyView/StrategyView.tsx index b783ec8bccf3..eb45b310e939 100644 --- a/frontend/src/component/strategies/StrategyView/StrategyView.tsx +++ b/frontend/src/component/strategies/StrategyView/StrategyView.tsx @@ -1,6 +1,6 @@ import { Grid } from '@mui/material'; import { useNavigate } from 'react-router-dom'; -import { UPDATE_STRATEGY } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_STRATEGY } from '@server/types/permissions'; import { PageContent } from 'component/common/PageContent/PageContent'; import { useStrategies } from 'hooks/api/getters/useStrategies/useStrategies'; import useApplications from 'hooks/api/getters/useApplications/useApplications'; diff --git a/frontend/src/component/tags/CreateTagType/CreateTagType.tsx b/frontend/src/component/tags/CreateTagType/CreateTagType.tsx index 7f5d2ad9bd09..530188129554 100644 --- a/frontend/src/component/tags/CreateTagType/CreateTagType.tsx +++ b/frontend/src/component/tags/CreateTagType/CreateTagType.tsx @@ -3,7 +3,7 @@ import useTagTypeForm from '../TagTypeForm/useTagTypeForm'; import TagTypeForm from '../TagTypeForm/TagTypeForm'; import { CreateButton } from 'component/common/CreateButton/CreateButton'; import FormTemplate from 'component/common/FormTemplate/FormTemplate'; -import { CREATE_TAG_TYPE } from 'component/providers/AccessProvider/permissions'; +import { CREATE_TAG_TYPE } from '@server/types/permissions'; import useTagTypesApi from 'hooks/api/actions/useTagTypesApi/useTagTypesApi'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import useToast from 'hooks/useToast'; diff --git a/frontend/src/component/tags/EditTagType/EditTagType.tsx b/frontend/src/component/tags/EditTagType/EditTagType.tsx index 4af677dffd74..cb7fced4f327 100644 --- a/frontend/src/component/tags/EditTagType/EditTagType.tsx +++ b/frontend/src/component/tags/EditTagType/EditTagType.tsx @@ -1,5 +1,5 @@ import { useNavigate } from 'react-router-dom'; -import { UPDATE_TAG_TYPE } from 'component/providers/AccessProvider/permissions'; +import { UPDATE_TAG_TYPE } from '@server/types/permissions'; import useTagTypeForm from '../TagTypeForm/useTagTypeForm'; import TagForm from '../TagTypeForm/TagTypeForm'; import { UpdateButton } from 'component/common/UpdateButton/UpdateButton'; diff --git a/frontend/src/component/tags/TagTypeList/AddTagTypeButton/AddTagTypeButton.tsx b/frontend/src/component/tags/TagTypeList/AddTagTypeButton/AddTagTypeButton.tsx index 80f33171ee5d..8879b932f3e2 100644 --- a/frontend/src/component/tags/TagTypeList/AddTagTypeButton/AddTagTypeButton.tsx +++ b/frontend/src/component/tags/TagTypeList/AddTagTypeButton/AddTagTypeButton.tsx @@ -1,7 +1,7 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; -import { CREATE_TAG_TYPE } from 'component/providers/AccessProvider/permissions'; +import { CREATE_TAG_TYPE } from '@server/types/permissions'; import useMediaQuery from '@mui/material/useMediaQuery'; import { useNavigate } from 'react-router-dom'; diff --git a/frontend/src/component/tags/TagTypeList/TagTypeList.tsx b/frontend/src/component/tags/TagTypeList/TagTypeList.tsx index a4ce5f25dc35..33e11512b35b 100644 --- a/frontend/src/component/tags/TagTypeList/TagTypeList.tsx +++ b/frontend/src/component/tags/TagTypeList/TagTypeList.tsx @@ -15,10 +15,7 @@ import Label from '@mui/icons-material/Label'; import { PageHeader } from 'component/common/PageHeader/PageHeader'; import { PageContent } from 'component/common/PageContent/PageContent'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; -import { - DELETE_TAG_TYPE, - UPDATE_TAG_TYPE, -} from 'component/providers/AccessProvider/permissions'; +import { DELETE_TAG_TYPE, UPDATE_TAG_TYPE } from '@server/types/permissions'; import { Dialogue } from 'component/common/Dialogue/Dialogue'; import useTagTypesApi from 'hooks/api/actions/useTagTypesApi/useTagTypesApi'; import useTagTypes from 'hooks/api/getters/useTagTypes/useTagTypes'; diff --git a/frontend/src/component/tags/TagTypeList/__tests__/TagTypeList.test.tsx b/frontend/src/component/tags/TagTypeList/__tests__/TagTypeList.test.tsx index 8fa36e5c1d4e..530167204783 100644 --- a/frontend/src/component/tags/TagTypeList/__tests__/TagTypeList.test.tsx +++ b/frontend/src/component/tags/TagTypeList/__tests__/TagTypeList.test.tsx @@ -1,7 +1,7 @@ import { TagTypeList } from 'component/tags/TagTypeList/TagTypeList'; import renderer from 'react-test-renderer'; import { MemoryRouter } from 'react-router-dom'; -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import UIProvider from 'component/providers/UIProvider/UIProvider'; import { ThemeProvider } from 'themes/ThemeProvider'; import { AccessProviderMock } from 'component/providers/AccessProvider/AccessProviderMock'; diff --git a/frontend/src/hooks/useChangeRequestsEnabled.test.tsx b/frontend/src/hooks/useChangeRequestsEnabled.test.tsx index 482392d86a6d..89b444a0036c 100644 --- a/frontend/src/hooks/useChangeRequestsEnabled.test.tsx +++ b/frontend/src/hooks/useChangeRequestsEnabled.test.tsx @@ -3,10 +3,7 @@ import { AccessProviderMock } from '../component/providers/AccessProvider/Access import { useChangeRequestsEnabled } from './useChangeRequestsEnabled'; import type { FC } from 'react'; import { testServerRoute, testServerSetup } from '../utils/testServer'; -import { - SKIP_CHANGE_REQUEST, - ADMIN, -} from '../component/providers/AccessProvider/permissions'; +import { SKIP_CHANGE_REQUEST, ADMIN } from '@server/types/permissions'; const project = 'project'; const environment = 'production'; diff --git a/frontend/src/hooks/useChangeRequestsEnabled.ts b/frontend/src/hooks/useChangeRequestsEnabled.ts index 56296ca68496..aa8b2c5debc0 100644 --- a/frontend/src/hooks/useChangeRequestsEnabled.ts +++ b/frontend/src/hooks/useChangeRequestsEnabled.ts @@ -1,4 +1,4 @@ -import { SKIP_CHANGE_REQUEST } from 'component/providers/AccessProvider/permissions'; +import { SKIP_CHANGE_REQUEST } from '@server/types/permissions'; import React from 'react'; import { useChangeRequestConfig } from './api/getters/useChangeRequestConfig/useChangeRequestConfig'; import { useCheckProjectPermissions } from './useHasAccess'; diff --git a/frontend/src/hooks/useHasAccess.ts b/frontend/src/hooks/useHasAccess.ts index 9460f78cab34..add85900c9fc 100644 --- a/frontend/src/hooks/useHasAccess.ts +++ b/frontend/src/hooks/useHasAccess.ts @@ -7,7 +7,7 @@ import { UPDATE_FEATURE_ENVIRONMENT, UPDATE_FEATURE_ENVIRONMENT_VARIANTS, UPDATE_FEATURE_STRATEGY, -} from '../component/providers/AccessProvider/permissions'; +} from '@server/types/permissions'; import { useAuthPermissions } from './api/getters/useAuth/useAuthPermissions'; import useProjectOverview from './api/getters/useProjectOverview/useProjectOverview'; diff --git a/frontend/src/utils/projectFilterGenerator.ts b/frontend/src/utils/projectFilterGenerator.ts index 84e55ce7f2f0..9d4c56f13089 100644 --- a/frontend/src/utils/projectFilterGenerator.ts +++ b/frontend/src/utils/projectFilterGenerator.ts @@ -1,4 +1,4 @@ -import { ADMIN } from 'component/providers/AccessProvider/permissions'; +import { ADMIN } from '@server/types/permissions'; import type { IPermission } from 'interfaces/user'; type objectIdx = {