74 Commits

Author SHA1 Message Date
7ffb3f86ac RepoSelector: Auto select exact matching item when the user types it in 2020-11-13 16:25:45 +01:00
daf63b438a RepoSelector: Sort by prefix first
If we have "blahFlutter" and "Flutter" searching for "flu" should put
"Flutter" higher up in the list.
2020-11-13 16:13:34 +01:00
9bf9193ec8 RepoSelector: Hilight selected text 2020-11-13 16:03:28 +01:00
df78b24542 GitHostRepo: Add name and username
Instead of having to parse this from the fullName. This way the code is
easier to read and it's more reliable.
2020-11-13 15:36:24 +01:00
d5148dba6f Create Repo: Reduce left padding
Thre was just too much.
2020-11-13 15:19:23 +01:00
ba844282a6 Do not let the user create a repo which already exists
Fixes APP-3C
2020-11-13 15:15:30 +01:00
5571fdb65e Use time.dart
I'm sacrificing const code for readability. So maybe I'll lose a bit of
performance, but this is so much easier to read.
2020-11-10 19:07:09 +01:00
bfe2456d3b AutoConfigure: Set an error if we get an oauth exception 2020-11-10 18:47:13 +01:00
ebf48911e8 Use dart-git's convenience method 2020-11-10 00:46:51 +01:00
6205e47aa3 Move adding a single file to an empty repo to after the merge
Otherwise this is always added.
2020-11-08 10:34:27 +01:00
3000d94123 When adding a remote rm the old remote with the same name
This is a problem when setting up the remote fails.
2020-11-07 14:17:41 +01:00
43206219da Merge AppState into Repository
The 'AppState' was more of a Repository state, and it's easier if it
lives inside the Repository class.
2020-10-23 02:01:45 +02:00
770394a8f9 Rename StateContainer to Respository 2020-10-23 01:38:47 +02:00
35ed7f616e CustomKeys: Allow an ssh password to be provided
Fixes #227
2020-10-22 14:35:17 +02:00
e3a4844f0e GitRemoteSettings -> Let a custom SSH key be provided
Just like during the GitHost Setup.
2020-10-22 14:22:00 +02:00
704329e3d5 Fix setting up an empty repo
Fixes APP-EQ
2020-10-21 15:32:33 +02:00
018dd4ca36 Fix reset repo 2020-10-21 04:29:01 +02:00
98c92a3fe1 Handle new version of git_bindings
This changes the way the SSH keys are managed, they are no longer
managed by the git_bindings plugin and are instead just passed as
parameters. They are now saved in shared_prefs. This allows us to easily
have multiple ssh keys.

It also allows us to store the ssh keys in a more secure storage
location in the future.
2020-10-19 14:52:24 +02:00
81bd1322a6 Settings: Rename internalRepoFolderName to folderName 2020-10-17 12:28:14 +02:00
09fdcc3012 Generate the SSH keys via Dart
The more dart code we use, the easier it will be to port to other
platforms.
2020-10-15 12:30:35 +02:00
540078c413 Improve repo migrations
Earlier we had one folder 'journal_local', when the remote would be
setup a new folder called 'journal' would be created, and each all the
files would be copied over. This meant the local history was being
destroyed.

Now, we only have 1 folder 'journal', and on 'cloning', we add the url
as a remote, and do a git fetch + merge.

This simplifies everything drastically, and opens the door for multiple
remotes.
2020-10-15 12:18:47 +02:00
d2b1ad7e46 Allow loading ssh keys from a file
Fixes #74
2020-10-02 17:22:30 +02:00
b3ea9c9565 Avoid using deprecated autovalidate 2020-10-02 16:17:05 +02:00
43269bbe53 Add lots of listen: false when using Provider
Provider version 4 has an assert which fires if used incorrectly.
2020-09-28 00:09:14 +02:00
4b3f1669f5 Stop caching the gitBaseDir
It makes the entire code base far more complicated and the round trip to
get the directory really isn't that much. This is a massive
micro-optimization for very little benefit.
2020-09-26 18:52:28 +02:00
fe08834259 Split Settings into AppSettings and Settings
This way I can eventually change Settings into RepoSettings without
breaking anything.
2020-09-25 00:33:54 +02:00
f30c52f595 Move all persistent state from AppState to Settings
This way all the persistant state of the app is managed from the same
place. It makes everything much easier. Also, it's required for when
GitJournal supports multiple repositories.
2020-09-24 23:45:37 +02:00
c8e3318bb9 HostSetup: Make all remaining strings translatable 2020-09-04 18:46:16 +02:00
45af5c3863 RepoSelector: Add language colours
This is disabled for now, as the new UI is still a WIP

Fetched from https://github.com/Diastro/github-colors
2020-09-04 02:39:31 +02:00
a05e9d04de Setup: Make more strings translatable 2020-09-04 01:57:01 +02:00
482250f253 RepoSelector: Remove overflow animation 2020-09-03 21:50:23 +02:00
721153308e RepoSelector: Show the datetime in relative terms
Unless it is more than 30 days
2020-09-03 21:50:23 +02:00
624998721e RepoSelector: Try making it prettier
It's a mess, so for now lets go back to the previous design, but I still
want to keep this code.
2020-09-03 21:50:20 +02:00
b96513b25f RepoSelector: Mark strings as translatable 2020-09-03 20:05:49 +02:00
f2f10433d9 AutoConfigure: Make it clear what permissions will be requested 2020-08-21 12:36:42 +02:00
7936cc70b8 Analytics: Make all events into enums
No more random strings
2020-08-17 15:29:38 +02:00
16cea4e079 AutoConfigure: Mark strings as translatable 2020-08-10 11:06:14 +02:00
633d9f5744 Remove more instances of Settings.instance
Use the Provider
2020-08-09 01:50:36 +02:00
9d55b449d3 Settings: Access it through the Provider
Make it a ChageNotifier and try to access it through the Provider
instead of like a global variable. This way, the state is better
managed and it'll be easier to split out Settings into smaller classes.
2020-08-09 01:29:22 +02:00
9d00fdac06 Use import_sorter
flutter pub run import_sorter:main --no-comments

The code feels much cleaner
2020-07-24 12:43:28 +02:00
5d7f616c6e const++ 2020-07-21 10:46:03 +02:00
97812e1501 Convert more prints to logs
This way they will show up in the LogViewer
2020-06-10 13:25:22 +02:00
66a76a0767 Revert "Use flutter_web_auth instead of our own OAuth mechanism"
This reverts commit 763cbf8493c610dec0e7e344bee40ad331e7a272.
This reverts commit ddad699b259bafe6c7ed630e7afc2eb38b7825e6.

This is causing way too many problems -

On Android with GitHub we occasionally get a User Cancelled exception.
On iOS this doesn't work < ios11

I prefer keeping my way till then. Even though it doesn't support
KeepAlive on Android.
2020-06-10 11:53:43 +02:00
88552fe8e9 Revert "Workaround intl bug by harding 'en' locale"
This reverts commit 303192d9d575b26a77a00f7a62212f310ec1e329.
This reverts commit cd9d128b47ed523036f7ae1232ec7adcf04ed8a9.

GitJournal is used by non-English speakers (a lot in China and Russia)
and while we don't support those languages completely, we do support
them a little bit. I don't want to loose this functionality. It would be
better for us to fix the bug in intl.
2020-06-10 09:31:08 +02:00
ddad699b25 Fix flutter analyze 2020-06-09 18:56:51 +02:00
cd9d128b47 Workaround intl bug by harding 'en' locale
https://github.com/dart-lang/intl/issues/266

This is strange since Intl.getLocale() returns 'en_US' in my case.

Currently, GitJournal only supports 'english' anyway, so this shouldn't
be a big problem.
2020-06-09 18:23:43 +02:00
763cbf8493 Use flutter_web_auth instead of our own OAuth mechanism
This works slightly better on iOS and on Android it has a keep alive,
which will prevent our app from being killed. Additionally, this way
there is less for me to maintain, which is always nicer.

The API for flutter_web_auth is also much simpler.

This also inolves some custom logic for parsing the Query Parameters
from the GitLab callback, as it doesn't seem to be a proper URI. Not
sure what is going on with Gitlab.
2020-06-09 17:09:38 +02:00
7226bc1c41 Setup: Reset state of some variables
That way if we go back and try to restart the previous errors are
cleared.
2020-06-09 17:08:42 +02:00
ee1009b087 Avoid hardcoding the git repo folder's name everywhere
This way, in the future we can support multiple repos, and more
importantly it will be easier to reconfigure the git host.
2020-05-26 23:49:57 +02:00
0d3648768c GitLab manual setup: Fix url
GitLab seems to have changed the url to add a deploy key manually.
2020-05-26 13:43:41 +02:00