Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: tweak issue options display (#12041)

boojack2259c8b46386
diff --git a/frontend/src/components/IssueV1/components/DataExportSection/ExportOptionSection/ExportOptionSection.vue b/frontend/src/components/IssueV1/components/DataExportSection/ExportOptionSection/ExportOptionSection.vue
index 4ff4fc6660..f5207ed618 100644
--- a/frontend/src/components/IssueV1/components/DataExportSection/ExportOptionSection/ExportOptionSection.vue
+++ b/frontend/src/components/IssueV1/components/DataExportSection/ExportOptionSection/ExportOptionSection.vue
@@ -3,7 +3,7 @@
<div class="w-full flex flex-row justify-between items-center mb-1">
<span class="textlabel mr-4">{{ $t("issue.data-export.options") }}</span>
<div
- v-if="!isCreating"
+ v-if="showEditButtons"
class="flex flex-row justify-end items-center gap-2"
>
<NTooltip
@@ -69,6 +69,7 @@ import {
} from "@/components/IssueV1/logic";
import { rolloutServiceClient } from "@/grpcweb";
import { pushNotification, useCurrentUserV1 } from "@/store";
+import { IssueStatus } from "@/types/proto/v1/issue_service";
import {
Plan_Spec,
Plan_ExportDataConfig,
@@ -97,6 +98,14 @@ const state = reactive<LocalState>({
isEditing: false,
});
+const showEditButtons = computed(() => {
+ return !isCreating.value && issue.value.status === IssueStatus.OPEN;
+});
+
+const optionsEditable = computed(() => {
+ return isCreating.value || (showEditButtons.value && state.isEditing);
+});
+
const denyEditTaskReasons = computed(() => {
return allowUserToEditStatementForTask(
issue.value,
@@ -105,10 +114,6 @@ const denyEditTaskReasons = computed(() => {
);
});
-const optionsEditable = computed(() => {
- return isCreating.value || state.isEditing;
-});
-
const handleCancelEdit = () => {
state.isEditing = false;
state.config = Plan_ExportDataConfig.fromPartial({
diff --git a/frontend/src/components/IssueV1/components/ReviewIssueSpecSection/ReviewOptionSection/ReviewOptionSection.vue b/frontend/src/components/IssueV1/components/ReviewIssueSpecSection/ReviewOptionSection/ReviewOptionSection.vue
index 025f058723..85804c8b55 100644
--- a/frontend/src/components/IssueV1/components/ReviewIssueSpecSection/ReviewOptionSection/ReviewOptionSection.vue
+++ b/frontend/src/components/IssueV1/components/ReviewIssueSpecSection/ReviewOptionSection/ReviewOptionSection.vue
@@ -3,25 +3,25 @@
<div class="w-full flex flex-row justify-between items-center mb-1">
<span class="textlabel mr-4">{{ $t("issue.data-export.options") }}</span>
<div
- v-if="!isCreating"
+ v-if="showEditButtons"
class="flex flex-row justify-end items-center gap-2"
>
<NTooltip
v-if="!state.isEditing"
- :disabled="denyEditTaskReasons.length === 0"
+ :disabled="denyEditReasons.length === 0"
>
<template #trigger>
<NButton
size="tiny"
tag="div"
- :disabled="denyEditTaskReasons.length > 0"
+ :disabled="denyEditReasons.length > 0"
@click="state.isEditing = true"
>
{{ $t("common.edit") }}
</NButton>
</template>
<template #default>
- <ErrorList :errors="denyEditTaskReasons" />
+ <ErrorList :errors="denyEditReasons" />
</template>
</NTooltip>
<template v-else>
@@ -84,11 +84,16 @@ const state = reactive<LocalState>({
isEditing: false,
});
-const denyEditTaskReasons = computed(() => {
+const showEditButtons = computed(() => {
+ return !isCreating.value && issue.value.status === IssueStatus.OPEN;
+});
+
+const optionsEditable = computed(() => {
+ return isCreating.value || (showEditButtons.value && state.isEditing);
+});
+
+const denyEditReasons = computed(() => {
const reasons: string[] = [];
- if (issue.value.status !== IssueStatus.OPEN) {
- reasons.push("Issue is not open");
- }
if (
!hasProjectPermissionV2(
issue.value.projectEntity,
@@ -101,10 +106,6 @@ const denyEditTaskReasons = computed(() => {
return reasons;
});
-const optionsEditable = computed(() => {
- return isCreating.value || state.isEditing;
-});
-
const handleCancelEdit = () => {
state.isEditing = false;
state.statementType =