Skip to content

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

refactor: simplify IssueContext and remove format-on-save feature (#17652)

Danny Xu4617cf0ddf57
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
index 18eb53e882..9f19cf59b5 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
@@ -58,7 +58,6 @@ import {
specForTask,
useIssueContext,
} from "@/components/IssueV1/logic";
-import formatSQL from "@/components/MonacoEditor/sqlFormatter";
import {
databaseEngineForSpec,
getLocalSheetByName,
@@ -76,8 +75,6 @@ import {
} from "@/grpcweb";
import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";
import { useSheetV1Store, useCurrentProjectV1 } from "@/store";
-import { dialectOfEngineV1, languageOfEngineV1 } from "@/types";
-import type { Engine } from "@/types/proto-es/v1/common_pb";
import { CreateIssueRequestSchema } from "@/types/proto-es/v1/issue_service_pb";
import { IssueSchema, Issue_Type } from "@/types/proto-es/v1/issue_service_pb";
import { CreatePlanRequestSchema } from "@/types/proto-es/v1/plan_service_pb";
@@ -99,17 +96,13 @@ import {
getSheetStatement,
hasPermissionToCreateChangeDatabaseIssueInProject,
issueV1Slug,
- setSheetStatement,
sheetNameOfTaskV1,
type Defer,
} from "@/utils";
-const MAX_FORMATTABLE_STATEMENT_SIZE = 10000; // 10K characters
-
const { t } = useI18n();
const router = useRouter();
-const { isCreating, issue, formatOnSave, events, selectedTask } =
- useIssueContext();
+const { isCreating, issue, events, selectedTask } = useIssueContext();
const { project } = useCurrentProjectV1();
const { resultMap: checkResultMap, upsertResult: upsertCheckResult } =
usePlanSQLCheckContext();
@@ -230,7 +223,6 @@ const createSheets = async () => {
const engine = await databaseEngineForSpec(spec);
sheet.engine = engine;
pendingCreateSheetMap.set(sheet.name, sheet);
- await maybeFormatSQL(sheet, engine);
}
}
const pendingCreateSheetList = Array.from(pendingCreateSheetMap.values());
@@ -267,28 +259,6 @@ const createPlan = async (title: string, description: string) => {
return response;
};
-const maybeFormatSQL = async (sheet: Sheet, engine: Engine) => {
- if (!formatOnSave.value) {
- return;
- }
- const language = languageOfEngineV1(engine);
- if (language !== "sql") {
- return;
- }
- const dialect = dialectOfEngineV1(engine);
-
- const statement = getSheetStatement(sheet);
- if (statement.length > MAX_FORMATTABLE_STATEMENT_SIZE) {
- return;
- }
- const { error, data: formatted } = await formatSQL(statement, dialect);
- if (error) {
- return;
- }
-
- setSheetStatement(sheet, formatted);
-};
-
const runSQLCheckForIssue = async () => {
if (
!isCreating.value ||
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/review/IssueReviewButtonGroup.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/review/IssueReviewButtonGroup.vue
index d09a258afb..c15c89fce9 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/review/IssueReviewButtonGroup.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/review/IssueReviewButtonGroup.vue
@@ -44,20 +44,25 @@ import ReviewActionButton from "./ReviewActionButton.vue";
const { t } = useI18n();
const currentUser = useCurrentUserV1();
-const { issue, phase, events, selectedTask, selectedStage } = useIssueContext();
+const { issue, isCreating, events, selectedTask, selectedStage } =
+ useIssueContext();
const { project } = useCurrentProjectV1();
const shouldShowApproveOrReject = computed(() => {
if (
issue.value.status === IssueStatus.CANCELED ||
issue.value.status === IssueStatus.DONE ||
- phase.value !== "REVIEW" ||
- issue.value.approvalStatus !== Issue_ApprovalStatus.PENDING
+ isCreating.value
) {
return false;
}
- // Hide review actions if self-approval is disabled.
+ // Must be pending approval
+ if (issue.value.approvalStatus !== Issue_ApprovalStatus.PENDING) {
+ return false;
+ }
+
+ // Hide review actions if self-approval is disabled
if (
!project.value.allowSelfApproval &&
currentUser.value.email === extractUserId(issue.value.creator)
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/rollout/CombinedRolloutButtonGroup.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/rollout/CombinedRolloutButtonGroup.vue
index e7b734a790..104770d7d5 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/rollout/CombinedRolloutButtonGroup.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/rollout/CombinedRolloutButtonGroup.vue
@@ -28,6 +28,7 @@ import {
getApplicableIssueStatusActionList,
getApplicableStageRolloutActionList,
getApplicableTaskRolloutActionList,
+ releaserCandidatesForIssue,
useIssueContext,
} from "@/components/IssueV1/logic";
import type { Task } from "@/types/proto-es/v1/rollout_service_pb";
@@ -37,8 +38,11 @@ import RolloutActionButtonGroup from "./RolloutActionButtonGroup.vue";
import type { RolloutAction } from "./common";
const { t } = useI18n();
-const { issue, selectedStage, selectedTask, events, releaserCandidates } =
- useIssueContext();
+const { issue, selectedStage, selectedTask, events } = useIssueContext();
+
+const releaserCandidates = computed(() => {
+ return releaserCandidatesForIssue(issue.value);
+});
const issueStatusActionList = computed(() => {
return getApplicableIssueStatusActionList(issue.value);
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/rollout/RolloutActionButton.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/rollout/RolloutActionButton.vue
index e9e52c6250..3acb712e0a 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/rollout/RolloutActionButton.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/rollout/RolloutActionButton.vue
@@ -26,6 +26,7 @@ import type {
} from "@/components/IssueV1/logic";
import {
allowUserToApplyTaskRolloutAction,
+ releaserCandidatesForIssue,
taskRolloutActionButtonProps,
taskRolloutActionDisplayName,
useIssueContext,
@@ -48,7 +49,11 @@ defineEmits<{
}>();
const { t } = useI18n();
-const { issue, selectedTask, releaserCandidates } = useIssueContext();
+const { issue, selectedTask } = useIssueContext();
+
+const releaserCandidates = computed(() => {
+ return releaserCandidatesForIssue(issue.value);
+});
const errors = asyncComputed(async () => {
const errors: ErrorItem[] = [];
diff --git a/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorActionPopover.vue b/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorActionPopover.vue
index 06f406f3c5..d6bbb42395 100644
--- a/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorActionPopover.vue
+++ b/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorActionPopover.vue
@@ -11,13 +11,15 @@
<div class="flex flex-col items-start justify-start">
<template v-if="shouldShowInstanceRoleSelect">
<InstanceRoleSelect />
+ </template>
+ <template
+ v-if="shouldShowInstanceRoleSelect && shouldShowTransactionModeToggle"
+ >
<NDivider class="!my-2" />
</template>
<template v-if="shouldShowTransactionModeToggle">
<TransactionModeToggle />
- <NDivider class="!my-2" />
</template>
- <FormatOnSaveCheckbox v-model:value="formatOnSave" :language="language" />
</div>
</NPopover>
</template>
@@ -30,26 +32,17 @@ import { useIssueContext } from "@/components/IssueV1/logic";
import { useCurrentProjectV1 } from "@/store";
import { Engine } from "@/types/proto-es/v1/common_pb";
import { Task_Type } from "@/types/proto-es/v1/rollout_service_pb";
-import { databaseForTask } from "@/utils";
-import {
- useInstanceV1EditorLanguage,
- instanceV1SupportsTransactionMode,
-} from "@/utils";
-import FormatOnSaveCheckbox from "./FormatOnSaveCheckbox.vue";
+import { databaseForTask, instanceV1SupportsTransactionMode } from "@/utils";
import InstanceRoleSelect from "./InstanceRoleSelect.vue";
import TransactionModeToggle from "./TransactionModeToggle.vue";
-const { formatOnSave, selectedTask } = useIssueContext();
+const { selectedTask } = useIssueContext();
const { project } = useCurrentProjectV1();
const database = computed(() => {
return databaseForTask(project.value, selectedTask.value);
});
-const language = useInstanceV1EditorLanguage(
- computed(() => database.value.instanceResource)
-);
-
const shouldShowInstanceRoleSelect = computed(() => {
// Only works for postgres.
const engine = database.value.instanceResource.engine;
diff --git a/frontend/src/components/IssueV1/components/StatementSection/EditorView/FormatOnSaveCheckbox.vue b/frontend/src/components/IssueV1/components/StatementSection/EditorView/FormatOnSaveCheckbox.vue
deleted file mode 100644
index 93b53a4160..0000000000
--- a/frontend/src/components/IssueV1/components/StatementSection/EditorView/FormatOnSaveCheckbox.vue
+++ /dev/null
@@ -1,27 +0,0 @@
-<template>
- <NCheckbox
- v-if="allowFormatOnSave"
- :checked="value"
- size="small"
- @update:checked="$emit('update:value', $event)"
- >
- {{ $t("issue.format-on-save") }}
- </NCheckbox>
-</template>
-
-<script setup lang="ts">
-import { NCheckbox } from "naive-ui";
-import { computed } from "vue";
-import type { Language } from "@/types";
-
-const props = defineProps<{
- language: Language;
- value: boolean;
-}>();
-
-defineEmits<{
- (event: "update:value", on: boolean): void;
-}>();
-
-const allowFormatOnSave = computed(() => props.language === "sql");
-</script>
diff --git a/frontend/src/components/IssueV1/components/TaskListSection/TaskExtraActionsButton.vue b/frontend/src/components/IssueV1/components/TaskListSection/TaskExtraActionsButton.vue
index 7a32669da8..6041115afc 100644
--- a/frontend/src/components/IssueV1/components/TaskListSection/TaskExtraActionsButton.vue
+++ b/frontend/src/components/IssueV1/components/TaskListSection/TaskExtraActionsButton.vue
@@ -30,6 +30,7 @@ import type { TaskRolloutAction } from "@/components/IssueV1/logic";
import {
allowUserToApplyTaskRolloutAction,
getApplicableTaskRolloutActionList,
+ releaserCandidatesForIssue,
useIssueContext,
} from "@/components/IssueV1/logic";
import type { Task } from "@/types/proto-es/v1/rollout_service_pb";
@@ -45,8 +46,11 @@ const props = defineProps<{
}>();
const { t } = useI18n();
-const { events, isCreating, selectedTask, issue, releaserCandidates } =
- useIssueContext();
+const { events, isCreating, selectedTask, issue } = useIssueContext();
+
+const releaserCandidates = computed(() => {
+ return releaserCandidatesForIssue(issue.value);
+});
const actionList = computed(() => {
return getApplicableTaskRolloutActionList(
diff --git a/frontend/src/components/IssueV1/logic/base.ts b/frontend/src/components/IssueV1/logic/base.ts
index 24c9566bd6..e2355921eb 100644
--- a/frontend/src/components/IssueV1/logic/base.ts
+++ b/frontend/src/components/IssueV1/logic/base.ts
@@ -1,12 +1,9 @@
import Emittery from "emittery";
import { first, isEqual } from "lodash-es";
-import { useDialog } from "naive-ui";
import { computed, ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";
-import { useUIStateStore } from "@/store";
import { emptyStage, emptyTask } from "@/types";
-import { Issue_ApprovalStatus } from "@/types/proto-es/v1/issue_service_pb";
import type { PlanCheckRun } from "@/types/proto-es/v1/plan_service_pb";
import type { Stage, Task } from "@/types/proto-es/v1/rollout_service_pb";
import {
@@ -20,9 +17,8 @@ import {
extractTaskUID,
extractStageUID,
} from "@/utils";
-import type { IssueContext, IssueEvents, IssuePhase } from "./context";
+import type { IssueContext, IssueEvents } from "./context";
import { planCheckRunListForTask } from "./plan-check";
-import { releaserCandidatesForIssue } from "./releaser";
import { stageForTask } from "./utils";
const state = {
@@ -36,10 +32,8 @@ export const useBaseIssueContext = (
context: Pick<IssueContext, "isCreating" | "ready" | "issue">
): Partial<IssueContext> => {
const { isCreating, issue } = context;
- const uiStateStore = useUIStateStore();
const route = useRoute();
const router = useRouter();
- const dialog = useDialog();
const events: IssueEvents = new Emittery();
@@ -126,25 +120,6 @@ export const useBaseIssueContext = (
});
});
- const releaserCandidates = computed(() => {
- return releaserCandidatesForIssue(issue.value);
- });
-
- const phase = computed((): IssuePhase => {
- if (isCreating.value) return "CREATE";
-
- const approvalStatus = issue.value.approvalStatus;
- const rolloutReady =
- approvalStatus === Issue_ApprovalStatus.APPROVED ||
- approvalStatus === Issue_ApprovalStatus.SKIPPED;
- return rolloutReady ? "ROLLOUT" : "REVIEW";
- });
-
- const formatOnSave = computed({
- get: () => uiStateStore.editorFormatStatementOnSave,
- set: (value: boolean) => uiStateStore.setEditorFormatStatementOnSave(value),
- });
-
const planCheckRunMapForTask = ref<Map<string, PlanCheckRun[]>>(new Map());
const getPlanCheckRunsForTask = (task: Task) => {
@@ -169,13 +144,9 @@ export const useBaseIssueContext = (
);
return {
- phase,
events,
- releaserCandidates,
selectedStage,
selectedTask,
- formatOnSave,
- dialog,
getPlanCheckRunsForTask,
};
};
diff --git a/frontend/src/components/IssueV1/logic/context.ts b/frontend/src/components/IssueV1/logic/context.ts
index 7bbd6a29a1..268ce19144 100644
--- a/frontend/src/components/IssueV1/logic/context.ts
+++ b/frontend/src/components/IssueV1/logic/context.ts
@@ -1,5 +1,4 @@
import type Emittery from "emittery";
-import type { useDialog } from "naive-ui";
import { v4 as uuidv4 } from "uuid";
import type { InjectionKey, Ref, ComputedRef } from "vue";
import { inject, provide } from "vue";
@@ -12,8 +11,6 @@ import type {
TaskRolloutAction,
} from "./action";
-export type IssuePhase = "CREATE" | "REVIEW" | "ROLLOUT";
-
export type IssueEvents = Emittery<{
"status-changed": { eager: boolean };
"select-task": { task: Task };
@@ -27,23 +24,16 @@ export type IssueContext = {
isCreating: Ref<boolean>;
ready: Ref<boolean>;
issue: Ref<ComposedIssue>;
- phase: Ref<IssuePhase>;
allowChange: ComputedRef<boolean>;
- // The release candidates of the issue.
- // Format: users/{email}
- releaserCandidates: Ref<string[]>;
-
// UI status
selectedStage: Ref<Stage>;
selectedTask: Ref<Task>;
- formatOnSave: Ref<boolean>;
// UI events
events: IssueEvents;
// misc
- dialog: ReturnType<typeof useDialog>;
reInitialize: (overrides?: Record<string, string>) => Promise<void>;
// utility functions
@@ -58,16 +48,6 @@ export const useIssueContext = () => {
return inject(KEY)!;
};
-export const provideIssueContext = (
- context: Partial<IssueContext>,
- root = false
-) => {
- if (!root) {
- const parent = useIssueContext();
- context = {
- ...parent,
- ...context,
- };
- }
+export const provideIssueContext = (context: Partial<IssueContext>) => {
provide(KEY, context as IssueContext);
};
diff --git a/frontend/src/components/IssueV1/logic/utils.ts b/frontend/src/components/IssueV1/logic/utils.ts
index 2c84d922c0..445f480e6c 100644
--- a/frontend/src/components/IssueV1/logic/utils.ts
+++ b/frontend/src/components/IssueV1/logic/utils.ts
@@ -1,7 +1,4 @@
import { create } from "@bufbuild/protobuf";
-import { NButton } from "naive-ui";
-import { h } from "vue";
-import { t } from "@/plugins/i18n";
import {
projectNamePrefix,
useDatabaseV1Store,
@@ -25,13 +22,11 @@ import type { Project } from "@/types/proto-es/v1/project_service_pb";
import type { Task } from "@/types/proto-es/v1/rollout_service_pb";
import { Task_Status, Task_Type } from "@/types/proto-es/v1/rollout_service_pb";
import {
- defer,
extractDatabaseResourceName,
extractProjectResourceName,
flattenTaskV1List,
isValidIssueName,
} from "@/utils";
-import type { IssueContext } from "./context";
export const projectOfIssue = (issue: Issue): Project => {
return useProjectV1Store().getProjectByName(
@@ -162,122 +157,6 @@ export const stageForTask = (issue: ComposedIssue, task: Task) => {
);
};
-export const chooseUpdateTarget = (
- issue: ComposedIssue,
- selectedTask: Task,
- filter: (task: Task) => boolean,
- dialog: IssueContext["dialog"],
- updateType: string,
- isBatchMode: boolean
-) => {
- type Target = "CANCELED" | "TASK" | "STAGE" | "ALL";
- const d = defer<{ target: Target; tasks: Task[] }>();
-
- const targets: Record<Target, Task[]> = {
- CANCELED: [],
- TASK: [selectedTask],
- STAGE: (stageForTask(issue, selectedTask)?.tasks ?? []).filter(filter),
- ALL: flattenTaskV1List(issue.rolloutEntity).filter(filter),
- };
-
- if (isBatchMode) {
- dialog.info({
- title: t("issue.update-statement.self", { type: updateType }),
- content: t(
- "issue.update-statement.current-change-will-apply-to-all-tasks-in-batch-mode"
- ),
- type: "info",
- autoFocus: false,
- closable: false,
- maskClosable: false,
- closeOnEsc: false,
- showIcon: false,
- positiveText: t("common.confirm"),
- negativeText: t("common.cancel"),
- onPositiveClick: () => {
- d.resolve({ target: "ALL", tasks: targets.ALL });
- },
- onNegativeClick: () => {
- d.resolve({ target: "CANCELED", tasks: [] });
- },
- });
- return d.promise;
- }
-
- if (targets.STAGE.length === 1 && targets.ALL.length === 1) {
- d.resolve({ target: "TASK", tasks: targets.TASK });
- return d.promise;
- }
-
- const $d = dialog.create({
- title: t("issue.update-statement.self", { type: updateType }),
- content: t("issue.update-statement.apply-current-change-to"),
- type: "info",
- autoFocus: false,
- closable: false,
- maskClosable: false,
- closeOnEsc: false,
- showIcon: false,
- action: () => {
- const finish = (target: Target) => {
- d.resolve({ target, tasks: targets[target] });
- $d.destroy();
- };
-
- const CANCEL = h(
- NButton,
- { size: "small", onClick: () => finish("CANCELED") },
- {
- default: () => t("common.cancel"),
- }
- );
- const TASK = h(
- NButton,
- { size: "small", onClick: () => finish("TASK") },
- {
- default: () => t("issue.update-statement.target.selected-task"),
- }
- );
- const buttons = [CANCEL, TASK];
- if (targets.STAGE.length > 1) {
- // More than one editable tasks in stage
- // Add "Selected stage" option
- const STAGE = h(
- NButton,
- { size: "small", onClick: () => finish("STAGE") },
- {
- default: () => t("issue.update-statement.target.selected-stage"),
- }
- );
- buttons.push(STAGE);
- }
- if (targets.ALL.length > targets.STAGE.length) {
- // More editable tasks in other stages
- // Add "All tasks" option
- const ALL = h(
- NButton,
- { size: "small", onClick: () => finish("ALL") },
- {
- default: () => t("issue.update-statement.target.all-tasks"),
- }
- );
- buttons.push(ALL);
- }
-
- return h(
- "div",
- { class: "flex items-center justify-end gap-x-2" },
- buttons
- );
- },
- onClose() {
- d.resolve({ target: "CANCELED", tasks: [] });
- },
- });
-
- return d.promise;
-};
-
export const isUnfinishedResolvedTask = (issue: ComposedIssue | undefined) => {
if (!issue) {
return false;
diff --git a/frontend/src/components/Plan/components/IssueReviewView/IssueBaseLayout.vue b/frontend/src/components/Plan/components/IssueReviewView/IssueBaseLayout.vue
index b289616dc8..3bd248d2cb 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/IssueBaseLayout.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/IssueBaseLayout.vue
@@ -91,14 +91,11 @@ const composedIssue = computed(() => {
return composedIssue;
});
-provideIssueContext(
- {
- isCreating: computed(() => false),
- ready,
- allowChange,
- issue: composedIssue,
- ...issueBaseContext,
- },
- true /* root */
-);
+provideIssueContext({
+ isCreating: computed(() => false),
+ ready,
+ allowChange,
+ issue: composedIssue,
+ ...issueBaseContext,
+});
</script>
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index a518fa479d..3dbbe0081a 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -945,7 +945,6 @@
}
},
"new-issue": "@:common.new @:common.issue",
- "format-on-save": "Format on save",
"action-to-current-stage": "{action} current stage",
"upload-sql": "Upload SQL",
"statement-from-sheet-warning": "Due to the SQL being oversized, it has been truncated to display, and editing is disabled. You can upload a new SQL file to overwrite it.",
@@ -993,16 +992,6 @@
"custom-date-placeholder": "Select expiration date and time"
},
"review-sent-back": "Review sent back",
- "update-statement": {
- "self": "Update {type}",
- "apply-current-change-to": "Apply current change to",
- "target": {
- "selected-task": "Selected task",
- "selected-stage": "Selected stage",
- "all-tasks": "All tasks"
- },
- "current-change-will-apply-to-all-tasks-in-batch-mode": "In batch mode, current change will be applied to all tasks."
- },
"action-anyway": "{action} anyway",
"sql-check": {
"sql-checks": "SQL checks",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index f045bff8b3..7d201cb9e1 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -945,7 +945,6 @@
}
},
"new-issue": "@:common.new @:common.issue",
- "format-on-save": "Formatear al guardar",
"action-to-current-stage": "{action} etapa actual",
"upload-sql": "Cargar SQL",
"statement-from-sheet-warning": "Debido a que el SQL es demasiado grande, se ha truncado para mostrarlo y la edición está deshabilitada. Puede cargar un nuevo archivo SQL para sobrescribirlo.",
@@ -993,16 +992,6 @@
"custom-date-placeholder": "Seleccione la fecha y hora de vencimiento"
},
"review-sent-back": "Revisión devuelta",
- "update-statement": {
- "self": "Actualizar {type}",
- "apply-current-change-to": "Aplicar el cambio actual a",
- "target": {
- "selected-task": "Tarea seleccionada",
- "selected-stage": "Etapa seleccionada",
- "all-tasks": "Todas las tareas"
- },
- "current-change-will-apply-to-all-tasks-in-batch-mode": "En el modo por lotes, el cambio actual se aplicará a todas las tareas."
- },
"action-anyway": "{action} de todos modos",
"sql-check": {
"sql-checks": "Comprobaciones SQL",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 38785aea54..0b1741051c 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -945,7 +945,6 @@
}
},
"new-issue": "@:common.new@:common.issue",
- "format-on-save": "保存時にフォーマットする",
"action-to-current-stage": "{action}現在の段階",
"upload-sql": "SQLのアップロード",
"statement-from-sheet-warning": "SQL が大きすぎるため、表示時に切り捨てられ、編集が無効になっています。新しい SQL ファイルをアップロードして上書きすることができます。",
@@ -993,16 +992,6 @@
"custom-date-placeholder": "有効期限と時刻を選択します"
},
"review-sent-back": "レビューが返されました",
- "update-statement": {
- "self": "{type}を更新します",
- "apply-current-change-to": "現在の変更を適用する",
- "target": {
- "selected-task": "選択したタスク",
- "selected-stage": "選択したステージ",
- "all-tasks": "すべてのタスク"
- },
- "current-change-will-apply-to-all-tasks-in-batch-mode": "バッチ モードでは、現在の変更がすべてのタスクに適用されます。"
- },
"action-anyway": "まだ {action} が必要です",
"sql-check": {
"sql-checks": "SQLチェック項目",
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 6a1a4f6ca9..30651b1584 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -945,7 +945,6 @@
}
},
"new-issue": "@:common.new @:common.issue",
- "format-on-save": "Định dạng khi lưu",
"action-to-current-stage": "{action} giai đoạn hiện tại",
"upload-sql": "Tải lên SQL",
"statement-from-sheet-warning": "Do kích thước SQL vượt quá, nó đã bị cắt bớt để hiển thị và chỉnh sửa bị vô hiệu hóa. Bạn có thể tải lên một tệp SQL mới để ghi đè nó.",
@@ -993,16 +992,6 @@
"custom-date-placeholder": "Chọn ngày và giờ hết hạn"
},
"review-sent-back": "Đánh giá đã gửi lại",
- "update-statement": {
- "self": "Cập nhật {type}",
- "apply-current-change-to": "Áp dụng thay đổi hiện tại cho",
- "target": {
- "selected-task": "Tác vụ đã chọn",
- "selected-stage": "Giai đoạn đã chọn",
- "all-tasks": "Tất cả tác vụ"
- },
- "current-change-will-apply-to-all-tasks-in-batch-mode": "Trong chế độ hàng loạt, thay đổi hiện tại sẽ được áp dụng cho tất cả các tác vụ."
- },
"action-anyway": "{action} bằng mọi cách",
"sql-check": {
"sql-checks": "Kiểm tra SQL",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 0d645b6f8b..5d92831ca1 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -945,7 +945,6 @@
}
},
"new-issue": "@:common.new@:common.issue",
- "format-on-save": "保存时格式化",
"action-to-current-stage": "{action}当前阶段",
"upload-sql": "上传 SQL",
"statement-from-sheet-warning": "由于 SQL 文件过大,因此被截断以便显示,并且编辑功能已禁用。你可以上传新的 SQL 文件以将其覆盖。",
@@ -993,16 +992,6 @@
"custom-date-placeholder": "选择到期日期和时间"
},
"review-sent-back": "审核被退回",
- "update-statement": {
- "self": "更新{type}",
- "apply-current-change-to": "应用当前修改到",
- "target": {
- "selected-task": "选中的任务",
- "selected-stage": "选中的阶段",
- "all-tasks": "所有任务"
- },
- "current-change-will-apply-to-all-tasks-in-batch-mode": "在批量模式下,当前更改将应用于所有任务。"
- },
"action-anyway": "仍要{action}",
"sql-check": {
"sql-checks": "SQL 检查项",
diff --git a/frontend/src/store/modules/uistate.ts b/frontend/src/store/modules/uistate.ts
index eb878f6655..d32639d890 100644
--- a/frontend/src/store/modules/uistate.ts
+++ b/frontend/src/store/modules/uistate.ts
@@ -2,7 +2,6 @@ import { isUndefined } from "lodash-es";
import { defineStore } from "pinia";
import { computed, reactive } from "vue";
import { useCurrentUserV1 } from "@/store";
-import { useDynamicLocalStorage } from "@/utils";
export interface UIState {
collapseStateByKey: Map<string, boolean>;
@@ -20,15 +19,6 @@ export const useUIStateStore = defineStore("uistate", () => {
() => `ui.list.collapse.${currentUser.value.name}`
);
const INTRO_MODULE_KEY = computed(() => `ui.intro.${currentUser.value.name}`);
- const EDITOR_FORMAT_MODULE_KEY = computed(
- () => `ui.state.editor.format-statement-on-save.${currentUser.value.name}`
- );
-
- // default to false
- const editorFormatStatementOnSave = useDynamicLocalStorage<boolean>(
- EDITOR_FORMAT_MODULE_KEY,
- false
- );
const getIntroStateByKey = (key: string): boolean => {
return stateByKey(state.introStateByKey, INTRO_MODULE_KEY.value, key);
@@ -60,10 +50,6 @@ export const useUIStateStore = defineStore("uistate", () => {
state.introStateByKey.set(key, newState);
};
- const setEditorFormatStatementOnSave = (value: boolean) => {
- editorFormatStatementOnSave.value = value;
- };
-
const restoreState = () => {
const storedCollapseState = localStorage.getItem(COLLAPSE_MODULE_KEY.value);
const collapseState = storedCollapseState
@@ -91,9 +77,7 @@ export const useUIStateStore = defineStore("uistate", () => {
return {
saveIntroStateByKey,
restoreState,
- setEditorFormatStatementOnSave,
getIntroStateByKey,
- editorFormatStatementOnSave,
};
});
diff --git a/frontend/src/views/project/ProjectIssueDetail.vue b/frontend/src/views/project/ProjectIssueDetail.vue
index 3a355f5be6..b43135916e 100644
--- a/frontend/src/views/project/ProjectIssueDetail.vue
+++ b/frontend/src/views/project/ProjectIssueDetail.vue
@@ -72,17 +72,14 @@ const issueBaseContext = useBaseIssueContext({
issue,
});
-provideIssueContext(
- {
- isCreating,
- issue,
- ready,
- reInitialize,
- allowChange,
- ...issueBaseContext,
- },
- true /* root */
-);
+provideIssueContext({
+ isCreating,
+ issue,
+ ready,
+ reInitialize,
+ allowChange,
+ ...issueBaseContext,
+});
providePlanCheckRunContext(
{