Skip to content

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

Changed task content to task description

Tianzhou Chen7b0aa40f26fb
diff --git a/frontend/src/miragejs/factories/task.js b/frontend/src/miragejs/factories/task.js
index a243211931..fd1c97d916 100644
--- a/frontend/src/miragejs/factories/task.js
+++ b/frontend/src/miragejs/factories/task.js
@@ -28,7 +28,7 @@ export default {
type() {
return "bytebase.datasource.create";
},
- content() {
+ description() {
return faker.fake("{{lorem.paragraphs}}");
},
stageProgressList() {
diff --git a/frontend/src/miragejs/factories/taskPatch.js b/frontend/src/miragejs/factories/taskPatch.js
index 01953af150..1fa2bf5b1e 100644
--- a/frontend/src/miragejs/factories/taskPatch.js
+++ b/frontend/src/miragejs/factories/taskPatch.js
@@ -15,7 +15,7 @@ export default {
status() {
return "RUNNING";
},
- content() {
+ description() {
return faker.fake("{{lorem.paragraphs}}");
},
assignee() {
diff --git a/frontend/src/miragejs/routes/index.js b/frontend/src/miragejs/routes/index.js
index 478709e434..94876cb22d 100644
--- a/frontend/src/miragejs/routes/index.js
+++ b/frontend/src/miragejs/routes/index.js
@@ -140,12 +140,12 @@ export default function routes() {
}
// Empty string is valid
- if (attrs.content !== undefined) {
- if (task.content != attrs.content) {
+ if (attrs.description !== undefined) {
+ if (task.description != attrs.description) {
changeList.push({
- fieldId: TaskBuiltinFieldId.CONTENT,
- oldValue: task.content,
- newValue: attrs.content,
+ fieldId: TaskBuiltinFieldId.DESCRIPTION,
+ oldValue: task.description,
+ newValue: attrs.description,
});
}
}
diff --git a/frontend/src/plugins/task/template.ts b/frontend/src/plugins/task/template.ts
index 8baf45ccb3..51972efd00 100644
--- a/frontend/src/plugins/task/template.ts
+++ b/frontend/src/plugins/task/template.ts
@@ -15,7 +15,7 @@ const allTaskTemplateList: TaskTemplate[] = [
attributes: {
name: "New General Task",
type: "bytebase.general",
- content: "",
+ description: "",
stageProgressList: [
{
id: "1",
@@ -41,7 +41,7 @@ const allTaskTemplateList: TaskTemplate[] = [
attributes: {
name: "New Data Source",
type: "bytebase.datasource.create",
- content: "Estimated QPS: 10",
+ description: "Estimated QPS: 10",
stageProgressList: [
{
id: "1",
@@ -105,7 +105,7 @@ const allTaskTemplateList: TaskTemplate[] = [
attributes: {
name: "Update Schema",
type: "bytebase.datasource.schema.update",
- content: "DDL: ",
+ description: "DDL: ",
stageProgressList: ctx.environmentList.map((env) => {
return {
id: env.id,
diff --git a/frontend/src/plugins/types.ts b/frontend/src/plugins/types.ts
index 22c0a49bbf..030227505d 100644
--- a/frontend/src/plugins/types.ts
+++ b/frontend/src/plugins/types.ts
@@ -6,7 +6,7 @@ export type TaskFieldId = number;
export enum TaskBuiltinFieldId {
STATUS = 10000,
ASSIGNEE = 10001,
- CONTENT = 10002,
+ DESCRIPTION = 10002,
}
export type TaskFieldType = "String" | "Environment";
diff --git a/frontend/src/types/bytebase.ts b/frontend/src/types/bytebase.ts
index 08f6bfefc7..5f93f82a16 100644
--- a/frontend/src/types/bytebase.ts
+++ b/frontend/src/types/bytebase.ts
@@ -87,7 +87,7 @@ export type Task = ResourceObject & {
status: TaskStatus;
category: "DDL" | "DML" | "OPS";
type: TaskType;
- content: string;
+ description: string;
stageProgressList: StageProgress[];
creator: {
id: string;
@@ -106,7 +106,7 @@ export type TaskNew = Omit<ResourceObject, "id"> & {
attributes: {
name: string;
type: TaskType;
- content: string;
+ description: string;
stageProgressList: StageProgress[];
creator: {
id: string;
@@ -123,7 +123,7 @@ export type TaskNew = Omit<ResourceObject, "id"> & {
export type TaskPatch = {
name?: string;
status?: TaskStatus;
- content?: string;
+ description?: string;
assignee?: {
id: string;
name: string;
diff --git a/frontend/src/views/TaskActivityPanel.vue b/frontend/src/views/TaskActivityPanel.vue
index a7744d5dcc..2ece9799a2 100644
--- a/frontend/src/views/TaskActivityPanel.vue
+++ b/frontend/src/views/TaskActivityPanel.vue
@@ -463,7 +463,7 @@ export default {
name = "Assignee";
oldValue = update.oldValue;
newValue = update.newValue;
- } else if (update.fieldId == TaskBuiltinFieldId.CONTENT) {
+ } else if (update.fieldId == TaskBuiltinFieldId.DESCRIPTION) {
name = "Description";
} else {
const field = fieldFromId(props.taskTemplate, update.fieldId);
diff --git a/frontend/src/views/TaskContent.vue b/frontend/src/views/TaskDescription.vue
similarity index 76%
rename from frontend/src/views/TaskContent.vue
rename to frontend/src/views/TaskDescription.vue
index 2351df9c6a..cc8feeeec4 100644
--- a/frontend/src/views/TaskContent.vue
+++ b/frontend/src/views/TaskDescription.vue
@@ -1,5 +1,5 @@
<template>
- <!-- Content Bar -->
+ <!-- Description Bar -->
<div v-if="!$props.new" class="flex justify-end space-x-2">
<button
v-if="!state.edit"
@@ -33,18 +33,18 @@
v-if="state.edit"
type="button"
class="mt-0.5 px-3 border border-control-border rounded-sm text-control bg-control-bg hover:bg-control-bg-hover disabled:bg-control-bg disabled:opacity-50 disabled:cursor-not-allowed text-sm leading-5 font-normal focus:ring-control focus:outline-none focus-visible:ring-2 focus:ring-offset-2"
- :disabled="editContent == task.attributes.content"
+ :disabled="editDescription == task.attributes.description"
@click.prevent="saveEdit"
>
Save
</button>
</div>
- <!-- Content -->
- <label for="content" class="sr-only">Edit Description</label>
+ <!-- Description -->
+ <label for="description" class="sr-only">Edit Description</label>
<!-- Use border-white focus:border-white to have the invisible border width
otherwise it will have 1px jiggling switching between focus/unfocus state -->
<textarea
- ref="editContentTextArea"
+ ref="editDescriptionTextArea"
rows="5"
class="mt-4 w-full resize-none whitespace-pre-wrap border-white focus:border-white outline-none"
:class="state.edit ? 'focus:ring-control focus-visible:ring-2' : ''"
@@ -55,7 +55,7 @@
"
placeholder="Add some description..."
:readonly="!state.edit"
- v-model="editContent"
+ v-model="editDescription"
@input="
(e) => {
sizeToFit(e.target);
@@ -87,8 +87,8 @@ interface LocalState {
}
export default {
- name: "TaskContent",
- emits: ["update-content"],
+ name: "TaskDescription",
+ emits: ["update-description"],
props: {
task: {
required: true,
@@ -101,19 +101,22 @@ export default {
},
components: {},
setup(props, { emit }) {
- const editContent = ref(props.task.attributes.content);
- const editContentTextArea = ref();
+ const editDescription = ref(props.task.attributes.description);
+ const editDescriptionTextArea = ref();
const state = reactive<LocalState>({
edit: false,
});
const keyboardHandler = (e: KeyboardEvent) => {
- if (state.edit && editContentTextArea.value === document.activeElement) {
+ if (
+ state.edit &&
+ editDescriptionTextArea.value === document.activeElement
+ ) {
if (e.code == "Escape") {
cancelEdit();
} else if (e.code == "Enter" && e.metaKey) {
- if (editContent.value != props.task.attributes.content) {
+ if (editDescription.value != props.task.attributes.description) {
saveEdit();
}
}
@@ -123,10 +126,10 @@ export default {
onMounted(() => {
document.addEventListener("keydown", keyboardHandler);
nextTick(() => {
- sizeToFit(editContentTextArea.value);
+ sizeToFit(editDescriptionTextArea.value);
if (props.new) {
state.edit = true;
- editContentTextArea.value.focus();
+ editDescriptionTextArea.value.focus();
}
});
});
@@ -146,35 +149,35 @@ export default {
);
const beginEdit = () => {
- editContent.value = props.task.attributes.content;
+ editDescription.value = props.task.attributes.description;
state.edit = true;
nextTick(() => {
- editContentTextArea.value.focus();
+ editDescriptionTextArea.value.focus();
});
};
const saveEdit = () => {
- emit("update-content", editContent.value, (updatedTask: Task) => {
+ emit("update-description", editDescription.value, (updatedTask: Task) => {
state.edit = false;
- editContent.value = updatedTask.attributes.content;
+ editDescription.value = updatedTask.attributes.description;
nextTick(() => {
- sizeToFit(editContentTextArea.value);
+ sizeToFit(editDescriptionTextArea.value);
});
});
};
const cancelEdit = () => {
state.edit = false;
- editContent.value = props.task.attributes.content;
+ editDescription.value = props.task.attributes.description;
nextTick(() => {
- sizeToFit(editContentTextArea.value);
+ sizeToFit(editDescriptionTextArea.value);
});
};
return {
state,
- editContent,
- editContentTextArea,
+ editDescription,
+ editDescriptionTextArea,
beginEdit,
saveEdit,
cancelEdit,
diff --git a/frontend/src/views/TaskDetail.vue b/frontend/src/views/TaskDetail.vue
index bfea08179d..14ce9081ed 100644
--- a/frontend/src/views/TaskDetail.vue
+++ b/frontend/src/views/TaskDetail.vue
@@ -72,10 +72,10 @@
@update-custom-field="updateCustomField"
/>
<div class="lg:hidden my-4 border-t border-block-border" />
- <TaskContent
+ <TaskDescription
:task="state.task"
:new="state.new"
- @update-content="updateContent"
+ @update-description="updateDescription"
/>
</div>
<section
@@ -129,7 +129,7 @@ import { idFromSlug, taskSlug, activeStage } from "../utils";
import TaskHighlightPanel from "../views/TaskHighlightPanel.vue";
import TaskFlow from "../views/TaskFlow.vue";
import TaskOutputPanel from "../views/TaskOutputPanel.vue";
-import TaskContent from "../views/TaskContent.vue";
+import TaskDescription from "../views/TaskDescription.vue";
import TaskActivityPanel from "../views/TaskActivityPanel.vue";
import TaskSidebar from "../views/TaskSidebar.vue";
import {
@@ -248,7 +248,7 @@ export default {
TaskHighlightPanel,
TaskFlow,
TaskOutputPanel,
- TaskContent,
+ TaskDescription,
TaskActivityPanel,
TaskSidebar,
},
@@ -324,13 +324,13 @@ export default {
document.getElementById("task-detail-top")!.scrollIntoView();
});
- const updateContent = (
- newContent: string,
+ const updateDescription = (
+ newDescription: string,
postUpdated: (updatedTask: Task) => void
) => {
patchTask(
{
- content: newContent,
+ description: newDescription,
},
postUpdated
);
@@ -484,7 +484,7 @@ export default {
return {
state,
modalState,
- updateContent,
+ updateDescription,
updateTaskStatus,
updateCustomField,
doCreate,