Skip to content

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

Use upper case for style parameter, also fix the style rendering condition

Tianzhou Chend7cc9a4f2bc9
diff --git a/frontend/src/bbkit/BBAlert.vue b/frontend/src/bbkit/BBAlert.vue
index 2da25c3353..0fa1c4cd6a 100644
--- a/frontend/src/bbkit/BBAlert.vue
+++ b/frontend/src/bbkit/BBAlert.vue
@@ -45,7 +45,7 @@
>
<div>
<div
- v-if="style == 'success'"
+ v-if="style == 'SUCCESS'"
class="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100"
>
<svg
@@ -65,7 +65,7 @@
</svg>
</div>
<div
- v-if="style == 'warning'"
+ v-else-if="style == 'WARN'"
class="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-yellow-100"
>
<svg
@@ -84,7 +84,7 @@
</svg>
</div>
<div
- v-if="style == 'critical'"
+ v-else-if="style == 'CRITICAL'"
class="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-red-100"
>
<svg
@@ -160,7 +160,7 @@
</template>
<script lang="ts">
-import { onMounted } from "vue";
+import { onMounted, PropType } from "vue";
export default {
name: "BBAlert",
@@ -171,7 +171,7 @@ export default {
type: Boolean,
},
style: {
- default: "info",
+ default: Object as PropType<"INFO" | "SUCCESS" | "WARN" | "CRITICAL">,
type: String,
},
title: {
@@ -215,10 +215,10 @@ export default {
});
const buttonStyleMap: Record<string, string> = {
- info: "bg-blue-600 hover:bg-blue-700",
- success: "bg-blue-600 hover:bg-blue-700",
- warning: "bg-red-600 hover:bg-red-700",
- critical: "bg-red-600 hover:bg-red-700",
+ INFO: "bg-blue-600 hover:bg-blue-700",
+ SUCCESS: "bg-blue-600 hover:bg-blue-700",
+ WARN: "bg-red-600 hover:bg-red-700",
+ CRITICAL: "bg-red-600 hover:bg-red-700",
};
const okButtonStyle = buttonStyleMap[props.style];
diff --git a/frontend/src/views/EnvironmentDetail.vue b/frontend/src/views/EnvironmentDetail.vue
index 4936c271cc..dfc5bdf65e 100644
--- a/frontend/src/views/EnvironmentDetail.vue
+++ b/frontend/src/views/EnvironmentDetail.vue
@@ -7,7 +7,7 @@
/>
<BBAlert
:showing="state.showDeleteModal"
- :style="'critical'"
+ :style="'CRITICAL'"
:okText="'Delete'"
:title="
'Delete environment \'' + state.environment.attributes.name + '\' ?'