Commit Graph

188 Commits

Author SHA1 Message Date
konrad 699d3d6060 Add Golangci Lint (#676)
continuous-integration/drone/push Build is passing Details
Increase golangci timeout

Fix installing golangci-lint in ci

Remove mage targets replaced by golangci

Run golint in ci

Add goheader linter

Enable & fix more linters

Fix lint issues

Add mage target to automagically fix issues found by golangci

golangci-lint run --fix

Add golangci config

Add golangci mage target

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#676
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-10-11 20:10:03 +00:00
kolaente b3d09cd2d4
Fix loading list background information for uploaded backgrounds
continuous-integration/drone/push Build was killed Details
Signed-off-by: kolaente <k@knt.li>
2020-09-28 20:53:17 +02:00
konrad 64d125afd9 Testing improvements (#666)
continuous-integration/drone/push Build is passing Details
Change method names to avoid doubling db

Assert team test exists

Assert team member test exists

Assert task test exists

Assert task relation test exists

Assert task comment test exists

Better tests for team namespaces

Assert exists in namespace users tests

Assert exists in namespace tests

Assert exists in user list tests

Assert exists in list tests

Better team list tests

Assert label tests exist in db

Assert label task tests exist in db

Assert label task tests exist in db

Assert kanban tests exist in db

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#666
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-09-27 15:45:17 +00:00
konrad 0fb2edf051 Saved filters (#655)
continuous-integration/drone/push Build is passing Details
Fix updating saved filters

Fix filter not loadable because of missing param declaration

Add fancy special cases for postgres exists in db

Add special case for postgrs json

Add read one test

Add rights tests

Fix lint

Fixed getting a single saved filter from db

Add tests for the usual crud methods

Add test stubs and TODOs

Add test for converting saved filter ids to list ids and vice versa

Add test fixture for saved filters and fix existing tests

Fix exposed json variables of filters

Fix creating saved filters table for tests

Add getting saved filters as pseudo namespace

Cleanup

Refactor getting all namespaces to use a map for easier handling of pseudo namespaces

Add custom erros for saved filters

Swagger docs

Fix lint

Add routes for saved filters

Add alias for mage build

Add method to get a saved filter from the lists endpoint

Add getting tasks from a saved filter

Add create, update, delete, read one methods

Add rights methods for saved filters

Fix docs minLength

Add saved filters column

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#655
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-09-26 21:02:17 +00:00
konrad 6bdddd462a Favorite lists (#654)
continuous-integration/drone/push Build is passing Details
Add tests

Remove the favorites pseudo namespace if there are no lists or tasks favorited

Regenerate swagger docs

Fix favorite lists not being updated because of nonexisting users (the favorite list does not have one)

Make the pseudo favorites list always favorited

Add favorited lists to the favorites pseudo namespace

Add favorite field to list

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#654
2020-09-06 14:20:16 +00:00
konrad e5559137dd Favorite tasks (#653)
continuous-integration/drone/push Build is passing Details
Fixed namespace tests

Add test for favorite tasks

Fix favorite tasks not being updated

Fix integration tests

Fix lint

Return a pseudo namespace and list for favorites

Make sure users can only see their favorites

Add condition show tasks from the favorites list

Regenerate swagger docs

Add favorite field to task

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#653
2020-09-05 20:16:02 +00:00
kolaente ecf09e17a8
Only check if a bucket limit is exceeded when moving a task between buckets
continuous-integration/drone/push Build is passing Details
2020-09-04 22:01:33 +02:00
konrad 14d706c91e Kanban bucket limits (#652)
continuous-integration/drone/push Build is passing Details
Fix integration tests

Generate swagger docs

Add test for moving a task between buckets

Add check for bucket limit when updating a task

Add fixture to ensure a bucket with a high limit will never exceed the limit

Refactor bucket limit check into seperate function

Add test for creating and fix

Fix unexported field

Add error in case a task was added to a bucket which has its limit already exceeded

Add migration to add new task field

Add limit field to buckets

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#652
2020-09-04 14:37:56 +00:00
kolaente a58b932743
Work around tasks with attachments not being duplicated
continuous-integration/drone/push Build is failing Details
2020-08-16 23:44:16 +02:00
kolaente d192c36c39
Add better tests for namespaces
continuous-integration/drone/push Build is passing Details
2020-08-15 22:16:36 +02:00
kolaente 4a70c81b33
Make sure to require admin rights when modifying list/namespace users to be consistent with teams
continuous-integration/drone/push Build is passing Details
Signed-off-by: kolaente <k@knt.li>
2020-08-12 18:20:47 +02:00
konrad bd8c1c3bb7 Return rights when reading a single item (#626)
continuous-integration/drone/push Build is passing Details
Fix lint

Update docs

Fix loading all rights (list & namespace)

Add tests

Update web framework

Make tests run again

Update all calls to CanRead methods

Update task attachment & task comment & task rights to return the max right

Update team rights to return the max right

Update namespace rights to return the max right

Update list rights to return the max right

Update link share rights to return the max right

Update label rights to return the max right

Update web dependency

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#626
2020-08-10 12:11:43 +00:00
kolaente 6a82d4e2af
Fix updating team admin status
continuous-integration/drone/push Build is passing Details
2020-08-05 17:28:11 +02:00
kolaente 11722bf029
Add update route to toggle team member admin status
continuous-integration/drone/push Build is failing Details
2020-08-05 17:21:17 +02:00
konrad dfb7730b63 More avatar providers (#622)
continuous-integration/drone/push Build is passing Details
Don't fail if the last avatar file does not exist when deleting it

Fix lint

Remove old global avatar setting and update docs

Generate docs

Invalidate the avatar cache when uploading a new one

Add debug logs

Add caching for upload avatars

Add cache locks

Fix encoding

Resize the uploaded image to a max of 1024 pixels

Remove the old uploaded avatar if one already exists

Add mimetype check for images

Set avatar provider to upload when uploading an avatar

Add upload avatar provider

Make font size smaller to let the initials still look good in smaller sizes

Add debug log

Add cache and resizing of initials avatars

Make font size depend on avatar size

Add drawing initials avatar

Add initials provider

Make the initials avatar provider the default

Add routes

Add user avatar settings handler methods

Add user avatar provider field

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#622
2020-08-02 17:16:58 +00:00
konrad e4539ef232 Use db sessions for task-related things (#621)
continuous-integration/drone/push Build is passing Details
Use db sessions for task-related things

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#621
2020-08-01 16:54:38 +00:00
kolaente 9acba7d3f0
Fix duplicating a list with background
continuous-integration/drone/push Build is passing Details
2020-07-17 14:16:59 +02:00
kolaente 2d567bfe0f
Make sure lists which would have a duplicate identifier can still be duplicated
continuous-integration/drone/push Build is passing Details
+ debug logging for duplicating lists
2020-07-17 13:26:49 +02:00
konrad 4db06ba9a1 Fix creating lists with non ascii characters (#607)
continuous-integration/drone/push Build is passing Details
Fix test name

Fix migrating lists with non utf-8 characters in their name

Fix creating lists with non utf-8 characters

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#607
2020-07-07 07:48:12 +00:00
kolaente f57b7e989f
Fix updating the index when moving a task
continuous-integration/drone/tag Build was killed Details
continuous-integration/drone/push Build is passing Details
2020-07-01 16:54:18 +02:00
kolaente 556ccd68c1
Set the list identifier when creating a new task
continuous-integration/drone/push Build is passing Details
2020-07-01 11:17:18 +02:00
konrad 1181039249 Duplicate Lists (#603)
continuous-integration/drone/push Build is passing Details
Fix buckets not being duplicated correctly

Fix list id param not working

Add api endpoint

Add swagger docs

Add comment about test

Make duplicating actually work

Add copying link shares

Add copying list backgrounds

Add copying task relations

Add copying task comments

Add copying assignees

Add copying task task label relations

Add copying task attachments

Add duplicating tasks

Add basic struct and methods

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#603
2020-06-30 20:53:14 +00:00
kolaente 3b2289c8fa
Fix swagger docs
continuous-integration/drone/push Build is passing Details
2020-06-28 16:25:46 +02:00
kolaente 2820d92ab3
Expose namespace id when querying lists
continuous-integration/drone/push Build is passing Details
2020-06-27 23:00:15 +02:00
konrad 08205008e7 Migrate all timestamps to real iso dates (#594)
continuous-integration/drone/push Build is passing Details
Fix query param name

Add option to include null results when filtering

Always set db time to gmt

Fix null filter

Fix timezone setting for todoist parsing

Fix timezone setting for wunderlist parsing

Fix import

Fix caldav reminder parsing

Use timezone from config

Add error and test for invalid filter values

Fix integration tests

Remove task collection date hack

Fix task filter

Fix lint

Fix tests and fixtures for date timezone stuff

Properly set timezone

Change fixtures time zone to gmt

Set db timezone

Set created and updated timestamps for all fixtures

Fix lint

Fix test fixtures

Fix misspell

Fix test fixtures

Partially fix tests

Remove timeutil package

Remove adding _unix suffix hack

Remove _unix suffix

Move all timeutil.TimeStamp to time.Time

Remove all Unix suffixes in field names

Add better error messages when running migrations

Make sure to not migrate 0 unix timestamps to 1970 iso dates

Add migration script for sqlite

Add converting sqlite values

Convert 0 unix timestamps to null in postgres

Convert 0 to null in timestamps

Automatically rename _unix suffix

Add all tables and columns for migration

Fix sql migration query for mysql

Fail with an error if trying to use an unsupported dbms

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#594
2020-06-27 17:04:01 +00:00
kolaente 912abb3a10
Fix namespace title not being updated
continuous-integration/drone/push Build encountered an error Details
2020-06-26 00:03:28 +02:00
kolaente 525a547500
Remove min length for labels, lists, namespaces, tasks and teams
continuous-integration/drone/push Build is failing Details
2020-06-17 18:52:23 +02:00
kolaente ca4d5000ed
Add list background information when getting all lists
continuous-integration/drone/push Build is passing Details
2020-06-16 18:57:08 +02:00
kolaente 24c1098736
Fix resetting list, label & namespace colors
continuous-integration/drone/push Build is passing Details
2020-06-15 11:32:07 +02:00
konrad 47d7e713af Repeat tasks after completion (#587)
continuous-integration/drone/push Build is passing Details
Fix integration tests

Add updating start and end date from current date

Add updating reminders from current date

Add updating reminders from current date

Add updating due date from current date

Add updating flag

Add tests

Add field to repeat a task after current date

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#587
2020-06-14 11:04:38 +00:00
konrad ab1d58959f Ensure task dates are in the future if a task has a repeating interval (#586)
continuous-integration/drone/push Build is passing Details
Ensure task dates are in the future if a task has a repeating interval

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#586
2020-06-13 21:32:31 +00:00
konrad a0ffe89056 List Background upload (#582)
continuous-integration/drone/push Build is passing Details
Add filesize check when uploading a new file

Fix error 500 if the uploaded background was not an unsplash one

Add upload background setting to info endpoint

Add config docs

Fix lint

Return list background type if it was uploaded

Add file upload

Add docs

Save uploaded backgrounds as file

Add background upload handler

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#582
2020-06-11 17:31:37 +00:00
kolaente a525787ab7
Update and fix staticcheck
continuous-integration/drone/push Build is passing Details
2020-05-29 22:15:21 +02:00
konrad e5e30d0915 List Backgrounds (#568)
continuous-integration/drone/push Build is failing Details
Return the updated list when setting a list background

Add swagger docs for unsplash methods

Add unsplash info to search results

Fix misspell

Fix lint

Add rights check for setting and getting backgrounds

Show unsplash information when loading a single list

Make application id for pingbacks configurable

Remove old backgrounds when setting a new one

Return 404 if the list does not have a background

Implement getting list backgrounds

Implement actually setting a photo from unsplash as list background

go mod tidy

Add migration for background file id

Roughly implement setting a list background from unsplash

Implement saving a background

Add migration for unsplash photo table

Add unsplash search

Fix parsing page param

Fix parsing page param

Fix background config

Add unsplash wrapper library

Add enabled background providers to info endpoint

Add config options for backgrounds

Add unsplash background provider

Add routing handler for backgrounds

Add basic background provider interface

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#568
2020-05-26 20:07:55 +00:00
kolaente 98ef052967
Don't return all tasks when a user has no lists 2020-05-19 17:22:10 +02:00
kolaente 8a01b20e1e
Fix setting a list identifier to empty
continuous-integration/drone/push Build is passing Details
2020-05-16 13:13:11 +02:00
kolaente 5a86f44fc3
Generate a random list identifier based on the list title
continuous-integration/drone/push Build is passing Details
2020-05-16 12:58:37 +02:00
konrad fe43173b6c Ensure consistent naming of title fields (#528)
continuous-integration/drone/push Build is passing Details
Remove task text and namespace name in migration

Fix lint

Add migration for namespace title

Fix renaming namespace name to title

Rename namespace name field to title

Drop text column at the end of the migration

Add migration for task text to title

Rename task text to title

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#528
2020-05-16 10:17:44 +00:00
konrad 587ce92dc9 Improve getting all namespaces performance (#526)
continuous-integration/drone/push Build is passing Details
Improve getting all namespaces performance

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#526
2020-05-15 15:10:22 +00:00
konrad 8758fb6ac5 Fix case-insensitive task search for postgresql (#524)
continuous-integration/drone/push Build is passing Details
"Fix" gocyclo

Fix case-insensitive task search for postgresql

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#524
2020-05-15 14:12:20 +00:00
kolaente 92e5e2db6a
Make the _unix suffix optional when sorting tasks
continuous-integration/drone/push Build is passing Details
2020-05-15 16:07:36 +02:00
kolaente 4137d4aed2
Fix creating new things with a link share auth
continuous-integration/drone/push Build is passing Details
2020-05-12 15:51:48 +02:00
kolaente 55cd40d175
Fix team rights not updating for namespace rights
continuous-integration/drone/push Build is passing Details
2020-05-11 18:39:30 +02:00
konrad 8ac158cdb4 Task Filter Fixes (#495)
continuous-integration/drone/push Build is passing Details
Fix gocyclo

Fix misspell

Error codes docs

Filter fixes

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#495
2020-05-09 15:48:56 +00:00
kolaente 18f6e31b54
Fix parsing array style comparators by query param
continuous-integration/drone/push Build is failing Details
2020-05-09 15:08:58 +02:00
kolaente 563fe16bd4
Add checking and logging when trying to put a task into a nonexisting bucket
continuous-integration/drone/push Build is passing Details
2020-05-07 10:20:10 +02:00
konrad fd3ccd6130 Fix total label count when getting all labels (#477)
continuous-integration/drone/push Build is passing Details
Fix total label count when getting all labels

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#477
2020-05-03 21:28:36 +00:00
kolaente a97ce76f1f
Fix bucket ID being reset with no need to do so
continuous-integration/drone/push Build is passing Details
2020-05-03 22:25:48 +02:00
kolaente 83cf6e191c
Fix not moving its bucket when moving a task between lists
continuous-integration/drone/push Build is failing Details
2020-05-03 21:33:59 +02:00
kolaente f0ac6e89be
Remove setting task bucket to 0
continuous-integration/drone/push Build is passing Details
2020-05-03 21:24:28 +02:00