From 43cc61818cfde975ab4e21262ca59d6773585a05 Mon Sep 17 00:00:00 2001 From: Ivan Vasilov Date: Thu, 20 Nov 2025 17:44:53 +0200 Subject: [PATCH] chore: Migrate all `isPending` uses in `react-query` (#40642) * Bump react-query. Minor type and logic fixes. * Migrate all use of isLoading to isPending in mutations. * Fix type errors. --- .../grid/components/editor/JsonEditor.tsx | 4 +- .../grid/components/editor/TextEditor.tsx | 4 +- .../interfaces/APIKeys/APIKeyDeleteDialog.tsx | 2 +- .../APIKeys/CreatePublishableAPIKeyDialog.tsx | 2 +- .../APIKeys/CreateSecretAPIKeyDialog.tsx | 2 +- .../interfaces/APIKeys/SecretAPIKeys.tsx | 3 +- .../AccessTokens/NewAccessTokenDialog.tsx | 6 +- .../Preferences/AccountConnections.tsx | 3 +- .../Account/Preferences/AccountIdentities.tsx | 2 +- .../Preferences/ChangeEmailAddress.tsx | 6 +- .../Preferences/DeleteAccountButton.tsx | 8 +-- .../Preferences/ProfileInformation.tsx | 4 +- .../Account/TOTPFactors/AddNewFactorModal.tsx | 4 +- .../Account/TOTPFactors/DeleteFactorModal.tsx | 4 +- .../interfaces/Advisors/AdvisorRuleItem.tsx | 2 +- .../interfaces/Advisors/CreateRuleSheet.tsx | 2 +- .../interfaces/Advisors/DisableRuleModal.tsx | 2 +- .../interfaces/Advisors/EnableRuleModal.tsx | 2 +- .../interfaces/Auth/AuditLogsForm.tsx | 2 +- .../Auth/AuthProvidersForm/ProviderForm.tsx | 2 +- .../interfaces/Auth/BasicAuthSettingsForm.tsx | 2 +- .../Auth/EmailTemplates/EmailTemplates.tsx | 2 +- .../interfaces/Auth/Hooks/CreateHookSheet.tsx | 2 +- .../interfaces/Auth/Hooks/HooksListing.tsx | 2 +- .../Auth/OAuthApps/CreateOAuthAppSheet.tsx | 2 +- .../Auth/OAuthApps/OAuthAppsList.tsx | 2 +- .../OAuthApps/OAuthServerSettingsForm.tsx | 6 +- .../Auth/Policies/PolicyEditorPanel/index.tsx | 4 +- .../ProtectionAuthSettingsForm.tsx | 2 +- .../interfaces/Auth/RateLimits/RateLimits.tsx | 2 +- .../Auth/RedirectUrls/AddNewURLModal.tsx | 4 +- .../Auth/RedirectUrls/RedirectUrls.tsx | 2 +- .../interfaces/Auth/SmtpForm/SmtpForm.tsx | 2 +- .../ThirdPartyAuthForm/CreateAuth0Dialog.tsx | 6 +- .../CreateAwsCognitoAuthDialog.tsx | 6 +- .../CreateClerkAuthDialog.tsx | 9 ++- .../CreateFirebaseAuthDialog.tsx | 6 +- .../ThirdPartyAuthForm/CreateWorkOSDialog.tsx | 6 +- .../interfaces/Auth/Users/BanUserModal.tsx | 2 +- .../interfaces/Auth/Users/CreateUserModal.tsx | 2 +- .../interfaces/Auth/Users/DeleteUserModal.tsx | 2 +- .../interfaces/Auth/Users/InviteUserModal.tsx | 2 +- .../interfaces/Auth/Users/UserOverview.tsx | 8 +-- .../ChangePaymentMethodModal.tsx | 2 +- .../DeletePaymentMethodModal.tsx | 2 +- .../BranchManagement/CreateBranchModal.tsx | 4 +- .../BranchManagement/EditBranchModal.tsx | 4 +- .../interfaces/BranchManagement/Overview.tsx | 4 +- .../interfaces/BranchManagement/ReviewRow.tsx | 2 +- .../Database/Backups/BackupItem.tsx | 2 +- .../Database/Backups/BackupsList.tsx | 2 +- .../Database/Backups/PITR/PITRSelection.tsx | 2 +- .../CreateNewProjectDialog.tsx | 2 +- .../ETL/DestinationPanel/DestinationPanel.tsx | 12 ++-- .../Database/ETL/EnableReplicationModal.tsx | 2 +- .../Database/ETL/NewPublicationPanel.tsx | 2 +- .../ReplicationPipelineStatus.tsx | 4 +- .../Database/ETL/RetryOptionsDropdown.tsx | 4 +- .../CreateEnumeratedTypeSidePanel.tsx | 2 +- .../DeleteEnumeratedTypeModal.tsx | 2 +- .../EditEnumeratedTypeSidePanel.tsx | 2 +- .../Extensions/EnableExtensionModal.tsx | 2 +- .../Database/Extensions/ExtensionRow.tsx | 2 +- .../Functions/CreateFunction/index.tsx | 4 +- .../Functions/FunctionsList/FunctionsList.tsx | 18 +++--- .../Database/Hooks/DeleteHookModal.tsx | 2 +- .../Database/Indexes/CreateIndexSidePanel.tsx | 2 +- .../interfaces/Database/Indexes/Indexes.tsx | 6 +- .../Publications/PublicationsTableItem.tsx | 4 +- .../Database/Roles/CreateRolePanel.tsx | 2 +- .../Database/Roles/DeleteRoleModal.tsx | 2 +- .../interfaces/Database/Roles/RoleRow.tsx | 2 +- .../Database/Triggers/TriggerSheet.tsx | 4 +- .../Triggers/TriggersList/TriggersList.tsx | 18 +++--- .../DiskManagement/DiskManagementForm.tsx | 6 +- .../EdgeFunctionDetails.tsx | 4 +- .../EdgeFunctionTesterSheet.tsx | 16 ++--- .../EdgeFunctionSecrets/AddNewSecretForm.tsx | 5 +- .../EdgeFunctionSecrets.tsx | 4 +- .../EdgeFunctionSecrets/EditSecretSheet.tsx | 2 +- .../CreateCronJobSheet/CreateCronJobSheet.tsx | 2 +- .../CronJobScheduleSection.tsx | 2 +- .../CronJobs/CronJobTableCell.tsx | 4 +- .../Integrations/CronJobs/DeleteCronJob.tsx | 6 +- .../Integrations/Queues/CreateQueueSheet.tsx | 13 +--- .../Integrations/Queues/QueueTab.tsx | 2 +- .../Queues/SingleQueue/DeleteQueue.tsx | 4 +- .../SingleQueue/MessageDetailsPanel.tsx | 6 +- .../Queues/SingleQueue/PurgeQueue.tsx | 4 +- .../Queues/SingleQueue/SendMessageModal.tsx | 4 +- .../Vault/Secrets/DeleteSecretModal.tsx | 2 +- .../Vault/Secrets/EditSecretModal.tsx | 20 +++---- .../VercelGithub/IntegrationConnection.tsx | 2 +- .../Integrations/Webhooks/OverviewTab.tsx | 2 +- .../Wrappers/CreateIcebergWrapperSheet.tsx | 4 +- .../Wrappers/CreateWrapperSheet.tsx | 4 +- .../Wrappers/DeleteWrapperModal.tsx | 2 +- .../Wrappers/EditWrapperSheet.tsx | 2 +- .../create-key-dialog.tsx | 6 +- .../jwt-secret-keys-table/index.tsx | 14 ++--- .../rotate-key-dialog.tsx | 7 +-- .../interfaces/JwtSecrets/jwt-settings.tsx | 4 +- .../BillingSettings/BillingEmail.tsx | 2 +- .../CostControl/SpendCapSidePanel.tsx | 2 +- .../BillingSettings/CreditTopUp.tsx | 2 +- .../Subscription/ExitSurveyModal.tsx | 4 +- .../Subscription/PaymentMethodSelection.tsx | 4 +- .../SubscriptionPlanUpdateDialog.tsx | 4 +- .../Subscription/UpgradeModal.tsx | 2 +- .../AwsMarketplaceCreateNewOrg.tsx | 2 +- .../AwsMarketplaceLinkExistingOrg.tsx | 2 +- .../NewAwsMarketplaceOrgModal.tsx | 8 +-- .../interfaces/Organization/Documents/DPA.tsx | 2 +- .../DeleteOrganizationButton.tsx | 2 +- .../OrganizationDetailsForm.tsx | 2 +- .../SidePanelVercelProjectLinker.tsx | 2 +- .../InvoicesSettings/InvoicePayButton.tsx | 4 +- .../Organization/OAuthApps/DeleteAppModal.tsx | 2 +- .../OAuthApps/OAuthSecrets/OAuthSecrets.tsx | 2 +- .../OAuthApps/OAuthSecrets/SecretRow.tsx | 2 +- .../Organization/OAuthApps/RevokeAppModal.tsx | 2 +- .../Organization/ProjectClaim/confirm.tsx | 4 +- .../interfaces/Organization/SSO/SSOConfig.tsx | 4 +- .../Organization/SecuritySettings.tsx | 2 +- .../TeamSettings/InviteMemberButton.tsx | 2 +- .../TeamSettings/MemberActions.tsx | 6 +- .../OrganizationInvite/OrganizationInvite.tsx | 2 +- .../IndexAdvisor/EnableIndexAdvisorButton.tsx | 2 +- .../IndexAdvisorDisabledState.tsx | 2 +- .../interfaces/Realtime/RealtimeSettings.tsx | 2 +- .../interfaces/Reports/CreateReportModal.tsx | 2 +- .../components/interfaces/Reports/Reports.tsx | 2 +- .../interfaces/Reports/UpdateModal.tsx | 2 +- .../interfaces/SQLEditor/MoveQueryModal.tsx | 4 +- .../SQLEditor/OngoingQueriesPanel.tsx | 4 +- .../interfaces/SQLEditor/RenameQueryModal.tsx | 2 +- .../interfaces/SQLEditor/SQLEditor.tsx | 6 +- .../Settings/API/HardenAPIModal.tsx | 4 +- .../Settings/API/PostgrestConfig.tsx | 2 +- .../Settings/Addons/CustomDomainSidePanel.tsx | 4 +- .../Settings/Addons/IPv4SidePanel.tsx | 4 +- .../Settings/Addons/PITRSidePanel.tsx | 4 +- .../Settings/Database/BannedIPs.tsx | 2 +- .../ConnectionPooling/ConnectionPooling.tsx | 2 +- .../ConfirmDisableReadOnlyModal.tsx | 4 +- .../DatabaseSettings/ResetDbPassword.tsx | 2 +- .../Database/DiskSizeConfiguration.tsx | 2 +- .../Database/DiskSizeConfigurationModal.tsx | 2 +- .../AddRestrictionModal.tsx | 2 +- .../NetworkRestrictions/AllowAllModal.tsx | 2 +- .../NetworkRestrictions/DisallowAllModal.tsx | 2 +- .../RemoveRestrictionModal.tsx | 2 +- .../Settings/Database/SSLConfiguration.tsx | 2 +- .../ProjectComplianceMode.tsx | 2 +- .../CustomDomainActivate.tsx | 6 +- .../CustomDomainConfig/CustomDomainConfig.tsx | 2 +- .../CustomDomainConfig/CustomDomainVerify.tsx | 4 +- .../CustomDomainsConfigureHostname.tsx | 4 +- .../DeleteProjectPanel/DeleteProjectModal.tsx | 4 +- .../interfaces/Settings/General/General.tsx | 2 +- .../Infrastructure/PauseProjectButton.tsx | 2 +- .../Infrastructure/ProjectUpgradeAlert.tsx | 2 +- .../Infrastructure/RestartServerButton.tsx | 4 +- .../TransferProjectButton.tsx | 12 ++-- .../DeployNewReplicaPanel.tsx | 4 +- .../DropAllReplicasConfirmationModal.tsx | 2 +- .../DropReplicaConfirmationModal.tsx | 2 +- .../RestartReplicaConfirmationModal.tsx | 2 +- .../GitHubIntegrationConnectionForm.tsx | 8 +-- .../VercelIntegrationConnectionForm.tsx | 4 +- .../SignIn/ForgotPasswordWizard.tsx | 8 +-- .../interfaces/SignIn/SignInMfaForm.tsx | 2 +- .../interfaces/SignIn/SignUpForm.tsx | 2 +- .../ConnectTablesDialog.tsx | 2 +- .../NamespaceWithTables/index.tsx | 2 +- .../AnalyticsBucketDetails/index.tsx | 4 +- .../useAnalyticsBucketAssociatedEntities.tsx | 10 ++-- .../CreateAnalyticsBucketModal.tsx | 6 +- .../DeleteAnalyticsBucketModal.tsx | 4 +- .../interfaces/Storage/CreateBucketModal.tsx | 2 +- .../interfaces/Storage/DeleteBucketModal.tsx | 4 +- .../interfaces/Storage/EditBucketModal.tsx | 2 +- .../interfaces/Storage/EmptyBucketModal.tsx | 6 +- .../StorageExplorer/useFetchFileUrlQuery.tsx | 2 +- .../StorageSettings/CreateCredentialModal.tsx | 2 +- .../StorageSettings/RevokeCredentialModal.tsx | 2 +- .../Storage/StorageSettings/S3Connection.tsx | 2 +- .../StorageListV2MigrationCallout.tsx | 2 +- .../StorageSettings/StorageSettings.tsx | 2 +- .../VectorBuckets/CreateVectorTableSheet.tsx | 4 +- .../VectorBuckets/DeleteVectorBucketModal.tsx | 2 +- .../VectorBuckets/DeleteVectorTableModal.tsx | 2 +- .../VectorBuckets/VectorBucketDetails.tsx | 4 +- .../DeleteConfirmationDialogs.tsx | 6 +- .../TableGridEditor/GridHeaderActions.tsx | 2 +- .../RowEditor/JsonEditor/index.tsx | 4 +- .../SidePanelEditor/RowEditor/TextEditor.tsx | 4 +- .../SidePanelEditor/SchemaEditor.tsx | 4 +- .../components/DownloadLogsButton.tsx | 6 +- .../LayoutHeader/MergeRequestButton.tsx | 2 +- .../ProjectLayout/PauseFailedState.tsx | 2 +- .../PausedState/ProjectPausedState.tsx | 2 +- .../ProjectLayout/RestoreFailedState.tsx | 2 +- .../layouts/ProjectLayout/RestoringState.tsx | 3 +- .../layouts/ReportsLayout/ReportsMenu.tsx | 2 +- .../SQLEditorNavV2/DeleteSnippetsModal.tsx | 2 +- .../SQLEditorNavV2/SQLEditorNav.tsx | 2 +- .../SQLEditorNavV2/ShareSnippetModal.tsx | 2 +- .../SQLEditorNavV2/UnshareSnippetModal.tsx | 2 +- .../AIAssistantPanel/DisplayBlockRenderer.tsx | 2 +- .../AIAssistantPanel/EdgeFunctionRenderer.tsx | 2 +- .../components/ui/EditorPanel/EditorPanel.tsx | 12 ++-- .../ProjectSettings/ToggleLegacyApiKeys.tsx | 2 +- .../jwt-secret-updating-status-query.ts | 2 +- .../config/project-upgrade-status-query.ts | 2 +- .../oauth-server-apps-query.ts | 2 +- .../iceberg-wrapper-create-mutation.ts | 6 +- .../s3-vectors-wrapper-create-mutation.ts | 6 +- apps/studio/hooks/forms/useAIOptInForm.ts | 2 +- apps/studio/lib/profile.tsx | 2 +- apps/studio/package.json | 4 +- .../pages/integrations/github/authorize.tsx | 4 +- .../[slug]/marketplace/choose-project.tsx | 2 +- .../pages/integrations/vercel/install.tsx | 2 +- apps/studio/pages/new/[slug].tsx | 2 +- .../[ref]/auth/templates/[templateId].tsx | 2 +- .../pages/project/[ref]/branches/index.tsx | 2 +- .../project/[ref]/branches/merge-requests.tsx | 4 +- .../[ref]/functions/[functionSlug]/code.tsx | 2 +- .../pages/project/[ref]/functions/new.tsx | 2 +- .../project/[ref]/logs/explorer/index.tsx | 2 +- apps/studio/pages/project/[ref]/merge.tsx | 8 +-- .../project/[ref]/observability/database.tsx | 2 +- .../project/[ref]/settings/log-drains.tsx | 4 +- apps/studio/tests/helpers.tsx | 6 -- apps/studio/types/react-query.ts | 2 +- pnpm-lock.yaml | 60 +++++++++---------- 237 files changed, 447 insertions(+), 462 deletions(-) diff --git a/apps/studio/components/grid/components/editor/JsonEditor.tsx b/apps/studio/components/grid/components/editor/JsonEditor.tsx index e99c1104c6c..4922d306c7a 100644 --- a/apps/studio/components/grid/components/editor/JsonEditor.tsx +++ b/apps/studio/components/grid/components/editor/JsonEditor.tsx @@ -73,7 +73,7 @@ export const JsonEditor = ({ const [isPopoverOpen, setIsPopoverOpen] = useState(true) const [value, setValue] = useState(jsonString) - const { mutate: getCellValue, isLoading, isSuccess } = useGetCellValueMutation() + const { mutate: getCellValue, isPending, isSuccess } = useGetCellValueMutation() const loadFullValue = () => { if (selectedTable === undefined || project === undefined || !isTableLike(selectedTable)) return @@ -167,7 +167,7 @@ export const JsonEditor = ({ value={value ?? ''} language="markdown" /> - + ) : ( diff --git a/apps/studio/components/grid/components/editor/TextEditor.tsx b/apps/studio/components/grid/components/editor/TextEditor.tsx index ca49402a3d5..9607dda28ad 100644 --- a/apps/studio/components/grid/components/editor/TextEditor.tsx +++ b/apps/studio/components/grid/components/editor/TextEditor.tsx @@ -45,7 +45,7 @@ export const TextEditor = ({ const [value, setValue] = useState(initialValue) const [isConfirmNextModalOpen, setIsConfirmNextModalOpen] = useState(false) - const { mutate: getCellValue, isLoading, isSuccess } = useGetCellValueMutation() + const { mutate: getCellValue, isPending, isSuccess } = useGetCellValueMutation() const isTruncated = isValueTruncated(initialValue) @@ -121,7 +121,7 @@ export const TextEditor = ({ value={value ?? ''} language="markdown" /> - + ) : ( diff --git a/apps/studio/components/interfaces/APIKeys/CreatePublishableAPIKeyDialog.tsx b/apps/studio/components/interfaces/APIKeys/CreatePublishableAPIKeyDialog.tsx index 8a837bf9d47..f195342a307 100644 --- a/apps/studio/components/interfaces/APIKeys/CreatePublishableAPIKeyDialog.tsx +++ b/apps/studio/components/interfaces/APIKeys/CreatePublishableAPIKeyDialog.tsx @@ -51,7 +51,7 @@ function CreatePublishableAPIKeyDialog() { }, }) - const { mutate: createAPIKey, isLoading: isCreatingAPIKey } = useAPIKeyCreateMutation() + const { mutate: createAPIKey, isPending: isCreatingAPIKey } = useAPIKeyCreateMutation() const onSubmit: SubmitHandler> = async (values) => { createAPIKey( diff --git a/apps/studio/components/interfaces/APIKeys/CreateSecretAPIKeyDialog.tsx b/apps/studio/components/interfaces/APIKeys/CreateSecretAPIKeyDialog.tsx index a480f73d8da..4eb18794257 100644 --- a/apps/studio/components/interfaces/APIKeys/CreateSecretAPIKeyDialog.tsx +++ b/apps/studio/components/interfaces/APIKeys/CreateSecretAPIKeyDialog.tsx @@ -64,7 +64,7 @@ const CreateSecretAPIKeyDialog = () => { }, }) - const { mutate: createAPIKey, isLoading: isCreatingAPIKey } = useAPIKeyCreateMutation() + const { mutate: createAPIKey, isPending: isCreatingAPIKey } = useAPIKeyCreateMutation() const onSubmit: SubmitHandler> = async (values) => { createAPIKey( diff --git a/apps/studio/components/interfaces/APIKeys/SecretAPIKeys.tsx b/apps/studio/components/interfaces/APIKeys/SecretAPIKeys.tsx index 2828644e12d..c3d55af77a0 100644 --- a/apps/studio/components/interfaces/APIKeys/SecretAPIKeys.tsx +++ b/apps/studio/components/interfaces/APIKeys/SecretAPIKeys.tsx @@ -9,7 +9,6 @@ import { useAPIKeyDeleteMutation } from 'data/api-keys/api-key-delete-mutation' import type { APIKeysData } from 'data/api-keys/api-keys-query' import { useAPIKeysQuery } from 'data/api-keys/api-keys-query' import useLogsQuery from 'hooks/analytics/useLogsQuery' -import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions' import { handleErrorOnDelete, useQueryStateWithSelect } from 'hooks/misc/useQueryStateWithSelect' import { Card, EyeOffIcon } from 'ui' import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader' @@ -87,7 +86,7 @@ export const SecretAPIKeys = () => { handleErrorOnDelete(deletingAPIKeyIdRef, selectedId, `API Key not found`), }) - const { mutate: deleteAPIKey, isLoading: isDeletingAPIKey } = useAPIKeyDeleteMutation({ + const { mutate: deleteAPIKey, isPending: isDeletingAPIKey } = useAPIKeyDeleteMutation({ onSuccess: () => { toast.success(`Successfully deleted API key`) setAPIKeyToDelete(null) diff --git a/apps/studio/components/interfaces/Account/AccessTokens/NewAccessTokenDialog.tsx b/apps/studio/components/interfaces/Account/AccessTokens/NewAccessTokenDialog.tsx index afd1d8b7cf1..714055746a5 100644 --- a/apps/studio/components/interfaces/Account/AccessTokens/NewAccessTokenDialog.tsx +++ b/apps/studio/components/interfaces/Account/AccessTokens/NewAccessTokenDialog.tsx @@ -67,7 +67,7 @@ export const NewAccessTokenDialog = ({ defaultValues: { tokenName: '', expiresAt: ExpiresAtOptions['month'].value }, mode: 'onChange', }) - const { mutate: createAccessToken, isLoading } = useAccessTokenCreateMutation() + const { mutate: createAccessToken, isPending } = useAccessTokenCreateMutation() const onSubmit: SubmitHandler> = async (values) => { // Use custom date if custom option is selected @@ -240,7 +240,7 @@ export const NewAccessTokenDialog = ({ - diff --git a/apps/studio/components/interfaces/Account/Preferences/AccountConnections.tsx b/apps/studio/components/interfaces/Account/Preferences/AccountConnections.tsx index 5d7d4052125..e5f17b5c5d3 100644 --- a/apps/studio/components/interfaces/Account/Preferences/AccountConnections.tsx +++ b/apps/studio/components/interfaces/Account/Preferences/AccountConnections.tsx @@ -15,7 +15,6 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, - DropdownMenuSeparator, DropdownMenuTrigger, } from 'ui' import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' @@ -34,7 +33,7 @@ export const AccountConnections = () => { const isConnected = gitHubAuthorization !== null - const { mutate: removeAuthorization, isLoading: isRemoving } = + const { mutate: removeAuthorization, isPending: isRemoving } = useGitHubAuthorizationDeleteMutation({ onSuccess: () => { toast.success('GitHub authorization removed successfully') diff --git a/apps/studio/components/interfaces/Account/Preferences/AccountIdentities.tsx b/apps/studio/components/interfaces/Account/Preferences/AccountIdentities.tsx index 81801248215..b866e6bb73e 100644 --- a/apps/studio/components/interfaces/Account/Preferences/AccountIdentities.tsx +++ b/apps/studio/components/interfaces/Account/Preferences/AccountIdentities.tsx @@ -50,7 +50,7 @@ export const AccountIdentities = () => { const [selectedProviderUnlink, setSelectedProviderUnlink] = useState() const [selectedProviderUpdateEmail, setSelectedProviderUpdateEmail] = useState() - const { mutate: unlinkIdentity, isLoading: isUnlinking } = useUnlinkIdentityMutation({ + const { mutate: unlinkIdentity, isPending: isUnlinking } = useUnlinkIdentityMutation({ onSuccess: () => { toast.success( `Successfully unlinked ${getProviderName(selectedProviderUnlink ?? '')} identity!` diff --git a/apps/studio/components/interfaces/Account/Preferences/ChangeEmailAddress.tsx b/apps/studio/components/interfaces/Account/Preferences/ChangeEmailAddress.tsx index c853e7514c9..0aa80154dda 100644 --- a/apps/studio/components/interfaces/Account/Preferences/ChangeEmailAddress.tsx +++ b/apps/studio/components/interfaces/Account/Preferences/ChangeEmailAddress.tsx @@ -66,7 +66,7 @@ export const ChangeEmailAddressForm = ({ onClose }: { onClose: () => void }) => defaultValues: { email: '' }, }) - const { mutate: updateEmail, isLoading } = useEmailUpdateMutation({ + const { mutate: updateEmail, isPending } = useEmailUpdateMutation({ onSuccess: (_, vars) => { toast.success( `A confirmation email has been sent to ${vars.email}. Please confirm the change within 10 minutes.` @@ -121,10 +121,10 @@ export const ChangeEmailAddressForm = ({ onClose }: { onClose: () => void }) => - - diff --git a/apps/studio/components/interfaces/Account/Preferences/DeleteAccountButton.tsx b/apps/studio/components/interfaces/Account/Preferences/DeleteAccountButton.tsx index 90e9c00edb2..bbc1968e44c 100644 --- a/apps/studio/components/interfaces/Account/Preferences/DeleteAccountButton.tsx +++ b/apps/studio/components/interfaces/Account/Preferences/DeleteAccountButton.tsx @@ -65,7 +65,7 @@ export const DeleteAccountButton = () => { }) const { account } = form.watch() - const { mutate: submitSupportTicket, isLoading } = useSendSupportTicketMutation({ + const { mutate: submitSupportTicket, isPending } = useSendSupportTicketMutation({ onSuccess: () => { setIsOpen(false) setDeletionRequestFlag() @@ -171,7 +171,7 @@ export const DeleteAccountButton = () => { autoFocus {...field} autoComplete="off" - disabled={isLoading} + disabled={isPending} placeholder="Enter the account above" /> @@ -186,8 +186,8 @@ export const DeleteAccountButton = () => { size="small" type="danger" htmlType="submit" - loading={isLoading} - disabled={account !== accountEmail || isLoading} + loading={isPending} + disabled={account !== accountEmail || isPending} > Submit request for account deletion diff --git a/apps/studio/components/interfaces/Account/Preferences/ProfileInformation.tsx b/apps/studio/components/interfaces/Account/Preferences/ProfileInformation.tsx index 2c9decfe6ec..091420f9ad3 100644 --- a/apps/studio/components/interfaces/Account/Preferences/ProfileInformation.tsx +++ b/apps/studio/components/interfaces/Account/Preferences/ProfileInformation.tsx @@ -59,7 +59,7 @@ export const ProfileInformation = () => { values: defaultValues, }) - const { mutate: updateProfile, isLoading } = useProfileUpdateMutation({ + const { mutate: updateProfile, isPending } = useProfileUpdateMutation({ onSuccess: (data) => { toast.success('Successfully saved profile') const { first_name, last_name, username, primary_email } = data @@ -175,7 +175,7 @@ export const ProfileInformation = () => { diff --git a/apps/studio/components/interfaces/Auth/Policies/PolicyEditorPanel/index.tsx b/apps/studio/components/interfaces/Auth/Policies/PolicyEditorPanel/index.tsx index 5f99b384f83..5e9c7a45edc 100644 --- a/apps/studio/components/interfaces/Auth/Policies/PolicyEditorPanel/index.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/PolicyEditorPanel/index.tsx @@ -122,7 +122,7 @@ export const PolicyEditorPanel = memo(function ({ const supportWithCheck = ['update', 'all'].includes(command) const isRenamingPolicy = selectedPolicy !== undefined && name !== selectedPolicy.name - const { mutate: executeMutation, isLoading: isExecuting } = useExecuteSqlMutation({ + const { mutate: executeMutation, isPending: isExecuting } = useExecuteSqlMutation({ onSuccess: async () => { // refresh all policies await queryClient.invalidateQueries({ queryKey: databasePoliciesKeys.list(ref) }) @@ -132,7 +132,7 @@ export const PolicyEditorPanel = memo(function ({ onError: (error) => setError(error), }) - const { mutate: updatePolicy, isLoading: isUpdating } = useDatabasePolicyUpdateMutation({ + const { mutate: updatePolicy, isPending: isUpdating } = useDatabasePolicyUpdateMutation({ onSuccess: () => { toast.success('Successfully updated policy') onSelectCancel() diff --git a/apps/studio/components/interfaces/Auth/ProtectionAuthSettingsForm/ProtectionAuthSettingsForm.tsx b/apps/studio/components/interfaces/Auth/ProtectionAuthSettingsForm/ProtectionAuthSettingsForm.tsx index 63f6674bf8b..0d523816eba 100644 --- a/apps/studio/components/interfaces/Auth/ProtectionAuthSettingsForm/ProtectionAuthSettingsForm.tsx +++ b/apps/studio/components/interfaces/Auth/ProtectionAuthSettingsForm/ProtectionAuthSettingsForm.tsx @@ -76,7 +76,7 @@ export const ProtectionAuthSettingsForm = () => { isError, isLoading, } = useAuthConfigQuery({ projectRef }) - const { mutate: updateAuthConfig, isLoading: isUpdatingConfig } = useAuthConfigUpdateMutation({ + const { mutate: updateAuthConfig, isPending: isUpdatingConfig } = useAuthConfigUpdateMutation({ onError: (error) => { toast.error(`Failed to update settings: ${error?.message}`) }, diff --git a/apps/studio/components/interfaces/Auth/RateLimits/RateLimits.tsx b/apps/studio/components/interfaces/Auth/RateLimits/RateLimits.tsx index 55e086b2a44..881979f463b 100644 --- a/apps/studio/components/interfaces/Auth/RateLimits/RateLimits.tsx +++ b/apps/studio/components/interfaces/Auth/RateLimits/RateLimits.tsx @@ -48,7 +48,7 @@ export const RateLimits = () => { isError, isSuccess, } = useAuthConfigQuery({ projectRef }) - const { mutate: updateAuthConfig, isLoading: isUpdatingConfig } = useAuthConfigUpdateMutation({ + const { mutate: updateAuthConfig, isPending: isUpdatingConfig } = useAuthConfigUpdateMutation({ onSuccess: () => { toast.success('Rate limits successfully updated') }, diff --git a/apps/studio/components/interfaces/Auth/RedirectUrls/AddNewURLModal.tsx b/apps/studio/components/interfaces/Auth/RedirectUrls/AddNewURLModal.tsx index 92fdbf8fde1..0bf6ba0e790 100644 --- a/apps/studio/components/interfaces/Auth/RedirectUrls/AddNewURLModal.tsx +++ b/apps/studio/components/interfaces/Auth/RedirectUrls/AddNewURLModal.tsx @@ -5,6 +5,7 @@ import { useFieldArray, useForm } from 'react-hook-form' import { toast } from 'sonner' import * as z from 'zod' +import { Label } from '@ui/components/shadcn/ui/label' import { useParams } from 'common' import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation' import { @@ -19,7 +20,6 @@ import { } from 'ui' import { Input } from 'ui-patterns/DataInputs/Input' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' -import { Label } from '@ui/components/shadcn/ui/label' import { urlRegex } from '../Auth.constants' const MAX_URLS_LENGTH = 2 * 1024 @@ -32,7 +32,7 @@ interface AddNewURLModalProps { export const AddNewURLModal = ({ visible, allowList, onClose }: AddNewURLModalProps) => { const { ref } = useParams() - const { mutate: updateAuthConfig, isLoading: isUpdatingConfig } = useAuthConfigUpdateMutation() + const { mutate: updateAuthConfig, isPending: isUpdatingConfig } = useAuthConfigUpdateMutation() const FormSchema = z.object({ urls: z diff --git a/apps/studio/components/interfaces/Auth/RedirectUrls/RedirectUrls.tsx b/apps/studio/components/interfaces/Auth/RedirectUrls/RedirectUrls.tsx index 4db53464020..d1434eb583c 100644 --- a/apps/studio/components/interfaces/Auth/RedirectUrls/RedirectUrls.tsx +++ b/apps/studio/components/interfaces/Auth/RedirectUrls/RedirectUrls.tsx @@ -29,7 +29,7 @@ export const RedirectUrls = () => { isError, isSuccess, } = useAuthConfigQuery({ projectRef }) - const { mutate: updateAuthConfig, isLoading: isUpdatingConfig } = useAuthConfigUpdateMutation() + const { mutate: updateAuthConfig, isPending: isUpdatingConfig } = useAuthConfigUpdateMutation() const URI_ALLOW_LIST_ARRAY = useMemo(() => { return authConfig?.URI_ALLOW_LIST diff --git a/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx b/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx index 6b8c9357bc0..bae64905289 100644 --- a/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx +++ b/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx @@ -46,7 +46,7 @@ interface SmtpFormValues { export const SmtpForm = () => { const { ref: projectRef } = useParams() const { data: authConfig, error: authConfigError, isError } = useAuthConfigQuery({ projectRef }) - const { mutate: updateAuthConfig, isLoading: isUpdatingConfig } = useAuthConfigUpdateMutation() + const { mutate: updateAuthConfig, isPending: isUpdatingConfig } = useAuthConfigUpdateMutation() const [enableSmtp, setEnableSmtp] = useState(false) const [hidden, setHidden] = useState(true) diff --git a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateAuth0Dialog.tsx b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateAuth0Dialog.tsx index 69010641e6d..9f3bf9f61c0 100644 --- a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateAuth0Dialog.tsx +++ b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateAuth0Dialog.tsx @@ -50,7 +50,7 @@ export const CreateAuth0IntegrationDialog = ({ const isCreating = true const { ref: projectRef } = useParams() - const { mutate: createAuthIntegration, isLoading } = useCreateThirdPartyAuthIntegrationMutation({ + const { mutate: createAuthIntegration, isPending } = useCreateThirdPartyAuthIntegrationMutation({ onSuccess: () => { toast.success(`Successfully created a new Auth0 Auth integration.`) onClose() @@ -169,10 +169,10 @@ export const CreateAuth0IntegrationDialog = ({ )} - - diff --git a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateAwsCognitoAuthDialog.tsx b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateAwsCognitoAuthDialog.tsx index c27876c6261..bf209bf461a 100644 --- a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateAwsCognitoAuthDialog.tsx +++ b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateAwsCognitoAuthDialog.tsx @@ -53,7 +53,7 @@ export const CreateAwsCognitoAuthIntegrationDialog = ({ const isCreating = true const { ref: projectRef } = useParams() - const { mutate: createAuthIntegration, isLoading } = useCreateThirdPartyAuthIntegrationMutation({ + const { mutate: createAuthIntegration, isPending } = useCreateThirdPartyAuthIntegrationMutation({ onSuccess: () => { toast.success(`Successfully created a new Amazon Cognito Auth integration.`) onClose() @@ -179,10 +179,10 @@ export const CreateAwsCognitoAuthIntegrationDialog = ({ )} - - diff --git a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateClerkAuthDialog.tsx b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateClerkAuthDialog.tsx index 50b78761d0d..76639f6d3bc 100644 --- a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateClerkAuthDialog.tsx +++ b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateClerkAuthDialog.tsx @@ -1,11 +1,11 @@ import { zodResolver } from '@hookform/resolvers/zod' -import { Trash } from 'lucide-react' import { useEffect } from 'react' import { SubmitHandler, useForm } from 'react-hook-form' import { toast } from 'sonner' import * as z from 'zod' import { useParams } from 'common' +import { InlineLink } from 'components/ui/InlineLink' import { useCreateThirdPartyAuthIntegrationMutation } from 'data/third-party-auth/integration-create-mutation' import { Button, @@ -22,7 +22,6 @@ import { Separator, } from 'ui' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' -import { InlineLink } from 'components/ui/InlineLink' interface CreateClerkAuthIntegrationProps { visible: boolean @@ -60,7 +59,7 @@ export const CreateClerkAuthIntegrationDialog = ({ onDelete, }: CreateClerkAuthIntegrationProps) => { const { ref: projectRef } = useParams() - const { mutate: createAuthIntegration, isLoading } = useCreateThirdPartyAuthIntegrationMutation({ + const { mutate: createAuthIntegration, isPending } = useCreateThirdPartyAuthIntegrationMutation({ onSuccess: () => { toast.success(`Successfully created a new Clerk integration.`) onClose() @@ -138,10 +137,10 @@ export const CreateClerkAuthIntegrationDialog = ({ - - diff --git a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateFirebaseAuthDialog.tsx b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateFirebaseAuthDialog.tsx index 4c49a1fefc1..9c13f8e70ad 100644 --- a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateFirebaseAuthDialog.tsx +++ b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateFirebaseAuthDialog.tsx @@ -50,7 +50,7 @@ export const CreateFirebaseAuthIntegrationDialog = ({ const isCreating = true const { ref: projectRef } = useParams() - const { mutate: createAuthIntegration, isLoading } = useCreateThirdPartyAuthIntegrationMutation({ + const { mutate: createAuthIntegration, isPending } = useCreateThirdPartyAuthIntegrationMutation({ onSuccess: () => { toast.success(`Successfully created a new Firebase Auth integration.`) onClose() @@ -151,10 +151,10 @@ export const CreateFirebaseAuthIntegrationDialog = ({ )} - - diff --git a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateWorkOSDialog.tsx b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateWorkOSDialog.tsx index 9a2ee0d3efa..2edd1728780 100644 --- a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateWorkOSDialog.tsx +++ b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateWorkOSDialog.tsx @@ -56,7 +56,7 @@ export const CreateWorkOSIntegrationDialog = ({ const isCreating = true const { ref: projectRef } = useParams() - const { mutate: createAuthIntegration, isLoading } = useCreateThirdPartyAuthIntegrationMutation({ + const { mutate: createAuthIntegration, isPending } = useCreateThirdPartyAuthIntegrationMutation({ onSuccess: () => { toast.success(`Successfully created a new WorkOS integration.`) onClose() @@ -160,10 +160,10 @@ export const CreateWorkOSIntegrationDialog = ({ )} - - diff --git a/apps/studio/components/interfaces/Auth/Users/BanUserModal.tsx b/apps/studio/components/interfaces/Auth/Users/BanUserModal.tsx index 7543072de08..97d7cb372d6 100644 --- a/apps/studio/components/interfaces/Auth/Users/BanUserModal.tsx +++ b/apps/studio/components/interfaces/Auth/Users/BanUserModal.tsx @@ -33,7 +33,7 @@ interface BanUserModalProps { export const BanUserModal = ({ visible, user, onClose }: BanUserModalProps) => { const { ref: projectRef } = useParams() - const { mutate: updateUser, isLoading: isBanningUser } = useUserUpdateMutation({ + const { mutate: updateUser, isPending: isBanningUser } = useUserUpdateMutation({ onSuccess: (_, vars) => { const bannedUntil = dayjs() .add(Number(vars.banDuration), 'hours') diff --git a/apps/studio/components/interfaces/Auth/Users/CreateUserModal.tsx b/apps/studio/components/interfaces/Auth/Users/CreateUserModal.tsx index 16ab8f410ff..9b905af61f6 100644 --- a/apps/studio/components/interfaces/Auth/Users/CreateUserModal.tsx +++ b/apps/studio/components/interfaces/Auth/Users/CreateUserModal.tsx @@ -43,7 +43,7 @@ const CreateUserModal = ({ visible, setVisible }: CreateUserModalProps) => { 'create_user' ) - const { mutate: createUser, isLoading: isCreatingUser } = useUserCreateMutation({ + const { mutate: createUser, isPending: isCreatingUser } = useUserCreateMutation({ onSuccess(res) { toast.success(`Successfully created user: ${res.email}`) form.reset({ email: '', password: '', autoConfirmUser: true }) diff --git a/apps/studio/components/interfaces/Auth/Users/DeleteUserModal.tsx b/apps/studio/components/interfaces/Auth/Users/DeleteUserModal.tsx index 8c596658878..c68031a943a 100644 --- a/apps/studio/components/interfaces/Auth/Users/DeleteUserModal.tsx +++ b/apps/studio/components/interfaces/Auth/Users/DeleteUserModal.tsx @@ -20,7 +20,7 @@ export const DeleteUserModal = ({ }: DeleteUserModalProps) => { const { ref: projectRef } = useParams() - const { mutate: deleteUser, isLoading: isDeleting } = useUserDeleteMutation({ + const { mutate: deleteUser, isPending: isDeleting } = useUserDeleteMutation({ onSuccess: () => { toast.success(`Successfully deleted ${selectedUser?.email}`) onDeleteSuccess?.() diff --git a/apps/studio/components/interfaces/Auth/Users/InviteUserModal.tsx b/apps/studio/components/interfaces/Auth/Users/InviteUserModal.tsx index 0fca24fe1d6..6edd5664f0c 100644 --- a/apps/studio/components/interfaces/Auth/Users/InviteUserModal.tsx +++ b/apps/studio/components/interfaces/Auth/Users/InviteUserModal.tsx @@ -16,7 +16,7 @@ const InviteUserModal = ({ visible, setVisible }: InviteUserModalProps) => { const { ref: projectRef } = useParams() const handleToggle = () => setVisible(!visible) - const { mutate: inviteUser, isLoading: isInviting } = useUserInviteMutation({ + const { mutate: inviteUser, isPending: isInviting } = useUserInviteMutation({ onSuccess: (_, variables) => { toast.success(`Sent invite email to ${variables.email}`) setVisible(false) diff --git a/apps/studio/components/interfaces/Auth/Users/UserOverview.tsx b/apps/studio/components/interfaces/Auth/Users/UserOverview.tsx index 516e60b2111..9eb3c0608e2 100644 --- a/apps/studio/components/interfaces/Auth/Users/UserOverview.tsx +++ b/apps/studio/components/interfaces/Auth/Users/UserOverview.tsx @@ -99,7 +99,7 @@ export const UserOverview = ({ user, onDeleteSuccess }: UserOverviewProps) => { const seconds = Math.floor(mailerOtpExpiry % 60) const formattedExpiry = `${mailerOtpExpiry > 60 ? `${minutes} minute${minutes > 1 ? 's' : ''} ${seconds > 0 ? 'and' : ''} ` : ''}${seconds > 0 ? `${seconds} second${seconds > 1 ? 's' : ''}` : ''}` - const { mutate: resetPassword, isLoading: isResettingPassword } = useUserResetPasswordMutation({ + const { mutate: resetPassword, isPending: isResettingPassword } = useUserResetPasswordMutation({ onSuccess: (_, vars) => { setSuccessAction('send_recovery') toast.success(`Sent password recovery to ${vars.user.email}`) @@ -108,7 +108,7 @@ export const UserOverview = ({ user, onDeleteSuccess }: UserOverviewProps) => { toast.error(`Failed to send password recovery: ${err.message}`) }, }) - const { mutate: sendMagicLink, isLoading: isSendingMagicLink } = useUserSendMagicLinkMutation({ + const { mutate: sendMagicLink, isPending: isSendingMagicLink } = useUserSendMagicLinkMutation({ onSuccess: (_, vars) => { setSuccessAction('send_magic_link') toast.success( @@ -125,7 +125,7 @@ export const UserOverview = ({ user, onDeleteSuccess }: UserOverviewProps) => { ) }, }) - const { mutate: sendOTP, isLoading: isSendingOTP } = useUserSendOTPMutation({ + const { mutate: sendOTP, isPending: isSendingOTP } = useUserSendOTPMutation({ onSuccess: (_, vars) => { setSuccessAction('send_otp') toast.success(`Sent OTP to ${vars.user.phone}`) @@ -140,7 +140,7 @@ export const UserOverview = ({ user, onDeleteSuccess }: UserOverviewProps) => { setIsDeleteFactorsModalOpen(false) }, }) - const { mutate: updateUser, isLoading: isUpdatingUser } = useUserUpdateMutation({ + const { mutate: updateUser, isPending: isUpdatingUser } = useUserUpdateMutation({ onSuccess: () => { toast.success('Successfully unbanned user') setIsUnbanModalOpen(false) diff --git a/apps/studio/components/interfaces/Billing/Payment/PaymentMethods/ChangePaymentMethodModal.tsx b/apps/studio/components/interfaces/Billing/Payment/PaymentMethods/ChangePaymentMethodModal.tsx index 2157dc2189e..cb6503be215 100644 --- a/apps/studio/components/interfaces/Billing/Payment/PaymentMethods/ChangePaymentMethodModal.tsx +++ b/apps/studio/components/interfaces/Billing/Payment/PaymentMethods/ChangePaymentMethodModal.tsx @@ -15,7 +15,7 @@ const ChangePaymentMethodModal = ({ onClose, }: ChangePaymentMethodModalProps) => { const { slug } = useParams() - const { mutate: markAsDefault, isLoading: isUpdating } = + const { mutate: markAsDefault, isPending: isUpdating } = useOrganizationPaymentMethodMarkAsDefaultMutation({ onSuccess: () => { toast.success( diff --git a/apps/studio/components/interfaces/Billing/Payment/PaymentMethods/DeletePaymentMethodModal.tsx b/apps/studio/components/interfaces/Billing/Payment/PaymentMethods/DeletePaymentMethodModal.tsx index e05ff07ce4b..a4c077dde45 100644 --- a/apps/studio/components/interfaces/Billing/Payment/PaymentMethods/DeletePaymentMethodModal.tsx +++ b/apps/studio/components/interfaces/Billing/Payment/PaymentMethods/DeletePaymentMethodModal.tsx @@ -17,7 +17,7 @@ const DeletePaymentMethodModal = ({ }: DeletePaymentMethodModalProps) => { const { slug } = useParams() - const { mutate: deletePayment, isLoading: isDeleting } = + const { mutate: deletePayment, isPending: isDeleting } = useOrganizationPaymentMethodDeleteMutation({ onSuccess: () => { toast.success( diff --git a/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx b/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx index 6488c82b3bc..18374b74843 100644 --- a/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx +++ b/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx @@ -177,12 +177,12 @@ export const CreateBranchModal = () => { const { mutate: sendEvent } = useSendEventMutation() - const { mutateAsync: checkGithubBranchValidity, isLoading: isCheckingGHBranchValidity } = + const { mutateAsync: checkGithubBranchValidity, isPending: isCheckingGHBranchValidity } = useCheckGithubBranchValidity({ onError: () => {}, }) - const { mutate: createBranch, isLoading: isCreatingBranch } = useBranchCreateMutation({ + const { mutate: createBranch, isPending: isCreatingBranch } = useBranchCreateMutation({ onSuccess: async (data) => { toast.success(`Successfully created preview branch "${data.name}"`) if (projectRef) { diff --git a/apps/studio/components/interfaces/BranchManagement/EditBranchModal.tsx b/apps/studio/components/interfaces/BranchManagement/EditBranchModal.tsx index 0f2439e5238..8ccee1d7239 100644 --- a/apps/studio/components/interfaces/BranchManagement/EditBranchModal.tsx +++ b/apps/studio/components/interfaces/BranchManagement/EditBranchModal.tsx @@ -69,12 +69,12 @@ export const EditBranchModal = ({ branch, visible, onClose }: EditBranchModalPro }) const { data: branches } = useBranchesQuery({ projectRef }) - const { mutateAsync: checkGithubBranchValidity, isLoading: isChecking } = + const { mutateAsync: checkGithubBranchValidity, isPending: isChecking } = useCheckGithubBranchValidity({ onError: () => {}, }) - const { mutate: updateBranch, isLoading: isUpdating } = useBranchUpdateMutation({ + const { mutate: updateBranch, isPending: isUpdating } = useBranchUpdateMutation({ onSuccess: (data) => { toast.success(`Successfully updated branch "${data.name}"`) onClose() diff --git a/apps/studio/components/interfaces/BranchManagement/Overview.tsx b/apps/studio/components/interfaces/BranchManagement/Overview.tsx index 4f9f6f047b9..64ef6818bae 100644 --- a/apps/studio/components/interfaces/BranchManagement/Overview.tsx +++ b/apps/studio/components/interfaces/BranchManagement/Overview.tsx @@ -190,14 +190,14 @@ const PreviewBranchActions = ({ ] = useState(false) const [showEditBranchModal, setShowEditBranchModal] = useState(false) - const { mutate: resetBranch, isLoading: isResetting } = useBranchResetMutation({ + const { mutate: resetBranch, isPending: isResetting } = useBranchResetMutation({ onSuccess() { toast.success('Success! Please allow a few seconds for the branch to reset.') setShowConfirmResetModal(false) }, }) - const { mutate: updateBranch, isLoading: isUpdatingBranch } = useBranchUpdateMutation({ + const { mutate: updateBranch, isPending: isUpdatingBranch } = useBranchUpdateMutation({ onSuccess() { toast.success('Successfully updated branch') setShowBranchModeSwitch(false) diff --git a/apps/studio/components/interfaces/BranchManagement/ReviewRow.tsx b/apps/studio/components/interfaces/BranchManagement/ReviewRow.tsx index 4e932850701..5dc02d0e0cf 100644 --- a/apps/studio/components/interfaces/BranchManagement/ReviewRow.tsx +++ b/apps/studio/components/interfaces/BranchManagement/ReviewRow.tsx @@ -24,7 +24,7 @@ export const ReviewRow = ({ branch }: ReviewRowProps) => { const queryClient = useQueryClient() const { project_ref: branchRef, parent_project_ref: projectRef } = branch - const { mutate: updateBranch, isLoading: isUpdating } = useBranchUpdateMutation({ + const { mutate: updateBranch, isPending: isUpdating } = useBranchUpdateMutation({ onSuccess: () => { toast.success('Branch marked as not ready for review') queryClient.invalidateQueries({ diff --git a/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx b/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx index f298ebd9142..d0682d6e124 100644 --- a/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx +++ b/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx @@ -25,7 +25,7 @@ export const BackupItem = ({ index, isHealthy, backup, onSelectBackup }: BackupI 'queue_job.restore.prepare' ) - const { mutate: downloadBackup, isLoading: isDownloading } = useBackupDownloadMutation({ + const { mutate: downloadBackup, isPending: isDownloading } = useBackupDownloadMutation({ onSuccess: (res) => { const { fileUrl } = res diff --git a/apps/studio/components/interfaces/Database/Backups/BackupsList.tsx b/apps/studio/components/interfaces/Database/Backups/BackupsList.tsx index e913babcfe0..74a21047659 100644 --- a/apps/studio/components/interfaces/Database/Backups/BackupsList.tsx +++ b/apps/studio/components/interfaces/Database/Backups/BackupsList.tsx @@ -29,7 +29,7 @@ export const BackupsList = () => { const { data: backups } = useBackupsQuery({ projectRef }) const { mutate: restoreFromBackup, - isLoading: isRestoring, + isPending: isRestoring, isSuccess: isSuccessBackup, } = useBackupRestoreMutation({ onSuccess: () => { diff --git a/apps/studio/components/interfaces/Database/Backups/PITR/PITRSelection.tsx b/apps/studio/components/interfaces/Database/Backups/PITR/PITRSelection.tsx index 786cda8b371..ab8638b2ad0 100644 --- a/apps/studio/components/interfaces/Database/Backups/PITR/PITRSelection.tsx +++ b/apps/studio/components/interfaces/Database/Backups/PITR/PITRSelection.tsx @@ -45,7 +45,7 @@ export const PITRSelection = () => { const { mutate: restoreFromPitr, - isLoading: isRestoring, + isPending: isRestoring, isSuccess: isSuccessPITR, } = usePitrRestoreMutation({ onSuccess: (_, variables) => { diff --git a/apps/studio/components/interfaces/Database/Backups/RestoreToNewProject/CreateNewProjectDialog.tsx b/apps/studio/components/interfaces/Database/Backups/RestoreToNewProject/CreateNewProjectDialog.tsx index 504787eb6c8..e62e335673a 100644 --- a/apps/studio/components/interfaces/Database/Backups/RestoreToNewProject/CreateNewProjectDialog.tsx +++ b/apps/studio/components/interfaces/Database/Backups/RestoreToNewProject/CreateNewProjectDialog.tsx @@ -74,7 +74,7 @@ export const CreateNewProjectDialog = ({ ) const hasPITREnabled = cloneBackups?.pitr_enabled - const { mutate: triggerClone, isLoading: cloneMutationLoading } = useProjectCloneMutation({ + const { mutate: triggerClone, isPending: cloneMutationLoading } = useProjectCloneMutation({ onError: (error) => { toast.error(`Failed to restore to new project: ${error.message}`) }, diff --git a/apps/studio/components/interfaces/Database/ETL/DestinationPanel/DestinationPanel.tsx b/apps/studio/components/interfaces/Database/ETL/DestinationPanel/DestinationPanel.tsx index bfc4f9cd6f1..7ac88336bc7 100644 --- a/apps/studio/components/interfaces/Database/ETL/DestinationPanel/DestinationPanel.tsx +++ b/apps/studio/components/interfaces/Database/ETL/DestinationPanel/DestinationPanel.tsx @@ -93,23 +93,23 @@ export const DestinationPanel = ({ ) const [isFormInteracting, setIsFormInteracting] = useState(false) - const { mutateAsync: createDestinationPipeline, isLoading: creatingDestinationPipeline } = + const { mutateAsync: createDestinationPipeline, isPending: creatingDestinationPipeline } = useCreateDestinationPipelineMutation({ onSuccess: () => form.reset(defaultValues), }) - const { mutateAsync: updateDestinationPipeline, isLoading: updatingDestinationPipeline } = + const { mutateAsync: updateDestinationPipeline, isPending: updatingDestinationPipeline } = useUpdateDestinationPipelineMutation({ onSuccess: () => form.reset(defaultValues), }) - const { mutateAsync: startPipeline, isLoading: startingPipeline } = useStartPipelineMutation() + const { mutateAsync: startPipeline, isPending: startingPipeline } = useStartPipelineMutation() - const { mutateAsync: createS3AccessKey, isLoading: isCreatingS3AccessKey } = + const { mutateAsync: createS3AccessKey, isPending: isCreatingS3AccessKey } = useS3AccessKeyCreateMutation() - const { mutateAsync: createNamespace, isLoading: isCreatingNamespace } = - useIcebergNamespaceCreateMutation({ projectRef }) + const { mutateAsync: createNamespace, isPending: isCreatingNamespace } = + useIcebergNamespaceCreateMutation() const { data: publications = [], diff --git a/apps/studio/components/interfaces/Database/ETL/EnableReplicationModal.tsx b/apps/studio/components/interfaces/Database/ETL/EnableReplicationModal.tsx index b16a92f9bcf..40bc4d4764c 100644 --- a/apps/studio/components/interfaces/Database/ETL/EnableReplicationModal.tsx +++ b/apps/studio/components/interfaces/Database/ETL/EnableReplicationModal.tsx @@ -20,7 +20,7 @@ export const EnableReplicationModal = () => { const { ref: projectRef } = useParams() const [open, setOpen] = useState(false) - const { mutate: createTenantSource, isLoading: creatingTenantSource } = + const { mutate: createTenantSource, isPending: creatingTenantSource } = useCreateTenantSourceMutation({ onSuccess: () => { toast.success('ETL replication has been successfully enabled!') diff --git a/apps/studio/components/interfaces/Database/ETL/NewPublicationPanel.tsx b/apps/studio/components/interfaces/Database/ETL/NewPublicationPanel.tsx index 5bac190cfbc..9227a39bfd4 100644 --- a/apps/studio/components/interfaces/Database/ETL/NewPublicationPanel.tsx +++ b/apps/studio/components/interfaces/Database/ETL/NewPublicationPanel.tsx @@ -34,7 +34,7 @@ interface NewPublicationPanelProps { export const NewPublicationPanel = ({ visible, sourceId, onClose }: NewPublicationPanelProps) => { const { ref: projectRef } = useParams() - const { mutateAsync: createPublication, isLoading: creatingPublication } = + const { mutateAsync: createPublication, isPending: creatingPublication } = useCreatePublicationMutation() const { data: tables } = useReplicationTablesQuery({ projectRef, diff --git a/apps/studio/components/interfaces/Database/ETL/ReplicationPipelineStatus/ReplicationPipelineStatus.tsx b/apps/studio/components/interfaces/Database/ETL/ReplicationPipelineStatus/ReplicationPipelineStatus.tsx index e6eb18fbf74..51e34cc0e70 100644 --- a/apps/studio/components/interfaces/Database/ETL/ReplicationPipelineStatus/ReplicationPipelineStatus.tsx +++ b/apps/studio/components/interfaces/Database/ETL/ReplicationPipelineStatus/ReplicationPipelineStatus.tsx @@ -103,8 +103,8 @@ export const ReplicationPipelineStatus = () => { }) const hasUpdate = Boolean(versionData?.new_version) - const { mutateAsync: startPipeline, isLoading: isStartingPipeline } = useStartPipelineMutation() - const { mutateAsync: stopPipeline, isLoading: isStoppingPipeline } = useStopPipelineMutation() + const { mutateAsync: startPipeline, isPending: isStartingPipeline } = useStartPipelineMutation() + const { mutateAsync: stopPipeline, isPending: isStoppingPipeline } = useStopPipelineMutation() const destinationName = pipeline?.destination_name const statusName = getStatusName(pipelineStatusData?.status) diff --git a/apps/studio/components/interfaces/Database/ETL/RetryOptionsDropdown.tsx b/apps/studio/components/interfaces/Database/ETL/RetryOptionsDropdown.tsx index 16f331f8a95..862511fdfa6 100644 --- a/apps/studio/components/interfaces/Database/ETL/RetryOptionsDropdown.tsx +++ b/apps/studio/components/interfaces/Database/ETL/RetryOptionsDropdown.tsx @@ -37,7 +37,7 @@ export const RetryOptionsDropdown = ({ tableId, tableName }: RetryOptionsDropdow const { ref: projectRef, pipelineId: _pipelineId } = useParams() const [isOpen, setIsOpen] = useState(false) - const { mutate: rollbackTable, isLoading: isRollingBack } = useRollbackTableMutation({ + const { mutate: rollbackTable, isPending: isRollingBack } = useRollbackTableMutation({ onSuccess: (_, vars) => { const { projectRef, pipelineId } = vars toast.success(`Table "${tableName}" rolled back successfully and pipeline is being restarted`) @@ -50,7 +50,7 @@ export const RetryOptionsDropdown = ({ tableId, tableName }: RetryOptionsDropdow ) }, }) - const { mutate: startPipeline, isLoading: isRestartingPipeline } = useStartPipelineMutation({ + const { mutate: startPipeline, isPending: isRestartingPipeline } = useStartPipelineMutation({ onSuccess: () => { toast.success('Pipeline restarted successfully') setIsOpen(false) diff --git a/apps/studio/components/interfaces/Database/EnumeratedTypes/CreateEnumeratedTypeSidePanel.tsx b/apps/studio/components/interfaces/Database/EnumeratedTypes/CreateEnumeratedTypeSidePanel.tsx index 0e7ef55f107..b830d3caea5 100644 --- a/apps/studio/components/interfaces/Database/EnumeratedTypes/CreateEnumeratedTypeSidePanel.tsx +++ b/apps/studio/components/interfaces/Database/EnumeratedTypes/CreateEnumeratedTypeSidePanel.tsx @@ -42,7 +42,7 @@ const CreateEnumeratedTypeSidePanel = ({ const initialValues = { name: '', description: '', values: [{ value: '' }] } const submitRef = useRef(null) const { data: project } = useSelectedProjectQuery() - const { mutate: createEnumeratedType, isLoading: isCreating } = useEnumeratedTypeCreateMutation({ + const { mutate: createEnumeratedType, isPending: isCreating } = useEnumeratedTypeCreateMutation({ onSuccess: (res, vars) => { toast.success(`Successfully created type "${vars.name}"`) closePanel() diff --git a/apps/studio/components/interfaces/Database/EnumeratedTypes/DeleteEnumeratedTypeModal.tsx b/apps/studio/components/interfaces/Database/EnumeratedTypes/DeleteEnumeratedTypeModal.tsx index 362a2a0314e..37e3b1ab71d 100644 --- a/apps/studio/components/interfaces/Database/EnumeratedTypes/DeleteEnumeratedTypeModal.tsx +++ b/apps/studio/components/interfaces/Database/EnumeratedTypes/DeleteEnumeratedTypeModal.tsx @@ -18,7 +18,7 @@ const DeleteEnumeratedTypeModal = ({ onDelete, }: DeleteEnumeratedTypeModalProps) => { const { data: project } = useSelectedProjectQuery() - const { mutate: deleteEnumeratedType, isLoading: isDeleting } = useEnumeratedTypeDeleteMutation({ + const { mutate: deleteEnumeratedType, isPending: isDeleting } = useEnumeratedTypeDeleteMutation({ onSuccess: () => { toast.success(`Successfully deleted "${selectedEnumeratedType.name}"`) onClose() diff --git a/apps/studio/components/interfaces/Database/EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx b/apps/studio/components/interfaces/Database/EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx index 8beba161e56..d307fbfcb2f 100644 --- a/apps/studio/components/interfaces/Database/EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx +++ b/apps/studio/components/interfaces/Database/EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx @@ -41,7 +41,7 @@ const EditEnumeratedTypeSidePanel = ({ }: EditEnumeratedTypeSidePanelProps) => { const submitRef = useRef(null) const { data: project } = useSelectedProjectQuery() - const { mutate: updateEnumeratedType, isLoading: isCreating } = useEnumeratedTypeUpdateMutation({ + const { mutate: updateEnumeratedType, isPending: isCreating } = useEnumeratedTypeUpdateMutation({ onSuccess: (_, vars) => { toast.success(`Successfully updated type "${vars.name.updated}"`) onClose() diff --git a/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx b/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx index c6b58a9307a..2298b219e85 100644 --- a/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx +++ b/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx @@ -46,7 +46,7 @@ const EnableExtensionModal = ({ visible, extension, onCancel }: EnableExtensionM { enabled: visible } ) const { data: protectedSchemas } = useProtectedSchemas({ excludeSchemas: ['extensions'] }) - const { mutate: enableExtension, isLoading: isEnabling } = useDatabaseExtensionEnableMutation({ + const { mutate: enableExtension, isPending: isEnabling } = useDatabaseExtensionEnableMutation({ onSuccess: () => { toast.success(`Extension "${extension.name}" is now enabled`) onCancel() diff --git a/apps/studio/components/interfaces/Database/Extensions/ExtensionRow.tsx b/apps/studio/components/interfaces/Database/Extensions/ExtensionRow.tsx index d418a6ce95c..a5c8b1bbb85 100644 --- a/apps/studio/components/interfaces/Database/Extensions/ExtensionRow.tsx +++ b/apps/studio/components/interfaces/Database/Extensions/ExtensionRow.tsx @@ -41,7 +41,7 @@ export const ExtensionRow = ({ extension }: ExtensionRowProps) => { ? `${DOCS_URL}${extensionMeta?.link}` : extensionMeta?.link ?? undefined - const { mutate: disableExtension, isLoading: isDisabling } = useDatabaseExtensionDisableMutation({ + const { mutate: disableExtension, isPending: isDisabling } = useDatabaseExtensionDisableMutation({ onSuccess: () => { toast.success(`${extension.name} is off.`) setIsDisableModalOpen(false) diff --git a/apps/studio/components/interfaces/Database/Functions/CreateFunction/index.tsx b/apps/studio/components/interfaces/Database/Functions/CreateFunction/index.tsx index 94b78e8a2bb..88efee47e75 100644 --- a/apps/studio/components/interfaces/Database/Functions/CreateFunction/index.tsx +++ b/apps/studio/components/interfaces/Database/Functions/CreateFunction/index.tsx @@ -92,9 +92,9 @@ export const CreateFunction = ({ onClose, }) - const { mutate: createDatabaseFunction, isLoading: isCreating } = + const { mutate: createDatabaseFunction, isPending: isCreating } = useDatabaseFunctionCreateMutation() - const { mutate: updateDatabaseFunction, isLoading: isUpdating } = + const { mutate: updateDatabaseFunction, isPending: isUpdating } = useDatabaseFunctionUpdateMutation() const onSubmit: SubmitHandler> = async (data) => { diff --git a/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx b/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx index 30b5aef655e..f63d1428eed 100644 --- a/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx +++ b/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx @@ -6,19 +6,24 @@ import { useRef } from 'react' import { toast } from 'sonner' import { useParams } from 'common' +import { + ReportsSelectFilter, + selectFilterSchema, +} from 'components/interfaces/Reports/v2/ReportsSelectFilter' +import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider' import ProductEmptyState from 'components/to-be-cleaned/ProductEmptyState' import AlertError from 'components/ui/AlertError' import { ButtonTooltip } from 'components/ui/ButtonTooltip' import SchemaSelector from 'components/ui/SchemaSelector' import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader' -import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider' -import { useDatabaseFunctionsQuery } from 'data/database-functions/database-functions-query' import { useDatabaseFunctionDeleteMutation } from 'data/database-functions/database-functions-delete-mutation' +import type { DatabaseFunction } from 'data/database-functions/database-functions-query' +import { useDatabaseFunctionsQuery } from 'data/database-functions/database-functions-query' import { useSchemasQuery } from 'data/database/schemas-query' import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions' +import { handleErrorOnDelete, useQueryStateWithSelect } from 'hooks/misc/useQueryStateWithSelect' import { useQuerySchemaState } from 'hooks/misc/useSchemaQueryState' import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject' -import { handleErrorOnDelete, useQueryStateWithSelect } from 'hooks/misc/useQueryStateWithSelect' import { useIsProtectedSchema } from 'hooks/useProtectedSchemas' import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state' import { useSidebarManagerSnapshot } from 'state/sidebar-manager-state' @@ -32,13 +37,8 @@ import { TableHeader, TableRow, } from 'ui' -import { - ReportsSelectFilter, - selectFilterSchema, -} from 'components/interfaces/Reports/v2/ReportsSelectFilter' import { ProtectedSchemaWarning } from '../../ProtectedSchemaWarning' import FunctionList from './FunctionList' -import type { DatabaseFunction } from 'data/database-functions/database-functions-query' import { useIsInlineEditorEnabled } from 'components/interfaces/Account/Preferences/InlineEditorSettings' import { CreateFunction } from 'components/interfaces/Database/Functions/CreateFunction' @@ -203,7 +203,7 @@ const FunctionsList = () => { handleErrorOnDelete(deletingFunctionIdRef, selectedId, `Function not found`), }) - const { mutate: deleteDatabaseFunction, isLoading: isDeletingFunction } = + const { mutate: deleteDatabaseFunction, isPending: isDeletingFunction } = useDatabaseFunctionDeleteMutation({ onSuccess: (_, variables) => { toast.success(`Successfully removed function ${variables.func.name}`) diff --git a/apps/studio/components/interfaces/Database/Hooks/DeleteHookModal.tsx b/apps/studio/components/interfaces/Database/Hooks/DeleteHookModal.tsx index d01331af18e..c9e8146b382 100644 --- a/apps/studio/components/interfaces/Database/Hooks/DeleteHookModal.tsx +++ b/apps/studio/components/interfaces/Database/Hooks/DeleteHookModal.tsx @@ -21,7 +21,7 @@ const DeleteHookModal = ({ const { name, schema } = selectedHook ?? {} const { data: project } = useSelectedProjectQuery() - const { mutate: deleteDatabaseTrigger, isLoading: isDeleting } = useDatabaseTriggerDeleteMutation( + const { mutate: deleteDatabaseTrigger, isPending: isDeleting } = useDatabaseTriggerDeleteMutation( { onSuccess: () => { toast.success(`Successfully deleted ${name}`) diff --git a/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx b/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx index a76f24f6ae7..557f9d92dc5 100644 --- a/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx +++ b/apps/studio/components/interfaces/Database/Indexes/CreateIndexSidePanel.tsx @@ -78,7 +78,7 @@ const CreateIndexSidePanel = ({ visible, onClose }: CreateIndexSidePanelProps) = connectionString: project?.connectionString, }) - const { mutate: createIndex, isLoading: isExecuting } = useDatabaseIndexCreateMutation({ + const { mutate: createIndex, isPending: isExecuting } = useDatabaseIndexCreateMutation({ onSuccess: () => { onClose() toast.success(`Successfully created index`) diff --git a/apps/studio/components/interfaces/Database/Indexes/Indexes.tsx b/apps/studio/components/interfaces/Database/Indexes/Indexes.tsx index c10c7e8da91..9adff97567c 100644 --- a/apps/studio/components/interfaces/Database/Indexes/Indexes.tsx +++ b/apps/studio/components/interfaces/Database/Indexes/Indexes.tsx @@ -18,15 +18,15 @@ import { handleErrorOnDelete, useQueryStateWithSelect } from 'hooks/misc/useQuer import { useIsProtectedSchema } from 'hooks/useProtectedSchemas' import { Button, + Card, Input, SidePanel, Table, TableBody, TableCell, TableHead, - TableRow, TableHeader, - Card, + TableRow, } from 'ui' import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' import { ProtectedSchemaWarning } from '../ProtectedSchemaWarning' @@ -83,7 +83,7 @@ const Indexes = () => { connectionString: project?.connectionString, }) - const { mutate: deleteIndex, isLoading: isExecuting } = useDatabaseIndexDeleteMutation({ + const { mutate: deleteIndex, isPending: isExecuting } = useDatabaseIndexDeleteMutation({ onSuccess: async () => { setSelectedIndexNameToDelete(null) toast.success('Successfully deleted index') diff --git a/apps/studio/components/interfaces/Database/Publications/PublicationsTableItem.tsx b/apps/studio/components/interfaces/Database/Publications/PublicationsTableItem.tsx index 62b689f9843..d550f90628b 100644 --- a/apps/studio/components/interfaces/Database/Publications/PublicationsTableItem.tsx +++ b/apps/studio/components/interfaces/Database/Publications/PublicationsTableItem.tsx @@ -33,7 +33,7 @@ export const PublicationsTableItem = ({ 'publications' ) - const { mutate: updatePublications, isLoading } = useDatabasePublicationUpdateMutation() + const { mutate: updatePublications, isPending } = useDatabasePublicationUpdateMutation() const toggleReplicationForTable = async ( table: PostgresTable, @@ -94,7 +94,7 @@ export const PublicationsTableItem = ({ toggleReplicationForTable(table, selectedPublication)} /> diff --git a/apps/studio/components/interfaces/Database/Roles/CreateRolePanel.tsx b/apps/studio/components/interfaces/Database/Roles/CreateRolePanel.tsx index 7381c5968cf..6d070ec4aa8 100644 --- a/apps/studio/components/interfaces/Database/Roles/CreateRolePanel.tsx +++ b/apps/studio/components/interfaces/Database/Roles/CreateRolePanel.tsx @@ -53,7 +53,7 @@ export const CreateRolePanel = ({ visible, onClose }: CreateRolePanelProps) => { resolver: zodResolver(FormSchema), }) - const { mutate: createDatabaseRole, isLoading: isCreating } = useDatabaseRoleCreateMutation({ + const { mutate: createDatabaseRole, isPending: isCreating } = useDatabaseRoleCreateMutation({ onSuccess: (_, vars) => { toast.success(`Successfully created new role: ${vars.payload.name}`) handleClose() diff --git a/apps/studio/components/interfaces/Database/Roles/DeleteRoleModal.tsx b/apps/studio/components/interfaces/Database/Roles/DeleteRoleModal.tsx index 2b42240b506..4bc9d70584d 100644 --- a/apps/studio/components/interfaces/Database/Roles/DeleteRoleModal.tsx +++ b/apps/studio/components/interfaces/Database/Roles/DeleteRoleModal.tsx @@ -15,7 +15,7 @@ interface DeleteRoleModalProps { export const DeleteRoleModal = ({ role, visible, onClose, onDelete }: DeleteRoleModalProps) => { const { data: project } = useSelectedProjectQuery() - const { mutate: deleteDatabaseRole, isLoading: isDeleting } = useDatabaseRoleDeleteMutation({ + const { mutate: deleteDatabaseRole, isPending: isDeleting } = useDatabaseRoleDeleteMutation({ onSuccess: () => { toast.success(`Successfully deleted role: ${role.name}`) onClose() diff --git a/apps/studio/components/interfaces/Database/Roles/RoleRow.tsx b/apps/studio/components/interfaces/Database/Roles/RoleRow.tsx index c4c5b82dee4..b4d03690567 100644 --- a/apps/studio/components/interfaces/Database/Roles/RoleRow.tsx +++ b/apps/studio/components/interfaces/Database/Roles/RoleRow.tsx @@ -31,7 +31,7 @@ export const RoleRow = ({ role, disabled = false, onSelectDelete }: RoleRowProps const { data: project } = useSelectedProjectQuery() const [isExpanded, setIsExpanded] = useState(false) - const { mutate: updateDatabaseRole, isLoading: isUpdating } = useDatabaseRoleUpdateMutation() + const { mutate: updateDatabaseRole, isPending: isUpdating } = useDatabaseRoleUpdateMutation() const { isSuperuser, canLogin, canCreateRole, canCreateDb, isReplicationRole, canBypassRls } = role diff --git a/apps/studio/components/interfaces/Database/Triggers/TriggerSheet.tsx b/apps/studio/components/interfaces/Database/Triggers/TriggerSheet.tsx index 4d5cf8d0f4a..c14145482fd 100644 --- a/apps/studio/components/interfaces/Database/Triggers/TriggerSheet.tsx +++ b/apps/studio/components/interfaces/Database/Triggers/TriggerSheet.tsx @@ -92,7 +92,7 @@ export const TriggerSheet = ({ const [showFunctionSelector, setShowFunctionSelector] = useState(false) - const { mutate: createDatabaseTrigger, isLoading: isCreating } = useDatabaseTriggerCreateMutation( + const { mutate: createDatabaseTrigger, isPending: isCreating } = useDatabaseTriggerCreateMutation( { onSuccess: () => { toast.success(`Successfully created trigger`) @@ -103,7 +103,7 @@ export const TriggerSheet = ({ }, } ) - const { mutate: updateDatabaseTrigger, isLoading: isUpdating } = useDatabaseTriggerUpdateMutation( + const { mutate: updateDatabaseTrigger, isPending: isUpdating } = useDatabaseTriggerUpdateMutation( { onSuccess: () => { toast.success(`Successfully updated trigger`) diff --git a/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggersList.tsx b/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggersList.tsx index d4c4df241d4..f7c47373648 100644 --- a/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggersList.tsx +++ b/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggersList.tsx @@ -1,28 +1,29 @@ import type { PostgresTrigger } from '@supabase/postgres-meta' import { PermissionAction } from '@supabase/shared-types/out/constants' import { DatabaseZap, FunctionSquare, Plus, Search, Shield } from 'lucide-react' -import { useRef, useState } from 'react' import { parseAsBoolean, parseAsString, useQueryState } from 'nuqs' +import { useRef, useState } from 'react' import { toast } from 'sonner' +import { useIsInlineEditorEnabled } from 'components/interfaces/Account/Preferences/InlineEditorSettings' +import { ProtectedSchemaWarning } from 'components/interfaces/Database/ProtectedSchemaWarning' +import { DeleteTrigger } from 'components/interfaces/Database/Triggers/DeleteTrigger' +import { TriggerSheet } from 'components/interfaces/Database/Triggers/TriggerSheet' import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider' import AlertError from 'components/ui/AlertError' import { ButtonTooltip } from 'components/ui/ButtonTooltip' import SchemaSelector from 'components/ui/SchemaSelector' -import { ProtectedSchemaWarning } from 'components/interfaces/Database/ProtectedSchemaWarning' -import { DeleteTrigger } from 'components/interfaces/Database/Triggers/DeleteTrigger' -import { TriggerSheet } from 'components/interfaces/Database/Triggers/TriggerSheet' import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader' -import { useDatabaseTriggersQuery } from 'data/database-triggers/database-triggers-query' import { useDatabaseTriggerDeleteMutation } from 'data/database-triggers/database-trigger-delete-mutation' +import { useDatabaseTriggersQuery } from 'data/database-triggers/database-triggers-query' import { useTablesQuery } from 'data/tables/tables-query' import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions' +import { handleErrorOnDelete, useQueryStateWithSelect } from 'hooks/misc/useQueryStateWithSelect' import { useQuerySchemaState } from 'hooks/misc/useSchemaQueryState' import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject' -import { handleErrorOnDelete, useQueryStateWithSelect } from 'hooks/misc/useQueryStateWithSelect' import { useIsProtectedSchema, useProtectedSchemas } from 'hooks/useProtectedSchemas' -import { useIsInlineEditorEnabled } from 'components/interfaces/Account/Preferences/InlineEditorSettings' import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state' +import { useEditorPanelStateSnapshot } from 'state/editor-panel-state' import { useSidebarManagerSnapshot } from 'state/sidebar-manager-state' import { AiIconAnimation, @@ -35,7 +36,6 @@ import { TableRow, } from 'ui' import { TriggerList } from './TriggerList' -import { useEditorPanelStateSnapshot } from 'state/editor-panel-state' import { generateTriggerCreateSQL } from './TriggerList.utils' export const TriggersList = () => { @@ -114,7 +114,7 @@ export const TriggersList = () => { handleErrorOnDelete(deletingTriggerIdRef, selectedId, `Database Trigger not found`), }) - const { mutate: deleteDatabaseTrigger, isLoading: isDeletingTrigger } = + const { mutate: deleteDatabaseTrigger, isPending: isDeletingTrigger } = useDatabaseTriggerDeleteMutation({ onSuccess: (_, variables) => { toast.success(`Successfully removed ${variables.trigger.name}`) diff --git a/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx b/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx index 5ff32c1e12f..4de34f0e855 100644 --- a/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx +++ b/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx @@ -225,13 +225,13 @@ export function DiskManagementForm() { const isProjectRequestingDiskChanges = isRequestingChanges && !isProjectResizing const noPermissions = isPermissionsLoaded && !canUpdateDiskConfiguration - const { mutateAsync: updateDiskConfiguration, isLoading: isUpdatingDisk } = + const { mutateAsync: updateDiskConfiguration, isPending: isUpdatingDisk } = useUpdateDiskAttributesMutation({ // this is to suppress to toast message onError: () => {}, onSuccess: () => setRefetchInterval(2000), }) - const { mutateAsync: updateSubscriptionAddon, isLoading: isUpdatingCompute } = + const { mutateAsync: updateSubscriptionAddon, isPending: isUpdatingCompute } = useProjectAddonUpdateMutation({ // this is to suppress to toast message onError: () => {}, @@ -240,7 +240,7 @@ export function DiskManagementForm() { if (projectRef) setProjectStatus({ ref: projectRef, status: PROJECT_STATUS.RESIZING }) }, }) - const { mutateAsync: updateDiskAutoscaleConfig, isLoading: isUpdatingDiskAutoscaleConfig } = + const { mutateAsync: updateDiskAutoscaleConfig, isPending: isUpdatingDiskAutoscaleConfig } = useUpdateDiskAutoscaleConfigMutation({ // this is to suppress to toast message onError: () => {}, diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx index 9320f44a7e5..541b73566c8 100644 --- a/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx +++ b/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx @@ -104,8 +104,8 @@ export const EdgeFunctionDetails = () => { slug: functionSlug, }) - const { mutate: updateEdgeFunction, isLoading: isUpdating } = useEdgeFunctionUpdateMutation() - const { mutate: deleteEdgeFunction, isLoading: isDeleting } = useEdgeFunctionDeleteMutation({ + const { mutate: updateEdgeFunction, isPending: isUpdating } = useEdgeFunctionUpdateMutation() + const { mutate: deleteEdgeFunction, isPending: isDeleting } = useEdgeFunctionDeleteMutation({ onSuccess: () => { toast.success(`Successfully deleted "${selectedFunction?.name}"`) router.push(`/project/${projectRef}/functions`) diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionTesterSheet.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionTesterSheet.tsx index 06585eba6e0..a4c8c3b5b1f 100644 --- a/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionTesterSheet.tsx +++ b/apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionTesterSheet.tsx @@ -96,7 +96,7 @@ export const EdgeFunctionTesterSheet = ({ visible, onClose }: EdgeFunctionTester const { serviceKey } = getKeys(apiKeys) const { mutate: sendEvent } = useSendEventMutation() - const { mutate: testEdgeFunction, isLoading } = useEdgeFunctionTestMutation({ + const { mutate: testEdgeFunction, isPending } = useEdgeFunctionTestMutation({ onSuccess: (res) => setResponse(res), onError: (err) => { setError(err instanceof Error ? err.message : 'An unknown error occurred') @@ -248,7 +248,7 @@ export const EdgeFunctionTesterSheet = ({ visible, onClose }: EdgeFunctionTester {...field} size="tiny" placeholder="Enter key..." - disabled={isLoading} + disabled={isPending} className="h-auto py-2 font-mono rounded-none shadow-none bg-transparent border-l-0 border-r-1 border-t-0 border-b-0 border-border" /> @@ -263,7 +263,7 @@ export const EdgeFunctionTesterSheet = ({ visible, onClose }: EdgeFunctionTester {...field} size="tiny" placeholder="Enter value..." - disabled={isLoading} + disabled={isPending} className="h-auto py-2 font-mono rounded-none shadow-none bg-transparent border-none" /> @@ -310,7 +310,7 @@ export const EdgeFunctionTesterSheet = ({ visible, onClose }: EdgeFunctionTester