Skip to content

Conversation

@minchinweb
Copy link
Contributor

Further to previous Pull Requests #350, #397, #739.

Closes #159. Closes #351. Closes #358.

Maintains extended metadata in DayOne entries when edited by jrnl. Export support for these have already been added.

This code has been used locally for probably 5 years now.

Checklist

  • The code change is tested and works locally.
  • Tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?

Copy link
Member

@micahellison micahellison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add some tests for this functionality?

@minchinweb
Copy link
Contributor Author

I added a basic test to make sure that the extended metadata is being added to new entries.

To do this, I added support for the extended metadata to the JSON exporter.

To completion's sake, extended metadata should also be added to the XML exporter, but I'm less sure on how to add subkeys, as would be needed.

Also, I discovered that we have no tests that cover editing an entry in the entire test suite. This is probably in part due to complexity (it would involve mocking opening an editor, changing the displayed file, and then closing the editor). One of the drivers of these changes was to make sure that extended metadata is maintained across edits, so at some point that would be good to add.

If you're satisfied with the additional test, it should be good to merge.

@wren wren added the enhancement New feature or request label May 27, 2020
@wren wren changed the title [DayOne] Extended Metadata Support (updated for v2.4) Add extended metadata support for DayOne Classic May 27, 2020
@micahellison micahellison self-requested a review May 30, 2020 19:38
Copy link
Member

@micahellison micahellison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Thanks for adding tests! Could you resolve the merge issues?

@minchinweb
Copy link
Contributor Author

@micahellison done!

Copy link
Member

@micahellison micahellison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@micahellison micahellison merged commit 61f5c3f into jrnl-org:develop Jun 6, 2020
@minchinweb minchinweb deleted the 2.4-dayone-fixes branch June 8, 2020 19:43
wren pushed a commit that referenced this pull request Jul 25, 2020
* Updating changelog [ci skip]

* Incrementing version to v2.4 [ci skip]

* [DayOne] remove extra spaces from the titles of edited DayOne entries

Otherwise, a leading space was being introduced

* [DayOne] maintain existing tags stored in DayOne metadata

* [DayOne] brings back extended DayOne attributes

* [DayOne] maintain metadata on edited entries

Fixes #358, See also #159

* [DayOne Exporter] apply black formatting

* [JSON Exporter] add support for extended DayOne Metadata

* [DayOne] [Tests] test that extended DayOne metadata is added to new entries

Co-authored-by: Jrnl Bot <jrnl.bot@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DayOne: Editing existing entries with tags removes the tags when saving Dayone (non-)Editting deleting entries DayOne issue and improvement

4 participants