diff --git a/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx b/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx
index 101401a91c3..530bc2073e7 100644
--- a/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx
+++ b/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx
@@ -5,7 +5,7 @@ import { observer } from 'mobx-react-lite'
import { Badge, Button, Loading, Listbox, IconUser, Modal } from 'ui'
import { Member, Role } from 'types'
-import { useStore, useFlag, useOrganizationDetail } from 'hooks'
+import { useStore, useOrganizationDetail } from 'hooks'
import { patch } from 'lib/common/fetch'
import { API_URL } from 'lib/constants'
import { isInviteExpired, getUserDisplayName } from '../Organization.utils'
@@ -28,17 +28,13 @@ const MembersView = () => {
const { ui } = useStore()
const slug = ui.selectedOrganization?.slug || ''
- const isOwner = ui.selectedOrganization?.is_owner
- const enablePermissions = useFlag('enablePermissions')
const { mutateOrgMembers } = useOrganizationDetail(slug)
const [loading, setLoading] = useState(false)
const [selectedMember, setSelectedMember] = useState
()
const [userRoleChangeModalVisible, setUserRoleChangeModalVisible] = useState(false)
- const hasAccessToMemberActions = enablePermissions ? true : isOwner
-
const getRoleNameById = (id: number | undefined) => {
if (!roles) return id
return roles.find((x: any) => x.id === id)?.name
@@ -87,7 +83,7 @@ const MembersView = () => {
,
Role
- {enablePermissions && }
+
,
,
]}
@@ -157,71 +153,64 @@ const MembersView = () => {
- {!role && !enablePermissions && {x.is_owner ? 'Owner' : 'Developer'}
}
+ {!role && {x.is_owner ? 'Owner' : 'Developer'}
}
{role && (
- <>
- {!enablePermissions ? (
- {role?.name ?? 'Developer'}
- ) : (
-
-
-
+
+
+ {roles.map((r: any) => (
+
- {roles.map((r: any) => (
-
- {r.name}
-
- ))}
-
-
- {memberIsPendingInvite ? (
-
-
-
-
- Role can only be changed after the user has accepted the
- invite
-
-
-
- ) : !memberIsUser && !canRemoveRole ? (
-
-
-
-
- You need additional permissions to manage this team member
-
-
-
- ) : (
- <>>
- )}
-
+ {r.name}
+
+ ))}
+
+
+ {memberIsPendingInvite ? (
+
+
+
+
+ Role can only be changed after the user has accepted the invite
+
+
+
+ ) : !memberIsUser && !canRemoveRole ? (
+
+
+
+
+ You need additional permissions to manage this team member
+
+
+
+ ) : (
+ <>>
)}
- >
+
)}
- {hasAccessToMemberActions && !memberIsUser && (
+ {!memberIsUser && (
)}
diff --git a/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx b/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx
index 4eb120239de..f5df041e974 100644
--- a/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx
+++ b/studio/components/interfaces/Organization/TeamSettings/TeamSettings.tsx
@@ -2,7 +2,7 @@ import { useState, useContext } from 'react'
import { observer } from 'mobx-react-lite'
import { Button, Input, IconSearch } from 'ui'
-import { useFlag, useStore } from 'hooks'
+import { useStore } from 'hooks'
import { post } from 'lib/common/fetch'
import { API_URL } from 'lib/constants'
import InviteMemberButton from './InviteMemberButton'
@@ -21,10 +21,8 @@ const TeamSettings = observer(() => {
const slug = ui.selectedOrganization?.slug ?? ''
const isOwner = ui.selectedOrganization?.is_owner
- const enablePermissions = useFlag('enablePermissions')
const [isLeaving, setIsLeaving] = useState(false)
-
- const canAddMembers = enablePermissions ? rolesAddable.length > 0 : isOwner
+ const canAddMembers = rolesAddable.length > 0
function onFilterMemberChange(e: any) {
PageState.membersFilterString = e.target.value
diff --git a/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx b/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx
index cff0c2c739d..a316a3b1bf6 100644
--- a/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx
+++ b/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx
@@ -4,7 +4,7 @@ import { Button, Input } from 'ui'
import * as Tooltip from '@radix-ui/react-tooltip'
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { useStore, checkPermissions, useFlag } from 'hooks'
+import { useStore, checkPermissions } from 'hooks'
import { API_URL, PRICING_TIER_PRODUCT_IDS } from 'lib/constants'
import { delete_, post } from 'lib/common/fetch'
import TextConfirmModal from 'components/ui/Modals/TextConfirmModal'
@@ -17,13 +17,10 @@ interface Props {
const DeleteProjectButton: FC = ({ type = 'danger' }) => {
const router = useRouter()
const { app, ui } = useStore()
- const enablePermissions = useFlag('enablePermissions')
const project = ui.selectedProject
const projectRef = project?.ref
const projectTier = project?.subscription_tier ?? PRICING_TIER_PRODUCT_IDS.FREE
-
- const isOwner = ui.selectedOrganization?.is_owner
const isFree = projectTier === PRICING_TIER_PRODUCT_IDS.FREE
const [isOpen, setIsOpen] = useState(false)
@@ -38,9 +35,7 @@ const DeleteProjectButton: FC = ({ type = 'danger' }) => {
}
}, [isOpen])
- const canDeleteProject = enablePermissions
- ? checkPermissions(PermissionAction.UPDATE, 'projects')
- : isOwner
+ const canDeleteProject = checkPermissions(PermissionAction.UPDATE, 'projects')
const toggle = () => {
if (loading) return
diff --git a/studio/components/interfaces/Settings/General/General.tsx b/studio/components/interfaces/Settings/General/General.tsx
index 6ca7d6cd1ef..3145838560e 100644
--- a/studio/components/interfaces/Settings/General/General.tsx
+++ b/studio/components/interfaces/Settings/General/General.tsx
@@ -2,7 +2,7 @@ import { FC } from 'react'
import { Form, Input } from 'ui'
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { useStore, checkPermissions, useFlag } from 'hooks'
+import { useStore, checkPermissions } from 'hooks'
import { API_URL } from 'lib/constants'
import { post } from 'lib/common/fetch'
import {
@@ -20,16 +20,11 @@ const General: FC = ({}) => {
const { app, ui } = useStore()
const project = ui.selectedProject
- const enablePermissions = useFlag('enablePermissions')
- const isOwner = ui.selectedOrganization?.is_owner
-
const formId = 'project-general-settings'
const initialValues = { name: project?.name ?? '', ref: project?.ref ?? '' }
- const canUpdateProject = enablePermissions
- ? checkPermissions(PermissionAction.UPDATE, 'projects')
- : isOwner
+ const canUpdateProject = checkPermissions(PermissionAction.UPDATE, 'projects')
- const onSubmit = async (values: any, { setSubmitting, resetForm }: any) => {
+ const onSubmit = async (values: any, { resetForm }: any) => {
const response = await post(`${API_URL}/projects/${project?.ref}/update`, { name: values.name })
if (response.error) {
ui.setNotification({
diff --git a/studio/components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx b/studio/components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx
index 06d68b8ef2a..4923bfcb441 100644
--- a/studio/components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx
+++ b/studio/components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx
@@ -5,7 +5,7 @@ import * as Tooltip from '@radix-ui/react-tooltip'
import { Button, IconPause } from 'ui'
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { checkPermissions, useStore, useFlag } from 'hooks'
+import { checkPermissions, useStore } from 'hooks'
import { post } from 'lib/common/fetch'
import { API_URL, PROJECT_STATUS } from 'lib/constants'
import ConfirmModal from 'components/ui/Dialogs/ConfirmDialog'
@@ -21,15 +21,13 @@ const PauseProjectButton: FC = observer(({ projectRef, projectId }) => {
const [loading, setLoading] = useState(false)
const [isModalOpen, setIsModalOpen] = useState(false)
- const enablePermissions = useFlag('enablePermissions')
- const isOwner = ui.selectedOrganization?.is_owner
-
const openModal = () => setIsModalOpen(true)
const closeModal = () => setIsModalOpen(false)
- const canPauseProject = enablePermissions
- ? checkPermissions(PermissionAction.INFRA_EXECUTE, 'queue_jobs.projects.pause')
- : isOwner
+ const canPauseProject = checkPermissions(
+ PermissionAction.INFRA_EXECUTE,
+ 'queue_jobs.projects.pause'
+ )
const requestPauseProject = async () => {
if (!canPauseProject) {
diff --git a/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx b/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx
index 61bf61c4f15..1392bbd62e9 100644
--- a/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx
+++ b/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx
@@ -16,21 +16,19 @@ interface Props {
const ProjectPausedState: FC = ({ project }) => {
const { ui, app } = useStore()
- const isOwner = ui.selectedOrganization?.is_owner
const orgSlug = ui.selectedOrganization?.slug
const kpsEnabled = useFlag('initWithKps')
- const enablePermissions = useFlag('enablePermissions')
+ const { membersExceededLimit } = useFreeProjectLimitCheck(orgSlug)
+ const hasMembersExceedingFreeTierLimit = (membersExceededLimit || []).length > 0
const [showConfirmRestore, setShowConfirmRestore] = useState(false)
const [showFreeProjectLimitWarning, setShowFreeProjectLimitWarning] = useState(false)
- const { membersExceededLimit } = useFreeProjectLimitCheck(orgSlug)
- const hasMembersExceedingFreeTierLimit = (membersExceededLimit || []).length > 0
-
- const canResumeProject = enablePermissions
- ? checkPermissions(PermissionAction.INFRA_EXECUTE, 'queue_jobs.projects.initialize_or_resume')
- : isOwner
+ const canResumeProject = checkPermissions(
+ PermissionAction.INFRA_EXECUTE,
+ 'queue_jobs.projects.initialize_or_resume'
+ )
const onSelectRestore = () => {
if (!canResumeProject) {
diff --git a/studio/pages/new/[slug].tsx b/studio/pages/new/[slug].tsx
index bb74530426a..0578455f4f4 100644
--- a/studio/pages/new/[slug].tsx
+++ b/studio/pages/new/[slug].tsx
@@ -45,7 +45,6 @@ const Wizard: NextPageWithLayout = () => {
const { slug } = router.query
const { app, ui } = useStore()
- const enablePermissions = useFlag('enablePermissions')
const projectCreationDisabled = useFlag('disableProjectCreationAndUpdate')
const kpsEnabled = useFlag('initWithKps')
const subscriptionStats = useSubscriptionStats()
@@ -66,13 +65,8 @@ const Wizard: NextPageWithLayout = () => {
const currentOrg = organizations.find((o: any) => o.slug === slug)
const stripeCustomerId = currentOrg?.stripe_customer_id
- const isOrganizationOwner = ui.selectedOrganization?.is_owner
const availableRegions = getAvailableRegions()
-
- const isAdmin = enablePermissions
- ? checkPermissions(PermissionAction.CREATE, 'projects')
- : isOrganizationOwner
-
+ const isAdmin = checkPermissions(PermissionAction.CREATE, 'projects')
const isInvalidSlug = isUndefined(currentOrg)
const isEmptyOrganizations = organizations.length <= 0 && app.organizations.isInitialized
const isEmptyPaymentMethod = paymentMethods ? !paymentMethods.length : false
diff --git a/studio/pages/project/[ref]/settings/database.tsx b/studio/pages/project/[ref]/settings/database.tsx
index 012c8b3c48d..56850b1d5d1 100644
--- a/studio/pages/project/[ref]/settings/database.tsx
+++ b/studio/pages/project/[ref]/settings/database.tsx
@@ -42,10 +42,7 @@ const ResetDbPassword: FC = () => {
const { ui } = useStore()
const projectRef = ui.selectedProject?.ref
- const enablePermissions = useFlag('enablePermissions')
- const canResetDbPassword = enablePermissions
- ? checkPermissions(PermissionAction.UPDATE, 'projects')
- : ui.selectedOrganization?.is_owner
+ const canResetDbPassword = checkPermissions(PermissionAction.UPDATE, 'projects')
const [showResetDbPass, setShowResetDbPass] = useState(false)
const [isUpdatingPassword, setIsUpdatingPassword] = useState(false)
diff --git a/studio/styles/toast.scss b/studio/styles/toast.scss
index 88dd2d08fcf..69091a11ec0 100644
--- a/studio/styles/toast.scss
+++ b/studio/styles/toast.scss
@@ -552,4 +552,12 @@
animation-name: Toastify__slideOutDown;
}
+.toast-message {
+ max-width: 258px;
+ div[role='status'] {
+ @apply justify-start w-full break-words;
+ word-break: break-word;
+ }
+}
+
/*# sourceMappingURL=ReactToastify.css.map */
\ No newline at end of file