feat(dui): disable apply changes button for resolved issues

This commit is contained in:
Björn Steinhagen
2026-03-04 20:25:34 +02:00
parent 4fdf61bf1e
commit 04faa51c45
+10 -4
View File
@@ -13,10 +13,12 @@
<div v-if="app.$parametersBinding && hasObjectDeltas" class="w-full pt-1 pb-1">
<FormButton
class="w-full justify-center"
:disabled="isApplying"
:disabled="isApplying || isResolved"
@click="applyChanges"
>
{{ isApplying ? 'Applying...' : 'Apply changes' }}
{{
isApplying ? 'Applying...' : isResolved ? 'Issue resolved' : 'Apply changes'
}}
</FormButton>
</div>
<div class="flex flex-wrap items-center gap-x-3 gap-y-1">
@@ -96,7 +98,7 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
import { useQuery } from '@vue/apollo-composable'
import { ResourceMetaType } from '~/lib/common/generated/gql/graphql'
import { ResourceMetaType, IssueStatus } from '~/lib/common/generated/gql/graphql'
import { issueResourceMetaSearchQuery } from '~/lib/issues/graphql/queries'
import type { IssuesItemFragment } from '~/lib/common/generated/gql/graphql'
import type { IModelCard } from '~/lib/models/card'
@@ -111,6 +113,10 @@ const props = defineProps<{
const app = useNuxtApp()
const isApplying = ref(false)
const isResolved = computed(() => {
return props.issue.status === IssueStatus.Resolved
})
const queryVariables = computed(() => ({
workspaceId: props.modelCard.workspaceId,
projectId: props.modelCard.projectId,
@@ -160,7 +166,7 @@ const applyChanges = async () => {
if (app.$parametersBinding) {
await app.$parametersBinding.update(payload)
} else {
console.warn('IParametersBinding is not available in this host app')
console.warn('IParametersBinding not available in this host app')
}
} catch (error) {
console.error('Failed to apply changes:', error)