Skip to content
This repository was archived by the owner on Jul 20, 2026. It is now read-only.

Commit f9a9de3

Browse files
committed
Fixed issues #14, #15, #16
1 parent 58592bd commit f9a9de3

7 files changed

Lines changed: 64 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Once installed, you will see an option to create a Draw.io diagram/whiteboard fr
3232
## Installation ##
3333
1. Copy Nextcloud draw.io integration app ("drawio" directory) to your Nextcloud server into the /apps/ directory
3434
2. Go to "Apps" > "+ Apps" > "Not Enabled" and _Enable_ the **Draw.io** application
35-
3. Go to "Admin settings > Additional settings" ( /index.php/settings/admin/additional ) and click the "Save" button to register MIME types.
35+
3. Go to "Admin settings > Draw.io" ( /index.php/settings/admin/drawio ) and click the "Save" button to register MIME types.
3636

3737

3838
## Known Issues ##

drawio/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## 2.0.2
4+
5+
- Fixed preview bug (issue #14 and #16)
6+
- Added draw.io own section to the admin settings (issue #15)
7+
38
## 2.0.1
49

510
- Fixed saving in offline mode and draw.io versions < 20.8.0

drawio/appinfo/info.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<name>Draw.io</name>
66
<summary>Draw.io integration app</summary>
77
<description><![CDATA[Integrates draw.io diagrams editor with Nextcloud]]></description>
8-
<version>2.0.1</version>
8+
<version>2.0.2</version>
99
<licence>agpl</licence>
1010
<author>JGraph Ltd</author>
1111
<namespace>Drawio</namespace>
@@ -24,6 +24,7 @@
2424
</dependencies>
2525
<settings>
2626
<admin>OCA\Drawio\Settings\Admin</admin>
27+
<admin-section>OCA\Drawio\Settings\Section</admin-section>
2728
</settings>
2829
<repair-steps>
2930
<install>

drawio/img/app-dark.svg

Lines changed: 18 additions & 0 deletions
Loading

drawio/lib/Preview/DrawioPreview.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ public function getMimeType(): string
6565
public function isAvailable(FileInfo $file): bool
6666
{
6767
$prevFile = $this->getPreviewFile($file->getId());
68-
return ($this->appConfig->getPreviews() === 'yes') && $prevFile !== false &&
68+
return ($this->appConfig->GetPreviews() === 'yes') && $prevFile !== false &&
6969
$prevFile->getMtime() >= $file->getMtime();
7070
}
7171

7272
public function getThumbnail($path, $maxX, $maxY, $scalingup, $view)
7373
{
7474
$thumbnail = $this->getPreviewFile($view->getFileInfo($path)->getId());
7575

76-
if ($this->appConfig->getPreviews() === 'no' || $thumbnail === false) {
76+
if ($this->appConfig->GetPreviews() === 'no' || $thumbnail === false) {
7777
return false;
7878
}
7979

drawio/lib/Settings/Admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function getForm()
3232

3333
public function getSection()
3434
{
35-
return "additional";
35+
return "drawio";
3636
}
3737

3838
public function getPriority()

drawio/lib/Settings/Section.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace OCA\Drawio\Settings;
4+
5+
use OCP\IL10N;
6+
use OCP\IURLGenerator;
7+
use OCP\Settings\IIconSection;
8+
9+
class Section implements IIconSection {
10+
/** @var IURLGenerator */
11+
private $url;
12+
/** @var IL10N */
13+
private $l10n;
14+
15+
public function __construct(IURLGenerator $url, IL10N $l10n) {
16+
$this->url = $url;
17+
$this->l10n = $l10n;
18+
}
19+
20+
public function getID() {
21+
return 'drawio';
22+
}
23+
24+
public function getName() {
25+
return $this->l10n->t('Draw.io');
26+
}
27+
28+
public function getPriority() {
29+
return 75;
30+
}
31+
32+
public function getIcon() {
33+
return $this->url->imagePath('drawio', 'app-dark.svg');
34+
}
35+
}

0 commit comments

Comments
 (0)