Compare commits

..

8 Commits

Author SHA1 Message Date
Julius Knorr
a3346b8958 Merge pull request #6521 from nextcloud/backport/6518/stable25
[stable25] stable23: fix: Detect end of the activity responses (fix #3395)
2024-11-19 13:06:30 +01:00
Julius Härtl
9586405290 fix: Detect end of the activity responses (fix #3395)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2024-11-19 10:26:14 +00:00
Julius Härtl
15d7098c46 Merge pull request #5707 from nextcloud/backport/5703/stable25
[stable25] fix: Avoid conflicts on deck attachments folder name
2024-07-12 08:56:31 +02:00
Luka Trovic
54b62fe7f3 ci: fix flow cypress
Signed-off-by: Luka Trovic <luka@nextcloud.com>
2024-06-19 10:55:25 +02:00
Luka Trovic
7355bdd27f fix: update base query count
Signed-off-by: Luka Trovic <luka@nextcloud.com>
2024-05-23 19:10:39 +02:00
Julius Härtl
7e9f94233a fix: Compatibility with php 7.4
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2024-03-28 10:14:56 +01:00
Julius Härtl
c061cba5cd ci: Update base query count
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2024-03-27 15:02:39 +00:00
Julius Härtl
c4c905042f fix: Avoid conflicts on deck attachments folder name
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2024-03-27 15:02:39 +00:00
5 changed files with 36 additions and 4 deletions

View File

@@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [14.x]
node-version: [16.x]
# containers: [1, 2, 3]
php-versions: [ '7.4' ]
databases: [ 'sqlite' ]

View File

@@ -210,4 +210,12 @@ class ConfigService {
return $this->config->getUserValue($userId ?? $this->getUserId(), 'deck', 'attachment_folder', '/Deck');
}
public function setAttachmentFolder(?string $userId = null, string $path): void {
if ($userId === null && $this->getUserId() === null) {
throw new NoPermissionException('Must be logged in get the attachment folder');
}
$this->config->setUserValue($userId ?? $this->getUserId(), 'deck', 'attachment_folder', $path);
}
}

View File

@@ -31,6 +31,7 @@ use OCA\Deck\Sharing\DeckShareProvider;
use OCA\Deck\StatusException;
use OCP\AppFramework\Http\StreamResponse;
use OCP\Constants;
use OCP\Files\Folder;
use OCP\Files\IMimeTypeDetector;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
@@ -190,6 +191,16 @@ class FilesAppService implements IAttachmentService, ICustomAttachmentService {
$folder = $userFolder->newFolder($this->configService->getAttachmentFolder());
}
if ($folder->isShared()) {
$folderName = $userFolder->getNonExistingName($this->configService->getAttachmentFolder());
$folder = $userFolder->newFolder($folderName);
$this->configService->setAttachmentFolder($this->userId, $folderName);
}
if (!$folder instanceof Folder || $folder->isShared()) {
throw new NotFoundException('No target folder found');
}
$fileName = $folder->getNonExistingName($fileName);
$target = $folder->newFile($fileName);
$content = fopen($file['tmp_name'], 'rb');

View File

@@ -84,7 +84,20 @@ export default {
params.append('object_id', '' + this.objectId)
params.append('limit', ACTIVITY_FETCH_LIMIT)
const response = await axios.get(generateOcsUrl(`apps/activity/api/v2/activity/${this.filter}`) + '?' + params)
const response = await axios.get(
generateOcsUrl(`apps/activity/api/v2/activity/${this.filter}`) + '?' + params,
{
validateStatus: (status) => {
return (status >= 200 && status < 300) || status === 304
},
},
)
if (response.status === 304) {
this.endReached = true
return []
}
let activities = response.data.ocs.data
if (this.filter === 'deck') {
// We need to manually filter activities here, since currently we use two different types and there is no way
@@ -95,7 +108,7 @@ export default {
})
}
this.activities.push(...activities)
if (response.data.ocs.meta.statuscode === 304 || activities.length === 0) {
if (activities.length === 0) {
this.endReached = true
return []
}

View File

@@ -1 +1 @@
68024
79470