diff --git a/apps/studio/components/interfaces/Auth/Hooks/HookCard.tsx b/apps/studio/components/interfaces/Auth/Hooks/HookCard.tsx
index 9850a9a51da..80dc0264277 100644
--- a/apps/studio/components/interfaces/Auth/Hooks/HookCard.tsx
+++ b/apps/studio/components/interfaces/Auth/Hooks/HookCard.tsx
@@ -100,7 +100,9 @@ export const HookCard = ({ hook, onSelect }: HookCardProps) => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to configure auth hooks',
+ text: !canUpdateAuthHook
+ ? 'You need additional permissions to configure auth hooks'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/index.tsx b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/index.tsx
index b11333148e0..ba6aa9ab2ae 100644
--- a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/index.tsx
+++ b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/index.tsx
@@ -804,7 +804,9 @@ export const AIPolicyEditorPanel = memo(function ({
tooltip={{
content: {
side: 'top',
- text: 'You need additional permissions to update policies',
+ text: !canUpdatePolicies
+ ? 'You need additional permissions to update policies'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyRow.tsx b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyRow.tsx
index ae34fb099d4..9944a44b4c4 100644
--- a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyRow.tsx
+++ b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyRow.tsx
@@ -3,7 +3,7 @@ import { PermissionAction } from '@supabase/shared-types/out/constants'
import { noop } from 'lodash'
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
-import { ButtonTooltip } from 'components/ui/ButtonTooltip'
+import { DropdownMenuItemTooltip } from 'components/ui/DropdownMenuItemTooltip'
import Panel from 'components/ui/Panel'
import { useAuthConfigQuery } from 'data/auth/auth-config-query'
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
@@ -20,7 +20,6 @@ import {
TooltipContent_Shadcn_,
TooltipTrigger_Shadcn_,
} from 'ui'
-import { DropdownMenuItemTooltip } from 'components/ui/DropdownMenuItemTooltip'
interface PolicyRowProps {
policy: PostgresPolicy
diff --git a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyTableRowHeader.tsx b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyTableRowHeader.tsx
index 1a954208d97..4823c3bc72e 100644
--- a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyTableRowHeader.tsx
+++ b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyTableRowHeader.tsx
@@ -79,7 +79,9 @@ const PolicyTableRowHeader = ({
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to toggle RLS',
+ text: !canToggleRLS
+ ? 'You need additional permissions to toggle RLS'
+ : undefined,
},
}}
>
@@ -94,7 +96,9 @@ const PolicyTableRowHeader = ({
content: {
side: 'bottom',
text: !canToggleRLS
- ? 'You need additional permissions to create RLS policies'
+ ? !canToggleRLS
+ ? 'You need additional permissions to create RLS policies'
+ : undefined
: undefined,
},
}}
diff --git a/apps/studio/components/interfaces/Auth/RedirectUrls/RedirectUrlList.tsx b/apps/studio/components/interfaces/Auth/RedirectUrls/RedirectUrlList.tsx
index 8ee007d54b4..304cac3af4d 100644
--- a/apps/studio/components/interfaces/Auth/RedirectUrls/RedirectUrlList.tsx
+++ b/apps/studio/components/interfaces/Auth/RedirectUrls/RedirectUrlList.tsx
@@ -72,7 +72,9 @@ export const RedirectUrlList = ({
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to remove redirect URLs',
+ text: !canUpdateConfig
+ ? 'You need additional permissions to remove redirect URLs'
+ : undefined,
},
}}
icon={}
@@ -88,7 +90,9 @@ export const RedirectUrlList = ({
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to update redirect URLs',
+ text: !canUpdateConfig
+ ? 'You need additional permissions to update redirect URLs'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Auth/Users/UserOverview.tsx b/apps/studio/components/interfaces/Auth/Users/UserOverview.tsx
index 7dd8d768955..6754170842f 100644
--- a/apps/studio/components/interfaces/Auth/Users/UserOverview.tsx
+++ b/apps/studio/components/interfaces/Auth/Users/UserOverview.tsx
@@ -521,6 +521,8 @@ const RowAction = ({
}
className?: string
}) => {
+ const disabled = button?.disabled ?? false
+
return (
@@ -535,11 +537,13 @@ const RowAction = ({
icon={success ? : button.icon}
loading={button.isLoading ?? false}
onClick={button.onClick}
- disabled={button?.disabled ?? false}
+ disabled={disabled}
tooltip={{
content: {
side: 'bottom',
- text: `You need additional permissions to ${button.text.toLowerCase()}`,
+ text: disabled
+ ? `You need additional permissions to ${button.text.toLowerCase()}`
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/BranchManagement/BranchManagement.tsx b/apps/studio/components/interfaces/BranchManagement/BranchManagement.tsx
index 435e55c6fa4..366d9e47ff2 100644
--- a/apps/studio/components/interfaces/BranchManagement/BranchManagement.tsx
+++ b/apps/studio/components/interfaces/BranchManagement/BranchManagement.tsx
@@ -216,7 +216,9 @@ const BranchManagement = () => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to create branches',
+ text: !canCreateBranches
+ ? 'You need additional permissions to create branches'
+ : undefined,
},
}}
>
@@ -271,7 +273,9 @@ const BranchManagement = () => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to disable branching',
+ text: !canDisableBranching
+ ? 'You need additional permissions to disable branching'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx b/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx
index 4432578919c..264af8aa091 100644
--- a/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx
+++ b/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx
@@ -29,7 +29,9 @@ export const BranchingEmptyState = () => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to enable branching',
+ text: !canEnableBranching
+ ? 'You need additional permissions to enable branching'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/DataWarehouse/CreateWarehouseAccessToken.tsx b/apps/studio/components/interfaces/DataWarehouse/CreateWarehouseAccessToken.tsx
index af20da05fdd..cbb8960f1fa 100644
--- a/apps/studio/components/interfaces/DataWarehouse/CreateWarehouseAccessToken.tsx
+++ b/apps/studio/components/interfaces/DataWarehouse/CreateWarehouseAccessToken.tsx
@@ -40,7 +40,9 @@ const CreateWarehouseAccessToken = ({ onSubmit, loading, open, setOpen }: Create
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to create access tokens',
+ text: !canCreateAccessTokens
+ ? 'You need additional permissions to create access tokens'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx b/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx
index 65f4bf35f2c..521ea2827c9 100644
--- a/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx
+++ b/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx
@@ -142,7 +142,9 @@ const FunctionsList = ({
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to create functions',
+ text: !canCreateFunctions
+ ? 'You need additional permissions to create functions'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Database/Tables/ColumnList.tsx b/apps/studio/components/interfaces/Database/Tables/ColumnList.tsx
index cf3977ff8f1..b3c3482ee26 100644
--- a/apps/studio/components/interfaces/Database/Tables/ColumnList.tsx
+++ b/apps/studio/components/interfaces/Database/Tables/ColumnList.tsx
@@ -72,7 +72,9 @@ const ColumnList = ({
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to create columns',
+ text: !canUpdateColumns
+ ? 'You need additional permissions to create columns'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Database/Tables/TableList.tsx b/apps/studio/components/interfaces/Database/Tables/TableList.tsx
index 519347c7858..d7245c85ec8 100644
--- a/apps/studio/components/interfaces/Database/Tables/TableList.tsx
+++ b/apps/studio/components/interfaces/Database/Tables/TableList.tsx
@@ -275,7 +275,9 @@ const TableList = ({
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to create tables',
+ text: !canUpdateTables
+ ? 'You need additional permissions to create tables'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx
index 3936710c68e..aca153eb113 100644
--- a/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx
+++ b/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx
@@ -257,7 +257,9 @@ const EdgeFunctionDetails = () => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to delete edge functions',
+ text: !canUpdateEdgeFunction
+ ? 'You need additional permissions to delete edge functions'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecret.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecret.tsx
index 516266d5c20..ba5212aafdf 100644
--- a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecret.tsx
+++ b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecret.tsx
@@ -42,7 +42,9 @@ const EdgeFunctionSecret = ({ secret, onSelectDelete }: EdgeFunctionSecretProps)
side: 'bottom',
text: isReservedSecret
? 'This is a reserved secret and cannot be deleted'
- : 'You need additional permissions to delete edge function secrets',
+ : !canUpdateSecrets
+ ? 'You need additional permissions to delete edge function secrets'
+ : undefined,
},
}}
/>
diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecrets.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecrets.tsx
index c5183483b9e..fa151ea1294 100644
--- a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecrets.tsx
+++ b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecrets.tsx
@@ -81,7 +81,9 @@ const EdgeFunctionSecrets = () => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to update edge function secrets',
+ text: !canUpdateSecrets
+ ? 'You need additional permissions to update edge function secrets'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Integrations/CronJobs/CreateCronJobSheet.tsx b/apps/studio/components/interfaces/Integrations/CronJobs/CreateCronJobSheet.tsx
index 02391b94026..caa6249c62d 100644
--- a/apps/studio/components/interfaces/Integrations/CronJobs/CreateCronJobSheet.tsx
+++ b/apps/studio/components/interfaces/Integrations/CronJobs/CreateCronJobSheet.tsx
@@ -316,7 +316,9 @@ export const CreateCronJobSheet = ({
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to enable database extensions',
+ text: !canToggleExtensions
+ ? 'You need additional permissions to enable database extensions'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Integrations/IntegrationPanels.tsx b/apps/studio/components/interfaces/Integrations/IntegrationPanels.tsx
index dc03ab01576..8af175bded5 100644
--- a/apps/studio/components/interfaces/Integrations/IntegrationPanels.tsx
+++ b/apps/studio/components/interfaces/Integrations/IntegrationPanels.tsx
@@ -303,7 +303,10 @@ const EmptyIntegrationConnection = React.forwardRef<
disabled={disabled}
onClick={() => onClick()}
tooltip={{
- content: { side: 'bottom', text: 'Additional permissions required to add connection' },
+ content: {
+ side: 'bottom',
+ text: disabled ? 'Additional permissions required to add connection' : undefined,
+ },
}}
>
Add new project connection
diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/OAuthApps.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/OAuthApps.tsx
index c7c5c69de5b..375284c0b9b 100644
--- a/apps/studio/components/interfaces/Organization/OAuthApps/OAuthApps.tsx
+++ b/apps/studio/components/interfaces/Organization/OAuthApps/OAuthApps.tsx
@@ -85,7 +85,9 @@ const OAuthApps = () => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to create apps',
+ text: !canCreateOAuthApps
+ ? 'You need additional permissions to create apps'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx b/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx
index 038c8878f33..cabc8158278 100644
--- a/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx
+++ b/apps/studio/components/interfaces/Settings/API/HardenAPIModal.tsx
@@ -184,7 +184,13 @@ export const HardenAPIModal = ({ visible, onClose }: HardenAPIModalProps) => {
disabled={hasAPISchema && isAPISchemaExposed}
loading={isCreatingAPISchema}
tooltip={{
- content: { side: 'right', text: 'Schema has already been created and exposed' },
+ content: {
+ side: 'right',
+ text:
+ hasAPISchema && isAPISchemaExposed
+ ? 'Schema has already been created and exposed'
+ : undefined,
+ },
}}
>
Create and expose schema to Data API
@@ -249,7 +255,12 @@ export const HardenAPIModal = ({ visible, onClose }: HardenAPIModalProps) => {
className="w-min"
disabled={!isPublicSchemaExposed}
loading={isUpdatingConfig}
- tooltip={{ content: { side: 'right', text: 'Public schema no longer exposed' } }}
+ tooltip={{
+ content: {
+ side: 'right',
+ text: !isPublicSchemaExposed ? 'Public schema no longer exposed' : undefined,
+ },
+ }}
onClick={onSelectRemovePublicSchema}
>
Remove public schema from exposed schemas
diff --git a/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx b/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
index 2c942355681..cc291744349 100644
--- a/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
@@ -99,7 +99,9 @@ const BannedIPs = () => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to unban networks',
+ text: !canUnbanNetworks
+ ? 'You need additional permissions to unban networks'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
index 19a6f94a6fd..b39170c9349 100644
--- a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
@@ -55,7 +55,9 @@ const DisallowAllAccessButton = ({ disabled, onClick }: AccessButtonProps) => (
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to update network restrictions',
+ text: disabled
+ ? 'You need additional permissions to update network restrictions'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx b/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx
index 9025f11222e..427a7d66422 100644
--- a/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx
+++ b/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx
@@ -27,7 +27,9 @@ const DeleteProjectButton = ({ type = 'danger' }: DeleteProjectButtonProps) => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to delete this project',
+ text: !canDeleteProject
+ ? 'You need additional permissions to delete this project'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectButton.tsx b/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectButton.tsx
index c1f6a75e03d..9777aca6547 100644
--- a/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectButton.tsx
+++ b/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectButton.tsx
@@ -79,7 +79,9 @@ const TransferProjectButton = () => {
side: 'bottom',
text: !canTransferProject
? 'You need additional permissions to transfer this project'
- : 'Project transfers are temporarily disabled, please try again later.',
+ : disableProjectTransfer
+ ? 'Project transfers are temporarily disabled, please try again later.'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx
index ac9c1837de8..81db395954a 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx
@@ -231,7 +231,9 @@ const InstanceConfigurationUI = () => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to deploy replicas',
+ text: !canManageReplicas
+ ? 'You need additional permissions to deploy replicas'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/MapView.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/MapView.tsx
index a7ddcaaa19b..b39fe8e455c 100644
--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/MapView.tsx
+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/MapView.tsx
@@ -358,7 +358,9 @@ const MapView = ({
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to deploy replicas',
+ text: !canManageReplicas
+ ? 'You need additional permissions to deploy replicas'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/layouts/ProjectLayout/PauseFailedState.tsx b/apps/studio/components/layouts/ProjectLayout/PauseFailedState.tsx
index 88eb1049fe9..9e8e36faf38 100644
--- a/apps/studio/components/layouts/ProjectLayout/PauseFailedState.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/PauseFailedState.tsx
@@ -75,7 +75,12 @@ const PauseFailedState = () => {
icon={}
loading={isDownloading}
disabled={backups.length === 0}
- tooltip={{ content: { side: 'bottom', text: 'No available backups to download' } }}
+ tooltip={{
+ content: {
+ side: 'bottom',
+ text: backups.length === 0 ? 'No available backups to download' : undefined,
+ },
+ }}
onClick={onClickDownloadBackup}
>
Download backup
diff --git a/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx b/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx
index 9c2e528eb2a..a64d8ccff44 100644
--- a/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/PausedState/ProjectPausedState.tsx
@@ -276,7 +276,9 @@ export const ProjectPausedState = ({ product }: ProjectPausedStateProps) => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to resume this project',
+ text: !canResumeProject
+ ? 'You need additional permissions to resume this project'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/layouts/ProjectLayout/RestoreFailedState.tsx b/apps/studio/components/layouts/ProjectLayout/RestoreFailedState.tsx
index 8b416e8a6a0..6ba94a4833b 100644
--- a/apps/studio/components/layouts/ProjectLayout/RestoreFailedState.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/RestoreFailedState.tsx
@@ -75,7 +75,12 @@ const RestoreFailedState = () => {
icon={}
loading={isDownloading}
disabled={backups.length === 0}
- tooltip={{ content: { side: 'bottom', text: 'No available backups to download' } }}
+ tooltip={{
+ content: {
+ side: 'bottom',
+ text: backups.length === 0 ? 'No available backups to download' : undefined,
+ },
+ }}
onClick={onClickDownloadBackup}
>
Download backup
diff --git a/apps/studio/components/layouts/ProjectLayout/RestoringState.tsx b/apps/studio/components/layouts/ProjectLayout/RestoringState.tsx
index 4f95cd0f2c4..5f4bf20491e 100644
--- a/apps/studio/components/layouts/ProjectLayout/RestoringState.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/RestoringState.tsx
@@ -126,7 +126,12 @@ const RestoringState = () => {
icon={}
loading={isDownloading}
disabled={backups.length === 0}
- tooltip={{ content: { side: 'bottom', text: 'No available backups to download' } }}
+ tooltip={{
+ content: {
+ side: 'bottom',
+ text: backups.length === 0 ? 'No available backups to download' : undefined,
+ },
+ }}
onClick={onClickDownloadBackup}
>
Download backup
diff --git a/apps/studio/components/layouts/ReportsLayout/ReportsMenu.tsx b/apps/studio/components/layouts/ReportsLayout/ReportsMenu.tsx
index a4e768de272..dbb19165499 100644
--- a/apps/studio/components/layouts/ReportsLayout/ReportsMenu.tsx
+++ b/apps/studio/components/layouts/ReportsLayout/ReportsMenu.tsx
@@ -136,7 +136,9 @@ const ReportsMenu = () => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to create custom reports',
+ text: !canCreateCustomReport
+ ? 'You need additional permissions to create custom reports'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/layouts/StorageLayout/StorageMenu.tsx b/apps/studio/components/layouts/StorageLayout/StorageMenu.tsx
index a30790de3b6..d47cd875f5f 100644
--- a/apps/studio/components/layouts/StorageLayout/StorageMenu.tsx
+++ b/apps/studio/components/layouts/StorageLayout/StorageMenu.tsx
@@ -79,7 +79,9 @@ const StorageMenu = () => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to create buckets',
+ text: !canCreateBuckets
+ ? 'You need additional permissions to create buckets'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/layouts/TableEditorLayout/TableEditorMenu.tsx b/apps/studio/components/layouts/TableEditorLayout/TableEditorMenu.tsx
index 82ff2ae0376..215893ac1d3 100644
--- a/apps/studio/components/layouts/TableEditorLayout/TableEditorMenu.tsx
+++ b/apps/studio/components/layouts/TableEditorLayout/TableEditorMenu.tsx
@@ -136,7 +136,9 @@ const TableEditorMenu = () => {
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to create tables',
+ text: !canCreateTables
+ ? 'You need additional permissions to create tables'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerHeader.tsx b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerHeader.tsx
index 5e31b0477ca..e9b7bf980c9 100644
--- a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerHeader.tsx
+++ b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerHeader.tsx
@@ -434,7 +434,9 @@ const FileExplorerHeader = ({
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to upload files',
+ text: !canUpdateStorage
+ ? 'You need additional permissions to upload files'
+ : undefined,
},
}}
>
@@ -448,7 +450,9 @@ const FileExplorerHeader = ({
tooltip={{
content: {
side: 'bottom',
- text: 'You need additional permissions to create folders',
+ text: !canUpdateStorage
+ ? 'You need additional permissions to create folders'
+ : undefined,
},
}}
>
diff --git a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerHeaderSelection.tsx b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerHeaderSelection.tsx
index c1131dd741b..8b6daad9cf2 100644
--- a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerHeaderSelection.tsx
+++ b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerHeaderSelection.tsx
@@ -48,6 +48,7 @@ const FileExplorerHeaderSelection = () => {
}
type="primary"
+ disabled={!canUpdateFiles}
onClick={() => setSelectedItemsToDelete(selectedItems)}
tooltip={{
content: {
@@ -62,6 +63,7 @@ const FileExplorerHeaderSelection = () => {
}
type="primary"
+ disabled={!canUpdateFiles}
onClick={() => setSelectedItemsToMove(selectedItems)}
tooltip={{
content: {
diff --git a/apps/studio/pages/project/[ref]/auth/policies.tsx b/apps/studio/pages/project/[ref]/auth/policies.tsx
index 1c3bb93b5a8..1d13326de51 100644
--- a/apps/studio/pages/project/[ref]/auth/policies.tsx
+++ b/apps/studio/pages/project/[ref]/auth/policies.tsx
@@ -9,7 +9,6 @@ import Policies from 'components/interfaces/Auth/Policies/Policies'
import AuthLayout from 'components/layouts/AuthLayout/AuthLayout'
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
import AlertError from 'components/ui/AlertError'
-import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import NoPermission from 'components/ui/NoPermission'
import SchemaSelector from 'components/ui/SchemaSelector'
import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'