diff options
Diffstat (limited to 'apps/workflowengine')
24 files changed, 0 insertions, 161 deletions
diff --git a/apps/workflowengine/composer/composer/autoload_classmap.php b/apps/workflowengine/composer/composer/autoload_classmap.php index 52d221fb767..0444cce13e7 100644 --- a/apps/workflowengine/composer/composer/autoload_classmap.php +++ b/apps/workflowengine/composer/composer/autoload_classmap.php @@ -10,7 +10,6 @@ return array( 'OCA\\WorkflowEngine\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', 'OCA\\WorkflowEngine\\BackgroundJobs\\Rotate' => $baseDir . '/../lib/BackgroundJobs/Rotate.php', 'OCA\\WorkflowEngine\\Check\\AbstractStringCheck' => $baseDir . '/../lib/Check/AbstractStringCheck.php', - 'OCA\\WorkflowEngine\\Check\\Directory' => $baseDir . '/../lib/Check/Directory.php', 'OCA\\WorkflowEngine\\Check\\FileMimeType' => $baseDir . '/../lib/Check/FileMimeType.php', 'OCA\\WorkflowEngine\\Check\\FileName' => $baseDir . '/../lib/Check/FileName.php', 'OCA\\WorkflowEngine\\Check\\FileSize' => $baseDir . '/../lib/Check/FileSize.php', diff --git a/apps/workflowengine/composer/composer/autoload_static.php b/apps/workflowengine/composer/composer/autoload_static.php index 57b569dbc10..0b9ac89ae30 100644 --- a/apps/workflowengine/composer/composer/autoload_static.php +++ b/apps/workflowengine/composer/composer/autoload_static.php @@ -25,7 +25,6 @@ class ComposerStaticInitWorkflowEngine 'OCA\\WorkflowEngine\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', 'OCA\\WorkflowEngine\\BackgroundJobs\\Rotate' => __DIR__ . '/..' . '/../lib/BackgroundJobs/Rotate.php', 'OCA\\WorkflowEngine\\Check\\AbstractStringCheck' => __DIR__ . '/..' . '/../lib/Check/AbstractStringCheck.php', - 'OCA\\WorkflowEngine\\Check\\Directory' => __DIR__ . '/..' . '/../lib/Check/Directory.php', 'OCA\\WorkflowEngine\\Check\\FileMimeType' => __DIR__ . '/..' . '/../lib/Check/FileMimeType.php', 'OCA\\WorkflowEngine\\Check\\FileName' => __DIR__ . '/..' . '/../lib/Check/FileName.php', 'OCA\\WorkflowEngine\\Check\\FileSize' => __DIR__ . '/..' . '/../lib/Check/FileSize.php', diff --git a/apps/workflowengine/l10n/de.js b/apps/workflowengine/l10n/de.js index 8feec57e910..761beaa28d9 100644 --- a/apps/workflowengine/l10n/de.js +++ b/apps/workflowengine/l10n/de.js @@ -97,7 +97,6 @@ OC.L10N.register( "is" : "ist", "is not" : "ist nicht", "File name" : "Dateiname", - "Directory" : "Verzeichnis", "File MIME type" : "Datei MIME-Typ", "File size (upload)" : "Dateigröße (beim Hochladen)", "less" : "weniger", diff --git a/apps/workflowengine/l10n/de.json b/apps/workflowengine/l10n/de.json index 9ded7338f81..eca78d35353 100644 --- a/apps/workflowengine/l10n/de.json +++ b/apps/workflowengine/l10n/de.json @@ -95,7 +95,6 @@ "is" : "ist", "is not" : "ist nicht", "File name" : "Dateiname", - "Directory" : "Verzeichnis", "File MIME type" : "Datei MIME-Typ", "File size (upload)" : "Dateigröße (beim Hochladen)", "less" : "weniger", diff --git a/apps/workflowengine/l10n/de_DE.js b/apps/workflowengine/l10n/de_DE.js index 8cf48150dad..882d975e932 100644 --- a/apps/workflowengine/l10n/de_DE.js +++ b/apps/workflowengine/l10n/de_DE.js @@ -97,7 +97,6 @@ OC.L10N.register( "is" : "ist", "is not" : "ist nicht", "File name" : "Dateiname", - "Directory" : "Verzeichnis", "File MIME type" : "Datei MIME-Typ", "File size (upload)" : "Dateigröße (beim Hochladen)", "less" : "weniger", diff --git a/apps/workflowengine/l10n/de_DE.json b/apps/workflowengine/l10n/de_DE.json index 253ed3df8d2..26b952586ba 100644 --- a/apps/workflowengine/l10n/de_DE.json +++ b/apps/workflowengine/l10n/de_DE.json @@ -95,7 +95,6 @@ "is" : "ist", "is not" : "ist nicht", "File name" : "Dateiname", - "Directory" : "Verzeichnis", "File MIME type" : "Datei MIME-Typ", "File size (upload)" : "Dateigröße (beim Hochladen)", "less" : "weniger", diff --git a/apps/workflowengine/l10n/en_GB.js b/apps/workflowengine/l10n/en_GB.js index dc97bed2037..971aa8d6415 100644 --- a/apps/workflowengine/l10n/en_GB.js +++ b/apps/workflowengine/l10n/en_GB.js @@ -97,7 +97,6 @@ OC.L10N.register( "is" : "is", "is not" : "is not", "File name" : "File name", - "Directory" : "Directory", "File MIME type" : "File MIME type", "File size (upload)" : "File size (upload)", "less" : "less", diff --git a/apps/workflowengine/l10n/en_GB.json b/apps/workflowengine/l10n/en_GB.json index f6597a1f36a..b4591846e96 100644 --- a/apps/workflowengine/l10n/en_GB.json +++ b/apps/workflowengine/l10n/en_GB.json @@ -95,7 +95,6 @@ "is" : "is", "is not" : "is not", "File name" : "File name", - "Directory" : "Directory", "File MIME type" : "File MIME type", "File size (upload)" : "File size (upload)", "less" : "less", diff --git a/apps/workflowengine/l10n/et_EE.js b/apps/workflowengine/l10n/et_EE.js index 89960752f17..a6dd9bd897e 100644 --- a/apps/workflowengine/l10n/et_EE.js +++ b/apps/workflowengine/l10n/et_EE.js @@ -97,7 +97,6 @@ OC.L10N.register( "is" : "on", "is not" : "ei ole", "File name" : "Failinimi", - "Directory" : "Kaust", "File MIME type" : "Faili MIME-tüüp", "File size (upload)" : "Faili suurus (üleslaadimine)", "less" : "väiksem", diff --git a/apps/workflowengine/l10n/et_EE.json b/apps/workflowengine/l10n/et_EE.json index 5a86411bdb3..3da17c5756d 100644 --- a/apps/workflowengine/l10n/et_EE.json +++ b/apps/workflowengine/l10n/et_EE.json @@ -95,7 +95,6 @@ "is" : "on", "is not" : "ei ole", "File name" : "Failinimi", - "Directory" : "Kaust", "File MIME type" : "Faili MIME-tüüp", "File size (upload)" : "Faili suurus (üleslaadimine)", "less" : "väiksem", diff --git a/apps/workflowengine/l10n/ga.js b/apps/workflowengine/l10n/ga.js index c6f9b29a57d..0c61ee9b09d 100644 --- a/apps/workflowengine/l10n/ga.js +++ b/apps/workflowengine/l10n/ga.js @@ -97,7 +97,6 @@ OC.L10N.register( "is" : "tá", "is not" : "níl", "File name" : "Ainm comhaid", - "Directory" : "Eolaire", "File MIME type" : "Cineál comhaid MIME", "File size (upload)" : "Méid comhaid (uaslódáil)", "less" : "níos lú", diff --git a/apps/workflowengine/l10n/ga.json b/apps/workflowengine/l10n/ga.json index d5f47ae7f97..46ee7bd06a9 100644 --- a/apps/workflowengine/l10n/ga.json +++ b/apps/workflowengine/l10n/ga.json @@ -95,7 +95,6 @@ "is" : "tá", "is not" : "níl", "File name" : "Ainm comhaid", - "Directory" : "Eolaire", "File MIME type" : "Cineál comhaid MIME", "File size (upload)" : "Méid comhaid (uaslódáil)", "less" : "níos lú", diff --git a/apps/workflowengine/l10n/pt_BR.js b/apps/workflowengine/l10n/pt_BR.js index 1404b310f47..8d40914252d 100644 --- a/apps/workflowengine/l10n/pt_BR.js +++ b/apps/workflowengine/l10n/pt_BR.js @@ -97,7 +97,6 @@ OC.L10N.register( "is" : "é", "is not" : "não é", "File name" : "Nome do arquivo", - "Directory" : "Diretório", "File MIME type" : "Tipo de arquivo MIME", "File size (upload)" : "Tamanho do arquivo (upload)", "less" : "menor que", diff --git a/apps/workflowengine/l10n/pt_BR.json b/apps/workflowengine/l10n/pt_BR.json index 1604f631e11..2cbde62dc24 100644 --- a/apps/workflowengine/l10n/pt_BR.json +++ b/apps/workflowengine/l10n/pt_BR.json @@ -95,7 +95,6 @@ "is" : "é", "is not" : "não é", "File name" : "Nome do arquivo", - "Directory" : "Diretório", "File MIME type" : "Tipo de arquivo MIME", "File size (upload)" : "Tamanho do arquivo (upload)", "less" : "menor que", diff --git a/apps/workflowengine/l10n/ru.js b/apps/workflowengine/l10n/ru.js index c00da93134c..6d24bbea78e 100644 --- a/apps/workflowengine/l10n/ru.js +++ b/apps/workflowengine/l10n/ru.js @@ -97,7 +97,6 @@ OC.L10N.register( "is" : "равняется", "is not" : "не равняется", "File name" : "Имя файла", - "Directory" : "Директория", "File MIME type" : "MIME-тип файла", "File size (upload)" : "Размер передаваемого на сервер файла", "less" : "меньше", diff --git a/apps/workflowengine/l10n/ru.json b/apps/workflowengine/l10n/ru.json index c23b9d020b0..228ad6a71ce 100644 --- a/apps/workflowengine/l10n/ru.json +++ b/apps/workflowengine/l10n/ru.json @@ -95,7 +95,6 @@ "is" : "равняется", "is not" : "не равняется", "File name" : "Имя файла", - "Directory" : "Директория", "File MIME type" : "MIME-тип файла", "File size (upload)" : "Размер передаваемого на сервер файла", "less" : "меньше", diff --git a/apps/workflowengine/l10n/uk.js b/apps/workflowengine/l10n/uk.js index f335db33985..a9583382441 100644 --- a/apps/workflowengine/l10n/uk.js +++ b/apps/workflowengine/l10n/uk.js @@ -97,7 +97,6 @@ OC.L10N.register( "is" : "є", "is not" : "не", "File name" : "Ім'я файлу", - "Directory" : "Каталог", "File MIME type" : "Тип MIME файлу", "File size (upload)" : "Розмір файлу (завантаження)", "less" : "менше", diff --git a/apps/workflowengine/l10n/uk.json b/apps/workflowengine/l10n/uk.json index 13674a3b207..93c18f047c3 100644 --- a/apps/workflowengine/l10n/uk.json +++ b/apps/workflowengine/l10n/uk.json @@ -95,7 +95,6 @@ "is" : "є", "is not" : "не", "File name" : "Ім'я файлу", - "Directory" : "Каталог", "File MIME type" : "Тип MIME файлу", "File size (upload)" : "Розмір файлу (завантаження)", "less" : "менше", diff --git a/apps/workflowengine/l10n/zh_HK.js b/apps/workflowengine/l10n/zh_HK.js index bca42dd024f..edd352c1880 100644 --- a/apps/workflowengine/l10n/zh_HK.js +++ b/apps/workflowengine/l10n/zh_HK.js @@ -97,7 +97,6 @@ OC.L10N.register( "is" : "是", "is not" : "不是", "File name" : "檔案名稱", - "Directory" : "目錄", "File MIME type" : "檔案MIME類型", "File size (upload)" : "檔案大小(上傳)", "less" : "更少", diff --git a/apps/workflowengine/l10n/zh_HK.json b/apps/workflowengine/l10n/zh_HK.json index d606da3c02e..9b249cd1af4 100644 --- a/apps/workflowengine/l10n/zh_HK.json +++ b/apps/workflowengine/l10n/zh_HK.json @@ -95,7 +95,6 @@ "is" : "是", "is not" : "不是", "File name" : "檔案名稱", - "Directory" : "目錄", "File MIME type" : "檔案MIME類型", "File size (upload)" : "檔案大小(上傳)", "less" : "更少", diff --git a/apps/workflowengine/lib/Check/Directory.php b/apps/workflowengine/lib/Check/Directory.php deleted file mode 100644 index f7b856a95fe..00000000000 --- a/apps/workflowengine/lib/Check/Directory.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -declare(strict_types=1); - -/** - * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors - * SPDX-License-Identifier: AGPL-3.0-or-later - */ -namespace OCA\WorkflowEngine\Check; - -use OCA\WorkflowEngine\Entity\File; -use OCP\IL10N; -use OCP\WorkflowEngine\IFileCheck; - -class Directory extends AbstractStringCheck implements IFileCheck { - use TFileCheck; - - /** - * @param IL10N $l - */ - public function __construct( - IL10N $l, - ) { - parent::__construct($l); - } - - /** - * @return string - */ - protected function getActualValue(): string { - if ($this->path === null) { - return ''; - } - // files/some/path -> some/path - return preg_replace('/^files\//', '', pathinfo($this->path, PATHINFO_DIRNAME)); - } - - /** - * @param string $operator - * @param string $checkValue - * @param string $actualValue - * @return bool - */ - protected function executeStringCheck($operator, $checkValue, $actualValue) { - if ($operator === 'is' || $operator === '!is') { - $checkValue = ltrim(rtrim($checkValue, '/'), '/'); - } - return parent::executeStringCheck($operator, $checkValue, $actualValue); - } - - public function supportedEntities(): array { - return [ File::class ]; - } - - public function isAvailableForScope(int $scope): bool { - return true; - } -} diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php index 27b25a2e752..0f41679789d 100644 --- a/apps/workflowengine/lib/Manager.php +++ b/apps/workflowengine/lib/Manager.php @@ -8,7 +8,6 @@ namespace OCA\WorkflowEngine; use Doctrine\DBAL\Exception; use OCA\WorkflowEngine\AppInfo\Application; -use OCA\WorkflowEngine\Check\Directory; use OCA\WorkflowEngine\Check\FileMimeType; use OCA\WorkflowEngine\Check\FileName; use OCA\WorkflowEngine\Check\FileSize; @@ -693,7 +692,6 @@ class Manager implements IManager { protected function getBuildInChecks(): array { try { return [ - $this->container->query(Directory::class), $this->container->query(FileMimeType::class), $this->container->query(FileName::class), $this->container->query(FileSize::class), diff --git a/apps/workflowengine/src/components/Checks/file.js b/apps/workflowengine/src/components/Checks/file.js index b2d348e4712..568efc81cd3 100644 --- a/apps/workflowengine/src/components/Checks/file.js +++ b/apps/workflowengine/src/components/Checks/file.js @@ -32,19 +32,6 @@ const FileChecks = [ }, { - class: 'OCA\\WorkflowEngine\\Check\\Directory', - name: t('workflowengine', 'Directory'), - operators: stringOrRegexOperators, - placeholder: (check) => { - if (check.operator === 'matches' || check.operator === '!matches') { - return '/^myfolder/.+$/i' - } - return 'myfolder/subfolder' - }, - validate: stringValidator, - }, - - { class: 'OCA\\WorkflowEngine\\Check\\FileMimeType', name: t('workflowengine', 'File MIME type'), operators: stringOrRegexOperators, diff --git a/apps/workflowengine/tests/Check/DirectoryTest.php b/apps/workflowengine/tests/Check/DirectoryTest.php deleted file mode 100644 index 6eef082b5e5..00000000000 --- a/apps/workflowengine/tests/Check/DirectoryTest.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -declare(strict_types=1); -/** - * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -namespace OCA\WorkflowEngine\Tests\Check; - -use OCA\WorkflowEngine\Check\Directory; -use OCA\WorkflowEngine\Entity\File; -use OCP\Files\Storage\IStorage; -use OCP\IL10N; -use Test\TestCase; - -class DirectoryTest extends TestCase { - /** @var IL10N */ - private $l10n; - - /** @var IStorage */ - private $storage; - - /** @var Directory */ - private $directory; - - protected function setUp(): void { - parent::setUp(); - $this->l10n = $this->createMock(IL10N::class); - $this->storage = $this->createMock(IStorage::class); - $this->directory = new Directory($this->l10n); - } - - /** - * @dataProvider dataProviderCheck - */ - public function testExecuteStringCheck(string $operator, string $configuredDirectoryPath, string $filePath, bool $expectedResult): void { - $this->directory->setFileInfo($this->storage, $filePath); - - $result = $this->directory->executeCheck($operator, $configuredDirectoryPath); - - $this->assertEquals($expectedResult, $result); - } - - public function testSupportedEntities(): void { - $this->assertSame([File::class], $this->directory->supportedEntities()); - } - - public function testIsAvailableForScope(): void { - $this->assertTrue($this->directory->isAvailableForScope(1)); - } - - public function dataProviderCheck(): array { - return [ - ['is', 'some/path', 'files/some/path/file.txt', true], - ['is', '/some/path/', 'files/some/path/file.txt', true], - - ['!is', 'some/path', 'files/some/path/file.txt', false], - ['!is', 'some/path/', 'files/someother/path/file.txt', true], - - ['matches', '/^some\/path\/.+$/i', 'files/SomE/PATH/subfolder/file.txt', true], - ['matches', '/some\/path\/.*\/sub2/', 'files/some/path/subfolder1/sub2/anotherfile.pdf', true], - - ['!matches', '/some\/path/', 'files/some/path/file.txt', false], - ['!matches', '/some\/path/', 'files/another/path/file.txt', true], - ]; - } -} |