gurubobnz / trello-json-viewer

Web UI for reading Trello's JSON archives
12 stars 5 forks source link

give a chance to view archived cards #9

Open whusnoopy opened 2 years ago

whusnoopy commented 2 years ago

If the exported json with archived cards, we can't view them via the current version, though these cards data stored in the json file.

I wish I can give a pull request later to do it.

gurubobnz commented 2 years ago

Hello - yes please, if you can figure it out that would be very helpful :)

gurubobnz commented 1 year ago

Ok I started having a look at this ... there is a closed boolean on each card. Only the closed:false cards are displayed on the page as filtered when the board lists and cards are loaded:

    // Load the root elements into the board
    self.lists(data.lists.filter(list => !list.closed).map(data => new List(data)))
    self.cards(data.cards.filter(card => !card.closed).map(data => new Card(data)))

A quick test by negating the card.closed check does indeed show the archived cards. I feel like there could be problems with this as an archived card could be on an archived list also. Trello shows archived items in the sidebar, and lets you pop them up. I feel like we should do something similar.

gurubobnz commented 1 year ago

Another solution could be to simply add an observable toggle as board.lists() and board.cards() are already observable arrays. They could just be changed to be pureComputeds listening to a showArchived observable. Open and closed lists should be shown, and perhaps lists with no cards should be hidden while displaying archived cards.