Skip to content

Commit fe6640a

Browse files
authored
PLU-472: Collaborators (#1327)
[COLLAB-1]: Create flow_collaborators table, model, resolvers [COLLAB-2]: Create flow_connections table, model [COLLAB-3]: Add mutations to upsert and delete collaborators [COLLAB-4]: Automatically add connections when adding collaborator [COLLAB-5]: Manage collaborators via UI [COLLAB-6]: Collaborators can view Pipes [COLLAB-7]: Owner creates Step with connection, Editor can create Step [COLLAB-8]: Owner update Step connection, Editor can save Step [COLLAB-9]: Restrict UI based on role [COLLAB-10]: Editors can edit, save, and check step [COLLAB-11]: Editors can publish and unpublish [COLLAB-12]: Editors can delete step [COLLAB-13]: Editor can change to shared connections [COLLAB-14]: Editor add step with shared connection [COLLAB-14.1]: Editor can duplicate and reorder step [COLLAB-15]: Collaborators can view executions [COLLAB-16]: Editor can retry failed execution [COLLAB-17]: Add feature flag [COLLAB-18]: Pipe transfer [COLLAB-19]: Refactor role to flow model [COLLAB-20]: fix duplicate branch [COLLAB-21]: Bug bash fixes [COLLAB-22]: Error emails for collaborators [COLLAB-23]: Verify Tiles permissions on role change or pipe transfer chore: fixes and news item
2 parents b88c4ce + ba04b0f commit fe6640a

File tree

142 files changed

+7732
-818
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+7732
-818
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Knex } from 'knex'
2+
3+
export async function up(knex: Knex): Promise<void> {
4+
await knex.schema.createTable('flow_collaborators', (table) => {
5+
table.uuid('flow_id').references('id').inTable('flows').notNullable()
6+
table.uuid('user_id').references('id').inTable('users').notNullable()
7+
table.string('role').notNullable()
8+
table.timestamps(true, true)
9+
table.timestamp('deleted_at').nullable()
10+
table.timestamp('last_accessed_at').notNullable().defaultTo(knex.fn.now())
11+
table.uuid('updated_by').references('id').inTable('users').notNullable()
12+
13+
table.primary(['flow_id', 'user_id'])
14+
})
15+
}
16+
17+
export async function down(knex: Knex): Promise<void> {
18+
await knex.schema.dropTable('flow_collaborators')
19+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Knex } from 'knex'
2+
3+
export async function up(knex: Knex): Promise<void> {
4+
return knex.schema.table('flows', (table) => {
5+
table.uuid('updated_by').references('id').inTable('users').nullable()
6+
})
7+
}
8+
9+
export async function down(knex: Knex): Promise<void> {
10+
return knex.schema.table('flows', (table) => {
11+
table.dropColumn('updated_by')
12+
})
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Knex } from 'knex'
2+
3+
export async function up(knex: Knex): Promise<void> {
4+
return knex.schema.table('steps', (table) => {
5+
table.uuid('updated_by').references('id').inTable('users').nullable()
6+
})
7+
}
8+
9+
export async function down(knex: Knex): Promise<void> {
10+
return knex.schema.table('steps', (table) => {
11+
table.dropColumn('updated_by')
12+
})
13+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Knex } from 'knex'
2+
3+
export async function up(knex: Knex): Promise<void> {
4+
await knex.schema.createTable('flow_connections', (table) => {
5+
table.uuid('flow_id').references('id').inTable('flows').notNullable()
6+
// NOTE: this connection_id refers to either:
7+
// - the connection id of a connection in the connections table; OR
8+
// - the id of a Tile
9+
table.uuid('connection_id').notNullable()
10+
// NOTE: addedBy is the user id of the user who added the connection to the flow
11+
table.uuid('added_by').references('id').inTable('users').notNullable()
12+
table.string('connection_type').notNullable()
13+
table.timestamps(true, true)
14+
table.timestamp('deleted_at').nullable()
15+
table.jsonb('metadata').notNullable().defaultTo('{}')
16+
17+
// use the primary key constraint to avoid duplicates
18+
table.primary(['flow_id', 'connection_id'])
19+
})
20+
}
21+
22+
export async function down(knex: Knex): Promise<void> {
23+
await knex.schema.dropTable('flow_connections')
24+
}

0 commit comments

Comments
 (0)