Skip to content

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

Remove TaskContentBar and just move it to TaskContent

Tianzhou Chen48230ded1edf
diff --git a/frontend/src/views/TaskContent.vue b/frontend/src/views/TaskContent.vue
index 3fac2beffe..17c862ebde 100644
--- a/frontend/src/views/TaskContent.vue
+++ b/frontend/src/views/TaskContent.vue
@@ -1,14 +1,58 @@
<template>
+ <!-- Content Bar -->
+ <div class="flex justify-end space-x-3">
+ <button
+ v-if="!state.edit"
+ type="button"
+ class="btn-normal"
+ @click.prevent="beginEdit"
+ >
+ <!-- Heroicon name: solid/pencil -->
+ <svg
+ class="-ml-1 mr-2 h-5 w-5 text-gray-400"
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 20 20"
+ fill="currentColor"
+ aria-hidden="true"
+ >
+ <path
+ d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"
+ />
+ </svg>
+ <span>Edit</span>
+ </button>
+ <button
+ v-if="state.edit"
+ type="button"
+ class="btn-cancel"
+ @click.prevent="cancelEdit"
+ >
+ Cancel
+ </button>
+ <button
+ v-if="state.edit"
+ type="button"
+ class="btn-normal"
+ @click.prevent="saveEdit"
+ >
+ Save
+ </button>
+ </div>
+ <!-- Content -->
<h2 class="sr-only">Description</h2>
- <div class="prose max-w-none whitespace-pre-line" ref="taskContent">
+ <div class="mt-2 prose max-w-none whitespace-pre-line" ref="taskContent">
{{ task.attributes.content }}
</div>
</template>
<script lang="ts">
-import { nextTick, onMounted, PropType, ref } from "vue";
+import { nextTick, onMounted, PropType, ref, reactive } from "vue";
import { Task } from "../types";
+interface LocalState {
+ edit: boolean;
+}
+
export default {
name: "TaskContent",
props: {
@@ -20,6 +64,11 @@ export default {
components: {},
setup(props, ctx) {
const taskContent = ref(null);
+
+ const state = reactive<LocalState>({
+ edit: false,
+ });
+
onMounted(() => {
nextTick(() => {
// Set focus
@@ -27,8 +76,24 @@ export default {
});
});
+ const beginEdit = () => {
+ state.edit = true;
+ };
+
+ const saveEdit = () => {
+ state.edit = false;
+ };
+
+ const cancelEdit = () => {
+ state.edit = false;
+ };
+
return {
+ state,
taskContent,
+ beginEdit,
+ saveEdit,
+ cancelEdit,
};
},
};
diff --git a/frontend/src/views/TaskContentBar.vue b/frontend/src/views/TaskContentBar.vue
deleted file mode 100644
index 8cbcfe1ecc..0000000000
--- a/frontend/src/views/TaskContentBar.vue
+++ /dev/null
@@ -1,62 +0,0 @@
-<template>
- <div
- class="md:flex md:items-center md:justify-end md:space-x-4 lg:border-b lg:pb-6"
- >
- <div></div>
- <div class="mt-4 flex space-x-3 md:mt-0">
- <button
- type="button"
- class="inline-flex justify-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-900"
- >
- <!-- Heroicon name: solid/pencil -->
- <svg
- class="-ml-1 mr-2 h-5 w-5 text-gray-400"
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 20 20"
- fill="currentColor"
- aria-hidden="true"
- >
- <path
- d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"
- />
- </svg>
- <span>Edit</span>
- </button>
- <button
- type="button"
- class="inline-flex justify-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-900"
- >
- <!-- Heroicon name: solid/bell -->
- <svg
- class="-ml-1 mr-2 h-5 w-5 text-gray-400"
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 20 20"
- fill="currentColor"
- aria-hidden="true"
- >
- <path
- d="M10 2a6 6 0 00-6 6v3.586l-.707.707A1 1 0 004 14h12a1 1 0 00.707-1.707L16 11.586V8a6 6 0 00-6-6zM10 18a3 3 0 01-3-3h6a3 3 0 01-3 3z"
- />
- </svg>
- <span>Subscribe</span>
- </button>
- </div>
- </div>
-</template>
-
-<script lang="ts">
-import { PropType } from "vue";
-import { Task } from "../types";
-
-export default {
- name: "TaskToolbar",
- props: {
- task: {
- required: true,
- type: Object as PropType<Task>,
- },
- },
- components: {},
- setup(props, ctx) {},
-};
-</script>
diff --git a/frontend/src/views/TaskDetail.vue b/frontend/src/views/TaskDetail.vue
index f722448ff1..e976ebbf44 100644
--- a/frontend/src/views/TaskDetail.vue
+++ b/frontend/src/views/TaskDetail.vue
@@ -63,7 +63,6 @@
class="py-4 flex flex-col flex-1 min-w-0 lg:col-span-2 lg:pr-8 lg:border-r lg:border-gray-200"
>
<div>
- <TaskContentBar v-if="false" :task="state.task" />
<TaskSidebar
class="lg:hidden"
:task="state.task"
@@ -121,7 +120,6 @@ 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 TaskContentBar from "../views/TaskContentBar.vue";
import TaskContent from "../views/TaskContent.vue";
import TaskActivityPanel from "../views/TaskActivityPanel.vue";
import TaskSidebar from "../views/TaskSidebar.vue";
@@ -241,7 +239,6 @@ export default {
TaskHighlightPanel,
TaskFlow,
TaskOutputPanel,
- TaskContentBar,
TaskContent,
TaskActivityPanel,
TaskSidebar,