Skip to content

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

Add project field to database

天舟a7583f933f43
diff --git a/frontend/src/components/DatabaseTable.vue b/frontend/src/components/DatabaseTable.vue
index 419bdf3c57..caa949d8aa 100644
--- a/frontend/src/components/DatabaseTable.vue
+++ b/frontend/src/components/DatabaseTable.vue
@@ -11,6 +11,9 @@
<BBTableCell :leftPadding="4" class="w-12">
{{ environmentName(database.instance.environment) }}
</BBTableCell>
+ <BBTableCell class="w-16">
+ {{ projectName(database.project) }}
+ </BBTableCell>
<BBTableCell class="w-16">
{{ database.name }}
</BBTableCell>
@@ -23,25 +26,24 @@
<BBTableCell class="w-16">
{{ humanizeTs(database.lastSuccessfulSyncTs) }}
</BBTableCell>
- <BBTableCell class="w-16">
- {{ humanizeTs(database.createdTs) }}
- </BBTableCell>
</template>
</BBTable>
</template>
<script lang="ts">
-import { reactive, PropType } from "vue";
+import { PropType } from "vue";
import { useStore } from "vuex";
import { useRouter } from "vue-router";
-import { BBTableColumn } from "../bbkit/types";
-import { databaseSlug, instanceSlug } from "../utils";
-import { EnvironmentId, Database } from "../types";
+import { databaseSlug } from "../utils";
+import { Database } from "../types";
const COLUMN_LIST = [
{
title: "Environment",
},
+ {
+ title: "Project",
+ },
{
title: "Name",
},
@@ -54,9 +56,6 @@ const COLUMN_LIST = [
{
title: "Last successful sync",
},
- {
- title: "Created",
- },
];
export default {
diff --git a/frontend/src/miragejs/factories/instance.js b/frontend/src/miragejs/factories/instance.js
index 69e1b903ef..4e6c26d27a 100644
--- a/frontend/src/miragejs/factories/instance.js
+++ b/frontend/src/miragejs/factories/instance.js
@@ -1,5 +1,4 @@
import { Factory } from "miragejs";
-import faker from "faker";
import { UNKNOWN_ID } from "../../types";
export default {
@@ -47,63 +46,5 @@ export default {
return "5432";
}
},
- afterCreate(instance, server) {
- const allDatabase = server.create("database", {
- workspaceId: instance.workspaceId,
- instance,
- name: "*",
- // Demo Owner
- ownerId: "1",
- });
-
- server.create("dataSource", {
- workspaceId: instance.workspaceId,
- instance,
- database: allDatabase,
- name: instance.name + " admin RW",
- type: "RW",
- username: "adminRW",
- password: "pwdadminRW",
- });
-
- server.create("dataSource", {
- workspaceId: instance.workspaceId,
- instance,
- database: allDatabase,
- name: instance.name + " admin RO",
- type: "RO",
- username: "adminRO",
- password: "pwdadminRO",
- });
-
- for (let i = 0; i < 2; i++) {
- const database = server.create("database", {
- workspaceId: instance.workspaceId,
- instance,
- // Demo Owner
- ownerId: Math.ceil(Math.random() * 3).toString(),
- });
-
- server.create("dataSource", {
- workspaceId: instance.workspaceId,
- instance,
- database,
- name: database.name + " RW",
- type: "RW",
- username: "rootRW",
- password: "pwdRW",
- });
-
- server.create("dataSource", {
- workspaceId: instance.workspaceId,
- instance,
- database,
- name: database.name + " RO",
- type: "RO",
- username: "rootRO",
- password: "pwdRO",
- });
- }
- },
}),
};
diff --git a/frontend/src/miragejs/fixtures/index.js b/frontend/src/miragejs/fixtures/index.js
index eebd35a532..976639f3d8 100644
--- a/frontend/src/miragejs/fixtures/index.js
+++ b/frontend/src/miragejs/fixtures/index.js
@@ -5,9 +5,11 @@
import workspaces from "./workspaceList.json";
import roleMappings from "./roleMappingList.json";
import users from "./userList.json";
+import projectList from "./projectList.json";
export default {
workspaces,
roleMappings,
users,
+ projectList,
};
diff --git a/frontend/src/miragejs/fixtures/projectList.json b/frontend/src/miragejs/fixtures/projectList.json
new file mode 100644
index 0000000000..cc05449210
--- /dev/null
+++ b/frontend/src/miragejs/fixtures/projectList.json
@@ -0,0 +1,20 @@
+[
+ {
+ "id": "1",
+ "workspaceId": "1",
+ "creatorId": "1",
+ "updaterId": "1",
+ "createdTs": 1614528000000,
+ "lastUpdatedTs": 1614571200000,
+ "name": "DBA Project"
+ },
+ {
+ "id": "2",
+ "workspaceId": "2",
+ "creatorId": "1",
+ "updaterId": "1",
+ "createdTs": 1614528000000,
+ "lastUpdatedTs": 1614571200000,
+ "name": "DBA Project2"
+ }
+]
diff --git a/frontend/src/miragejs/models/index.js b/frontend/src/miragejs/models/index.js
index 6c11c806c3..acb745c7dd 100644
--- a/frontend/src/miragejs/models/index.js
+++ b/frontend/src/miragejs/models/index.js
@@ -50,6 +50,7 @@ export default {
project: Model.extend({
workspace: belongsTo(),
+ database: hasMany(),
}),
projectNew: Model,
@@ -85,6 +86,7 @@ export default {
database: Model.extend({
workspace: belongsTo(),
instance: belongsTo(),
+ project: belongsTo(),
dataSource: hasMany(),
}),
diff --git a/frontend/src/miragejs/seeds/index.ts b/frontend/src/miragejs/seeds/index.ts
index 774d83c0ce..88292d3a4c 100644
--- a/frontend/src/miragejs/seeds/index.ts
+++ b/frontend/src/miragejs/seeds/index.ts
@@ -1,6 +1,13 @@
import faker from "faker";
-import { Database, Environment, Stage, StageType, Task } from "../../types";
-import { instanceSlug, databaseSlug, taskSlug } from "../../utils";
+import {
+ Database,
+ Environment,
+ Instance,
+ Principal,
+ StageType,
+ Task,
+} from "../../types";
+import { databaseSlug, taskSlug } from "../../utils";
/*
* Mirage JS guide on Seeds: https://miragejs.com/docs/data-layer/factories#in-development
@@ -23,6 +30,7 @@ const workspacesSeeder = (server: any) => {
const ws2DBA = server.schema.users.find(4);
const ws2Dev = server.schema.users.find(1);
+ const ws2UserList = [ws2DBA, ws2Dev];
// Environment
const environmentList1 = [];
@@ -71,43 +79,25 @@ const workspacesSeeder = (server: any) => {
workspace2.update({ project: projectList2 });
// Instance
- const instanceNamelist = [
- "On-premise instance",
- "AWS instance",
- "GCP instance",
- "Azure instance",
- "Ali Cloud instance",
- ];
-
- const instanceList1 = [];
- for (let i = 0; i < 5; i++) {
- instanceList1.push(
- server.create("instance", {
- workspace: workspace1,
- name:
- instanceNamelist[
- Math.floor(Math.random() * instanceNamelist.length)
- ] +
- (i + 1),
- // Create an extra instance for prod.
- environmentId: i == 4 ? environmentList1[3].id : environmentList1[i].id,
- creatorId: ws1DBA.id,
- updaterId: ws1DBA.id,
- })
- );
- }
+ const instanceList1 = createInstanceList(
+ server,
+ workspace1.id,
+ ws1UserList,
+ environmentList1,
+ projectList1,
+ ws1DBA,
+ "1"
+ );
- for (let i = 0; i < 4; i++) {
- server.create("instance", {
- workspace: workspace2,
- name:
- instanceNamelist[Math.floor(Math.random() * instanceNamelist.length)] +
- (i + 1),
- environmentId: environmentList2[i].id,
- creatorId: ws2DBA.id,
- updaterId: ws2DBA.id,
- });
- }
+ const instanceList2 = createInstanceList(
+ server,
+ workspace2.id,
+ ws2UserList,
+ environmentList2,
+ projectList2,
+ ws2DBA,
+ "2"
+ );
// Database
const databaseList1 = [];
@@ -553,6 +543,99 @@ const workspacesSeeder = (server: any) => {
}
};
+const createInstanceList = (
+ server: any,
+ workspaceId: string,
+ userList: { id: string }[],
+ enviromentList: { id: string }[],
+ projectList: { id: string }[],
+ dba: { id: string },
+ dbaProjectId: string
+): Instance[] => {
+ const instanceNamelist = [
+ "On-premise instance",
+ "AWS instance",
+ "GCP instance",
+ "Azure instance",
+ "Ali Cloud instance",
+ ];
+
+ const instanceList = [];
+ for (let i = 0; i < 5; i++) {
+ const instance = server.create("instance", {
+ workspaceId: workspaceId,
+ name:
+ instanceNamelist[Math.floor(Math.random() * instanceNamelist.length)] +
+ (i + 1),
+ // Create an extra instance for prod.
+ environmentId: i == 4 ? enviromentList[3].id : enviromentList[i].id,
+ creatorId: dba.id,
+ updaterId: dba.id,
+ });
+ instanceList.push(instance);
+
+ const allDatabase = server.create("database", {
+ workspaceId: instance.workspaceId,
+ projectId: dbaProjectId,
+ instance,
+ name: "*",
+ ownerId: dba.id,
+ });
+
+ server.create("dataSource", {
+ workspaceId: instance.workspaceId,
+ instance,
+ database: allDatabase,
+ name: instance.name + " admin RW",
+ type: "RW",
+ username: "adminRW",
+ password: "pwdadminRW",
+ });
+
+ server.create("dataSource", {
+ workspaceId: instance.workspaceId,
+ instance,
+ database: allDatabase,
+ name: instance.name + " admin RO",
+ type: "RO",
+ username: "adminRO",
+ password: "pwdadminRO",
+ });
+
+ for (let i = 0; i < 2; i++) {
+ const database = server.create("database", {
+ workspaceId: instance.workspaceId,
+ projectId:
+ projectList[Math.floor(Math.random() * projectList.length)].id,
+ instance,
+ ownerId: userList[Math.floor(Math.random() * userList.length)].id,
+ });
+
+ server.create("dataSource", {
+ workspaceId: instance.workspaceId,
+ instance,
+ database,
+ name: database.name + " RW",
+ type: "RW",
+ username: "rootRW",
+ password: "pwdRW",
+ });
+
+ server.create("dataSource", {
+ workspaceId: instance.workspaceId,
+ instance,
+ database,
+ name: database.name + " RO",
+ type: "RO",
+ username: "rootRO",
+ password: "pwdRO",
+ });
+ }
+ }
+
+ return instanceList;
+};
+
const fillTaskAndStageStatus = (
environmentList: Environment[],
databaseList: Database[]
diff --git a/frontend/src/store/modules/database.ts b/frontend/src/store/modules/database.ts
index c49aaa84fb..2fc4ef2dba 100644
--- a/frontend/src/store/modules/database.ts
+++ b/frontend/src/store/modules/database.ts
@@ -14,6 +14,8 @@ import {
unknown,
DataSource,
DataSourceMember,
+ Project,
+ ProjectId,
} from "../../types";
function convert(
@@ -21,7 +23,7 @@ function convert(
includedList: ResourceObject[],
rootGetters: any
): Database {
- // We first populate the id for instance and dataSourceList.
+ // We first populate the id for instance, project and dataSourceList.
// And if we also provide the detail info for those objects in the includedList,
// then we convert them to the detailed objects.
const instanceId = (database.relationships!.instance
@@ -29,6 +31,11 @@ function convert(
let instance: Instance = unknown("INSTANCE") as Instance;
instance.id = instanceId;
+ const projectId = (database.relationships!.project.data as ResourceIdentifier)
+ .id;
+ let project: Project = unknown("PROJECT") as Project;
+ project.id = projectId;
+
const dataSourceIdList = database.relationships!.dataSource
.data as ResourceIdentifier[];
const dataSourceList: DataSource[] = [];
@@ -42,6 +49,9 @@ function convert(
if (item.type == "instance" && item.id == instanceId) {
instance = rootGetters["instance/convert"](item);
}
+ if (item.type == "project" && item.id == projectId) {
+ project = rootGetters["project/convert"](item);
+ }
if (
item.type == "data-source" &&
(item.relationships!.database.data as ResourceIdentifier).id ==
@@ -59,10 +69,11 @@ function convert(
return {
id: database.id,
instance,
+ project,
dataSourceList,
...(database.attributes as Omit<
Database,
- "id" | "instance" | "dataSourceList"
+ "id" | "instance" | "project" | "dataSourceList"
>),
};
}
@@ -157,11 +168,11 @@ const actions = {
async fetchDatabaseList({ commit, rootGetters }: any) {
// Unlike other list fetch, we don't fetch the instance and data source here.
// As the sole purpose for the fetch here is to prepare the database info
- // itself (in particular the database name) to be displayed in the task list
+ // itself (in particular the database name and project name) to be displayed in the task list
// on the home page.
// The data source contains sensitive connection credentials so we shouldn't
// return it unconditionally.
- const data = (await axios.get(`/api/database`)).data;
+ const data = (await axios.get(`/api/database?include=project`)).data;
const databaseList = data.data.map((database: ResourceObject) => {
return convert(database, [], rootGetters);
});
@@ -177,7 +188,7 @@ const actions = {
) {
const data = (
await axios.get(
- `/api/database?instance=${instanceId}&include=instance,dataSource`
+ `/api/database?instance=${instanceId}&include=instance,project,dataSource`
)
).data;
const databaseList = data.data.map((database: ResourceObject) => {
@@ -192,7 +203,7 @@ const actions = {
async fetchDatabaseListByUser({ commit, rootGetters }: any, userId: UserId) {
const data = (
await axios.get(
- `/api/database?user=${userId}&include=instance,dataSource`
+ `/api/database?user=${userId}&include=instance,project,dataSource`
)
).data;
const databaseList = data.data.map((database: ResourceObject) => {
@@ -249,7 +260,7 @@ const actions = {
async createDatabase({ commit, rootGetters }: any, newDatabase: DatabaseNew) {
const data = (
- await axios.post(`/api/database?include=instance,dataSource`, {
+ await axios.post(`/api/database?include=instance,project,dataSource`, {
data: {
type: "database",
attributes: newDatabase,
@@ -270,6 +281,41 @@ const actions = {
return createdDatabase;
},
+ async transferProject(
+ { commit, rootGetters }: any,
+ {
+ instanceId,
+ databaseId,
+ projectId,
+ }: {
+ instanceId: InstanceId;
+ databaseId: DatabaseId;
+ projectId: ProjectId;
+ }
+ ) {
+ const data = (
+ await axios.patch(
+ `/api/database/${databaseId}?include=instance,project,dataSource`,
+ {
+ data: {
+ type: "databasepatch",
+ attributes: {
+ projectId,
+ },
+ },
+ }
+ )
+ ).data;
+ const updatedDatabase = convert(data.data, data.included, rootGetters);
+
+ commit("upsertDatabaseList", {
+ databaseList: [updatedDatabase],
+ instanceId: updatedDatabase.instance.id,
+ });
+
+ return updatedDatabase;
+ },
+
async updateOwner(
{ commit, rootGetters }: any,
{
@@ -284,7 +330,7 @@ const actions = {
) {
const data = (
await axios.patch(
- `/api/database/${databaseId}?include=instance,dataSource`,
+ `/api/database/${databaseId}?include=instance,project,dataSource`,
{
data: {
type: "databasepatch",
diff --git a/frontend/src/store/modules/project.ts b/frontend/src/store/modules/project.ts
index a650bdf035..28201e76cb 100644
--- a/frontend/src/store/modules/project.ts
+++ b/frontend/src/store/modules/project.ts
@@ -32,6 +32,15 @@ const state: () => ProjectState = () => ({
});
const getters = {
+ convert: (
+ state: ProjectState,
+ getters: any,
+ rootState: any,
+ rootGetters: any
+ ) => (instance: ResourceObject): Project => {
+ return convert(instance, rootGetters);
+ },
+
projectListByUser: (state: ProjectState) => (userId: UserId) => {
return state.projectListByUser.get(userId) || [];
},
diff --git a/frontend/src/types/bytebase.ts b/frontend/src/types/bytebase.ts
index caebef2af6..24aa2bff49 100644
--- a/frontend/src/types/bytebase.ts
+++ b/frontend/src/types/bytebase.ts
@@ -768,6 +768,7 @@ export type DataSourceMemberNew = {
// We periodically sync the underlying db schema and stores those info
// in the "database" object.
+// Physically, a database belongs to an instance. Logically, it belongs to a project.
// "OK" means find the exact match
// "DRIFTED" means we find the database with the same name, but the fingerprint is different,
@@ -779,6 +780,7 @@ export type DatabaseSyncStatus = "OK" | "DRIFTED" | "NOT_FOUND";
export type Database = {
id: DatabaseId;
instance: Instance;
+ project: Project;
dataSourceList: DataSource[];
createdTs: number;
lastUpdatedTs: number;
@@ -792,12 +794,14 @@ export type Database = {
export type DatabaseNew = {
name: string;
instanceId: InstanceId;
+ projectId: ProjectId;
ownerId: PrincipalId;
creatorId: PrincipalId;
taskId?: TaskId;
};
export type DatabasePatch = {
+ projectId: ProjectId;
ownerId: PrincipalId;
};
diff --git a/frontend/src/views/DatabaseDetail.vue b/frontend/src/views/DatabaseDetail.vue
index c882fbf793..35ec54e936 100644
--- a/frontend/src/views/DatabaseDetail.vue
+++ b/frontend/src/views/DatabaseDetail.vue
@@ -65,10 +65,24 @@
>
<!-- Description list -->
<dl class="grid grid-cols-1 gap-x-4 gap-y-4 sm:grid-cols-2">
+ <div class="col-span-1 w-64">
+ <label for="user" class="textlabel"> Project </label>
+ <ProjectSelect
+ class="mt-1"
+ id="owner"
+ name="owner"
+ :disabled="!allowChangeProject"
+ :selectedId="database.project.id"
+ @select-project-id="
+ (projectId) => {
+ updateProject(projectId);
+ }
+ "
+ />
+ </div>
+
<div class="col-span-1">
- <label for="user" class="textlabel">
- Owner <span class="text-red-600">*</span>
- </label>
+ <label for="user" class="textlabel"> Owner </label>
<PrincipalSelect
class="mt-1 w-64"
id="owner"
@@ -157,8 +171,9 @@ import { useRouter } from "vue-router";
import DataSourceTable from "../components/DataSourceTable.vue";
import DataSourceConnectionPanel from "../components/DataSourceConnectionPanel.vue";
import PrincipalSelect from "../components/PrincipalSelect.vue";
+import ProjectSelect from "../components/ProjectSelect.vue";
import { idFromSlug, isDBA } from "../utils";
-import { PrincipalId, DataSource } from "../types";
+import { PrincipalId, DataSource, ProjectId } from "../types";
interface LocalState {
editing: boolean;
@@ -174,7 +189,12 @@ export default {
type: String,
},
},
- components: { DataSourceConnectionPanel, DataSourceTable, PrincipalSelect },
+ components: {
+ DataSourceConnectionPanel,
+ DataSourceTable,
+ PrincipalSelect,
+ ProjectSelect,
+ },
setup(props, ctx) {
const store = useStore();
const router = useRouter();
@@ -196,6 +216,12 @@ export default {
return isDBA(currentUser.value.role);
});
+ const allowChangeProject = computed(() => {
+ return (
+ currentUser.value.id == database.value.ownerId || isCurrentUserDBA.value
+ );
+ });
+
const allowChangeOwner = computed(() => {
return (
currentUser.value.id == database.value.ownerId || isCurrentUserDBA.value
@@ -226,6 +252,19 @@ export default {
});
});
+ const updateProject = (newProjectId: ProjectId) => {
+ store
+ .dispatch("database/transferProject", {
+ instanceId: database.value.instance.id,
+ databaseId: database.value.id,
+ projectId: newProjectId,
+ })
+ .then(() => {})
+ .catch((error) => {
+ console.error(error);
+ });
+ };
+
const updateDatabaseOwner = (newOwnerId: PrincipalId) => {
store
.dispatch("database/updateOwner", {
@@ -243,9 +282,11 @@ export default {
state,
database,
isCurrentUserDBA,
+ allowChangeProject,
allowChangeOwner,
readWriteDataSourceList,
readOnlyDataSourceList,
+ updateProject,
updateDatabaseOwner,
};
},
diff --git a/frontend/src/views/DatabaseNew.vue b/frontend/src/views/DatabaseNew.vue
index c8977cfa09..db92274ec1 100644
--- a/frontend/src/views/DatabaseNew.vue
+++ b/frontend/src/views/DatabaseNew.vue
@@ -15,6 +15,20 @@ input[type="number"] {
<template>
<form class="mx-4 space-y-6 divide-y divide-block-border">
<div class="grid gap-y-6 gap-x-4 grid-cols-4">
+ <div class="col-span-2 col-start-2 w-64">
+ <label for="project" class="textlabel">
+ Project <span style="color: red">*</span>
+ </label>
+ <ProjectSelect
+ class="mt-1"
+ id="project"
+ name="project"
+ :disabled="!allowEditProject"
+ :selectedId="state.projectId"
+ @select-project-id="selectProject"
+ />
+ </div>
+
<div class="col-span-2 col-start-2 w-64">
<label for="environment" class="textlabel">
Environment <span style="color: red">*</span>
@@ -231,6 +245,7 @@ import cloneDeep from "lodash-es/cloneDeep";
import isEmpty from "lodash-es/isEmpty";
import InstanceSelect from "../components/InstanceSelect.vue";
import EnvironmentSelect from "../components/EnvironmentSelect.vue";
+import ProjectSelect from "../components/ProjectSelect.vue";
import PrincipalSelect from "../components/PrincipalSelect.vue";
import { instanceSlug, databaseSlug, taskSlug } from "../utils";
import {
@@ -241,11 +256,13 @@ import {
EnvironmentId,
InstanceId,
PrincipalId,
+ ProjectId,
} from "../types";
import { TaskField, templateForType } from "../plugins";
import { isEqual } from "lodash";
interface LocalState {
+ projectId?: ProjectId;
environmentId?: EnvironmentId;
instanceId?: InstanceId;
databaseName?: string;
@@ -260,7 +277,12 @@ interface LocalState {
export default {
name: "DatabaseNew",
props: {},
- components: { InstanceSelect, EnvironmentSelect, PrincipalSelect },
+ components: {
+ InstanceSelect,
+ EnvironmentSelect,
+ ProjectSelect,
+ PrincipalSelect,
+ },
setup(props, ctx) {
const store = useStore();
const router = useRouter();
@@ -282,15 +304,14 @@ export default {
});
const state = reactive<LocalState>({
+ projectId: router.currentRoute.value.query.project
+ ? (router.currentRoute.value.query.project as ProjectId)
+ : undefined,
environmentId: router.currentRoute.value.query.environment
- ? store.getters["environment/environmentById"](
- router.currentRoute.value.query.environment
- ).id
+ ? (router.currentRoute.value.query.environment as EnvironmentId)
: undefined,
instanceId: router.currentRoute.value.query.instance
- ? store.getters["instance/instanceById"](
- router.currentRoute.value.query.instance
- )?.id
+ ? (router.currentRoute.value.query.instance as InstanceId)
: undefined,
databaseName: router.currentRoute.value.query.name as string,
ownerId:
@@ -306,6 +327,7 @@ export default {
const allowCreate = computed(() => {
return (
!isEmpty(state.databaseName) &&
+ state.projectId &&
state.environmentId &&
state.instanceId &&
state.ownerId
@@ -314,6 +336,12 @@ export default {
// If it's from database request task, we disallow changing the preset field.
// This is to prevent accidentally changing the requested field.
+ const allowEditProject = computed(() => {
+ return (
+ state.fromTaskType != "bytebase.database.create" || !state.projectId
+ );
+ });
+
const allowEditEnvironment = computed(() => {
return (
state.fromTaskType != "bytebase.database.create" || !state.environmentId
@@ -353,6 +381,23 @@ export default {
return "";
});
+ const selectProject = (projectId: ProjectId) => {
+ state.projectId = projectId;
+ const query = cloneDeep(router.currentRoute.value.query);
+ if (projectId) {
+ query.projectId = projectId;
+ } else {
+ delete query["project"];
+ }
+ router.replace({
+ name: "workspace.database.create",
+ query: {
+ ...router.currentRoute.value.query,
+ project: projectId,
+ },
+ });
+ };
+
const selectEnvironment = (environmentId: EnvironmentId) => {
state.environmentId = environmentId;
const query = cloneDeep(router.currentRoute.value.query);
@@ -430,6 +475,7 @@ export default {
// Create database
const createdDatabase = await store.dispatch("database/createDatabase", {
name: state.databaseName,
+ projectId: state.projectId,
instanceId: state.instanceId,
ownerId: state.ownerId,
creatorId: currentUser.value.id,
@@ -531,12 +577,14 @@ export default {
return {
state,
allowCreate,
+ allowEditProject,
allowEditEnvironment,
allowEditDatabaseName,
allowEditOwner,
allowEditTask,
instanceLink,
taskLink,
+ selectProject,
selectEnvironment,
selectInstance,
changeDatabaseName,