scrumlr.io icon indicating copy to clipboard operation
scrumlr.io copied to clipboard

feat: import exported boards

Open mateo-ivc opened this issue 6 months ago • 3 comments

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

  • Added import route

api/boards.go

  • Implementation of import board route
  • Parses the json string into the components that will be inserted into the database

dto/...

  • Added structs to parse the JSON data into usable structs.

database/notes.go

  • Added a query to import notes

services/notes.go

  • Added import method for notes -> calls importNote in the DB layer.

Frontend

api/boards.ts

  • Implementation of importBoard route -> sends json string

Note/NoteAuthorList

  • Added authorID of note to be able to create a avatar prop based on the authorID

PassphraseModal

  • Popup that asks for a password when importing a previously password-protected board.

constants/name.ts

  • Since imported Notes with the same author should have the same avatar and name, i implemented a function that returns a random name with seed

NewBoard

  • Added a new button to import a board by drag and drop or by selecting a file.
  • Asks for password if board was prior password protected

Checklist

  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] The light- and dark-theme are both supported and tested
  • [x] The design was implemented and is responsive for all devices and screen sizes
  • [x] The application was tested in the most commonly used browsers (e.g. Chrome, Firefox, Safari)

(Optional) Visual Changes

mateo-ivc avatar Aug 05 '24 12:08 mateo-ivc