-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add functionality to modify board view state * Refactor KanbanBoard component, remove unnecessary code * Refactor 'boards' resolver to shared function * Refactor board index resolver file * Update to transactions for database interactions * Remove commented code in issue resolver * Refactor import orders in KanbanBoard components * Remove unnecessary comments from index.tsx * Add 'AddItemToViewState' mutation to graphql * Implement row level locking for container items reordering * Disable data pre-loading and refetching * Add refetch to onCompleted in KanbanBoard * Refactor Kanban board's issue status update logic * Update issue status and ensure data consistency * Add version field to board table * Update board version on item addition * Refactor Kanban board code to improve readability
- Loading branch information
1 parent
751b93b
commit fbb601f
Showing
26 changed files
with
1,105 additions
and
445 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
112 changes: 112 additions & 0 deletions
112
backend/src/db/migrations/20240113143058-create-board-item-tables.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
'use strict'; | ||
|
||
const CONTAINER_TABLE_NAME = 'board_containers'; | ||
const ITEMS_TABLE_NAME = 'container_items'; | ||
|
||
/** @type {import('sequelize-cli').Migration} */ | ||
export default { | ||
async up(queryInterface, Sequelize) { | ||
await queryInterface.createTable(CONTAINER_TABLE_NAME, { | ||
id: { | ||
allowNull: false, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
type: Sequelize.INTEGER, | ||
}, | ||
boardId: { | ||
type: Sequelize.INTEGER, | ||
field: 'board_id', | ||
references: { | ||
model: { | ||
tableName: 'boards', | ||
schema: 'public', | ||
}, | ||
key: 'id', | ||
}, | ||
}, | ||
title: { | ||
type: Sequelize.STRING, | ||
field: 'title', | ||
}, | ||
position: { | ||
type: Sequelize.INTEGER, | ||
field: 'position', | ||
}, | ||
createdAt: { | ||
field: 'created_at', | ||
type: Sequelize.DATE, | ||
}, | ||
updatedAt: { | ||
field: 'updated_at', | ||
type: Sequelize.DATE, | ||
}, | ||
}); | ||
|
||
await queryInterface.addIndex(CONTAINER_TABLE_NAME, { | ||
fields: ['board_id'], | ||
unique: false, | ||
}); | ||
|
||
await queryInterface.createTable(ITEMS_TABLE_NAME, { | ||
id: { | ||
allowNull: false, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
type: Sequelize.INTEGER, | ||
}, | ||
issueId: { | ||
type: Sequelize.INTEGER, | ||
field: 'issue_id', | ||
references: { | ||
model: { | ||
tableName: 'issues', | ||
schema: 'public', | ||
}, | ||
key: 'id', | ||
}, | ||
}, | ||
containerId: { | ||
type: Sequelize.INTEGER, | ||
field: 'container_id', | ||
references: { | ||
model: { | ||
tableName: CONTAINER_TABLE_NAME, | ||
schema: 'public', | ||
}, | ||
key: 'id', | ||
}, | ||
}, | ||
position: { | ||
type: Sequelize.INTEGER, | ||
field: 'position', | ||
}, | ||
createdAt: { | ||
field: 'created_at', | ||
type: Sequelize.DATE, | ||
}, | ||
updatedAt: { | ||
field: 'updated_at', | ||
type: Sequelize.DATE, | ||
}, | ||
}); | ||
|
||
await queryInterface.addIndex(ITEMS_TABLE_NAME, { | ||
fields: ['container_id'], | ||
unique: false, | ||
}); | ||
|
||
await queryInterface.addIndex(ITEMS_TABLE_NAME, { | ||
fields: ['issue_id'], | ||
unique: false, | ||
}); | ||
|
||
await queryInterface.addIndex(ITEMS_TABLE_NAME, { | ||
fields: ['container_id', 'issue_id'], | ||
unique: true, | ||
}); | ||
}, | ||
async down(queryInterface, Sequelize) { | ||
await queryInterface.dropTable(CONTAINER_TABLE_NAME); | ||
await queryInterface.dropTable(ITEMS_TABLE_NAME); | ||
}, | ||
}; |
15 changes: 15 additions & 0 deletions
15
backend/src/db/migrations/20240116200136-add-version-to-board-table.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const TABLE_NAME = 'boards'; | ||
|
||
/** @type {import('sequelize-cli').Migration} */ | ||
export default { | ||
async up(queryInterface, Sequelize) { | ||
await queryInterface.addColumn(TABLE_NAME, 'version', { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
defaultValue: 1, | ||
}); | ||
}, | ||
async down(queryInterface, Sequelize) { | ||
await queryInterface.removeColumn(TABLE_NAME, 'version'); | ||
}, | ||
}; |
Oops, something went wrong.