diff --git a/apps/studio/components/interfaces/Settings/General/General.tsx b/apps/studio/components/interfaces/Settings/General/General.tsx index cffe5298a86..f1900b6662a 100644 --- a/apps/studio/components/interfaces/Settings/General/General.tsx +++ b/apps/studio/components/interfaces/Settings/General/General.tsx @@ -34,8 +34,7 @@ export const General = () => { // [Joshen] Need to refactor to use RHF so we don't need manual error handlers like this const [nameError, setNameError] = useState() - const { data: parentProject } = useProjectDetailQuery({ ref: project?.parent_project_ref }) - const isBranch = parentProject !== undefined + const isBranch = Boolean(project?.parent_project_ref) const { projectSettingsRestartProject } = useIsFeatureEnabled([ 'project_settings:restart_project', @@ -81,7 +80,10 @@ export const General = () => { Certain settings are not available while you're on a preview branch. To adjust your project settings, you may return to your{' '} - + main branch . @@ -135,66 +137,64 @@ export const General = () => { }} )} +
+ +
+
+
+

+ {projectSettingsRestartProject ? 'Restart project' : 'Restart database'} +

+
+

+ Your project will not be available for a few minutes. +

+
+
+ +
+
+
+
+

Pause project

+
+

+ Your project will not be accessible while it is paused. +

+
+
+ +
+
+
{!isBranch && ( - <> -
- -
-
+
+ + +
+
+
-

- {projectSettingsRestartProject ? 'Restart project' : 'Restart database'} +

Project usage statistics have been moved

+

+ You may view your project's usage under your organization's settings

-
-

- Your project will not be available for a few minutes. -

-
-
-
-
-

Pause project

-
-

- Your project will not be accessible while it is paused. -

-
+
-
- -
-
- - -
-
- -
-

Project usage statistics have been moved

-

- You may view your project's usage under your organization's settings -

-
-
-
- -
-
-
-
-
- + + +
)}
) diff --git a/apps/studio/components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx b/apps/studio/components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx index 03de40e464e..010cd814c07 100644 --- a/apps/studio/components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx +++ b/apps/studio/components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx @@ -32,7 +32,8 @@ const PauseProjectButton = () => { const isAwsK8s = useIsAwsK8sCloudProvider() const isFreePlan = organization?.plan.id === 'free' - const isPaidAndNotAwsK8s = !isFreePlan && !isAwsK8s + const isBranch = Boolean(project?.parent_project_ref) + const isPaidAndNotAwsK8s = !isBranch && !isFreePlan && !isAwsK8s const { mutate: pauseProject, isPending: isPausing } = useProjectPauseMutation({ onSuccess: (_, variables) => {