Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: run prettier through all frontend codes with the latest conf (#570)
Liu Jie5b81dd6c7ec
diff --git a/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue b/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vueindex 88534e90e6..c6291202f0 100644--- a/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue+++ b/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue@@ -68,20 +68,26 @@type="button"class="btn-normal py-2 px-4"@click.prevent="cancel"- >{{ $t("common.cancel") }}</button>+ >+ {{ $t("common.cancel") }}+ </button><buttonv-if="state.alterType == 'MULTI_DB'"class="btn-primary ml-3 inline-flex justify-center py-2 px-4":disabled="!allowGenerateMultiDb"@click.prevent="generateMultDb"- >{{ $t("common.next") }}</button>+ >+ {{ $t("common.next") }}+ </button><buttonv-if="isTenantProject || (!projectId && state.tab === 'tenant')"class="btn-primary ml-3 inline-flex justify-center py-2 px-4":disabled="!allowGenerateTenant"@click.prevent="generateTenant"- >{{ $t("common.next") }}</button>+ >+ {{ $t("common.next") }}+ </button></div></div>@@ -147,8 +153,11 @@ export default defineComponent({default: undefined,},type: {- type: String as PropType<"bb.issue.database.schema.update" | "bb.issue.database.data.update">,- }+ type: String as PropType<+ "bb.issue.database.schema.update" | "bb.issue.database.data.update"+ >,+ required: true,+ },},emits: ["dismiss"],setup(props, { emit }) {@@ -180,8 +189,8 @@ export default defineComponent({// Returns true if alter schema, false if change data.const isAlterSchema = computed((): boolean => {- return props.type === "bb.issue.database.schema.update"- })+ return props.type === "bb.issue.database.schema.update";+ });const isTenantProject = computed((): boolean => {return state.project?.tenantMode === "TENANT";@@ -262,9 +271,7 @@ export default defineComponent({});const generateTenant = async () => {- if (- !store.getters["subscription/feature"]("bb.feature.multi-tenancy")- ) {+ if (!store.getters["subscription/feature"]("bb.feature.multi-tenancy")) {state.showFeatureModal = true;return;}@@ -288,7 +295,9 @@ export default defineComponent({},query: {template: props.type,- name: `[${state.selectedDatabaseName}] ${isAlterSchema.value ? `Alter schema` : `Change data`}`,+ name: `[${state.selectedDatabaseName}] ${+ isAlterSchema.value ? `Alter schema` : `Change data`+ }`,project: project.id,databaseName: state.selectedDatabaseName,mode: "tenant",@@ -314,7 +323,9 @@ export default defineComponent({},query: {template: props.type,- name: `[${database.name}] ${isAlterSchema.value ? `Alter schema` : `Change data`}`,+ name: `[${database.name}] ${+ isAlterSchema.value ? `Alter schema` : `Change data`+ }`,project: database.project.id,databaseList: database.id,},diff --git a/frontend/src/components/DatabaseMigrationHistoryPanel.vue b/frontend/src/components/DatabaseMigrationHistoryPanel.vueindex a7612ea90f..ae6b1208fb 100644--- a/frontend/src/components/DatabaseMigrationHistoryPanel.vue+++ b/frontend/src/components/DatabaseMigrationHistoryPanel.vue@@ -1,17 +1,9 @@<template><div class="flex flex-col space-y-4"><div- class="- flex flex-row- items-center- text-lg- leading-6- font-medium- text-main- space-x-2- "+ class="flex flex-row items-center text-lg leading-6 font-medium text-main space-x-2">- {{ $t('migration-history.self') }}+ {{ $t("migration-history.self") }}<buttonv-if="allowEdit"type="button"@@ -19,10 +11,13 @@:disabled="state.migrationSetupStatus != 'OK'"@click.prevent="state.showBaselineModal = true">- {{ $t('migration-history.establish-baseline') }}+ {{ $t("migration-history.establish-baseline") }}</button><div>- <BBSpin v-if="state.loading" :title="$t('migration-history.refreshing-history')" />+ <BBSpin+ v-if="state.loading"+ :title="$t('migration-history.refreshing-history')"+ /></div></div><MigrationHistoryTable@@ -34,7 +29,9 @@v-else:style="`WARN`":title="attentionTitle"- :action-text="allowConfigInstance ? $t('migration-history.config-instance') : ''"+ :action-text="+ allowConfigInstance ? $t('migration-history.config-instance') : ''+ "@click-action="configInstance"/></div>@@ -44,7 +41,11 @@:style="'INFO'":ok-text="$t('migration-history.establish-baseline')":cancel-text="$t('common.cancel')"- :title="$t('migration-history.establish-database-baseline', { name: database.name })"+ :title="+ $t('migration-history.establish-database-baseline', {+ name: database.name,+ })+ ":description="$t('migration-history.establish-baseline-description')"@ok="() => {@@ -142,17 +143,21 @@ export default {const attentionTitle = computed((): string => {if (state.migrationSetupStatus == "NOT_EXIST") {return (- t('migration-history.instance-missing-migration-schema', { name: props.database.instance.name }) ++ t("migration-history.instance-missing-migration-schema", {+ name: props.database.instance.name,+ }) +(isDBAOrOwner(currentUser.value.role)? ""- : " " + t('migration-history.contact-dba'))+ : " " + t("migration-history.contact-dba")));} else if (state.migrationSetupStatus == "UNKNOWN") {return (- t('migration-history.instance-bad-connection', { name: props.database.instance.name }) ++ t("migration-history.instance-bad-connection", {+ name: props.database.instance.name,+ }) +(isDBAOrOwner(currentUser.value.role)? ""- : " " + t('migration-history.contact-dba'))+ : " " + t("migration-history.contact-dba")));}return "";@@ -184,7 +189,9 @@ export default {},query: {template: "bb.issue.database.schema.baseline",- name: t('migration-history.establish-database-baseline', { name: props.database.name }),+ name: t("migration-history.establish-database-baseline", {+ name: props.database.name,+ }),project: props.database.project.id,databaseList: `${props.database.id}`,},diff --git a/frontend/src/components/DatabaseOverviewPanel.vue b/frontend/src/components/DatabaseOverviewPanel.vueindex 38f3c1f5a0..070a12a8a1 100644--- a/frontend/src/components/DatabaseOverviewPanel.vue+++ b/frontend/src/components/DatabaseOverviewPanel.vue@@ -13,7 +13,10 @@</div><AnomalyTable :anomaly-section-list="anomalySectionList" /></div>- <div v-else class="text-lg leading-6 font-medium text-main mb-4 flex flex-row">+ <div+ v-else+ class="text-lg leading-6 font-medium text-main mb-4 flex flex-row"+ >{{ $t("database.no-anomalies-detected") }}<heroicons-outline:check-circle class="ml-1 w-6 h-6 text-success" /></div>@@ -38,39 +41,59 @@</div><div class="col-span-1">- <dt class="text-sm font-medium text-control-light">{{ $t("db.collation") }}</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("db.collation") }}+ </dt><dd class="mt-1 text-sm text-main">{{ database.collation }}</dd></div></template><div class="col-span-1 col-start-1">- <dt class="text-sm font-medium text-control-light">{{ $t("database.sync-status") }}</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("database.sync-status") }}+ </dt><dd class="mt-1 text-sm text-main"><span>{{ database.syncStatus }}</span></dd></div><div class="col-span-1">- <dt class="text-sm font-medium text-control-light">{{ $t("database.last-successful-sync") }}</dt>- <dd class="mt-1 text-sm text-main">{{ humanizeTs(database.lastSuccessfulSyncTs) }}</dd>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("database.last-successful-sync") }}+ </dt>+ <dd class="mt-1 text-sm text-main">+ {{ humanizeTs(database.lastSuccessfulSyncTs) }}+ </dd></div><div class="col-span-1 col-start-1">- <dt class="text-sm font-medium text-control-light">{{ $t("common.created-at") }}</dt>- <dd class="mt-1 text-sm text-main">{{ humanizeTs(database.createdTs) }}</dd>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("common.created-at") }}+ </dt>+ <dd class="mt-1 text-sm text-main">+ {{ humanizeTs(database.createdTs) }}+ </dd></div><div class="col-span-1">- <dt class="text-sm font-medium text-control-light">{{ $t("common.updated-at") }}</dt>- <dd class="mt-1 text-sm text-main">{{ humanizeTs(database.updatedTs) }}</dd>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("common.updated-at") }}+ </dt>+ <dd class="mt-1 text-sm text-main">+ {{ humanizeTs(database.updatedTs) }}+ </dd></div></dl><div class="pt-6">- <div class="text-lg leading-6 font-medium text-main mb-4">{{ $t("db.tables") }}</div>+ <div class="text-lg leading-6 font-medium text-main mb-4">+ {{ $t("db.tables") }}+ </div><TableTable :table-list="tableList" />- <div class="mt-6 text-lg leading-6 font-medium text-main mb-4">{{ $t("db.views") }}</div>+ <div class="mt-6 text-lg leading-6 font-medium text-main mb-4">+ {{ $t("db.views") }}+ </div><ViewTable :view-list="viewList" /></div>@@ -88,29 +111,41 @@:key="index"><div v-if="item.list.length" class="pt-6">- <div v-if="hasDataSourceFeature" class="text-lg leading-6 font-medium text-main mb-4">+ <div+ v-if="hasDataSourceFeature"+ class="text-lg leading-6 font-medium text-main mb-4"+ ><span v-data-source-type>{{ item.type }}</span></div><div class="space-y-4"><div v-for="(ds, dsIndex) of item.list" :key="dsIndex"><div v-if="hasDataSourceFeature" class="relative mb-2">- <div class="absolute inset-0 flex items-center" aria-hidden="true">+ <div+ class="absolute inset-0 flex items-center"+ aria-hidden="true"+ ><div class="w-full border-t border-gray-300"></div></div><div class="relative flex justify-start"><router-link:to="`/db/${databaseSlug}/datasource/${dataSourceSlug(ds)}`"class="pr-3 bg-white font-medium normal-link"- >{{ ds.name }}</router-link>+ >{{ ds.name }}</router-link+ ></div></div>- <div v-if="allowChangeDataSource" class="flex justify-end space-x-3">+ <div+ v-if="allowChangeDataSource"+ class="flex justify-end space-x-3"+ ><template v-if="isEditingDataSource(ds)"><buttontype="button"class="btn-normal"@click.prevent="cancelEditDataSource"- >{{ $t("common.cancel") }}</button>+ >+ {{ $t("common.cancel") }}+ </button><buttontype="button"class="btn-normal"@@ -118,14 +153,22 @@@click.prevent="saveEditDataSource"><!-- Heroicon name: solid/save -->- <heroicons-solid:save class="-ml-1 mr-2 h-5 w-5 text-control-light" />+ <heroicons-solid:save+ class="-ml-1 mr-2 h-5 w-5 text-control-light"+ /><span>{{ $t("common.save") }}</span></button></template><template v-else>- <button type="button" class="btn-normal" @click.prevent="editDataSource(ds)">+ <button+ type="button"+ class="btn-normal"+ @click.prevent="editDataSource(ds)"+ ><!-- Heroicon name: solid/pencil -->- <heroicons-solid:pencil class="-ml-1 mr-2 h-5 w-5 text-control-light" />+ <heroicons-solid:pencil+ class="-ml-1 mr-2 h-5 w-5 text-control-light"+ /><span>{{ $t("common.edit") }}</span></button></template>diff --git a/frontend/src/components/DatabaseSelect.vue b/frontend/src/components/DatabaseSelect.vueindex e215d71765..ebcec8ce4c 100644--- a/frontend/src/components/DatabaseSelect.vue+++ b/frontend/src/components/DatabaseSelect.vue@@ -11,14 +11,14 @@><option disabled :selected="UNKNOWN_ID === state.selectedId"><template v-if="mode == 'INSTANCE' && instanceId == UNKNOWN_ID">- {{ $t('db.select-instance-first') }}+ {{ $t("db.select-instance-first") }}</template><templatev-else-if="mode == 'ENVIRONMENT' && environmentId == UNKNOWN_ID">- {{ $t('db.select-environment-first') }}+ {{ $t("db.select-environment-first") }}</template>- <template v-else> {{ $t('db.select') }} </template>+ <template v-else> {{ $t("db.select") }} </template></option><optionv-for="(database, index) in databaseList"diff --git a/frontend/src/components/EnvironmentSelect.vue b/frontend/src/components/EnvironmentSelect.vueindex 2575257f11..820812b07c 100644--- a/frontend/src/components/EnvironmentSelect.vue+++ b/frontend/src/components/EnvironmentSelect.vue@@ -3,13 +3,13 @@class="btn-select disabled:cursor-not-allowed":disabled="disabled"@change="- (e) => {+ (e: any) => {$emit('select-environment-id', parseInt(e.target.value));}"><option disabled :selected="undefined === state.selectedId">- {{ $t('environment.select') }}+ {{ $t("environment.select") }}</option><template v-for="(environment, index) in environmentList" :key="index"><option@@ -31,7 +31,7 @@</template><script lang="ts">-import { computed, reactive, watch } from "vue";+import { computed, defineComponent, reactive, watch } from "vue";import { useStore } from "vuex";import cloneDeep from "lodash-es/cloneDeep";import { Environment } from "../types";@@ -40,11 +40,12 @@ interface LocalState {selectedId?: number;}-export default {+export default defineComponent({name: "EnvironmentSelect",props: {selectedId: {type: Number,+ default: undefined,},selectDefault: {default: true,@@ -118,5 +119,5 @@ export default {environmentList,};},-};+});</script>diff --git a/frontend/src/components/EnvironmentTabFilter.vue b/frontend/src/components/EnvironmentTabFilter.vueindex 32383d7d69..5335633585 100644--- a/frontend/src/components/EnvironmentTabFilter.vue+++ b/frontend/src/components/EnvironmentTabFilter.vue@@ -15,7 +15,7 @@</template><script lang="ts">-import { computed, reactive, watch } from "vue";+import { computed, defineComponent, reactive, watch } from "vue";import { useStore } from "vuex";import cloneDeep from "lodash-es/cloneDeep";import { Environment } from "../types";@@ -26,12 +26,13 @@ interface LocalState {selectedIndex: number;}-export default {+export default defineComponent({name: "EnvironmentTabFilter",components: {},props: {selectedId: {type: Number,+ default: undefined,},},emits: ["select-environment"],@@ -69,7 +70,7 @@ export default {const tabItemList = computed((): BBTabFilterItem[] => {const list: BBTabFilterItem[] = [{- title: t('common.all'),+ title: t("common.all"),alert: false,},];@@ -90,5 +91,5 @@ export default {tabItemList,};},-};+});</script>diff --git a/frontend/src/components/EnvironmentTable.vue b/frontend/src/components/EnvironmentTable.vueindex f6f193a904..27c0c44c69 100644--- a/frontend/src/components/EnvironmentTable.vue+++ b/frontend/src/components/EnvironmentTable.vue@@ -46,16 +46,16 @@ export default {const COLUMN_LIST = [{- title: t('common.id'),+ title: t("common.id"),},{- title: t('common.name'),+ title: t("common.name"),},{- title: t('common.created-at'),+ title: t("common.created-at"),},{- title: t('common.updated-at'),+ title: t("common.updated-at"),},];diff --git a/frontend/src/components/InstanceSelect.vue b/frontend/src/components/InstanceSelect.vueindex d155dd1b9f..623b462933 100644--- a/frontend/src/components/InstanceSelect.vue+++ b/frontend/src/components/InstanceSelect.vue@@ -3,13 +3,13 @@class="btn-select w-full disabled:cursor-not-allowed":disabled="disabled"@change="- (e) => {+ (e: any) => {$emit('select-instance-id', parseInt(e.target.value));}"><option disabled :selected="undefined === state.selectedId">- {{ $t('instance.select') }}+ {{ $t("instance.select") }}</option><template v-for="(instance, index) in instanceList" :key="index"><option@@ -32,7 +32,7 @@</template><script lang="ts">-import { computed, reactive, watch } from "vue";+import { computed, defineComponent, reactive, watch } from "vue";import { useStore } from "vuex";import { Instance } from "../types";@@ -40,15 +40,17 @@ interface LocalState {selectedId?: number;}-export default {+export default defineComponent({name: "InstanceSelect",components: {},props: {selectedId: {type: Number,+ default: undefined,},environmentId: {type: Number,+ default: undefined,},disabled: {default: false,@@ -100,5 +102,5 @@ export default {instanceList,};},-};+});</script>diff --git a/frontend/src/components/IntroBanner.vue b/frontend/src/components/IntroBanner.vueindex 93cb8fb420..30d243f613 100644--- a/frontend/src/components/IntroBanner.vue+++ b/frontend/src/components/IntroBanner.vue@@ -3,25 +3,29 @@<img class="m-4 h-72" src="../assets/illustration/guide.webp" alt="" /><div class="m-4"><h2 class="text-xl text-main">- <i18n-t keypath="intro.content">- <template v-slot:quickstart>- <span class="text-accent">{{ $t("common.quickstart") }}</span>- </template>- <template v-slot:doc>- <a class="normal-link" href="https://docs.bytebase.com" target="__blank">- {{ $t("intro.doc") }}- </a>- </template>- <template v-slot:issue>- <a- class="normal-link"- href="https://github.com/bytebase/bytebase/issues"- target="__blank"- >- {{ $t("intro.issue") }}- </a>- </template>- </i18n-t>+ <i18n-t keypath="intro.content">+ <template #quickstart>+ <span class="text-accent">{{ $t("common.quickstart") }}</span>+ </template>+ <template #doc>+ <a+ class="normal-link"+ href="https://docs.bytebase.com"+ target="__blank"+ >+ {{ $t("intro.doc") }}+ </a>+ </template>+ <template #issue>+ <a+ class="normal-link"+ href="https://github.com/bytebase/bytebase/issues"+ target="__blank"+ >+ {{ $t("intro.issue") }}+ </a>+ </template>+ </i18n-t></h2><div class="mt-4"><button class="btn-normal" @click.prevent="dismiss">diff --git a/frontend/src/components/Issue/IssueDetailLayout.vue b/frontend/src/components/Issue/IssueDetailLayout.vueindex 265a21fbd7..6f22cd126a 100644--- a/frontend/src/components/Issue/IssueDetailLayout.vue+++ b/frontend/src/components/Issue/IssueDetailLayout.vue@@ -1,5 +1,9 @@<template>- <div id="issue-detail-top" class="flex-1 overflow-auto focus:outline-none" tabindex="0">+ <div+ id="issue-detail-top"+ class="flex-1 overflow-auto focus:outline-none"+ tabindex="0"+ ><IssueBanner v-if="!create" :issue="issue" /><!-- Highlight Panel -->@@ -94,7 +98,9 @@><div class="flex max-w-3xl mx-auto px-6 lg:max-w-full"><div class="flex flex-col flex-1 lg:flex-row-reverse lg:col-span-2">- <div class="py-6 lg:pl-4 lg:w-96 xl:w-112 lg:border-l lg:border-block-border">+ <div+ class="py-6 lg:pl-4 lg:w-96 xl:w-112 lg:border-l lg:border-block-border"+ ><IssueSidebar:issue="issue":database="database"@@ -117,7 +123,10 @@<div class="w-full py-4 pr-4"><section v-if="showIssueTaskStatementPanel" class="border-b mb-4"><div v-if="!create" class="mb-4">- <TaskCheckBar :task="selectedTask" @run-checks="runTaskChecks" />+ <TaskCheckBar+ :task="selectedTask"+ @run-checks="runTaskChecks"+ /></div><template v-if="isTenantDeployMode"><!--@@ -156,7 +165,11 @@"/></template>- <template v-for="(stage, index) in issue.pipeline.stageList" v-else :key="index">+ <template+ v-for="(stage, index) in issue.pipeline.stageList"+ v-else+ :key="index"+ ><template v-if="selectedStage.id == stage.id"><IssueTaskStatementPanel:sql-hint="sqlHint(false)"@@ -171,7 +184,10 @@</template></template></section>- <section v-if="showIssueTaskRollbackStatementPanel" class="border-b mb-4">+ <section+ v-if="showIssueTaskRollbackStatementPanel"+ class="border-b mb-4"+ ><template v-if="create"><IssueTaskStatementPanel:sql-hint="sqlHint(true)"@@ -186,7 +202,11 @@"/></template>- <template v-for="(stage, index) in issue.pipeline.stageList" v-else :key="index">+ <template+ v-for="(stage, index) in issue.pipeline.stageList"+ v-else+ :key="index"+ ><template v-if="selectedStage.id == stage.id"><IssueTaskStatementPanel:sql-hint="sqlHint(true)"@@ -206,7 +226,11 @@:allow-edit="allowEditNameAndDescription"@update-description="updateDescription"/>- <section v-if="!create" aria-labelledby="activity-title" class="mt-4">+ <section+ v-if="!create"+ aria-labelledby="activity-title"+ class="mt-4"+ ><IssueActivityPanel:issue="issue":issue-template="issueTemplate"@@ -429,7 +453,10 @@ export default defineComponent({const applyRollbackStatementToOtherStages = (newStatement: string) => {for (const stage of (props.issue as IssueCreate).pipeline!.stageList) {for (const task of stage.taskList) {- if (task.type == "bb.task.database.schema.update" || task.type == "bb.task.database.data.update") {+ if (+ task.type == "bb.task.database.schema.update" ||+ task.type == "bb.task.database.data.update"+ ) {task.rollbackStatement = newStatement;}}@@ -753,8 +780,8 @@ export default defineComponent({switch (task.type) {case "bb.task.database.schema.update":return (- (task.payload as TaskDatabaseSchemaUpdatePayload).rollbackStatement ||- ""+ (task.payload as TaskDatabaseSchemaUpdatePayload)+ .rollbackStatement || "");case "bb.task.database.data.update":return (@@ -762,9 +789,8 @@ export default defineComponent({"");default:- return ""+ return "";}-};const isTenantDeployMode = computed((): boolean => {@@ -913,7 +939,10 @@ export default defineComponent({return false;}if (!props.create) {- if (props.issue.type == "bb.issue.database.schema.update" || props.issue.type == "bb.issue.database.data.update") {+ if (+ props.issue.type == "bb.issue.database.schema.update" ||+ props.issue.type == "bb.issue.database.data.update"+ ) {if ((props.issue as Issue).status == "DONE" ||(props.issue as Issue).status == "CANCELED"@@ -921,21 +950,22 @@ export default defineComponent({for (const stage of (props.issue as Issue).pipeline.stageList) {for (const task of stage.taskList) {if (task.status == "DONE") {- if (task.type == "bb.task.database.schema.update" &&+ if (+ task.type == "bb.task.database.schema.update" &&!isEmpty((task.payload as TaskDatabaseSchemaUpdatePayload).rollbackStatement)) {- return true- }- else if (task.type == "bb.task.database.data.update" &&+ return true;+ } else if (+ task.type == "bb.task.database.data.update" &&!isEmpty((task.payload as TaskDatabaseDataUpdatePayload).rollbackStatement)) {- return true+ return true;}}}@@ -984,7 +1014,10 @@ export default defineComponent({const showIssueTaskRollbackStatementPanel = computed(() => {if (isTenantDeployMode.value) return false;if (project.value.workflowType == "UI") {- if (props.issue.type == "bb.issue.database.schema.update" || props.issue.type == "bb.issue.database.data.update") {+ if (+ props.issue.type == "bb.issue.database.schema.update" ||+ props.issue.type == "bb.issue.database.data.update"+ ) {return true;}}diff --git a/frontend/src/components/Issue/IssueHighlightPanel.vue b/frontend/src/components/Issue/IssueHighlightPanel.vueindex 110156e443..b55bf5ac63 100644--- a/frontend/src/components/Issue/IssueHighlightPanel.vue+++ b/frontend/src/components/Issue/IssueHighlightPanel.vue@@ -22,14 +22,21 @@/></div><div v-if="!create">- <i18n-t keypath="issue.opened-by-at" tag="p" class="text-sm text-control-light">+ <i18n-t+ keypath="issue.opened-by-at"+ tag="p"+ class="text-sm text-control-light"+ ><template #creator><router-link:to="`/u/${issue.creator.id}`"class="font-medium text-control hover:underline"- >{{ issue.creator.name }}</router-link>+ >{{ issue.creator.name }}</router-link+ ></template>- <template #time>{{ dayjs(issue.updatedTs * 1000).format("LLL") }}</template>+ <template #time>{{+ dayjs(issue.updatedTs * 1000).format("LLL")+ }}</template></i18n-t><pv-if="pushEvent"@@ -38,11 +45,9 @@<template v-if="pushEvent.vcsType.startsWith('GITLAB')"><img class="h-4 w-auto" src="../../assets/gitlab-logo.svg" /></template>- <a- :href="vcsBranchUrl"- target="_blank"- class="normal-link"- >{{ `${vcsBranch}@${pushEvent.repositoryFullPath}` }}</a>+ <a :href="vcsBranchUrl" target="_blank" class="normal-link">{{+ `${vcsBranch}@${pushEvent.repositoryFullPath}`+ }}</a><i18n-t keypath="issue.commit-by-at" tag="span"><template #id>@@ -50,13 +55,16 @@:href="pushEvent.fileCommit.url"target="_blank"class="normal-link"- >{{ pushEvent.fileCommit.id.substring(0, 7) }}:</a>+ >{{ pushEvent.fileCommit.id.substring(0, 7) }}:</a+ ></template><template #title><span class="text-main">{{ pushEvent.fileCommit.title }}</span></template><template #author>{{ pushEvent.authorName }}</template>- <template #time>{{ dayjs(pushEvent.fileCommit.createdTs * 1000).format("LLL") }}</template>+ <template #time>{{+ dayjs(pushEvent.fileCommit.createdTs * 1000).format("LLL")+ }}</template></i18n-t></p></div>@@ -139,7 +147,7 @@ export default defineComponent({const vcsBranch = computed((): string => {if (pushEvent.value) {- return pushEvent.value.ref.replace(/^refs\/heads\//g, "")+ return pushEvent.value.ref.replace(/^refs\/heads\//g, "");}return "";});diff --git a/frontend/src/components/Issue/IssueStatusTransitionButtonGroup.vue b/frontend/src/components/Issue/IssueStatusTransitionButtonGroup.vueindex ee0a6d4aae..4da3cd0e28 100644--- a/frontend/src/components/Issue/IssueStatusTransitionButtonGroup.vue+++ b/frontend/src/components/Issue/IssueStatusTransitionButtonGroup.vue@@ -5,16 +5,26 @@class="btn-primary px-4 py-2":disabled="!allowCreate"@click.prevent="doCreate"- >{{ $t("common.create") }}</button>+ >+ {{ $t("common.create") }}+ </button></template><template v-else>- <div v-if="applicableTaskStatusTransitionList.length > 0" class="flex space-x-2">- <template v-for="(transition, index) in applicableTaskStatusTransitionList" :key="index">+ <div+ v-if="applicableTaskStatusTransitionList.length > 0"+ class="flex space-x-2"+ >+ <template+ v-for="(transition, index) in applicableTaskStatusTransitionList"+ :key="index"+ ><buttontype="button":class="transition.buttonClass"@click.prevent="tryStartTaskStatusTransition(transition)"- >{{ $t(transition.buttonName) }}</button>+ >+ {{ $t(transition.buttonName) }}+ </button></template><template v-if="applicableIssueStatusTransitionList.length > 0"><button@@ -29,32 +39,43 @@<heroicons-solid:dots-vertical class="w-6 h-6" /></button><BBContextMenu ref="menu" class="origin-top-right mt-10 w-42">- <template v-for="(transition, index) in applicableIssueStatusTransitionList" :key="index">+ <template+ v-for="(transition, index) in applicableIssueStatusTransitionList"+ :key="index"+ ><divclass="menu-item"role="menuitem"@click.prevent="tryStartIssueStatusTransition(transition)"- >{{ $t(transition.buttonName) }}</div>+ >+ {{ $t(transition.buttonName) }}+ </div></template></BBContextMenu></template></div><template v-else>- <div if="applicableIssueStatusTransitionList.length > 0" class="flex space-x-2">- <template v-for="(transition, index) in applicableIssueStatusTransitionList" :key="index">+ <div+ if="applicableIssueStatusTransitionList.length > 0"+ class="flex space-x-2"+ >+ <template+ v-for="(transition, index) in applicableIssueStatusTransitionList"+ :key="index"+ ><buttontype="button":class="transition.buttonClass":disabled="!allowIssueStatusTransition(transition)"@click.prevent="tryStartIssueStatusTransition(transition)"- >{{ $t(transition.buttonName) }}</button>+ >+ {{ $t(transition.buttonName) }}+ </button></template><template v-if="allowRollback">- <button- type="button"- class="btn-primary"- @click.prevent="doRollback"- >{{ $t("common.rollback") }}</button>+ <button type="button" class="btn-primary" @click.prevent="doRollback">+ {{ $t("common.rollback") }}+ </button></template></div></template>@@ -229,8 +250,9 @@ export default defineComponent({break;case "APPROVE":updateStatusModalState.style = "INFO";- updateStatusModalState.title = `${t("common.approve")} '${task.name- }'?`;+ updateStatusModalState.title = `${t("common.approve")} '${+ task.name+ }'?`;break;case "RETRY":updateStatusModalState.style = "INFO";@@ -238,8 +260,9 @@ export default defineComponent({break;case "CANCEL":updateStatusModalState.style = "INFO";- updateStatusModalState.title = `${t("common.cancel")} '${task.name- }'?`;+ updateStatusModalState.title = `${t("common.cancel")} '${+ task.name+ }'?`;break;case "SKIP":updateStatusModalState.style = "INFO";diff --git a/frontend/src/components/Issue/PipelineSimpleFlow.vue b/frontend/src/components/Issue/PipelineSimpleFlow.vueindex 28d285fefe..8dba3e2c92 100644--- a/frontend/src/components/Issue/PipelineSimpleFlow.vue+++ b/frontend/src/components/Issue/PipelineSimpleFlow.vue@@ -3,8 +3,14 @@<olclass="border-t border-b border-block-border divide-y divide-gray-300 lg:flex lg:divide-y-0">- <li v-for="(item, index) in itemList" :key="index" class="relative md:flex-1 md:flex">- <div class="cursor-default group flex items-center justify-between w-full">+ <li+ v-for="(item, index) in itemList"+ :key="index"+ class="relative md:flex-1 md:flex"+ >+ <div+ class="cursor-default group flex items-center justify-between w-full"+ ><span class="pl-4 py-2 flex items-center text-sm font-medium"><divclass="relative w-6 h-6 flex flex-shrink-0 items-center justify-center rounded-full select-none"@@ -16,7 +22,11 @@class="h-2 w-2 bg-info rounded-full"aria-hidden="true"></span>- <span v-else class="h-1.5 w-1.5 bg-control rounded-full" aria-hidden="true"></span>+ <span+ v-else+ class="h-1.5 w-1.5 bg-control rounded-full"+ aria-hidden="true"+ ></span></template><template v-else-if="item.taskStatus === 'PENDING_APPROVAL'"><heroicons-outline:user class="w-4 h-4" />@@ -37,7 +47,8 @@<spanclass="h-2.5 w-2.5 rounded-full text-center pb-6 font-medium text-base"aria-hidden="true"- >!</span>+ >!</span+ ></template></div><div@@ -62,7 +73,9 @@v-if="!item.valid"class="ml-2 w-5 h-5 flex justify-center rounded-full select-none bg-error text-white hover:bg-error-hover">- <span class="text-center font-normal" aria-hidden="true">!</span>+ <span class="text-center font-normal" aria-hidden="true"+ >!</span+ ></span></div></span>@@ -159,8 +172,9 @@ export default defineComponent({if (stage.taskList.length > 1) {for (let i = 0; i < stage.taskList.length; i++) {if ((stage.taskList[i] as Task).id == (activeTask as Task).id) {- taskName = `${activeTask.name} (${i + 1}/${stage.taskList.length- })`;+ taskName = `${activeTask.name} (${i + 1}/${+ stage.taskList.length+ })`;break;}}@@ -208,7 +222,7 @@ export default defineComponent({const flowItemTextClass = (item: FlowItem) => {let textClass =!props.create &&- activeTask(props.pipeline as Pipeline).id === item.taskId+ activeTask(props.pipeline as Pipeline).id === item.taskId? "font-bold ": "font-normal ";// For create, since we don't have stage id yet, we just compare name instead.diff --git a/frontend/src/components/Issue/PipelineTenantFlow.vue b/frontend/src/components/Issue/PipelineTenantFlow.vueindex ab7aa2785b..aabc45c497 100644--- a/frontend/src/components/Issue/PipelineTenantFlow.vue+++ b/frontend/src/components/Issue/PipelineTenantFlow.vue@@ -28,12 +28,16 @@<span class="text-sm flex-1">{{ item.taskName }}</span></div><div class="tooltip-wrapper" @click.prevent="clickItem(item)">- <span class="tooltip whitespace-nowrap">Missing SQL statement</span>+ <span class="tooltip whitespace-nowrap"+ >Missing SQL statement</span+ ><spanv-if="!item.valid"class="ml-2 w-5 h-5 flex justify-center rounded-full select-none bg-error text-white hover:bg-error-hover">- <span class="text-center font-normal" aria-hidden="true">!</span>+ <span class="text-center font-normal" aria-hidden="true"+ >!</span+ ></span></div></span>@@ -77,14 +81,18 @@:status="task.status"class="transform scale-75"/>- <heroicons-solid:arrow-narrow-right v-if="isActiveTask(task)" class="name w-5 h-5" />+ <heroicons-solid:arrow-narrow-right+ v-if="isActiveTask(task)"+ class="name w-5 h-5"+ /><div class="name">{{ j + 1 }} - {{ databaseForTask(task).name }}</div></div><div class="flex items-center px-1 py-1 whitespace-pre-wrap"><InstanceEngineIcon :instance="databaseForTask(task).instance" /><spanclass="flex-1 ml-2 overflow-x-hidden whitespace-nowrap overflow-ellipsis"- >{{ instanceName(databaseForTask(task).instance) }}</span>+ >{{ instanceName(databaseForTask(task).instance) }}</span+ ></div></div></div>@@ -219,8 +227,9 @@ export default defineComponent({if (stage.taskList.length > 1) {for (let i = 0; i < stage.taskList.length; i++) {if ((stage.taskList[i] as Task).id == (activeTask as Task).id) {- taskName = `${activeTask.name} (${i + 1}/${stage.taskList.length- })`;+ taskName = `${activeTask.name} (${i + 1}/${+ stage.taskList.length+ })`;break;}}diff --git a/frontend/src/components/Issue/TaskCheckBar.vue b/frontend/src/components/Issue/TaskCheckBar.vueindex ac29a137f7..40ea2ba1e1 100644--- a/frontend/src/components/Issue/TaskCheckBar.vue+++ b/frontend/src/components/Issue/TaskCheckBar.vue@@ -6,7 +6,9 @@class="btn-small py-0.5":disabled="hasRunningTaskCheck"@click.prevent="runChecks"- >{{ hasRunningTaskCheck ? $t("task.checking") : $t("task.run-task") }}</button>+ >+ {{ hasRunningTaskCheck ? $t("task.checking") : $t("task.run-task") }}+ </button><TaskCheckBadgeBar:task-check-run-list="task.taskCheckRunList"@select-task-check-run="@@ -51,7 +53,9 @@type="button"class="btn-primary py-2 px-4"@click.prevent="dismissDialog"- >{{ $t("common.close") }}</button>+ >+ {{ $t("common.close") }}+ </button></div></div></BBModal>@@ -126,7 +130,8 @@ export default defineComponent({const showRunCheckButton = computed((): boolean => {if (!props.allowRunTask) return false;return (- (props.task.type == "bb.task.database.schema.update" || props.task.type == "bb.task.database.data.update") &&+ (props.task.type == "bb.task.database.schema.update" ||+ props.task.type == "bb.task.database.data.update") &&(props.task.status == "PENDING" ||props.task.status == "PENDING_APPROVAL" ||props.task.status == "RUNNING" ||diff --git a/frontend/src/components/Issue/TaskRunTable.vue b/frontend/src/components/Issue/TaskRunTable.vueindex e57cde03e4..2a7e25e9ad 100644--- a/frontend/src/components/Issue/TaskRunTable.vue+++ b/frontend/src/components/Issue/TaskRunTable.vue@@ -27,7 +27,9 @@<heroicons-outline:check class="w-5 h-5" /></template><template v-else-if="taskRun.status == 'FAILED'">- <span class="text-white font-medium text-base" aria-hidden="true">!</span>+ <span class="text-white font-medium text-base" aria-hidden="true"+ >!</span+ ></template><template v-else-if="taskRun.status == 'CANCELED'"><heroicons-outline:minus-sm class="w-5 h-5" />@@ -41,7 +43,8 @@<router-linkclass="ml-1 normal-link":to="commentLink(taskRun).link"- >{{ commentLink(taskRun).title }}</router-link>+ >{{ commentLink(taskRun).title }}</router-link+ ></template></BBTableCell><BBTableCell class="table-cell w-12">@@ -49,13 +52,19 @@<PrincipalAvatar :principal="taskRun.creator" :size="'SMALL'" /><div class="flex flex-col"><div class="flex flex-row items-center space-x-2">- <router-link :to="`/u/${taskRun.creator.id}`">{{ taskRun.creator.name }}</router-link>+ <router-link :to="`/u/${taskRun.creator.id}`">{{+ taskRun.creator.name+ }}</router-link></div></div></div></BBTableCell>- <BBTableCell class="table-cell w-12">{{ humanizeTs(taskRun.createdTs) }}</BBTableCell>- <BBTableCell class="table-cell w-12">{{ humanizeTs(taskRun.updatedTs) }}</BBTableCell>+ <BBTableCell class="table-cell w-12">{{+ humanizeTs(taskRun.createdTs)+ }}</BBTableCell>+ <BBTableCell class="table-cell w-12">{{+ humanizeTs(taskRun.updatedTs)+ }}</BBTableCell></template></BBTable></template>diff --git a/frontend/src/components/MemberAddOrInvite.vue b/frontend/src/components/MemberAddOrInvite.vueindex 002b787ff2..498b74501c 100644--- a/frontend/src/components/MemberAddOrInvite.vue+++ b/frontend/src/components/MemberAddOrInvite.vue@@ -6,7 +6,9 @@:key="index"class="flex justify-between py-0.5 select-none">- <p id="add_or_invite_members_helper" class="sr-only">{{ $t("settings.members.helper") }}</p>+ <p id="add_or_invite_members_helper" class="sr-only">+ {{ $t("settings.members.helper") }}+ </p><div class="flex flex-row space-x-4"><div class="flex-grow"><input@@ -24,7 +26,9 @@v-if="state.errorList[index]"id="email-error"class="mt-2 text-sm text-error"- >{{ state.errorList[index] }}</p>+ >+ {{ state.errorList[index] }}+ </p></div><div v-if="hasRBACFeature" class="sm:hidden w-36"><RoleSelect@@ -81,11 +85,9 @@<div class="flex justify-between"><span class="flex items-center">- <button- type="button"- class="btn-secondary"- @click.prevent="addUser"- >{{ $t("settings.members.add-more") }}</button>+ <button type="button" class="btn-secondary" @click.prevent="addUser">+ {{ $t("settings.members.add-more") }}+ </button></span><buttondiff --git a/frontend/src/components/MemberTable.vue b/frontend/src/components/MemberTable.vueindex 609f9bfe97..c2ed60fe80 100644--- a/frontend/src/components/MemberTable.vue+++ b/frontend/src/components/MemberTable.vue@@ -13,9 +13,18 @@class="w-auto table-cell":title="$t(COLUMN_LIST[0].title)"/>- <BBTableHeaderCell class="w-8 table-cell" :title="$t(COLUMN_LIST[1].title)" />- <BBTableHeaderCell class="w-72 table-cell" :title="$t(COLUMN_LIST[2].title)" />- <BBTableHeaderCell class="w-auto table-cell" :title="$t(COLUMN_LIST[3].title)" />+ <BBTableHeaderCell+ class="w-8 table-cell"+ :title="$t(COLUMN_LIST[1].title)"+ />+ <BBTableHeaderCell+ class="w-72 table-cell"+ :title="$t(COLUMN_LIST[2].title)"+ />+ <BBTableHeaderCell+ class="w-auto table-cell"+ :title="$t(COLUMN_LIST[3].title)"+ /></template><template #body="{ rowData: member }"><BBTableCell :left-padding="4" class="table-cell">@@ -23,7 +32,8 @@<template v-if="'INVITED' == member.principal.status"><spanclass="inline-flex items-center px-2 py-0.5 rounded-lg text-xs font-semibold bg-main text-main-text"- >{{ $t("settings.members.invited") }}</span>+ >{{ $t("settings.members.invited") }}</span+ ><span class="textlabel">{{ member.principal.email }}</span></template><template v-else>@@ -33,11 +43,13 @@<router-link:to="`/u/${member.principal.id}`"class="normal-link"- >{{ member.principal.name }}</router-link>+ >{{ member.principal.name }}</router-link+ ><spanv-if="currentUser.id == member.principal.id"class="inline-flex items-center px-2 py-0.5 rounded-lg text-xs font-semibold bg-green-100 text-green-800"- >{{ $t("settings.members.yourself") }}</span>+ >{{ $t("settings.members.yourself") }}</span+ ></div><span class="textlabel">{{ member.principal.email }}</span></div>@@ -45,7 +57,9 @@</div></BBTableCell><BBTableCell class="whitespace-nowrap tooltip-wrapper">- <span v-if="changeRoleTooltip(member)" class="tooltip">{{ changeRoleTooltip(member) }}</span>+ <span v-if="changeRoleTooltip(member)" class="tooltip">{{+ changeRoleTooltip(member)+ }}</span><RoleSelect:selected-role="member.role":disabled="!allowChangeRole(member)"@@ -60,7 +74,9 @@<div class="flex flex-row items-center space-x-1"><span>{{ humanizeTs(member.updatedTs) }}</span><span>by</span>- <router-link :to="`/u/${member.updater.id}`" class="normal-link">{{ member.updater.name }}</router-link>+ <router-link :to="`/u/${member.updater.id}`" class="normal-link">{{+ member.updater.name+ }}</router-link></div></BBTableCell><BBTableCell>@@ -69,8 +85,12 @@:style="'ARCHIVE'":require-confirm="true":ok-text="$t('settings.members.action.deactivate')"- :confirm-title="`${$t('settings.members.action.deactivate-confirm-title')} '${member.principal.name}'?`"- :confirm-description="$t('settings.members.action.deactivate-confirm-description')"+ :confirm-title="`${$t(+ 'settings.members.action.deactivate-confirm-title'+ )} '${member.principal.name}'?`"+ :confirm-description="+ $t('settings.members.action.deactivate-confirm-description')+ "@confirm="changeRowStatus(member.id, 'ARCHIVED')"/><BBButtonConfirm@@ -78,7 +98,9 @@:style="'RESTORE'":require-confirm="true":ok-text="$t('settings.members.action.reactivate')"- :confirm-title="`${$t('settings.members.action.reactivate-confirm-title')} '${member.principal.name}'?`"+ :confirm-title="`${$t(+ 'settings.members.action.reactivate-confirm-title'+ )} '${member.principal.name}'?`":confirm-description="''"@confirm="changeRowStatus(member.id, 'NORMAL')"/>@@ -113,7 +135,7 @@ const COLUMN_LIST: BBTableColumn[] = [];// eslint-disable-next-line @typescript-eslint/no-empty-interface-interface LocalState { }+interface LocalState {}export default {name: "MemberTable",diff --git a/frontend/src/components/MigrationHistoryTable.vue b/frontend/src/components/MigrationHistoryTable.vueindex 9a015149b6..3bc8869bea 100644--- a/frontend/src/components/MigrationHistoryTable.vue+++ b/frontend/src/components/MigrationHistoryTable.vue@@ -91,7 +91,11 @@<script lang="ts">import { PropType } from "vue";import { Database, MigrationHistory } from "../types";-import { databaseSlug, migrationHistorySlug, nanosecondsToString } from "../utils";+import {+ databaseSlug,+ migrationHistorySlug,+ nanosecondsToString,+} from "../utils";import { BBTableColumn, BBTableSectionDataSource } from "../bbkit/types";import MigrationHistoryStatusIcon from "./MigrationHistoryStatusIcon.vue";import { useRouter } from "vue-router";@@ -129,25 +133,25 @@ export default {title: "",},{- title: t('migration-history.workflow'),+ title: t("migration-history.workflow"),},{- title: t('common.version'),+ title: t("common.version"),},{- title: t('common.issue'),+ title: t("common.issue"),},{title: "SQL",},{- title: t('common.duration'),+ title: t("common.duration"),},{- title: t('common.created-at'),+ title: t("common.created-at"),},{- title: t('common.creator'),+ title: t("common.creator"),},],],@@ -156,22 +160,22 @@ export default {[{ title: "" },{- title: t('common.version'),+ title: t("common.version"),},{- title: t('common.issue'),+ title: t("common.issue"),},{title: "SQL",},{- title: t('common.duration'),+ title: t("common.duration"),},{- title: t('common.created-at'),+ title: t("common.created-at"),},{- title: t('common.creator'),+ title: t("common.creator"),},],],diff --git a/frontend/src/components/ProjectMemberTable.vue b/frontend/src/components/ProjectMemberTable.vueindex 756df2fe9e..3629a8e57f 100644--- a/frontend/src/components/ProjectMemberTable.vue+++ b/frontend/src/components/ProjectMemberTable.vue@@ -8,15 +8,34 @@:row-clickable="false"><template #header>- <BBTableHeaderCell :left-padding="4" class="w-auto table-cell" :title="columnList[0].title" />+ <BBTableHeaderCell+ :left-padding="4"+ class="w-auto table-cell"+ :title="columnList[0].title"+ /><template v-if="hasRBACFeature">- <BBTableHeaderCell class="w-8 table-cell" :title="columnList[1].title" />- <BBTableHeaderCell class="w-72 table-cell" :title="columnList[2].title" />- <BBTableHeaderCell class="w-auto table-cell" :title="columnList[3].title" />+ <BBTableHeaderCell+ class="w-8 table-cell"+ :title="columnList[1].title"+ />+ <BBTableHeaderCell+ class="w-72 table-cell"+ :title="columnList[2].title"+ />+ <BBTableHeaderCell+ class="w-auto table-cell"+ :title="columnList[3].title"+ /></template><template v-else>- <BBTableHeaderCell class="w-72 table-cell" :title="columnList[1].title" />- <BBTableHeaderCell class="w-auto table-cell" :title="columnList[2].title" />+ <BBTableHeaderCell+ class="w-72 table-cell"+ :title="columnList[1].title"+ />+ <BBTableHeaderCell+ class="w-auto table-cell"+ :title="columnList[2].title"+ /></template></template><template #body="{ rowData: member }">@@ -25,7 +44,8 @@<template v-if="'INVITED' == member.principal.status"><spanclass="inline-flex items-center px-2 py-0.5 rounded-lg text-xs font-semibold bg-main text-main-text"- >{{ $t("settings.members.invited") }}</span>+ >{{ $t("settings.members.invited") }}</span+ ><span class="textlabel">{{ member.principal.email }}</span></template><template v-else>@@ -35,11 +55,13 @@<router-link:to="`/u/${member.principal.id}`"class="normal-link"- >{{ member.principal.name }}</router-link>+ >{{ member.principal.name }}</router-link+ ><spanv-if="currentUser.id == member.principal.id"class="inline-flex items-center px-2 py-0.5 rounded-lg text-xs font-semibold bg-green-100 text-green-800"- >{{ $t("common.you") }}</span>+ >{{ $t("common.you") }}</span+ ></div><span class="textlabel">{{ member.principal.email }}</span></div>@@ -60,8 +82,10 @@<BBTableCell class="table-cell"><div class="flex flex-row items-center space-x-1"><span>{{ humanizeTs(member.updatedTs) }}</span>- <span>{{ $t('common.by') }}</span>- <router-link :to="`/u/${member.updater.id}`" class="normal-link">{{ member.updater.name }}</router-link>+ <span>{{ $t("common.by") }}</span>+ <router-link :to="`/u/${member.updater.id}`" class="normal-link">{{+ member.updater.name+ }}</router-link></div></BBTableCell><BBTableCell>diff --git a/frontend/src/components/ProjectRoleSelect.vue b/frontend/src/components/ProjectRoleSelect.vueindex 045fd97676..5483e6d4dc 100644--- a/frontend/src/components/ProjectRoleSelect.vue+++ b/frontend/src/components/ProjectRoleSelect.vue@@ -7,22 +7,21 @@@select-item="(role) => $emit('change-role', role)"><template #menuItem="{ item }">- {{- $t(`common.role.${item.toLowerCase()}`)- }}+ {{ $t(`common.role.${item.toLowerCase()}`) }}</template></BBSelect></template><script lang="ts">-import { PropType } from "vue";+import { defineComponent, PropType } from "vue";import { ProjectRoleType } from "../types";-export default {+export default defineComponent({name: "ProjectRoleSelect",props: {selectedRole: {type: String as PropType<ProjectRoleType>,+ default: undefined,},disabled: {default: false,@@ -30,5 +29,5 @@ export default {},},emits: ["change-role"],-};+});</script>diff --git a/frontend/src/components/ProjectSelect.vue b/frontend/src/components/ProjectSelect.vueindex 22ee883dc4..e2488b63eb 100644--- a/frontend/src/components/ProjectSelect.vue+++ b/frontend/src/components/ProjectSelect.vue@@ -8,14 +8,18 @@}">- <option disabled :selected="UNKNOWN_ID == state.selectedId">Select project</option>+ <option disabled :selected="UNKNOWN_ID == state.selectedId">+ Select project+ </option><!-- If includeDefaultProject is false but the selected project is the defaultproject, we will show it. If includeDefaultProject is true, then it'salready in the list, so no need to show it twice--><optionv-if="!includeDefaultProject && state.selectedId == DEFAULT_PROJECT_ID":selected="true"- >Default</option>+ >+ Default+ </option><!-- It may happen the selected id might not be in the project list.e.g. the selected project is deleted after the selection and weare unable to cleanup properly. In such case, the seleted project id@@ -24,18 +28,24 @@v-else-if="selectedIdNotInList":value="state.selectedId":selected="true"- >{{ state.selectedId }}</option>+ >+ {{ state.selectedId }}+ </option><template v-for="(project, index) in projectList" :key="index"><optionv-if="project.rowStatus == 'NORMAL'":value="project.id":selected="project.id == state.selectedId"- >{{ projectName(project) }}</option>+ >+ {{ projectName(project) }}+ </option><optionv-else-if="project.id == state.selectedId":value="project.id":selected="true"- >{{ projectName(project) }}</option>+ >+ {{ projectName(project) }}+ </option></template></select></template>diff --git a/frontend/src/components/ProjectSettingPanel.vue b/frontend/src/components/ProjectSettingPanel.vueindex 4e62b1392f..9ff7b03802 100644--- a/frontend/src/components/ProjectSettingPanel.vue+++ b/frontend/src/components/ProjectSettingPanel.vue@@ -10,7 +10,9 @@:style="'ARCHIVE'":button-text="$t('project.settings.archive.btn-text')":ok-text="$t('common.archive')"- :confirm-title="$t('project.settings.archive.title') + ` '${project.name}'?`"+ :confirm-title="+ $t('project.settings.archive.title') + ` '${project.name}'?`+ ":confirm-description="$t('project.settings.archive.description')":require-confirm="true"@confirm="archiveOrRestoreProject(true)"@@ -21,7 +23,9 @@:style="'RESTORE'":button-text="$t('project.settings.restore.btn-text')":ok-text="$t('common.restore')"- :confirm-title="$t('project.settings.restore.title') + ` '${project.name}'?`"+ :confirm-title="+ $t('project.settings.restore.title') + ` '${project.name}'?`+ ":confirm-description="''":require-confirm="true"@confirm="archiveOrRestoreProject(false)"diff --git a/frontend/src/components/Quickstart.vue b/frontend/src/components/Quickstart.vueindex 14e13c9330..ab61946157 100644--- a/frontend/src/components/Quickstart.vue+++ b/frontend/src/components/Quickstart.vue@@ -1,7 +1,9 @@<template><div class="space-y-2 w-full pl-4 pr-2"><div class="flex flex-row justify-between">- <div class="outline-title toplevel flex">{{ $t("common.quickstart") }}</div>+ <div class="outline-title toplevel flex">+ {{ $t("common.quickstart") }}+ </div><button class="btn-icon" @click.prevent="hideQuickstart"><heroicons-solid:x class="w-4 h-4" /></button>@@ -19,7 +21,9 @@@click="intro.click"><span class="flex items-start">- <span class="flex-shrink-0 relative h-5 w-5 flex items-center justify-center">+ <span+ class="flex-shrink-0 relative h-5 w-5 flex items-center justify-center"+ ><template v-if="intro.done"><!-- Heroicon name: solid/check-circle --><heroicons-solid:check-circle@@ -27,17 +31,24 @@/></template><template v-else-if="isTaskActive(index)">- <span class="absolute h-4 w-4 rounded-full bg-blue-200"></span>- <span class="relative block w-2 h-2 bg-info rounded-full"></span>+ <span+ class="absolute h-4 w-4 rounded-full bg-blue-200"+ ></span>+ <span+ class="relative block w-2 h-2 bg-info rounded-full"+ ></span></template><template v-else>- <div class="h-2 w-2 bg-gray-300 rounded-full group-hover:bg-gray-400"></div>+ <div+ class="h-2 w-2 bg-gray-300 rounded-full group-hover:bg-gray-400"+ ></div></template></span><spanclass="ml-2 text-sm font-medium text-control-light group-hover:text-control-light-hover":class="intro.done ? 'line-through' : ''"- >{{ intro.name }}</span>+ >{{ intro.name }}</span+ ></span></component></li>@@ -112,7 +123,9 @@ export default defineComponent({name: computed(() => t("quick-start.visit-instance")),link: "/instance",allowDBA: true,- allowDeveloper: !store.getters["subscription/feature"]("bb.feature.dba-workflow"),+ allowDeveloper: !store.getters["subscription/feature"](+ "bb.feature.dba-workflow"+ ),done: computed(() => {return store.getters["uistate/introStateByKey"]("instance.visit");}),diff --git a/frontend/src/components/RoleSelect.vue b/frontend/src/components/RoleSelect.vueindex 44f0b738e9..31f96d21d8 100644--- a/frontend/src/components/RoleSelect.vue+++ b/frontend/src/components/RoleSelect.vue@@ -7,22 +7,21 @@@select-item="(role) => $emit('change-role', role)"><template #menuItem="{ item }">- {{- $t(`common.role.${item.toLowerCase()}`)- }}+ {{ $t(`common.role.${item.toLowerCase()}`) }}</template></BBSelect></template><script lang="ts">-import { PropType } from "vue";+import { defineComponent, PropType } from "vue";import { RoleType } from "../types";-export default {+export default defineComponent({name: "RoleSelect",props: {selectedRole: {type: String as PropType<RoleType>,+ default: undefined,},disabled: {default: false,@@ -30,5 +29,5 @@ export default {},},emits: ["change-role"],-};+});</script>diff --git a/frontend/src/components/VCSCard.vue b/frontend/src/components/VCSCard.vueindex a94e77f1a0..4f035e9a41 100644--- a/frontend/src/components/VCSCard.vue+++ b/frontend/src/components/VCSCard.vue@@ -16,25 +16,31 @@class="btn-normal py-2 px-4"@click.prevent="editVCS">- {{ $t('common.edit') }}+ {{ $t("common.edit") }}</button></div><div class="border-t border-block-border"><dl class="divide-y divide-block-border"><div class="grid grid-cols-4 gap-4 px-4 py-2 items-center">- <dt class="text-sm font-medium text-control-light">{{ $t('common.instance') }} URL</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("common.instance") }} URL+ </dt><dd class="mt-1 flex text-sm text-main col-span-2">{{ vcs.instanceUrl }}</dd></div><div class="grid grid-cols-4 gap-4 px-4 py-2 items-center">- <dt class="text-sm font-medium text-control-light">{{ $t('common.application') }} ID</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("common.application") }} ID+ </dt><dd class="mt-1 flex text-sm text-main col-span-2">{{ vcs.applicationId }}</dd></div><div class="grid grid-cols-4 gap-4 px-4 py-2 items-center">- <dt class="text-sm font-medium text-control-light">{{ $t('common.created-at') }}</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("common.created-at") }}+ </dt><dd class="mt-1 flex text-sm text-main col-span-2">{{ humanizeTs(vcs.createdTs) }}</dd>diff --git a/frontend/src/components/VCSProviderConfirmPanel.vue b/frontend/src/components/VCSProviderConfirmPanel.vueindex 0e7a80b771..21b030ba54 100644--- a/frontend/src/components/VCSProviderConfirmPanel.vue+++ b/frontend/src/components/VCSProviderConfirmPanel.vue@@ -1,23 +1,26 @@<template><div class="m-4 flex justify-center"><dl- class="- divide-y divide-block-border- border border-block-border- shadow- rounded-lg- "+ class="divide-y divide-block-border border border-block-border shadow rounded-lg"><div class="px-4 py-5 sm:px-6"><h3 class="text-lg leading-6 font-medium text-main">- {{ $t('version-control.setting.add-git-provider.confirm.confirm-info') }}+ {{+ $t("version-control.setting.add-git-provider.confirm.confirm-info")+ }}</h3><p class="mt-1 textinfolabel">- {{ $t('version-control.setting.add-git-provider.confirm.confirm-description') }}+ {{+ $t(+ "version-control.setting.add-git-provider.confirm.confirm-description"+ )+ }}</p></div><div class="grid grid-cols-4 gap-4 px-4 py-2">- <dt class="text-sm font-medium text-control-light text-right">{{ $t('common.type') }}</dt>+ <dt class="text-sm font-medium text-control-light text-right">+ {{ $t("common.type") }}+ </dt><dd class="col-start-2 col-span-3 text-sm text-main"><divv-if="config.type == 'GITLAB_SELF_HOST'"@@ -25,20 +28,26 @@><img class="h-6 w-auto" src="../assets/gitlab-logo.svg" /><div class="whitespace-nowrap">- {{ $t('version-control.setting.add-git-provider.gitlab-self-host-ce-ee') }}+ {{+ $t(+ "version-control.setting.add-git-provider.gitlab-self-host-ce-ee"+ )+ }}</div></div></dd></div><div class="grid grid-cols-4 gap-4 px-4 py-2">- <dt class="text-sm font-medium text-control-light text-right">{{ $t('common.name') }}</dt>+ <dt class="text-sm font-medium text-control-light text-right">+ {{ $t("common.name") }}+ </dt><dd class="col-start-2 col-span-3 text-sm text-main">{{ config.name }}</dd></div><div class="grid grid-cols-4 gap-4 px-4 py-2"><dt class="text-sm font-medium text-control-light text-right">- {{ $t('common.instance') }} URL+ {{ $t("common.instance") }} URL</dt><dd class="col-start-2 col-span-3 text-sm text-main">{{ config.instanceUrl }}diff --git a/frontend/src/components/VCSProviderOAuthPanel.vue b/frontend/src/components/VCSProviderOAuthPanel.vueindex 0dd2f706a2..b9066ca796 100644--- a/frontend/src/components/VCSProviderOAuthPanel.vue+++ b/frontend/src/components/VCSProviderOAuthPanel.vue@@ -2,34 +2,52 @@<div class="space-y-4"><div class="textlabel"><template v-if="config.type == 'GITLAB_SELF_HOST'">- {{ $t('version-control.setting.add-git-provider.oauth-info.register-oauth-application') }}+ {{+ $t(+ "version-control.setting.add-git-provider.oauth-info.register-oauth-application"+ )+ }}</template></div><ol class="textinfolabel space-y-2"><template v-if="config.type == 'GITLAB_SELF_HOST'"><li>- 1. {{ $t('version-control.setting.add-git-provider.oauth-info.login-as-admin') }}+ 1.+ {{+ $t(+ "version-control.setting.add-git-provider.oauth-info.login-as-admin"+ )+ }}<img class="w-auto" src="../assets/gitlab_admin_area.png" /></li><li>- 2. {{ $t('version-control.setting.add-git-provider.oauth-info.visit-admin-page') }}+ 2.+ {{+ $t(+ "version-control.setting.add-git-provider.oauth-info.visit-admin-page"+ )+ }}<a:href="createAdminApplicationUrl"target="_blank"class="normal-link"- >{{ $t('version-control.setting.add-git-provider.oauth-info.direct-link') }}</a+ >{{+ $t(+ "version-control.setting.add-git-provider.oauth-info.direct-link"+ )+ }}</a></li><li>- 3. {{ $t('version-control.setting.add-git-provider.oauth-info.create-oauth-app') }}+ 3.+ {{+ $t(+ "version-control.setting.add-git-provider.oauth-info.create-oauth-app"+ )+ }}<div class="m-4 flex justify-center"><dl- class="- divide-y divide-block-border- border border-block-border- shadow- rounded-lg- "+ class="divide-y divide-block-border border border-block-border shadow rounded-lg"><div class="grid grid-cols-2 gap-4 px-4 py-2"><dt class="text-sm font-medium text-control-light text-right">@@ -45,13 +63,7 @@{{ redirectUrl() }}<buttontabindex="-1"- class="- ml-1- text-sm- font-medium- text-control-light- hover:bg-gray-100- "+ class="ml-1 text-sm font-medium text-control-light hover:bg-gray-100"@click.prevent="copyRedirectURI"><heroicons-outline:clipboard class="w-6 h-6" />@@ -80,22 +92,31 @@</div></li><li>- 4. {{ $t('version-control.setting.add-git-provider.oauth-info.paste-oauth-info') }}+ 4.+ {{+ $t(+ "version-control.setting.add-git-provider.oauth-info.paste-oauth-info"+ )+ }}</li></template></ol><div><div class="textlabel">- {{ $t('common.application') }} ID <span class="text-red-600">*</span>+ {{ $t("common.application") }} ID <span class="text-red-600">*</span></div><BBTextFieldclass="mt-2 w-full":placeholder="'ex. 5333b60a6c9f234272dac2ee6b3422aaf224e0a66def54e0d243b77bexa8edda'":value="config.applicationId"- @input="changeApplicationId($event.target.value)"+ @input="(e: any) => changeApplicationId(e.target.value)"/><p v-if="state.showApplicationIdError" class="mt-2 text-sm text-error">- {{ $t('version-control.setting.add-git-provider.oauth-info.application-id-error') }}+ {{+ $t(+ "version-control.setting.add-git-provider.oauth-info.application-id-error"+ )+ }}</p><div class="mt-4 textlabel">Secret <span class="text-red-600">*</span>@@ -104,17 +125,25 @@class="mt-2 w-full":placeholder="'ex. b9e0efc7a233403799b42620c60ff98c146895a27b6219912a215f4e2251cc3a'":value="config.secret"- @input="changeSecret($event.target.value)"+ @input="(e: any) => changeSecret(e.target.value)"/><p v-if="state.showSecretError" class="mt-2 text-sm text-error">- {{ $t('version-control.setting.add-git-provider.oauth-info.secret-error') }}+ {{+ $t("version-control.setting.add-git-provider.oauth-info.secret-error")+ }}</p></div></div></template><script lang="ts">-import { computed, onUnmounted, PropType, reactive } from "vue";+import {+ computed,+ defineComponent,+ onUnmounted,+ PropType,+ reactive,+} from "vue";import isEmpty from "lodash-es/isEmpty";import { toClipboard } from "@soerenmartius/vue3-clipboard";import {@@ -132,7 +161,7 @@ interface LocalState {showSecretError: boolean;}-export default {+export default defineComponent({name: "VCSProviderOAuthPanel",props: {config: {@@ -178,6 +207,7 @@ export default {};const changeApplicationId = (value: string) => {+ // eslint-disable-next-line vue/no-mutating-propsprops.config.applicationId = value;if (state.applicationIdValidationTimer) {@@ -205,6 +235,7 @@ export default {};const changeSecret = (value: string) => {+ // eslint-disable-next-line vue/no-mutating-propsprops.config.secret = value;if (state.secretValidationTimer) {@@ -240,5 +271,5 @@ export default {changeSecret,};},-};+});</script>diff --git a/frontend/src/layouts/BodyLayout.vue b/frontend/src/layouts/BodyLayout.vueindex fdd39bc2ec..776bdc1669 100644--- a/frontend/src/layouts/BodyLayout.vue+++ b/frontend/src/layouts/BodyLayout.vue@@ -8,31 +8,12 @@</div><divtabindex="0"- class="- relative- flex-1 flex flex-col- max-w-xs- w-full- bg-white- focus:outline-none- "+ class="relative flex-1 flex flex-col max-w-xs w-full bg-white focus:outline-none"><div class="absolute top-0 right-0 -mr-12 pt-2"><buttontype="button"- class="- ml-1- flex- items-center- justify-center- h-10- w-10- rounded-full- focus:outline-none- focus:ring-2- focus:ring-inset- focus:ring-white- "+ class="ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white"@click.prevent="state.showMobileOverlay = false"><span class="sr-only">Close sidebar</span>@@ -61,7 +42,7 @@><div class="flex items-center"><heroicons-outline:question-mark-circle class="w-5 h-5 mr-2" />- <span class="text-sm">{{ $t('common.help') }}</span>+ <span class="text-sm">{{ $t("common.help") }}</span></div><div class="text-sm">{{ version }}</div></a>@@ -89,12 +70,7 @@</router-link><divv-if="showQuickstart"- class="- flex-shrink-0 flex- justify-center- border-t border-block-border- py-2- "+ class="flex-shrink-0 flex justify-center border-t border-block-border py-2"><Quickstart /></div>@@ -102,15 +78,7 @@<ahref="https://docs.bytebase.com"target="_blank"- class="- flex- justify-between- items-center- flex-shrink-0- w-full- text-main- group- "+ class="flex justify-between items-center flex-shrink-0 w-full text-main group"><div class="flex items-center py-1"><heroicons-outline:question-mark-circle class="w-5 h-5 mr-2" />@@ -127,30 +95,12 @@<!-- Static sidebar for mobile --><aside class="md:hidden"><div- class="- flex- items-center- justify-start- bg-gray-50- border-b border-block-border- px-4- py-1.5- "+ class="flex items-center justify-start bg-gray-50 border-b border-block-border px-4 py-1.5"><div><buttontype="button"- class="- -mr-3- h-12- w-12- inline-flex- items-center- justify-center- rounded-md- text-gray-500- hover:text-gray-900- "+ class="-mr-3 h-12 w-12 inline-flex items-center justify-center rounded-md text-gray-500 hover:text-gray-900"@click.prevent="state.showMobileOverlay = true"><span class="sr-only">Open sidebar</span>diff --git a/frontend/src/layouts/DashboardLayout.vue b/frontend/src/layouts/DashboardLayout.vueindex 7746cb06ac..e43de04c4d 100644--- a/frontend/src/layouts/DashboardLayout.vue+++ b/frontend/src/layouts/DashboardLayout.vue@@ -5,17 +5,7 @@</template><template v-else-if="isReadonly"><div- class="- h-12- w-full- text-lg- font-medium- bg-yellow-500- text-white- flex- justify-center- items-center- "+ class="h-12 w-full text-lg font-medium bg-yellow-500 text-white flex justify-center items-center">Server is in readonly mode. You can still view the console, but anychange attempt will fail.diff --git a/frontend/src/plugins/issue/DatabaseDataUpdateTemplate.ts b/frontend/src/plugins/issue/DatabaseDataUpdateTemplate.tsindex 2b64a54142..73536c02d9 100644--- a/frontend/src/plugins/issue/DatabaseDataUpdateTemplate.ts+++ b/frontend/src/plugins/issue/DatabaseDataUpdateTemplate.ts@@ -1,66 +1,66 @@import {- IssueCreate,- PipelineApporvalPolicyPayload,- StageCreate,- UNKNOWN_ID,+ IssueCreate,+ PipelineApporvalPolicyPayload,+ StageCreate,+ UNKNOWN_ID,} from "../../types";import { IssueTemplate, TemplateContext } from "../types";const template: IssueTemplate = {- type: "bb.issue.database.data.update",- buildIssue: (- ctx: TemplateContext- ): Omit<IssueCreate, "projectId" | "creatorId"> => {- const payload: any = {};- const stageList: StageCreate[] = [];- for (let i = 0; i < ctx.databaseList.length; i++) {- stageList.push({- name: `[${ctx.environmentList[i].name}] ${ctx.databaseList[i].name}`,- environmentId: ctx.environmentList[i].id,- taskList: [- {- name: `Change ${ctx.databaseList[i].name} data`,- status:- (- ctx.approvalPolicyList[i]- .payload as PipelineApporvalPolicyPayload- ).value == "MANUAL_APPROVAL_ALWAYS"- ? "PENDING_APPROVAL"- : "PENDING",- type: "bb.task.database.data.update",- instanceId: ctx.databaseList[i].instance.id,- databaseId: ctx.databaseList[i].id,- statement: ctx.statementList ? ctx.statementList[i] : "",- rollbackStatement: ctx.rollbackStatementList- ? ctx.rollbackStatementList[i]- : "",- migrationType: "MIGRATE",- earliestAllowedTs: 0,- },- ],- });- }- return {- name:- ctx.databaseList.length == 1- ? `[${ctx.databaseList[0].name}] Change data`- : "Change database data",- type: "bb.issue.database.data.update",- description: "",- assigneeId: UNKNOWN_ID,- pipeline: {- stageList,- name:- ctx.databaseList.length == 1- ? `[${ctx.databaseList[0].name}] Change data pipeline`- : "Update database data pipeline",- },- createContext: {},- payload,- };- },- inputFieldList: [],- outputFieldList: [],+ type: "bb.issue.database.data.update",+ buildIssue: (+ ctx: TemplateContext+ ): Omit<IssueCreate, "projectId" | "creatorId"> => {+ const payload: any = {};+ const stageList: StageCreate[] = [];+ for (let i = 0; i < ctx.databaseList.length; i++) {+ stageList.push({+ name: `[${ctx.environmentList[i].name}] ${ctx.databaseList[i].name}`,+ environmentId: ctx.environmentList[i].id,+ taskList: [+ {+ name: `Change ${ctx.databaseList[i].name} data`,+ status:+ (+ ctx.approvalPolicyList[i]+ .payload as PipelineApporvalPolicyPayload+ ).value == "MANUAL_APPROVAL_ALWAYS"+ ? "PENDING_APPROVAL"+ : "PENDING",+ type: "bb.task.database.data.update",+ instanceId: ctx.databaseList[i].instance.id,+ databaseId: ctx.databaseList[i].id,+ statement: ctx.statementList ? ctx.statementList[i] : "",+ rollbackStatement: ctx.rollbackStatementList+ ? ctx.rollbackStatementList[i]+ : "",+ migrationType: "MIGRATE",+ earliestAllowedTs: 0,+ },+ ],+ });+ }+ return {+ name:+ ctx.databaseList.length == 1+ ? `[${ctx.databaseList[0].name}] Change data`+ : "Change database data",+ type: "bb.issue.database.data.update",+ description: "",+ assigneeId: UNKNOWN_ID,+ pipeline: {+ stageList,+ name:+ ctx.databaseList.length == 1+ ? `[${ctx.databaseList[0].name}] Change data pipeline`+ : "Update database data pipeline",+ },+ createContext: {},+ payload,+ };+ },+ inputFieldList: [],+ outputFieldList: [],};export default template;diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.tsindex 6b932721e5..9447960adf 100644--- a/frontend/src/router/index.ts+++ b/frontend/src/router/index.ts@@ -96,56 +96,56 @@ const routes: Array<RouteRecordRaw> = ["subscription/feature"]("bb.feature.dba-workflow")? [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- "quickaction.bb.database.create",- "quickaction.bb.database.troubleshoot",- "quickaction.bb.instance.create",- "quickaction.bb.project.create",- "quickaction.bb.user.manage",- ]+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.data.update",+ "quickaction.bb.database.create",+ "quickaction.bb.database.troubleshoot",+ "quickaction.bb.instance.create",+ "quickaction.bb.project.create",+ "quickaction.bb.user.manage",+ ]: [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- "quickaction.bb.database.create",- "quickaction.bb.instance.create",- "quickaction.bb.project.create",- "quickaction.bb.user.manage",- ];+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.data.update",+ "quickaction.bb.database.create",+ "quickaction.bb.instance.create",+ "quickaction.bb.project.create",+ "quickaction.bb.user.manage",+ ];const dbaList: QuickActionType[] = store.getters["subscription/feature"]("bb.feature.dba-workflow")? [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- "quickaction.bb.database.create",- "quickaction.bb.database.troubleshoot",- "quickaction.bb.instance.create",- "quickaction.bb.project.create",- ]+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.data.update",+ "quickaction.bb.database.create",+ "quickaction.bb.database.troubleshoot",+ "quickaction.bb.instance.create",+ "quickaction.bb.project.create",+ ]: [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- "quickaction.bb.database.create",- "quickaction.bb.instance.create",- "quickaction.bb.project.create",- ];+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.data.update",+ "quickaction.bb.database.create",+ "quickaction.bb.instance.create",+ "quickaction.bb.project.create",+ ];const developerList: QuickActionType[] = store.getters["subscription/feature"]("bb.feature.dba-workflow")? [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- "quickaction.bb.database.request",- "quickaction.bb.database.troubleshoot",- "quickaction.bb.project.create",- ]+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.data.update",+ "quickaction.bb.database.request",+ "quickaction.bb.database.troubleshoot",+ "quickaction.bb.project.create",+ ]: [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- "quickaction.bb.database.create",- "quickaction.bb.project.create",- ];+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.data.update",+ "quickaction.bb.database.create",+ "quickaction.bb.project.create",+ ];return new Map([["OWNER", ownerList],["DBA", dbaList],@@ -473,19 +473,19 @@ const routes: Array<RouteRecordRaw> = [}}--const actionList: string[] = allowEditProject- ? project.tenantMode == 'DISABLED' ? [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- "quickaction.bb.database.create",- "quickaction.bb.project.database.transfer",- ] : [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.create",- "quickaction.bb.project.database.transfer",- ]+ ? project.tenantMode == "DISABLED"+ ? [+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.data.update",+ "quickaction.bb.database.create",+ "quickaction.bb.project.database.transfer",+ ]+ : [+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.create",+ "quickaction.bb.project.database.transfer",+ ]: [];return new Map([["OWNER", actionList],@@ -530,11 +530,12 @@ const routes: Array<RouteRecordRaw> = [const projectSlug = route.params.projectSlug as string;const projectWebhookSlug = route.params.projectWebhookSlug as string;- return `${t("common.webhook")} - ${store.getters["projectWebhook/projectWebhookById"](- idFromSlug(projectSlug),- idFromSlug(projectWebhookSlug)- ).name- }`;+ return `${t("common.webhook")} - ${+ store.getters["projectWebhook/projectWebhookById"](+ idFromSlug(projectSlug),+ idFromSlug(projectWebhookSlug)+ ).name+ }`;},allowBookmark: true,},@@ -571,44 +572,44 @@ const routes: Array<RouteRecordRaw> = ["subscription/feature"]("bb.feature.dba-workflow")? [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- "quickaction.bb.database.create",- "quickaction.bb.database.troubleshoot",- ]+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.data.update",+ "quickaction.bb.database.create",+ "quickaction.bb.database.troubleshoot",+ ]: [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- "quickaction.bb.database.create",- ];+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.data.update",+ "quickaction.bb.database.create",+ ];const dbaList: QuickActionType[] = store.getters["subscription/feature"]("bb.feature.dba-workflow")? [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- "quickaction.bb.database.create",- "quickaction.bb.database.troubleshoot",- ]+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.data.update",+ "quickaction.bb.database.create",+ "quickaction.bb.database.troubleshoot",+ ]: [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- "quickaction.bb.database.create",- ];+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.data.update",+ "quickaction.bb.database.create",+ ];const developerList: QuickActionType[] = store.getters["subscription/feature"]("bb.feature.dba-workflow")? [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- "quickaction.bb.database.request",- "quickaction.bb.database.troubleshoot",- ]+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.data.update",+ "quickaction.bb.database.request",+ "quickaction.bb.database.troubleshoot",+ ]: [- "quickaction.bb.database.schema.update",- "quickaction.bb.database.data.update",- "quickaction.bb.database.create",- ];+ "quickaction.bb.database.schema.update",+ "quickaction.bb.database.data.update",+ "quickaction.bb.database.create",+ ];return new Map([["OWNER", ownerList],["DBA", dbaList],@@ -681,10 +682,11 @@ const routes: Array<RouteRecordRaw> = [if (slug.toLowerCase() == "new") {return t("common.new");}- return `${t("common.data-source")} - ${store.getters["dataSource/dataSourceById"](- idFromSlug(slug)- ).name- }`;+ return `${t("common.data-source")} - ${+ store.getters["dataSource/dataSourceById"](+ idFromSlug(slug)+ ).name+ }`;},allowBookmark: true,},diff --git a/frontend/src/store/actions.ts b/frontend/src/store/actions.tsindex a30751c62a..f95dd1b7e0 100644--- a/frontend/src/store/actions.ts+++ b/frontend/src/store/actions.ts@@ -16,4 +16,4 @@ export function makeActions<T>(types: StringRecord = {}): T {}return actions as T;-};+}diff --git a/frontend/src/store/modules/sql.ts b/frontend/src/store/modules/sql.tsindex ff32a0e2b6..c2af399b93 100644--- a/frontend/src/store/modules/sql.ts+++ b/frontend/src/store/modules/sql.ts@@ -77,7 +77,7 @@ const actions = {type: "sqlExecute",attributes: {...queryInfo,- readonly: true+ readonly: true,},},},diff --git a/frontend/src/types/sql.ts b/frontend/src/types/sql.tsindex 9f051e71fb..fb5a3be61d 100644--- a/frontend/src/types/sql.ts+++ b/frontend/src/types/sql.ts@@ -21,7 +21,7 @@ export type QueryInfo = {databaseName?: string;statement: string;limit?: number;-}+};export type SqlResultSet = {data: string;diff --git a/frontend/src/utils/role.ts b/frontend/src/utils/role.tsindex 30d185c2a8..e831816477 100644--- a/frontend/src/utils/role.ts+++ b/frontend/src/utils/role.ts@@ -9,12 +9,16 @@ export function registerStoreWithRoleUtil(theStore: Store<any>) {// Returns true if admin feature is NOT supported or the principal is OWNERexport function isOwner(role: RoleType): boolean {- return !store.getters["subscription/feature"]("bb.feature.rbac") || role == "OWNER";+ return (+ !store.getters["subscription/feature"]("bb.feature.rbac") || role == "OWNER"+ );}// Returns true if admin feature is NOT supported or the principal is DBAexport function isDBA(role: RoleType): boolean {- return !store.getters["subscription/feature"]("bb.feature.rbac") || role == "DBA";+ return (+ !store.getters["subscription/feature"]("bb.feature.rbac") || role == "DBA"+ );}export function isDBAOrOwner(role: RoleType): boolean {@@ -23,7 +27,10 @@ export function isDBAOrOwner(role: RoleType): boolean {// Returns true if admin feature is NOT supported or the principal is DEVELOPERexport function isDeveloper(role: RoleType): boolean {- return !store.getters["subscription/feature"]("bb.feature.rbac") || role == "DEVELOPER";+ return (+ !store.getters["subscription/feature"]("bb.feature.rbac") ||+ role == "DEVELOPER"+ );}export function roleName(role: RoleType): string {@@ -39,11 +46,16 @@ export function roleName(role: RoleType): string {// Project Roleexport function isProjectOwner(role: ProjectRoleType): boolean {- return !store.getters["subscription/feature"]("bb.feature.rbac") || role == "OWNER";+ return (+ !store.getters["subscription/feature"]("bb.feature.rbac") || role == "OWNER"+ );}export function isProjectDeveloper(role: ProjectRoleType): boolean {- return !store.getters["subscription/feature"]("bb.feature.rbac") || role == "DEVELOPER";+ return (+ !store.getters["subscription/feature"]("bb.feature.rbac") ||+ role == "DEVELOPER"+ );}export function projectRoleName(role: ProjectRoleType): string {diff --git a/frontend/src/views/BannerDemo.vue b/frontend/src/views/BannerDemo.vueindex 5ad8b9e5a2..290e0443d1 100644--- a/frontend/src/views/BannerDemo.vue+++ b/frontend/src/views/BannerDemo.vue@@ -5,9 +5,7 @@<div class="w-0 flex-1 flex items-center"><p class="ml-3 font-medium text-white truncate"><span>- {{- $t(`banner.demo-intro${isReadonly ? '-readonly' : ''}`)- }}+ {{ $t(`banner.demo-intro${isReadonly ? "-readonly" : ""}`) }}</span></p></div>@@ -17,22 +15,7 @@<ahref="https://github.com/bytebase/bytebase"target="_blank"- class="- flex- items-center- justify-center- pl-4- pr-2- py-2- border border-transparent- rounded-md- shadow-sm- text-base- font-medium- text-accent- bg-white- hover:bg-indigo-50- "+ class="flex items-center justify-center pl-4 pr-2 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-accent bg-white hover:bg-indigo-50">{{ $t("banner.action") }}<heroicons-outline:lightning-bolt class="ml-1 w-6 h-6" />@@ -41,15 +24,7 @@<div class="order-2 flex-shrink-0 sm:order-3 sm:ml-3"><buttontype="button"- class="- -mr-1- flex- p-2- rounded-md- hover:bg-accent-hover- focus:outline-none focus:ring-2 focus:ring-white- sm:-mr-2- "+ class="-mr-1 flex p-2 rounded-md hover:bg-accent-hover focus:outline-none focus:ring-2 focus:ring-white sm:-mr-2"@click.prevent="show = false"><span class="sr-only">{{ $t("common.dismiss") }}</span>diff --git a/frontend/src/views/DatabaseDetail.vue b/frontend/src/views/DatabaseDetail.vueindex 72fe994643..92f9124d84 100644--- a/frontend/src/views/DatabaseDetail.vue+++ b/frontend/src/views/DatabaseDetail.vue@@ -2,7 +2,9 @@<div class="flex-1 overflow-auto focus:outline-none" tabindex="0"><main class="flex-1 relative overflow-y-auto"><!-- Highlight Panel -->- <div class="px-4 pb-4 space-y-2 md:space-y-0 md:flex md:items-center md:justify-between">+ <div+ class="px-4 pb-4 space-y-2 md:space-y-0 md:flex md:items-center md:justify-between"+ ><div class="flex-1 min-w-0"><!-- Summary --><div class="flex items-center">@@ -10,47 +12,62 @@<div class="flex items-center"><h1class="pt-2 pb-2.5 text-xl font-bold leading-6 text-main truncate"- >{{ database.name }}</h1>+ >+ {{ database.name }}+ </h1></div></div></div>- <dl class="flex flex-col space-y-1 md:space-y-0 md:flex-row md:flex-wrap">+ <dl+ class="flex flex-col space-y-1 md:space-y-0 md:flex-row md:flex-wrap"+ ><dt class="sr-only">{{ $t("common.environment") }}</dt><dd class="flex items-center text-sm md:mr-4">- <span class="textlabel">{{ $t("common.environment") }} - </span>+ <span class="textlabel"+ >{{ $t("common.environment") }} - </span+ ><router-link:to="`/environment/${environmentSlug(database.instance.environment)}`"class="normal-link">- {{- environmentName(database.instance.environment)- }}+ {{ environmentName(database.instance.environment) }}</router-link></dd><dt class="sr-only">{{ $t("common.instance") }}</dt><dd class="flex items-center text-sm md:mr-4"><InstanceEngineIcon :instance="database.instance" />- <span class="ml-1 textlabel">{{ $t("common.instance") }} - </span>+ <span class="ml-1 textlabel"+ >{{ $t("common.instance") }} - </span+ ><router-link:to="`/instance/${instanceSlug(database.instance)}`"class="normal-link"- >{{ instanceName(database.instance) }}</router-link>+ >{{ instanceName(database.instance) }}</router-link+ ></dd><dt class="sr-only">{{ $t("common.project") }}</dt><dd class="flex items-center text-sm md:mr-4">- <span class="textlabel">{{ $t("common.project") }} - </span>+ <span class="textlabel"+ >{{ $t("common.project") }} - </span+ ><router-link:to="`/project/${projectSlug(database.project)}`"class="normal-link"- >{{ projectName(database.project) }}</router-link>+ >{{ projectName(database.project) }}</router-link+ ></dd><template v-if="database.sourceBackup"><dt class="sr-only">{{ $t("db.parent") }}</dt><dd class="flex items-center text-sm md:mr-4 tooltip-wrapper">- <span class="textlabel">{{ $t("database.restored-from") }}</span>- <router-link :to="`/db/${database.sourceBackup.databaseId}`" class="normal-link">+ <span class="textlabel">{{+ $t("database.restored-from")+ }}</span>+ <router-link+ :to="`/db/${database.sourceBackup.databaseId}`"+ class="normal-link"+ ><!-- Do not display the name of the backup's database because that requires a fetch --><span class="tooltip">{{@@ -72,7 +89,9 @@</dd></dl><div v-if="isTenantProject" class="flex items-center mt-2 h-7">- <label class="textlabel">{{ $t("common.labels") }} - </label>+ <label class="textlabel"+ >{{ $t("common.labels") }} - </label+ ><DatabaseLabelsEditor:label-list="database.labels":allow-edit="allowEditDatabaseLabels"@@ -88,16 +107,28 @@@click.prevent="tryTransferProject"><span>{{ $t("database.transfer-project") }}</span>- <heroicons-outline:switch-horizontal class="-mr-1 ml-2 h-5 w-5 text-control-light" />+ <heroicons-outline:switch-horizontal+ class="-mr-1 ml-2 h-5 w-5 text-control-light"+ /></button>- <button v-if="allowEdit" type="button" class="btn-normal" @click.prevent="changeData">+ <button+ v-if="allowEdit"+ type="button"+ class="btn-normal"+ @click.prevent="changeData"+ ><span>{{ changeDataText }}</span><heroicons-outline:external-linkv-if="database.project.workflowType == 'VCS'"class="-mr-1 ml-2 h-5 w-5 text-control-light"/></button>- <button v-if="allowEdit" type="button" class="btn-normal" @click.prevent="alterSchema">+ <button+ v-if="allowEdit"+ type="button"+ class="btn-normal"+ @click.prevent="alterSchema"+ ><span>{{ alterSchemaText }}</span><heroicons-outline:external-linkv-if="database.project.workflowType == 'VCS'"@@ -136,16 +167,20 @@type="button"class="btn-normal py-2 px-4"@click.prevent="state.showModal = false"- >{{ $t("common.cancel") }}</button>+ >+ {{ $t("common.cancel") }}+ </button><buttontype="button"class="btn-primary ml-3 inline-flex justify-center py-2 px-4":disabled="state.editingProjectId == database.project.id"@click.prevent="- updateProject(state.editingProjectId);-state.showModal = false;+ updateProject(state.editingProjectId);+ state.showModal = false;"- >{{ $t("common.transfer") }}</button>+ >+ {{ $t("common.transfer") }}+ </button></div></BBModal><BBTabFilter@@ -164,7 +199,10 @@ state.showModal = false;<DatabaseOverviewPanel :database="database" /></template><template v-if="state.selectedIndex == MIGRATION_HISTORY_TAB">- <DatabaseMigrationHistoryPanel :database="database" :allow-edit="allowEdit" />+ <DatabaseMigrationHistoryPanel+ :database="database"+ :allow-edit="allowEdit"+ /></template><template v-if="state.selectedIndex == BACKUP_TAB"><DatabaseBackupPaneldiff --git a/frontend/src/views/InstanceDashboard.vue b/frontend/src/views/InstanceDashboard.vueindex 8eb352efbe..8140cbee3d 100644--- a/frontend/src/views/InstanceDashboard.vue+++ b/frontend/src/views/InstanceDashboard.vue@@ -1,8 +1,8 @@<template><div class="flex flex-col"><FeatureAttention- custom-class="m-5"v-if="remainingInstanceCount <= 3"+ custom-class="m-5"feature="bb.feature.instance-count":description="instanceCountAttention"/>diff --git a/frontend/src/views/IssueDetail.vue b/frontend/src/views/IssueDetail.vueindex 0c3145f597..5dacf1750a 100644--- a/frontend/src/views/IssueDetail.vue+++ b/frontend/src/views/IssueDetail.vue@@ -198,8 +198,8 @@ export default defineComponent({project = await store.dispatch("project/fetchProjectById", projectId);}- return project- }+ return project;+ };const maybeBuildTenantDeployIssue = async (): Promise<IssueCreate | false@@ -208,7 +208,7 @@ export default defineComponent({return false;}- const project = await findProject()+ const project = await findProject();const issueType = route.query.template as IssueType;if (project.tenantMode === "TENANT" &&@@ -241,7 +241,10 @@ export default defineComponent({title ="INVALID STATE, please create rollback from the original issue.";} else {- if (rollbackIssue.type != "bb.issue.database.schema.update" && rollbackIssue.type != "bb.issue.database.data.update") {+ if (+ rollbackIssue.type != "bb.issue.database.schema.update" &&+ rollbackIssue.type != "bb.issue.database.data.update"+ ) {title ="INVALID STATE, only support to rollback update schema or change data issue.";} else if (@@ -253,20 +256,23 @@ export default defineComponent({} else {for (const stage of rollbackIssue.pipeline.stageList) {for (const task of stage.taskList) {- if (- task.status == "DONE") {- if (task.type == "bb.task.database.schema.update" &&+ if (task.status == "DONE") {+ if (+ task.type == "bb.task.database.schema.update" &&!isEmpty((task.payload as TaskDatabaseSchemaUpdatePayload).rollbackStatement- )) {+ )+ ) {validState = true;break;- } else if (task.type == "bb.task.database.data.update" &&+ } else if (+ task.type == "bb.task.database.data.update" &&!isEmpty((task.payload as TaskDatabaseDataUpdatePayload).rollbackStatement- )) {+ )+ ) {validState = true;break;}@@ -299,21 +305,25 @@ export default defineComponent({const stage = rollbackIssue.pipeline.stageList[i];for (let j = stage.taskList.length - 1; j >= 0; j--) {const task = stage.taskList[j];- let allowRollback = false+ let allowRollback = false;if (task.status == "DONE") {- if (task.type == "bb.task.database.schema.update" &&+ if (+ task.type == "bb.task.database.schema.update" &&!isEmpty((task.payload as TaskDatabaseSchemaUpdatePayload).rollbackStatement- )) {- allowRollback = true- } else if (task.type == "bb.task.database.data.update" &&+ )+ ) {+ allowRollback = true;+ } else if (+ task.type == "bb.task.database.data.update" &&!isEmpty((task.payload as TaskDatabaseDataUpdatePayload).rollbackStatement- )) {- allowRollback = true+ )+ ) {+ allowRollback = true;}}@@ -524,7 +534,7 @@ export default defineComponent({() => state.newIssue,async (issue) => {if (issue?.type === "bb.issue.database.schema.update") {- const project = await findProject()+ const project = await findProject();if (project.tenantMode === "TENANT" &&!store.getters["subscription/feature"]("bb.feature.multi-tenancy")@@ -533,7 +543,7 @@ export default defineComponent({}}}- )+ );const onStatusChanged = (eager: boolean) => {pollIssue(eager ? POST_CHANGE_POLL_INTERVAL : NORMAL_POLL_INTERVAL);diff --git a/frontend/src/views/ProfileDashboard.vue b/frontend/src/views/ProfileDashboard.vueindex ce92e21e4d..c353d3229b 100644--- a/frontend/src/views/ProfileDashboard.vue+++ b/frontend/src/views/ProfileDashboard.vue@@ -1,5 +1,8 @@<template>- <main class="flex-1 relative z-0 overflow-auto focus:outline-none xl:order-last" tabindex="0">+ <main+ class="flex-1 relative z-0 overflow-auto focus:outline-none xl:order-last"+ tabindex="0"+ ><article><!-- Profile header --><div>@@ -13,7 +16,9 @@<div class="mt-6 flex flex-row justify-stretch space-x-4"><button v-if="false" type="button" class="btn-normal"><!-- Heroicon name: solid/mail -->- <heroicons-solid:mail class="-ml-1 mr-2 h-5 w-5 text-control-light" />+ <heroicons-solid:mail+ class="-ml-1 mr-2 h-5 w-5 text-control-light"+ /><span>Message</span></button><template v-if="allowEdit">@@ -22,7 +27,9 @@type="button"class="btn-normal"@click.prevent="cancelEdit"- >{{ $t("common.cancel") }}</button>+ >+ {{ $t("common.cancel") }}+ </button><buttontype="button"class="btn-normal"@@ -30,13 +37,22 @@@click.prevent="saveEdit"><!-- Heroicon name: solid/save -->- <heroicons-solid:save class="-ml-1 mr-2 h-5 w-5 text-control-light" />+ <heroicons-solid:save+ class="-ml-1 mr-2 h-5 w-5 text-control-light"+ /><span>{{ $t("common.save") }}</span></button></template>- <button v-else type="button" class="btn-normal" @click.prevent="editUser">+ <button+ v-else+ type="button"+ class="btn-normal"+ @click.prevent="editUser"+ ><!-- Heroicon name: solid/pencil -->- <heroicons-solid:pencil class="-ml-1 mr-2 h-5 w-5 text-control-light" />+ <heroicons-solid:pencil+ class="-ml-1 mr-2 h-5 w-5 text-control-light"+ /><span>{{ $t("common.edit") }}</span></button></template>@@ -53,11 +69,13 @@name="name"type="text"class="textfield"- :value="state.editingPrincipal.name"- @input="updatePrincipal('name', $event.target.value)"+ :value="state.editingPrincipal?.name"+ @input="(e: any)=>updatePrincipal('name', e.target.value)"/><!-- pb-1.5 is to avoid flicking when entering/existing the editing state -->- <h1 v-else class="pb-1.5 text-2xl font-bold text-main truncate">{{ principal.name }}</h1>+ <h1 v-else class="pb-1.5 text-2xl font-bold text-main truncate">+ {{ principal.name }}+ </h1></div></div></div>@@ -69,29 +87,35 @@><dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2"><div class="sm:col-span-1">- <dt class="text-sm font-medium text-control-light">{{ $t("settings.profile.role") }}</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("settings.profile.role") }}+ </dt><dd class="mt-1 text-sm text-main"><router-link:to="'/setting/member'"class="normal-link capitalize"- >{{ $t(`common.role.${principal.role.toLowerCase()}`) }}</router-link>- <router-link- :to="'/setting/subscription'"- class="normal-link"- >{{ $t("settings.profile.subscription") }}</router-link>+ >{{+ $t(`common.role.${principal.role.toLowerCase()}`)+ }}</router-link+ >+ <router-link :to="'/setting/subscription'" class="normal-link">{{+ $t("settings.profile.subscription")+ }}</router-link></dd></div><div class="sm:col-span-1">- <dt class="text-sm font-medium text-control-light">{{ $t("settings.profile.email") }}</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("settings.profile.email") }}+ </dt><dd class="mt-1 text-sm text-main">{{ principal.email }}</dd></div><template v-if="state.editing"><div class="sm:col-span-1">- <dt- class="text-sm font-medium text-control-light"- >{{ $t("settings.profile.password") }}</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("settings.profile.password") }}+ </dt><dd class="mt-1 text-sm text-main"><inputid="password"@@ -100,8 +124,8 @@class="textfield mt-1 w-full"autocomplete="off":placeholder="$t('common.sensitive-placeholder')"- :value="state.editingPrincipal.password"- @input="updatePrincipal('password', $event.target.value)"+ :value="state.editingPrincipal?.password"+ @input="(e: any) => updatePrincipal('password', e.target.value)"/></dd></div>@@ -109,10 +133,9 @@<div class="sm:col-span-1"><dt class="text-sm font-medium text-control-light">{{ $t("settings.profile.password-confirm") }}- <span- v-if="passwordMismatch"- class="text-error"- >{{ $t("settings.profile.password-mismatch") }}</span>+ <span v-if="passwordMismatch" class="text-error">{{+ $t("settings.profile.password-mismatch")+ }}</span></dt><dd class="mt-1 text-sm text-main"><input@@ -121,9 +144,11 @@type="text"class="textfield mt-1 w-full"autocomplete="off"- :placeholder="$t('settings.profile.password-confirm-placeholder')"+ :placeholder="+ $t('settings.profile.password-confirm-placeholder')+ ":value="state.passwordConfirm"- @input="state.passwordConfirm = $event.target.value"+ @input="(e: any) => state.passwordConfirm = e.target.value"/></dd></div>@@ -135,7 +160,15 @@</template><script lang="ts">-import { nextTick, computed, onMounted, onUnmounted, reactive, ref } from "vue";+import {+ nextTick,+ computed,+ onMounted,+ onUnmounted,+ reactive,+ ref,+ defineComponent,+} from "vue";import { useStore } from "vuex";import cloneDeep from "lodash-es/cloneDeep";import isEmpty from "lodash-es/isEmpty";@@ -150,12 +183,13 @@ interface LocalState {passwordConfirm?: string;}-export default {+export default defineComponent({name: "ProfileDashboard",components: { PrincipalAvatar },props: {principalId: {type: String,+ default: undefined,},},setup(props) {@@ -273,5 +307,5 @@ export default {saveEdit,};},-};+});</script>diff --git a/frontend/src/views/SettingSidebar.vue b/frontend/src/views/SettingSidebar.vueindex 63cac2cc8f..1703246844 100644--- a/frontend/src/views/SettingSidebar.vue+++ b/frontend/src/views/SettingSidebar.vue@@ -23,7 +23,8 @@<router-linkto="/setting/profile"class="outline-item group w-full flex items-center pl-11 pr-2 py-2"- >{{ $t("settings.sidebar.profile") }}</router-link>+ >{{ $t("settings.sidebar.profile") }}</router-link+ ></div></div><div class="mt-8">@@ -49,7 +50,8 @@<router-linkto="/setting/member"class="outline-item group w-full flex items-center pl-11 pr-2 py-2"- >{{ $t("settings.sidebar.members") }}</router-link>+ >{{ $t("settings.sidebar.members") }}</router-link+ ><!--Label Management is visible to allbut only editable to Owners and DBAs@@ -57,17 +59,20 @@<router-linkto="/setting/label"class="outline-item group w-full flex items-center pl-11 pr-2 py-2"- >{{ $t("settings.sidebar.labels") }}</router-link>+ >{{ $t("settings.sidebar.labels") }}</router-link+ ><router-linkv-if="showOwnerItem"to="/setting/version-control"class="outline-item group w-full flex items-center pl-11 pr-2 py-2"- >{{ $t("settings.sidebar.version-control") }}</router-link>+ >{{ $t("settings.sidebar.version-control") }}</router-link+ ><router-linkv-if="isDev()"to="/setting/subscription"class="outline-item group w-full flex items-center pl-11 pr-2 py-2"- >{{ $t("settings.sidebar.subscription") }}</router-link>+ >{{ $t("settings.sidebar.subscription") }}</router-link+ ><!-- <router-linkto="/setting/billing"class="outline-item group w-full flex items-center pl-11 pr-2 py-2"diff --git a/frontend/src/views/SettingWorkspaceGeneral.vue b/frontend/src/views/SettingWorkspaceGeneral.vueindex 08c6ba7c11..bf8b2bf5e3 100644--- a/frontend/src/views/SettingWorkspaceGeneral.vue+++ b/frontend/src/views/SettingWorkspaceGeneral.vue@@ -6,30 +6,27 @@class="btn-primary":disabled="!allowSave"@click.prevent="doSave"- >{{ $t("common.update") }}</button>+ >+ {{ $t("common.update") }}+ </button></div></div></template><script lang="ts">-import { computed, reactive } from "vue";+import { computed, defineComponent, reactive } from "vue";import { useStore } from "vuex";import { isOwner } from "../utils";-import { Setting } from "../types/setting";-interface LocalState {-}+// eslint-disable-next-line @typescript-eslint/no-empty-interface+interface LocalState {}-export default {+export default defineComponent({name: "SettingWorkspaceGeneral",- data() {- return { placeholder: "{{ DB_NAME_PLACEHOLDER }}" }- },setup() {const store = useStore();- const state = reactive<LocalState>({- });+ const state = reactive<LocalState>({});const currentUser = computed(() => store.getters["auth/currentUser"]());@@ -42,6 +39,7 @@ export default {});const doSave = () => {+ // do nothing};return {@@ -51,5 +49,8 @@ export default {doSave,};},-};+ data() {+ return { placeholder: "{{ DB_NAME_PLACEHOLDER }}" };+ },+});</script>diff --git a/frontend/src/views/SettingWorkspaceMember.vue b/frontend/src/views/SettingWorkspaceMember.vueindex e324514851..d0d3a68dea 100644--- a/frontend/src/views/SettingWorkspaceMember.vue+++ b/frontend/src/views/SettingWorkspaceMember.vue@@ -3,27 +3,28 @@<MemberAddOrInvite /></div><FeatureAttention- v-if="!hasRBACFeature"- custom-class="my-5"- feature="bb.feature.rbac"- :description="$t('subscription.features.bb-feature-rbac.desc')"+ v-if="!hasRBACFeature"+ custom-class="my-5"+ feature="bb.feature.rbac"+ :description="$t('subscription.features.bb-feature-rbac.desc')"/><div><div class="flex flex-row space-x-2">- <p class="text-lg font-medium leading-7 text-main">{{ $t("settings.members.active") }}</p>+ <p class="text-lg font-medium leading-7 text-main">+ {{ $t("settings.members.active") }}+ </p><div v-if="showUpgradeInfo" class="flex flex-row items-center space-x-1"><heroicons-solid:sparkles class="w-6 h-6 text-accent" />- <router-link- to="/setting/subscription"- class="text-lg accent-link"- >{{ $t("settings.members.upgrade") }}</router-link>+ <router-link to="/setting/subscription" class="text-lg accent-link">{{+ $t("settings.members.upgrade")+ }}</router-link></div></div><MemberTable :member-list="activeMemberList" /><div v-if="inactiveMemberList.length > 0" class="mt-8">- <p- class="text-lg font-medium leading-7 text-control-light"- >{{ $t("settings.members.inactive") }}</p>+ <p class="text-lg font-medium leading-7 text-control-light">+ {{ $t("settings.members.inactive") }}+ </p><MemberTable :member-list="inactiveMemberList" /></div></div>diff --git a/frontend/src/views/SettingWorkspaceVCSCreate.vue b/frontend/src/views/SettingWorkspaceVCSCreate.vueindex de09f71cf6..54ba971db7 100644--- a/frontend/src/views/SettingWorkspaceVCSCreate.vue+++ b/frontend/src/views/SettingWorkspaceVCSCreate.vue@@ -8,9 +8,9 @@target="_blank"class="normal-link">- {{ $t('common.detailed-guide') }}</a+ {{ $t("common.detailed-guide") }}</a>- </template>+ </template></i18n-t></div><div class="pt-4">diff --git a/frontend/src/views/TableDetail.vue b/frontend/src/views/TableDetail.vueindex 20e607bf42..00d6bf36e2 100644--- a/frontend/src/views/TableDetail.vue+++ b/frontend/src/views/TableDetail.vue@@ -12,47 +12,64 @@<div class="flex items-center"><h1class="pt-2 pb-2.5 text-xl font-bold leading-6 text-main truncate"- >{{ table.name }}</h1>+ >+ {{ table.name }}+ </h1></div></div></div>- <dl class="flex flex-col space-y-1 md:space-y-0 md:flex-row md:flex-wrap">+ <dl+ class="flex flex-col space-y-1 md:space-y-0 md:flex-row md:flex-wrap"+ ><dt class="sr-only">{{ $t("common.environment") }}</dt><dd class="flex items-center text-sm md:mr-4">- <span class="textlabel">{{ $t("common.environment") }} - </span>+ <span class="textlabel"+ >{{ $t("common.environment") }} - </span+ ><router-link:to="`/environment/${environmentSlug(database.instance.environment)}`"class="normal-link"- >{{ environmentName(database.instance.environment) }}</router-link>+ >{{+ environmentName(database.instance.environment)+ }}</router-link+ ></dd><dt class="sr-only">{{ $t("common.instance") }}</dt><dd class="flex items-center text-sm md:mr-4"><InstanceEngineIcon :instance="database.instance" />- <span class="ml-1 textlabel">{{ $t("common.instance") }} - </span>+ <span class="ml-1 textlabel"+ >{{ $t("common.instance") }} - </span+ ><router-link:to="`/instance/${instanceSlug(database.instance)}`"class="normal-link"- >{{ instanceName(database.instance) }}</router-link>+ >{{ instanceName(database.instance) }}</router-link+ ></dd><dt class="sr-only">{{ $t("common.project") }}</dt><dd class="flex items-center text-sm md:mr-4">- <span class="textlabel">{{ $t("common.project") }} - </span>+ <span class="textlabel"+ >{{ $t("common.project") }} - </span+ ><router-link:to="`/project/${projectSlug(database.project)}`"class="normal-link"- >{{ projectName(database.project) }}</router-link>+ >{{ projectName(database.project) }}</router-link+ ></dd><dt class="sr-only">{{ $t("common.database") }}</dt><dd class="flex items-center text-sm md:mr-4">- <span class="textlabel">{{ $t("common.database") }} - </span>- <router-link :to="`/db/${databaseSlug}`" class="normal-link">{{ database.name }}</router-link>+ <span class="textlabel"+ >{{ $t("common.database") }} - </span+ >+ <router-link :to="`/db/${databaseSlug}`" class="normal-link">{{+ database.name+ }}</router-link><span class="ml-2 textlabel">- {{- $t("sql-editor.self")- }}+ {{ $t("sql-editor.self") }}</span><button class="ml-1 btn-icon" @click.prevent="gotoSqlEditor"><heroicons-outline:terminal class="w-4 h-4" />@@ -63,41 +80,51 @@</div><div class="mt-6">- <div class="max-w-6xl mx-auto px-6 space-y-6 divide-y divide-block-border">+ <div+ class="max-w-6xl mx-auto px-6 space-y-6 divide-y divide-block-border"+ ><!-- Description list --><dl class="grid grid-cols-1 gap-x-4 gap-y-4 sm:grid-cols-2"><div class="col-span-1 col-start-1">- <dt class="text-sm font-medium text-control-light">{{ $t("database.engine") }}</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("database.engine") }}+ </dt><dd class="mt-1 text-sm text-main">{{- database.instance.engine == "POSTGRES" ||- database.instance.engine == "SNOWFLAKE"- ? "n/a"- : table.engine+ database.instance.engine == "POSTGRES" ||+ database.instance.engine == "SNOWFLAKE"+ ? "n/a"+ : table.engine}}</dd></div><div class="col-span-1">- <dt- class="text-sm font-medium text-control-light"- >{{ $t("database.row-count-estimate") }}</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("database.row-count-estimate") }}+ </dt><dd class="mt-1 text-sm text-main">{{ table.rowCount }}</dd></div><div class="col-span-1 col-start-1">- <dt class="text-sm font-medium text-control-light">{{ $t("database.data-size") }}</dt>- <dd class="mt-1 text-sm text-main">{{ bytesToString(table.dataSize) }}</dd>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("database.data-size") }}+ </dt>+ <dd class="mt-1 text-sm text-main">+ {{ bytesToString(table.dataSize) }}+ </dd></div><div class="col-span-1">- <dt class="text-sm font-medium text-control-light">{{ $t("database.index-size") }}</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("database.index-size") }}+ </dt><dd class="mt-1 text-sm text-main">{{- database.instance.engine == "CLICKHOUSE" ||- database.instance.engine == "SNOWFLAKE"- ? "n/a"- : bytesToString(table.indexSize)+ database.instance.engine == "CLICKHOUSE" ||+ database.instance.engine == "SNOWFLAKE"+ ? "n/a"+ : bytesToString(table.indexSize)}}</dd></div>@@ -111,46 +138,65 @@<div class="col-span-1 col-start-1"><dt class="text-sm font-medium text-control-light">{{- database.instance.engine == "POSTGRES"- ? $t("db.encoding")- : $t("db.character-set")+ database.instance.engine == "POSTGRES"+ ? $t("db.encoding")+ : $t("db.character-set")}}</dt>- <dd class="mt-1 text-sm text-main">{{ database.characterSet }}</dd>+ <dd class="mt-1 text-sm text-main">+ {{ database.characterSet }}+ </dd></div><div class="col-span-1">- <dt class="text-sm font-medium text-control-light">{{ $t("db.collation") }}</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("db.collation") }}+ </dt><dd class="mt-1 text-sm text-main">{{- database.instance.engine == "POSTGRES"- ? "n/a"- : table.collation+ database.instance.engine == "POSTGRES"+ ? "n/a"+ : table.collation}}</dd></div></template><div class="col-span-1 col-start-1">- <dt class="text-sm font-medium text-control-light">{{ $t("common.updated-at") }}</dt>- <dd class="mt-1 text-sm text-main">{{ humanizeTs(table.updatedTs) }}</dd>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("common.updated-at") }}+ </dt>+ <dd class="mt-1 text-sm text-main">+ {{ humanizeTs(table.updatedTs) }}+ </dd></div><div class="col-span-1">- <dt class="text-sm font-medium text-control-light">{{ $t("common.created-at") }}</dt>- <dd class="mt-1 text-sm text-main">{{ humanizeTs(table.createdTs) }}</dd>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("common.created-at") }}+ </dt>+ <dd class="mt-1 text-sm text-main">+ {{ humanizeTs(table.createdTs) }}+ </dd></div></dl></div></div><div class="mt-6 px-6">- <div class="text-lg leading-6 font-medium text-main mb-4">{{ $t("database.columns") }}</div>- <ColumnTable :column-list="table.columnList" :engine="database.instance.engine" />+ <div class="text-lg leading-6 font-medium text-main mb-4">+ {{ $t("database.columns") }}+ </div>+ <ColumnTable+ :column-list="table.columnList"+ :engine="database.instance.engine"+ /></div><div v-if="database.instance.engine != 'SNOWFLAKE'" class="mt-6 px-6">- <div class="text-lg leading-6 font-medium text-main mb-4">{{ $t("database.indexes") }}</div>+ <div class="text-lg leading-6 font-medium text-main mb-4">+ {{ $t("database.indexes") }}+ </div><IndexTable :index-list="table.indexList" /></div></main>diff --git a/frontend/src/views/auth/Signin.vue b/frontend/src/views/auth/Signin.vueindex 2f2f48cbff..7d39ceaf82 100644--- a/frontend/src/views/auth/Signin.vue+++ b/frontend/src/views/auth/Signin.vue@@ -1,11 +1,18 @@<template><div class="mx-auto w-full max-w-sm"><div>- <img class="h-12 w-auto" src="../../assets/logo-full.svg" alt="Bytebase" />+ <img+ class="h-12 w-auto"+ src="../../assets/logo-full.svg"+ alt="Bytebase"+ /></div><div class="mt-8 mb-3">- <template v-for="authProvider in authProviderList" :key="authProvider.type">+ <template+ v-for="authProvider in authProviderList"+ :key="authProvider.type"+ ><n-buttonclass="w-full h-10 mb-2 tooltip-wrapper":disabled="!has3rdPartyLoginFeature"@@ -16,7 +23,10 @@}">- <img class="w-5 mr-1" :src="AuthProviderConfig[authProvider.type].iconPath" />+ <img+ class="w-5 mr-1"+ :src="AuthProviderConfig[authProvider.type].iconPath"+ /><span class="text-center font-semibold align-middle">{{authProviderList.length == 1@@ -24,21 +34,23 @@: authProvider.name}}</span>- <span v-if="isDemo" class="tooltip">{{ $t("auth.sign-in.gitlab-demo") }}</span>- <span- v-else-if="!has3rdPartyLoginFeature"- class="tooltip"- >{{ $t("subscription.features.bb-feature-3rd-party-login.login") }}</span>+ <span v-if="isDemo" class="tooltip">{{+ $t("auth.sign-in.gitlab-demo")+ }}</span>+ <span v-else-if="!has3rdPartyLoginFeature" class="tooltip">{{+ $t("subscription.features.bb-feature-3rd-party-login.login")+ }}</span></n-button></template><template v-if="authProviderList.length == 0"><n-button class="w-full h-10 mb-2" disabled>- <img class="w-5 mr-1" :src="AuthProviderConfig['GITLAB_SELF_HOST'].iconPath" />+ <img+ class="w-5 mr-1"+ :src="AuthProviderConfig['GITLAB_SELF_HOST'].iconPath"+ /><span class="text-center font-semibold align-middle">- {{- $t("auth.sign-in.gitlab-oauth")- }}+ {{ $t("auth.sign-in.gitlab-oauth") }}</span></n-button></template>@@ -57,7 +69,10 @@<div class="mt-2"><form class="space-y-6" @submit.prevent="trySignin"><div>- <label for="email" class="block text-sm font-medium leading-5 text-control">+ <label+ for="email"+ class="block text-sm font-medium leading-5 text-control"+ >{{ $t("common.email") }}<span class="text-red-600">*</span></label>@@ -85,7 +100,8 @@<router-linkto="/auth/password-forgot"class="text-sm font-normal text-control-light hover:underline focus:outline-none"- >{{ $t("auth.sign-in.forget-password") }}</router-link>+ >{{ $t("auth.sign-in.forget-password") }}</router-link+ ></label><div class="mt-1 rounded-md shadow-sm"><input@@ -105,7 +121,9 @@type="submit":disabled="!allowSignin"class="btn-primary justify-center flex-grow py-2 px-4"- >{{ $t("common.sign-in") }}</button>+ >+ {{ $t("common.sign-in") }}+ </button></span></div></form>@@ -115,14 +133,17 @@<div class="mt-6 relative"><div class="relative flex justify-center text-sm"><template v-if="isDemo">- <span class="pl-2 bg-white text-accent">{{ $t("auth.sign-in.demo-note") }}</span>+ <span class="pl-2 bg-white text-accent">{{+ $t("auth.sign-in.demo-note")+ }}</span></template><template v-else>- <span class="pl-2 bg-white text-control">{{ $t("auth.sign-in.new-user") }}</span>- <router-link- to="/auth/signup"- class="accent-link bg-white px-2"- >{{ $t("common.sign-up") }}</router-link>+ <span class="pl-2 bg-white text-control">{{+ $t("auth.sign-in.new-user")+ }}</span>+ <router-link to="/auth/signup" class="accent-link bg-white px-2">{{+ $t("common.sign-up")+ }}</router-link></template></div></div>@@ -262,7 +283,8 @@ export default {}openWindowForOAuth(- `${authProvider.instanceUrl}/${AuthProviderConfig[authProvider.type].apiPath+ `${authProvider.instanceUrl}/${+ AuthProviderConfig[authProvider.type].apiPath}`,authProvider.applicationId,"bb.oauth.signin"