Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nathan/teampush Last pull before presentation #16

Merged
merged 2 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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