1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2024-11-24 13:42:47 +01:00
Commit Graph

6863 Commits

Author SHA1 Message Date
Aurélien
f9f25ddbd2 Add tests setSharedBy and setSharedWith
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
WENDLING NICOLAS
615668d688 Unary test for itemShare from itemService class
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
4133e68c8e Update tests to contain share data
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
54aa8b5270 🩹 Return starredCount in newItems response params
- returning sharedCount everywhere where starredCount is returned

Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
ec5ae1a90a 🩹 ItemMapper->deleteUser: include shared items
- deletes items shared with a user

Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
15dedf0ceb 🩹 Patch getNewestItemId: include shared articles
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
11bd056bdf 🩹 Patch readAll: concerns items shared with user
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
c640740444 🐛 Fix readAll: cannot read items we shared
- A shared item is still in our feed, but it's not ours to read

Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
bf92ace3e8 🐛 Added sharedCount to feedController index resp.
- After reloading news app, the shared menu count wouldn't update
- The number would only update on click (call ItemController index)
- Adding it here fixes the issue

Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
b27226d4ae 🚑 Fix bug - other user feeds show for shared item
- findAllFeeds doesn't return feeds of shared articles
- Disable feed cache handling for shared items

Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
e78153c051 Sharing: update ownership in sql (sharedwith)
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Aurélien
5f69c256e3 Add function for avoid duplicate item (share)
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
f3c4d744c0 🐛 Share Item: feed_id not nullable, copy feed_id
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Jimmy Huynh
98d72bac54 (*) fix: item Model
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Jimmy Huynh
4294842a00 (*) fix: item Model
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Jimmy Huynh
b402fddef9 (+) Adding sharing_user names to EVERY articles + pre-condition if sharedArticle: no title feed (e.g.: from wikiRSS...)
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
27ca98136a ItemController: return sharedCount in index req
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
785aaf6929 🐛 sharedCount: fix sql statement bug 1 => 1
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
WENDLING NICOLAS
edee520fc8 🎨 Fix function name to sharedCount
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
WENDLING NICOLAS
ca2b8c6566 Add count for unread items
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
5fc486a84f 🔥 shareItem: set unread = true for shared article
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
f2ef07c661 🔥 findAllShared: add table alias in sql statement
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Aurélien
f908df15b8 add function findAllShared in return
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
WENDLING NICOLAS
3936362343 Get all shared items with an user
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Aurélien
6ebe676911 add root for access shared items
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
08171bb42d NewsItem: add share routes + controller func
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
527eef0727 NewsItem: add share functions (mapper + service)
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Marco Nassabain
5b09e74f40 🗃 NewsItem: added share fields, feedId not null
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
2021-04-08 22:31:21 +02:00
Paul Tirk
f18adeba26 fix invalid 'empty' checks
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
f358c8213b add missing type hints
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
1208dc8d71 add tests for 'toAPI2' method
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
8b3c1341e8 return error if new folder name is missing on update
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
9db82b19a5 fix typo in api documentation
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
822423af38 use last modified timestamp data instead of removed 'updatedAt' field
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
8b5715c627 add folder part of v2 API to changelog
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
b45426937e return error if no folder name is provided
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
d4ace06ff5 add json error response without an exception
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
05b7ed7994 remove unused service exceptions & allow equally named folders
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
8035142973 fix wrong function definition & remove leftover copyright headers
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
0d7d3cdfb4 move v2 api responses into existing php traits
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
dff855fba5 change method names to follow nextcloud convention
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
a8dddd72fb linting
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
cce826fc72 fix wrong parentheses
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
323f215e3a separate serialization functions
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
f22eddb91d remove unused 'findByName' method of folder mapper/service
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
eb849a9be5 do not return existing folders when an API request error occurs
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
26e435fb05 update API to not return existing folders when error in request occurs
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
566a21b4a8 add possibility to serialize a reduced version of an entity
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
06a45387ef lint & add missing copyright/author information
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00
Paul Tirk
5e4c927017 add folder api v2
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
2021-04-08 10:23:11 +02:00