Skip to content

Commit

Permalink
Merge pull request #16 from WCRI56-Team-GS/nathan/teampush
Browse files Browse the repository at this point in the history
Nathan/teampush Last pull before presentation
  • Loading branch information
samhhenderson authored Mar 7, 2023
2 parents b219483 + 62405ad commit 7c1c820
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 31 deletions.
24 changes: 0 additions & 24 deletions client/components/Modals.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,17 @@ const ColumnModal = ({ showColumnModal, setShowColumnModal, showCardModal, setSh
const saveData = () => {
// get the value from the input field
const newColumnName = document.querySelector('.modal-column-input').value;

// store it somewhere (local?)
console.log('boardData from line 29: ', boardData);
console.log('typeof boardData[0]: ', typeof boardData[0]);
// our local state needs to reflect added column
const columnName = boardData[0]
console.log('line 33: ', columnName)
console.log('type of columnName: ', typeof columnName.columns)

const newBoardData = boardData.map(board => {
console.log('board: ', board)
console.log('currBoardID: ', currBoardID)
if (board._id === currBoardID) {
console.log('board and ID match')
board.columns.push({columnName: newColumnName, cards: [{cardText: 'Hello, I\'m a new column!'}]})
console.log('board: ', board)
}
return board;
})
console.log('newBoardData: ', newBoardData);
setBoardData(newBoardData)
console.log(boardData)


// [{board1}, {board2}, {board3}]
Expand All @@ -56,19 +45,6 @@ const ColumnModal = ({ showColumnModal, setShowColumnModal, showCardModal, setSh
// add to array of boards
// setBoardData(newArrayOfBoards)



// setBoardData([{}])
// boardData = array of BoardObjs
// filter currentBoard

// setBoardData((data) => ({
// ...data,
// columnName: newColumnName
// }))
// send a request to DB to udpate Board with new column
// toggle columnModal

console.log('save data button is running')
setShowColumnModal(!showColumnModal) //toggle columnModal on / off
// setShowCardModal is true, column should also render with reflected data
Expand Down
2 changes: 1 addition & 1 deletion client/styles/components/_modals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
display: flex;
flex-direction: column;
gap: 10px;

}
6 changes: 0 additions & 6 deletions client/styles/pages/_home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@
gap: 20px;
}

.column-container {
display: flex;
gap: 10px;

}

.overlay {
position: fixed;
top: 0;
Expand Down
1 change: 1 addition & 0 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ app.use("/build", express.static(path.resolve(__dirname, "../build")));

// route handlers
app.post('/api',
sessionController.isLoggedIn,
userController.getBoardIds,
boardController.getBoards,
(req, res) => {
Expand Down

0 comments on commit 7c1c820

Please sign in to comment.