Skip to content

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

chore: always show task list section (#14886)

boojackd77080d873f1
diff --git a/frontend/src/components/IssueV1/components/StageSection/StageCard.vue b/frontend/src/components/IssueV1/components/StageSection/StageCard.vue
index a5317a2f6e..993bed674d 100644
--- a/frontend/src/components/IssueV1/components/StageSection/StageCard.vue
+++ b/frontend/src/components/IssueV1/components/StageSection/StageCard.vue
@@ -9,15 +9,13 @@
<div class="text" @click="handleClickStage">
<div
- class="text-sm min-w-32 lg:min-w-fit with-underline space-x-1 whitespace-nowrap"
+ class="text-sm min-w-32 lg:min-w-fit with-underline whitespace-nowrap"
>
<heroicons:arrow-small-right
v-if="isActiveStage"
- class="w-5 h-5 inline-block mb-0.5"
+ class="w-5 h-5 inline-block mb-0.5 mr-1"
/>
- <span>{{ $t("common.stage") }}</span>
- <span>-</span>
- <span>{{ stageTitle }}</span>
+ <span>{{ $t("common.stage") }}</span> - <span>{{ stageTitle }}</span>
</div>
<div class="text-xs flex gap-1 flex-row items-center">
<div class="whitespace-no-wrap with-underline">
@@ -188,7 +186,7 @@ const handleClickStage = () => {
<style scoped lang="postcss">
.stage {
- @apply cursor-default flex items-center justify-start w-full text-sm font-medium relative;
+ @apply cursor-default flex items-center justify-start w-full text-sm relative;
@apply lg:flex-1;
}
.stage.selected .text .with-underline {
diff --git a/frontend/src/components/IssueV1/components/StageSection/StageInfo/DatabaseInfo.vue b/frontend/src/components/IssueV1/components/StageSection/StageInfo/DatabaseInfo.vue
deleted file mode 100644
index f9a1d58cb5..0000000000
--- a/frontend/src/components/IssueV1/components/StageSection/StageInfo/DatabaseInfo.vue
+++ /dev/null
@@ -1,140 +0,0 @@
-<template>
- <div class="flex items-center flex-wrap gap-1">
- <InstanceV1Name
- v-if="databaseCreationStatus === 'EXISTED'"
- :instance="coreDatabaseInfo.instanceResource"
- :plain="true"
- :link="link"
- >
- <template
- v-if="
- database && instanceEnvironment.name !== database.effectiveEnvironment
- "
- #prefix
- >
- <EnvironmentV1Name
- :environment="instanceEnvironment"
- :plain="true"
- :show-icon="false"
- :link="link"
- text-class="text-control-light"
- />
- </template>
- </InstanceV1Name>
- <span v-else>
- <!-- For creating database issues, we will only show the resource id of target instance. -->
- {{ extractInstanceResourceName(selectedTask.target) }}
- </span>
-
- <heroicons-outline:chevron-right class="text-control-light" />
-
- <div class="flex items-center gap-x-1">
- <heroicons-outline:database />
-
- <template
- v-if="
- databaseCreationStatus === 'EXISTED' ||
- databaseCreationStatus === 'CREATED'
- "
- >
- <EnvironmentV1Name
- :environment="coreDatabaseInfo.effectiveEnvironmentEntity"
- :plain="true"
- :show-icon="false"
- :link="link"
- text-class="text-control-light"
- />
-
- <DatabaseV1Name
- :database="coreDatabaseInfo"
- :plain="true"
- :link="link"
- :show-not-found="true"
- />
- </template>
- <span v-else>
- {{ coreDatabaseInfo.databaseName }}
- </span>
-
- <span
- v-if="databaseCreationStatus !== 'EXISTED'"
- class="text-control-light"
- >
- {{
- databaseCreationStatus === "CREATED"
- ? $t("task.database-create.created")
- : $t("task.database-create.pending")
- }}
- </span>
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computedAsync } from "@vueuse/core";
-import { computed } from "vue";
-import { databaseForTask, useIssueContext } from "@/components/IssueV1/logic";
-import {
- DatabaseV1Name,
- EnvironmentV1Name,
- InstanceV1Name,
-} from "@/components/v2";
-import { useDatabaseV1Store, useEnvironmentV1Store } from "@/store";
-import { isValidDatabaseName, unknownEnvironment } from "@/types";
-import { Task_Status, Task_Type } from "@/types/proto/v1/rollout_service";
-import { extractInstanceResourceName } from "@/utils";
-
-type DatabaseCreationStatus = "EXISTED" | "PENDING_CREATE" | "CREATED";
-
-withDefaults(
- defineProps<{
- link?: boolean;
- }>(),
- {
- link: true,
- }
-);
-
-const { issue, selectedTask } = useIssueContext();
-
-const coreDatabaseInfo = computed(() => {
- return databaseForTask(issue.value, selectedTask.value);
-});
-
-const databaseCreationStatus = computed((): DatabaseCreationStatus => {
- const task = selectedTask.value;
-
- // For database create task, see if its task status is "DONE"
- if (task.type === Task_Type.DATABASE_CREATE) {
- if (task.status === Task_Status.DONE) return "CREATED";
- else return "PENDING_CREATE";
- }
-
- return "EXISTED";
-});
-
-const database = computedAsync(async () => {
- const maybeExistedDatabase = coreDatabaseInfo.value;
- if (isValidDatabaseName(maybeExistedDatabase.name)) {
- return maybeExistedDatabase;
- }
- if (databaseCreationStatus.value === "CREATED") {
- const name = coreDatabaseInfo.value.name;
- const maybeCreatedDatabase =
- await useDatabaseV1Store().getOrFetchDatabaseByName(name);
- if (isValidDatabaseName(maybeCreatedDatabase.name)) {
- return maybeCreatedDatabase;
- }
- }
- return undefined;
-}, undefined);
-
-const instanceEnvironment = computed(() => {
- if (!database.value) return unknownEnvironment();
- return (
- useEnvironmentV1Store().getEnvironmentByName(
- database.value.instanceResource.environment
- ) ?? unknownEnvironment()
- );
-});
-</script>
diff --git a/frontend/src/components/IssueV1/components/StageSection/StageInfo/StageInfo.vue b/frontend/src/components/IssueV1/components/StageSection/StageInfo/StageInfo.vue
deleted file mode 100644
index 7db606d77d..0000000000
--- a/frontend/src/components/IssueV1/components/StageSection/StageInfo/StageInfo.vue
+++ /dev/null
@@ -1,18 +0,0 @@
-<template>
- <div
- class="flex flex-col lg:flex-row lg:flex-wrap lg:items-center justify-start gap-y-2 gap-x-4 text-sm"
- >
- <StageSelect />
- <DatabaseInfo :link="!disallowNavigateToConsole" />
- </div>
-</template>
-
-<script setup lang="ts">
-import { useAppFeature } from "@/store";
-import DatabaseInfo from "./DatabaseInfo.vue";
-import StageSelect from "./StageSelect.vue";
-
-const disallowNavigateToConsole = useAppFeature(
- "bb.feature.disallow-navigate-to-console"
-);
-</script>
diff --git a/frontend/src/components/IssueV1/components/StageSection/StageInfo/StageSelect.vue b/frontend/src/components/IssueV1/components/StageSection/StageInfo/StageSelect.vue
deleted file mode 100644
index 099f3764a2..0000000000
--- a/frontend/src/components/IssueV1/components/StageSection/StageInfo/StageSelect.vue
+++ /dev/null
@@ -1,79 +0,0 @@
-<template>
- <div class="flex items-center gap-x-2">
- <div class="textlabel">
- {{ $t("common.stage") }}
- </div>
- <NSelect
- :value="selectedStage.name"
- :options="options"
- :render-label="renderLabel"
- style="width: 12rem"
- @update-value="handleSelectStage"
- />
- </div>
-</template>
-
-<script setup lang="ts">
-import { first } from "lodash-es";
-import type { SelectOption } from "naive-ui";
-import { NSelect } from "naive-ui";
-import { computed, h } from "vue";
-import { useI18n } from "vue-i18n";
-import { EMPTY_TASK_NAME } from "@/types";
-import type { Stage } from "@/types/proto/v1/rollout_service";
-import { activeTaskInStageV1 } from "@/utils";
-import { useIssueContext } from "../../../logic";
-
-type StageSelectOption = SelectOption & {
- stage: Stage;
-};
-
-const { t } = useI18n();
-const { isCreating, issue, selectedStage, events } =
- useIssueContext();
-
-const stageList = computed(() => issue.value.rolloutEntity?.stages || []);
-
-const options = computed(() => {
- return stageList.value.map<StageSelectOption>((stage) => ({
- value: stage.name,
- label: stage.title,
- stage,
- }));
-});
-
-const renderLabel = (option: SelectOption) => {
- const { stage } = option as StageSelectOption;
-
- const text =
- !isCreating.value && stage === selectedStage.value
- ? t("issue.stage-select.current", { name: stage.title })
- : stage.title;
- return h("div", { class: "flex items-center gap-x-1" }, [
- h("span", {}, text),
- ]);
-};
-
-const activeOrFirstTaskInStage = (stage: Stage) => {
- if (isCreating.value) {
- return first(stage.tasks);
- }
- const activeTask = activeTaskInStageV1(stage);
- if (activeTask.name === EMPTY_TASK_NAME) {
- return first(stage.tasks);
- }
- return activeTask;
-};
-
-const handleSelectStage = (name: string) => {
- const stage = stageList.value.find((s) => s.name === name);
- if (stage === selectedStage.value) return;
-
- if (stage) {
- const task = activeOrFirstTaskInStage(stage);
- if (task) {
- events.emit("select-task", { task });
- }
- }
-};
-</script>
diff --git a/frontend/src/components/IssueV1/components/StageSection/StageInfo/index.ts b/frontend/src/components/IssueV1/components/StageSection/StageInfo/index.ts
deleted file mode 100644
index a45c5c2960..0000000000
--- a/frontend/src/components/IssueV1/components/StageSection/StageInfo/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import StageInfo from "./StageInfo.vue";
-
-export default StageInfo;
diff --git a/frontend/src/components/IssueV1/components/StageSection/StageSection.vue b/frontend/src/components/IssueV1/components/StageSection/StageSection.vue
index 3f189f48db..cd4ecba269 100644
--- a/frontend/src/components/IssueV1/components/StageSection/StageSection.vue
+++ b/frontend/src/components/IssueV1/components/StageSection/StageSection.vue
@@ -39,8 +39,6 @@
</div>
</NScrollbar>
</div>
-
- <StageInfo class="px-4 py-2" />
</template>
<template v-else>
<NoPermissionPlaceholder
@@ -60,7 +58,6 @@ import NoDataPlaceholder from "@/components/misc/NoDataPlaceholder.vue";
import NoPermissionPlaceholder from "@/components/misc/NoPermissionPlaceholder.vue";
import { hasProjectPermissionV2 } from "@/utils";
import StageCard from "./StageCard.vue";
-import StageInfo from "./StageInfo";
const { isCreating, issue } = useIssueContext();
diff --git a/frontend/src/components/IssueV1/components/TaskListSection/TaskCard.vue b/frontend/src/components/IssueV1/components/TaskListSection/TaskCard.vue
index fc6c77bbc4..88fd80fd5a 100644
--- a/frontend/src/components/IssueV1/components/TaskListSection/TaskCard.vue
+++ b/frontend/src/components/IssueV1/components/TaskListSection/TaskCard.vue
@@ -129,7 +129,7 @@ const onClickTask = (task: Task) => {
<style scoped lang="postcss">
.task.selected {
- @apply border-info;
+ @apply border-info bg-info bg-opacity-5;
}
.task .name {
@apply whitespace-pre-wrap break-all;
diff --git a/frontend/src/components/IssueV1/components/TaskListSection/TaskListSection.vue b/frontend/src/components/IssueV1/components/TaskListSection/TaskListSection.vue
index 8de9779da1..3655799e38 100644
--- a/frontend/src/components/IssueV1/components/TaskListSection/TaskListSection.vue
+++ b/frontend/src/components/IssueV1/components/TaskListSection/TaskListSection.vue
@@ -1,5 +1,5 @@
<template>
- <div v-if="shouldShowTaskBar" class="relative">
+ <div class="relative">
<div
ref="taskBar"
class="task-list gap-2 px-4 py-2 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 3xl:grid-cols-5 4xl:grid-cols-6 overflow-y-auto"
@@ -25,17 +25,11 @@ import TaskCard from "./TaskCard.vue";
// 3 * lines of cards + 2 * top and bottom padding + 2 * horizontal gaps + jitter
const MAX_LIST_HEIGHT = 207;
-const { issue, selectedStage } = useIssueContext();
+const { selectedStage } = useIssueContext();
const taskBar = ref<HTMLDivElement>();
const taskBarScrollState = useVerticalScrollState(taskBar, MAX_LIST_HEIGHT);
-const rollout = computed(() => issue.value.rolloutEntity);
const taskList = computed(() => selectedStage.value.tasks);
-
-// Show the task bar when some of the stages have more than one tasks.
-const shouldShowTaskBar = computed(() => {
- return rollout.value?.stages.some((stage) => stage.tasks.length > 1);
-});
</script>
<style scoped lang="postcss">