Skip to content

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

Change from NewXXX to XXXNew so the model name maintains lexical order

Tianzhou Chenb353e48073ca
diff --git a/frontend/src/components/EnvironmentForm.vue b/frontend/src/components/EnvironmentForm.vue
index 04465bcf25..e790ff5148 100644
--- a/frontend/src/components/EnvironmentForm.vue
+++ b/frontend/src/components/EnvironmentForm.vue
@@ -71,10 +71,10 @@
<script lang="ts">
import { computed, reactive, PropType } from "vue";
import isEqual from "lodash-es/isEqual";
-import { Environment, NewEnvironment } from "../types";
+import { Environment, EnvironmentNew } from "../types";
interface LocalState {
- environment?: Environment | NewEnvironment;
+ environment?: Environment | EnvironmentNew;
}
export default {
diff --git a/frontend/src/store/modules/datasource.ts b/frontend/src/store/modules/datasource.ts
index a73e5e2094..eca845e8d3 100644
--- a/frontend/src/store/modules/datasource.ts
+++ b/frontend/src/store/modules/datasource.ts
@@ -2,7 +2,7 @@ import axios from "axios";
import {
DataSourceId,
DataSource,
- NewDataSource,
+ DataSourceNew,
DataSourceState,
InstanceId,
} from "../../types";
@@ -68,7 +68,7 @@ const actions = {
{
instanceId,
newDataSource,
- }: { instanceId: InstanceId; newDataSource: NewDataSource }
+ }: { instanceId: InstanceId; newDataSource: DataSourceNew }
) {
const createdDataSource = (
await axios.post(`/api/instance/${instanceId}/datasource`, {
diff --git a/frontend/src/types/bytebase.ts b/frontend/src/types/bytebase.ts
index a605e9f4bf..569081f154 100644
--- a/frontend/src/types/bytebase.ts
+++ b/frontend/src/types/bytebase.ts
@@ -31,7 +31,7 @@ export type Bookmark = ResourceObject & {};
export type NewBookmark = Omit<Bookmark, "id">;
export type Activity = ResourceObject & {};
-export type NewActivity = Omit<Activity, "id">;
+export type ActivityNew = Omit<Activity, "id">;
export type Pipeline = ResourceObject & {
attributes: {
@@ -64,7 +64,7 @@ export type Pipeline = ResourceObject & {
subscriberIdList: Array<string>;
};
};
-export type NewPipeline = Omit<Pipeline, "id">;
+export type PipelineNew = Omit<Pipeline, "id">;
export type Environment = ResourceObject & {
attributes: {
@@ -72,7 +72,7 @@ export type Environment = ResourceObject & {
order: number;
};
};
-export type NewEnvironment = Omit<Environment, "id">;
+export type EnvironmentNew = Omit<Environment, "id">;
export type Instance = ResourceObject & {
attributes: {
@@ -83,7 +83,7 @@ export type Instance = ResourceObject & {
port?: string;
};
};
-export type NewInstance = Omit<Instance, "id">;
+export type InstanceNew = Omit<Instance, "id">;
export type DataSource = ResourceObject & {
attributes: {
@@ -94,16 +94,16 @@ export type DataSource = ResourceObject & {
password?: string;
};
};
-export type NewDataSource = Omit<DataSource, "id">;
+export type DataSourceNew = Omit<DataSource, "id">;
export type Group = ResourceObject & {};
-export type NewGroup = Omit<Group, "id">;
+export type GroupNew = Omit<Group, "id">;
export type Project = ResourceObject & {};
-export type NewProject = Omit<Project, "id">;
+export type ProjectNew = Omit<Project, "id">;
export type Repository = ResourceObject & {};
-export type NewRepository = Omit<Repository, "id">;
+export type RepositoryNew = Omit<Repository, "id">;
export type LoginInfo = Omit<
ResourceObject & {
diff --git a/frontend/src/views/EnvironmentDashboard.vue b/frontend/src/views/EnvironmentDashboard.vue
index ed0aa86702..c0e6d19dc2 100644
--- a/frontend/src/views/EnvironmentDashboard.vue
+++ b/frontend/src/views/EnvironmentDashboard.vue
@@ -58,7 +58,7 @@ import { useStore } from "vuex";
import { array_swap } from "../utils";
import EnvironmentForm from "../components/EnvironmentForm.vue";
import EnvironmentDetail from "../views/EnvironmentDetail.vue";
-import { Environment, NewEnvironment } from "../types";
+import { Environment, EnvironmentNew } from "../types";
interface LocalState {
reorderedEnvironmentList: Environment[];
@@ -152,7 +152,7 @@ export default {
state.showCreateModal = true;
};
- const doCreate = (newEnvironment: NewEnvironment) => {
+ const doCreate = (newEnvironment: EnvironmentNew) => {
store
.dispatch("environment/createEnvironment", {
newEnvironment,
diff --git a/frontend/src/views/InstanceDetail.vue b/frontend/src/views/InstanceDetail.vue
index b90f5abd18..0de66db87d 100644
--- a/frontend/src/views/InstanceDetail.vue
+++ b/frontend/src/views/InstanceDetail.vue
@@ -311,9 +311,9 @@ import { useRouter } from "vue-router";
import isEqual from "lodash-es/isEqual";
import { urlfy, idFromSlug } from "../utils";
import EnvironmentSelect from "../components/EnvironmentSelect.vue";
-import { Instance, NewInstance, DataSource, NewDataSource } from "../types";
+import { Instance, InstanceNew, DataSource, DataSourceNew } from "../types";
-const INIT_DATA_SOURCE: NewDataSource = {
+const INIT_DATA_SOURCE: DataSourceNew = {
type: "dataSource",
attributes: {
type: "ADMIN",
@@ -324,9 +324,9 @@ const INIT_DATA_SOURCE: NewDataSource = {
interface LocalState {
new: boolean;
originalInstance?: Instance;
- instance?: Instance | NewInstance;
+ instance?: Instance | InstanceNew;
originalAdminDataSource?: DataSource;
- adminDataSource?: DataSource | NewDataSource;
+ adminDataSource?: DataSource | DataSourceNew;
showDeleteModal: boolean;
showCancelModal: boolean;
showPassword: boolean;
@@ -373,7 +373,7 @@ export default {
document.removeEventListener("keydown", escHandler);
});
- const assignInstance = (instance: Instance | NewInstance) => {
+ const assignInstance = (instance: Instance | InstanceNew) => {
if (!state.new) {
state.originalInstance = instance as Instance;
}
@@ -381,7 +381,7 @@ export default {
state.instance = JSON.parse(JSON.stringify(state.originalInstance));
};
- const assignAdminDataSource = (dataSource: DataSource | NewDataSource) => {
+ const assignAdminDataSource = (dataSource: DataSource | DataSourceNew) => {
if (!state.new) {
state.originalAdminDataSource = dataSource as DataSource;
}
@@ -468,8 +468,8 @@ export default {
// The logic here to group instance/data source operation together is a shortcut
// for the sake of UX, which shouldn't affect underlying modeling anyway.
const doCreate = (
- newInstance: NewInstance,
- newAdminDataSource: NewDataSource
+ newInstance: InstanceNew,
+ newAdminDataSource: DataSourceNew
) => {
store
.dispatch("instance/createInstance", {