From 4e6baf8a336915e34920b3420e778762f1987136 Mon Sep 17 00:00:00 2001 From: "Calum H. (IMB11)" Date: Thu, 7 May 2026 15:56:54 +0100 Subject: [PATCH 1/4] feat: dont use save banner for project env modal --- .../environment/EnvironmentMigration.vue | 33 +++++++++- .../environment/ProjectEnvironmentModal.vue | 61 ++++++++++++++++++- 2 files changed, 88 insertions(+), 6 deletions(-) diff --git a/packages/ui/src/components/project/settings/environment/EnvironmentMigration.vue b/packages/ui/src/components/project/settings/environment/EnvironmentMigration.vue index 6f4a5e21fe..dcc1eb051e 100644 --- a/packages/ui/src/components/project/settings/environment/EnvironmentMigration.vue +++ b/packages/ui/src/components/project/settings/environment/EnvironmentMigration.vue @@ -16,6 +16,15 @@ import { computed } from 'vue' const { formatMessage } = useVIntl() +const props = withDefaults( + defineProps<{ + showFloatingSave?: boolean + }>(), + { + showFloatingSave: true, + }, +) + const { currentMember, projectV2, projectV3, invalidate } = injectProjectPageContext() const { handleError } = injectNotificationManager() const client = injectModrinthClient() @@ -42,7 +51,7 @@ function getInitialEnv() { return env?.length === 1 ? env[0] : undefined } -const { saved, current, saving, reset, save } = useSavable( +const { saved, current, saving, reset, save, hasChanges } = useSavable( () => ({ environment: getInitialEnv(), side_types_migration_review_status: projectV3.value?.side_types_migration_review_status, @@ -67,6 +76,24 @@ if (originalEnv && originalEnv !== 'unknown') { current.value.side_types_migration_review_status = 'reviewed' } +const canReset = computed(() => !needsToVerify.value) +const canSave = computed( + () => + supportsEnvironment.value && + hasPermission.value && + (projectV3.value?.environment?.length ?? 0) <= 1, +) + +defineExpose({ + hasChanges, + saving, + canReset, + canSave, + needsToVerify, + reset, + save, +}) + const messages = defineMessages({ verifyButton: { id: 'project.settings.environment.verification.verify-button', @@ -160,11 +187,11 @@ const messages = defineMessages({ /> Edit project Environment -
- +
+
+