40 Commits

Author SHA1 Message Date
f7aeb3527d Handle invalid markdown
In these cases we just try to fetch the body the best we can and ignore
all the keys.

This should give us more info about #4
2019-05-27 10:10:17 +02:00
64c8ddd7b0 Android: Use the c library for git pull
It's not perfect as our implementation of git pull results in an extra
merge commit and doesn't handle conflicts properly, but it is a basic
implementation, so at least we have something.
2019-05-16 12:23:27 +02:00
180652a10b GitAdd: All everything
It seems like there is a bug under which 'git add' hasn't been working.
I'm hoping this will just fix it and easily add all the old unadded
notes as well.
2019-02-23 15:30:33 +01:00
9ce4e5b1b9 DartLinter: Add prefer_collection_literals 2019-02-23 01:36:32 +01:00
8ff5d02033 DartLinter: Add unnecessary_this 2019-02-23 01:33:34 +01:00
a32f01b2c4 Implement undo delete properly
This way the git History is not modified.
2019-02-15 19:58:58 +01:00
7128e736d9 NoteSerializer: Do not serialize the filePath as metadata
This is a bug since we change this field from fileName to filePath.
2019-02-15 19:30:12 +01:00
03e46ce8cd Allow notes to be stored inside a sub-folder in a git repo 2019-02-14 12:59:43 +01:00
8345f1424e Note: Rename 'fileName' to 'filePath'
A note can reside in a subfolder, so lets just use the path as an
identifier instead of using just the fileName.
2019-02-14 12:07:23 +01:00
acede95536 Dart: Add analysis_options
For now I've mostly tried to follow the same style guide as the flutter
repository, with many options disabled. Eventually, maybe it would make
sense to be far stricter.
2019-02-13 13:08:15 +01:00
c7915d8feb Settings Screen: Actually save the gitAuthor + email
There is too much code duplication over here, but - meh - I'll clean it
up later.
2019-02-09 16:30:12 +01:00
ac5c2be05d Add a GitHost interface
GitLab and GitHost are two implementations of that interface.
2019-01-25 11:21:58 +01:00
a25deb2b0c Fix unused imports 2019-01-23 23:58:52 +01:00
170983024c Fix Clone screen not disappearing
and other misc changes
2019-01-23 12:48:37 +01:00
a29a102667 Move git api to apis folder 2019-01-23 11:54:02 +01:00
2f8dd95ee9 Note: Never let the created be null
Null paramters are annoying, cause we then need to check if != null all
the time. I hate this about Dart. A type should always have sensible
defaults.
2019-01-23 11:47:46 +01:00
cdc6fd9ed7 Git: Add a simplistic way to migrate between 2 git repos
This way initially all the changes are performed on the local git repo,
and then later they are applied on the remote git repo. Currently we
just copy the files, but we should be cherry-picking each commit and
applying it properly.
2019-01-23 11:24:51 +01:00
8b40cd2285 GitCommit: Let us specify the date time
The Timezone handling is java seems to be quite strange, so I'm going to
skip it for now and fix it later. We do seem to have proper timezone
classes in future versions of Java, but that requires me to increase the
minSDKVersion, and therefore not support very old android devices.
2019-01-23 11:03:06 +01:00
519de8fcff Remove onboarding screen
For now just create a local git repo and commit all the changes over
there, we're going to allow the user to first see the app and use it
however they want, and later connect it to a remote git repo.

This commit breaks the app, as the on-boarding screen is no longer
connected so you cannot push to a remote app.
2019-01-21 13:43:33 +01:00
aef0648baa Fix problems spotted by flutter analyze 2019-01-18 17:39:58 +01:00
c99fe854a1 Note: Replace 'id' with 'fileName'
It all just makes far more since when each Note has a fileName.

Though we don't save the fileName in the YAML header. It seems quite
redundant to do that.

Another advantage of this is that if we can read any file ending with a
'.md' in a git repo. It doesn't need to be named exactly how we want it,
and we will still save the details correctly.
2019-01-18 16:12:03 +01:00
a53df954ba Sync: Allow the git pull to fail
On a new repo, the git pull will fail as there isn't any content. We
really need to improve the overall error handling.
2019-01-17 14:56:46 +01:00
15bb98e852 Git: Slightly better exceptions 2019-01-17 14:56:33 +01:00
f74229dbc7 Fix sshkey custom comment
Custom comments had been implemented but were not working.
2019-01-16 23:37:19 +01:00
4292555286 Pull to sync: Show a snackbar with an error message
The error message is quite basic right now -
"No Connection" or the full error returned to us by the java libraries.
But it's a start!
2019-01-16 23:20:07 +01:00
d6c2d5d05a Note id: Default to created and do not save if not required
For this journaling app, even though we are treating journal entries as
notes, we don't really any 'id'. Just the filename is quite adequate. In
the future, we can figure out this 'id' nonsense, and if it is even
required given that we're always going to be built on top of a FS.
2019-01-15 21:41:39 +01:00
38218fd9a3 Only save and load .md files
For now I only want to deal with markdown. In the future, we can move
towards maybe accepting all .txt files as well? Not sure.
2019-01-15 21:23:26 +01:00
04b65fbf95 Filename: Use iso8601 string
This sucks balls. Overall, the datetime handling in Dart is really
really bad. It just has the concept of local time or utc time. There are
a few packages which attempt to solve this, but none which really solve
it in the way I would like.

All I want is someway to generate an iso8601 string with the timezone.
And that my DateTime should be aware of the timezone as an offset east
of UTC. Is that really so hard?
2019-01-15 14:41:51 +01:00
7e084ac0e9 Allow Journal Entries to be editted 2019-01-15 13:39:50 +01:00
55de42cba6 Change git author name and email 2019-01-11 20:01:37 +01:00
7ba58cdf14 GenerateSSHKey with a comment for GitJournal 2019-01-10 17:54:55 +01:00
a4243768b1 Add a gitClone page on the onBoarding screens 2019-01-10 12:40:45 +01:00
38f7840113 Add some basic onboarding screens
They don't really work out since I don't quite understand how PageView
and the PageController are supposed to work.
2019-01-10 11:54:39 +01:00
4bb02b12d6 Hookup the Journal app to git
Now notes are saved in the git repo, and immediately synced. This is not
the best implementation, as the notes are being reloaded a lot, and
the error handling is terrible (I miss golang). But it's the first
working poc.
2019-01-09 12:55:53 +01:00
18d9601dcd Add Git rm support 2019-01-08 18:51:43 +01:00
fb3f3bfccf Avoid using the path_provider plugin
We get the path ourselves as the 'git plugin' is using the
android 'getFilesDir()', instead of 'getDataDir()' which is what the
path_provider returns.

It's strange that it returns the latter as the Android docs clearly
state that one should not use this path and should use getFilesDir
instead.
2019-01-07 16:34:25 +01:00
967fce65b0 Minor refactor 2019-01-07 16:23:01 +01:00
c0914ffe5f YamlSerializer: refactor code into its own function
Just makes it easier to remove when we find a proper YAML serializer
2018-09-08 21:50:28 +02:00
104d54efc3 Fix tests 2018-06-03 20:19:20 +02:00
2082bea8ac Move some classes into another folder
Just giving some more structure
2018-06-03 19:49:34 +02:00