Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The Notes app is a distraction free notes taking app for [Nextcloud](https://www
<repository type="git">https://github.com/nextcloud/notes.git</repository>
<screenshot small-thumbnail="https://raw.githubusercontent.com/nextcloud/screenshots/master/apps/Notes/notes-thumbnail.jpg">https://raw.githubusercontent.com/nextcloud/screenshots/master/apps/Notes/notes.png</screenshot>
<dependencies>
<php min-version="8.0" max-version="8.4"/>
<php min-version="8.1" max-version="8.4"/>
<nextcloud min-version="28" max-version="32"/>
</dependencies>
<repair-steps>
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"require-dev": {
"guzzlehttp/guzzle": "^7",
"nextcloud/coding-standard": "^1.0",
"nextcloud/ocp": "dev-stable28",
"nextcloud/ocp": "dev-master",
"phan/phan": "^5",
"php-cs-fixer/shim": "3.66.0",
"psalm/phar": "^5.26",
Expand All @@ -16,7 +16,7 @@
},
"config": {
"platform": {
"php": "8.0"
"php": "8.1"
},
"sort-packages": true
},
Expand Down
45 changes: 25 additions & 20 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions lib/AppInfo/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@

namespace OCA\Notes\AppInfo;

use OCA\Notes\Service\NoteUtil;
use OCP\App\IAppManager;
use OCP\Capabilities\ICapability;

class Capabilities implements ICapability {
private IAppManager $appManager;

public function __construct(IAppManager $appManager) {
$this->appManager = $appManager;
public function __construct(
private IAppManager $appManager,
private NoteUtil $noteUtil,
private ?string $userId,
) {
}

public function getCapabilities(): array {
return [
Application::APP_ID => [
'api_version' => Application::$API_VERSIONS,
'version' => $this->appManager->getAppVersion(Application::APP_ID),
'notes_path' => $this->userId !== null && $this->userId !== ' ' ? $this->noteUtil->getNotesFolderUserPath($this->userId) : null,
],
];
}
Expand Down
6 changes: 6 additions & 0 deletions lib/Service/NoteUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,14 @@
return $folder;
}

public function getNotesFolderUserPath(string $userId): string {
$userFolder = $this->getRoot()->getUserFolder($userId);
$nodesFolder = $this->getOrCreateNotesFolder($userId, false);
return $userFolder->getRelativePath($nodesFolder->getPath());
}

public function getOrCreateNotesFolder(string $userId, bool $create = true) : Folder {
$userFolder = $this->getRoot()->getUserFolder($userId);

Check failure on line 193 in lib/Service/NoteUtil.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable28

MissingDependency

lib/Service/NoteUtil.php:193:17: MissingDependency: OCP\Files\IRootFolder depends on class or interface oc\hooks\emitter that does not exist (see https://psalm.dev/157)

Check failure on line 193 in lib/Service/NoteUtil.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable29

MissingDependency

lib/Service/NoteUtil.php:193:17: MissingDependency: OCP\Files\IRootFolder depends on class or interface oc\hooks\emitter that does not exist (see https://psalm.dev/157)

Check failure on line 193 in lib/Service/NoteUtil.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable30

MissingDependency

lib/Service/NoteUtil.php:193:17: MissingDependency: OCP\Files\IRootFolder depends on class or interface oc\hooks\emitter that does not exist (see https://psalm.dev/157)

Check failure on line 193 in lib/Service/NoteUtil.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

MissingDependency

lib/Service/NoteUtil.php:193:17: MissingDependency: OCP\Files\IRootFolder depends on class or interface oc\hooks\emitter that does not exist (see https://psalm.dev/157)

Check failure on line 193 in lib/Service/NoteUtil.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable28

MissingDependency

lib/Service/NoteUtil.php:193:17: MissingDependency: OCP\Files\IRootFolder depends on class or interface oc\hooks\emitter that does not exist (see https://psalm.dev/157)

Check failure on line 193 in lib/Service/NoteUtil.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable29

MissingDependency

lib/Service/NoteUtil.php:193:17: MissingDependency: OCP\Files\IRootFolder depends on class or interface oc\hooks\emitter that does not exist (see https://psalm.dev/157)

Check failure on line 193 in lib/Service/NoteUtil.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable30

MissingDependency

lib/Service/NoteUtil.php:193:17: MissingDependency: OCP\Files\IRootFolder depends on class or interface oc\hooks\emitter that does not exist (see https://psalm.dev/157)

Check failure on line 193 in lib/Service/NoteUtil.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable31

MissingDependency

lib/Service/NoteUtil.php:193:17: MissingDependency: OCP\Files\IRootFolder depends on class or interface oc\hooks\emitter that does not exist (see https://psalm.dev/157)

Check failure on line 193 in lib/Service/NoteUtil.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

MissingDependency

lib/Service/NoteUtil.php:193:17: MissingDependency: OCP\Files\IRootFolder depends on class or interface oc\hooks\emitter that does not exist (see https://psalm.dev/157)
$notesPath = $this->settingsService->get($userId, 'notesPath');
$allowShared = $notesPath !== $this->settingsService->getDefaultNotesPath($userId);

Expand Down
Loading