-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat: import exported boards #4392
base: main
Are you sure you want to change the base?
Conversation
@mateo-ivc is this ready? |
I think the implementation is done, but I should add some tests |
|
||
if (response.status === 201) { | ||
const body = await response.json(); | ||
return body.id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you cast the returned body to its respective type?
background: #ffffff; | ||
border-radius: 0.5em; | ||
box-shadow: 0 10px 20px rgba(black, 0.2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use colors from colors.scss
instead of hardcoded hex values or named standard colors (white being $gray--000
, for example).
left: 50%; | ||
max-width: 90%; | ||
position: absolute; | ||
top: 50%; | ||
transform: translate(-50%, -50%); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I'm assuming you centered the container here. Can you make the the parent container flex instead and use align-items
and justify-content
instead, or is there any specific reason to do it this way?
background: $color-form-background--dark; | ||
color: white; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, both are hardcoded colors
src/constants/nameList.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so the other authors keep the same name, right? This is why I was a proponent of keeping the real names, but oh well can't do anything about it 😅
Please move this to utils/random
though
completeBoard.board.passphrase = passphrase; | ||
} | ||
|
||
const boardId = await API.importBoard(JSON.stringify(completeBoard)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
direct API calls like that are not in the spirit of our architecture. Please use a thunk for this
Description
Since we have an export feature it would make sense to be able to import those boards again.
Therefore, when creating a new board, there is now an option to import a JSON file that reflects a board.
Changelog
Backend
api/router.go
api/boards.go
dto/...
database/notes.go
services/notes.go
Frontend
api/boards.ts
Note/NoteAuthorList
PassphraseModal
constants/name.ts
NewBoard
Checklist
(Optional) Visual Changes