Skip to content

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

chore: tweak workspace setting styles (#17069)

boojack8b21f0622aba
diff --git a/frontend/src/components/GeneralSetting/DomainRestrictionSetting.vue b/frontend/src/components/GeneralSetting/DomainRestrictionSetting.vue
index 25f9499422..fe24b3a772 100644
--- a/frontend/src/components/GeneralSetting/DomainRestrictionSetting.vue
+++ b/frontend/src/components/GeneralSetting/DomainRestrictionSetting.vue
@@ -12,36 +12,19 @@
{{ $t("settings.general.workspace.domain-restriction.description") }}
</p>
<div class="w-full flex flex-col gap-2 mt-2">
- <div
- v-for="(domain, i) in state.domains"
- :key="i"
- class="w-full flex items-center justify-center space-x-1"
- >
- <NInput
- :value="domain"
- :disabled="!allowEdit"
- :placeholder="
- $t(
- 'settings.general.workspace.domain-restriction.domain-input-placeholder'
- )
- "
- type="text"
- @update:value="($event) => updateDomain(i, $event)"
- />
- <NButton quaternary size="small" @click="removeDomain(i)">
- <template #icon>
- <XIcon class="w-4" />
- </template>
- </NButton>
- </div>
- <div>
- <NButton tertiary size="small" @click="addDomain">
- <template #icon>
- <PlusIcon class="w-4" />
- </template>
- Add domain
- </NButton>
- </div>
+ <NDynamicTags
+ :size="'large'"
+ :disabled="!allowEdit"
+ :value="state.domains"
+ :input-props="{
+ placeholder: $t(
+ 'settings.general.workspace.domain-restriction.domain-input-placeholder'
+ ),
+ clearable: true,
+ }"
+ :input-style="'min-width: 20rem;'"
+ @update:value="onDomainsUpdate"
+ />
<div class="w-full flex flex-row justify-between items-center">
<NCheckbox
@@ -75,8 +58,7 @@
import { create } from "@bufbuild/protobuf";
import { FieldMaskSchema } from "@bufbuild/protobuf/wkt";
import { isEqual, cloneDeep } from "lodash-es";
-import { PlusIcon, XIcon } from "lucide-vue-next";
-import { NCheckbox, NInput, NButton } from "naive-ui";
+import { NCheckbox, NDynamicTags } from "naive-ui";
import { computed, reactive } from "vue";
import { featureToRef } from "@/store";
import { useSettingV1Store } from "@/store/modules/v1/setting";
@@ -112,16 +94,8 @@ const hasFeature = featureToRef(
PlanFeature.FEATURE_USER_EMAIL_DOMAIN_RESTRICTION
);
-const updateDomain = (index: number, domain: string) => {
- state.domains[index] = domain;
-};
-
-const addDomain = () => {
- state.domains.push("");
-};
-
-const removeDomain = (index: number) => {
- state.domains.splice(index, 1);
+const onDomainsUpdate = (values: string[]) => {
+ state.domains = values;
if (validDomains.value.length === 0) {
state.enableRestriction = false;
}
diff --git a/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue b/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue
index c2c812cd63..eb557324b3 100644
--- a/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue
+++ b/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue
@@ -7,14 +7,15 @@
<FeatureBadge :feature="PlanFeature.FEATURE_PASSWORD_RESTRICTIONS" />
</p>
<div class="w-full flex flex-col space-y-3">
- <div class="flex items-center space-x-2">
+ <div class="flex items-center">
<NInputNumber
:value="state.minLength"
:readonly="!allowEdit"
- class="w-24"
+ class="w-24 mr-2"
:min="1"
:placeholder="'Minimum length'"
:precision="0"
+ size="small"
@update:value="
(val) =>
onUpdate({
@@ -25,13 +26,11 @@
})
"
/>
- <span class="textlabel">
- {{
- $t("settings.general.workspace.password-restriction.min-length", {
- min: state.minLength || DEFAULT_MIN_LENGTH,
- })
- }}
- </span>
+ {{
+ $t("settings.general.workspace.password-restriction.min-length", {
+ min: state.minLength || DEFAULT_MIN_LENGTH,
+ })
+ }}
</div>
<NCheckbox
:checked="state.requireNumber"
@@ -42,11 +41,9 @@
}
"
>
- <span class="textlabel">
- {{
- $t("settings.general.workspace.password-restriction.require-number")
- }}
- </span>
+ {{
+ $t("settings.general.workspace.password-restriction.require-number")
+ }}
</NCheckbox>
<NCheckbox
:checked="state.requireLetter"
@@ -57,11 +54,9 @@
}
"
>
- <span class="textlabel">
- {{
- $t("settings.general.workspace.password-restriction.require-letter")
- }}
- </span>
+ {{
+ $t("settings.general.workspace.password-restriction.require-letter")
+ }}
</NCheckbox>
<NCheckbox
:checked="state.requireUppercaseLetter"
@@ -72,13 +67,11 @@
}
"
>
- <span class="textlabel">
- {{
- $t(
- "settings.general.workspace.password-restriction.require-uppercase-letter"
- )
- }}
- </span>
+ {{
+ $t(
+ "settings.general.workspace.password-restriction.require-uppercase-letter"
+ )
+ }}
</NCheckbox>
<NCheckbox
:checked="state.requireSpecialCharacter"
@@ -89,13 +82,11 @@
}
"
>
- <span class="textlabel">
- {{
- $t(
- "settings.general.workspace.password-restriction.require-special-character"
- )
- }}
- </span>
+ {{
+ $t(
+ "settings.general.workspace.password-restriction.require-special-character"
+ )
+ }}
</NCheckbox>
<NCheckbox
:checked="state.requireResetPasswordForFirstLogin"
@@ -106,13 +97,11 @@
}
"
>
- <span class="textlabel">
- {{
- $t(
- "settings.general.workspace.password-restriction.require-reset-password-for-first-login"
- )
- }}
- </span>
+ {{
+ $t(
+ "settings.general.workspace.password-restriction.require-reset-password-for-first-login"
+ )
+ }}
</NCheckbox>
<NCheckbox
:checked="!!state.passwordRotation"
@@ -136,7 +125,7 @@
<i18n-t
tag="div"
keypath="settings.general.workspace.password-restriction.password-rotation"
- class="flex items-center space-x-2 textlabel"
+ class="flex items-center space-x-2"
>
<template #day>
<NInputNumber