diff options
Diffstat (limited to 'apps/workflowengine')
-rw-r--r-- | apps/workflowengine/l10n/ar.js | 1 | ||||
-rw-r--r-- | apps/workflowengine/l10n/ar.json | 1 | ||||
-rw-r--r-- | apps/workflowengine/l10n/de.js | 4 | ||||
-rw-r--r-- | apps/workflowengine/l10n/de.json | 4 | ||||
-rw-r--r-- | apps/workflowengine/l10n/gl.js | 5 | ||||
-rw-r--r-- | apps/workflowengine/l10n/gl.json | 5 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/FileMimeType.php | 8 | ||||
-rw-r--r-- | apps/workflowengine/src/components/Checks/request.js | 2 | ||||
-rw-r--r-- | apps/workflowengine/src/components/Event.vue | 78 | ||||
-rw-r--r-- | apps/workflowengine/tests/Check/FileMimeTypeTest.php | 6 |
10 files changed, 46 insertions, 68 deletions
diff --git a/apps/workflowengine/l10n/ar.js b/apps/workflowengine/l10n/ar.js index 5b00ffbc102..a091151116a 100644 --- a/apps/workflowengine/l10n/ar.js +++ b/apps/workflowengine/l10n/ar.js @@ -54,6 +54,7 @@ OC.L10N.register( "Images" : "صور", "Office documents" : "مستندات المكتب", "PDF documents" : "مستندات PDF", + "Custom MIME type" : "نوع MIME مخصص", "Custom mimetype" : "أنواع ملفات مخصصة", "Please enter a valid time span" : "الرجاء إدخال نطاق زمني صالح", "Select a request URL" : "حدد عنوان URL الخاص بالطلب", diff --git a/apps/workflowengine/l10n/ar.json b/apps/workflowengine/l10n/ar.json index 3119586087a..7fb680cbe8c 100644 --- a/apps/workflowengine/l10n/ar.json +++ b/apps/workflowengine/l10n/ar.json @@ -52,6 +52,7 @@ "Images" : "صور", "Office documents" : "مستندات المكتب", "PDF documents" : "مستندات PDF", + "Custom MIME type" : "نوع MIME مخصص", "Custom mimetype" : "أنواع ملفات مخصصة", "Please enter a valid time span" : "الرجاء إدخال نطاق زمني صالح", "Select a request URL" : "حدد عنوان URL الخاص بالطلب", diff --git a/apps/workflowengine/l10n/de.js b/apps/workflowengine/l10n/de.js index 06ce3246c3b..2fd7794d476 100644 --- a/apps/workflowengine/l10n/de.js +++ b/apps/workflowengine/l10n/de.js @@ -48,6 +48,7 @@ OC.L10N.register( "Nextcloud workflow engine" : "Nextcloud Arbeitsablauf-Engine", "Select a filter" : "Filter auswählen", "Select a comparator" : "Wähle einen Komparator", + "Remove filter" : "Filter entfernen", "Select a file type" : "Dateityp auswählen", "e.g. httpd/unix-directory" : "z. B. httpd/unix-directory", "Folder" : "Ordner", @@ -66,10 +67,11 @@ OC.L10N.register( "Desktop client" : "Desktop-Client", "Thunderbird & Outlook addons" : "Thunderbird & Outlook Add-ons", "Custom user agent" : "Benutzerdefinierter User-Agent", - "At least one event must be selected" : "Mindestens ein Termin muss ausgewählt werden", + "At least one event must be selected" : "Mindestens ein Ereignis muss ausgewählt werden", "Add new flow" : "Neuen Ablauf hinzufügen", "When" : "Wenn", "and" : "und", + "Add a new filter" : "Neuen Filter hinzufügen", "Cancel" : "Abbrechen", "Delete" : "Löschen", "The configuration is invalid" : "Die Konfiguration ist ungültig", diff --git a/apps/workflowengine/l10n/de.json b/apps/workflowengine/l10n/de.json index 90f020765d4..e45b6b02632 100644 --- a/apps/workflowengine/l10n/de.json +++ b/apps/workflowengine/l10n/de.json @@ -46,6 +46,7 @@ "Nextcloud workflow engine" : "Nextcloud Arbeitsablauf-Engine", "Select a filter" : "Filter auswählen", "Select a comparator" : "Wähle einen Komparator", + "Remove filter" : "Filter entfernen", "Select a file type" : "Dateityp auswählen", "e.g. httpd/unix-directory" : "z. B. httpd/unix-directory", "Folder" : "Ordner", @@ -64,10 +65,11 @@ "Desktop client" : "Desktop-Client", "Thunderbird & Outlook addons" : "Thunderbird & Outlook Add-ons", "Custom user agent" : "Benutzerdefinierter User-Agent", - "At least one event must be selected" : "Mindestens ein Termin muss ausgewählt werden", + "At least one event must be selected" : "Mindestens ein Ereignis muss ausgewählt werden", "Add new flow" : "Neuen Ablauf hinzufügen", "When" : "Wenn", "and" : "und", + "Add a new filter" : "Neuen Filter hinzufügen", "Cancel" : "Abbrechen", "Delete" : "Löschen", "The configuration is invalid" : "Die Konfiguration ist ungültig", diff --git a/apps/workflowengine/l10n/gl.js b/apps/workflowengine/l10n/gl.js index 6e7c011d4a9..deb75bff917 100644 --- a/apps/workflowengine/l10n/gl.js +++ b/apps/workflowengine/l10n/gl.js @@ -48,13 +48,15 @@ OC.L10N.register( "Nextcloud workflow engine" : "Motor de fluxo de traballo de Nextcloud", "Select a filter" : "Seleccione un filtro", "Select a comparator" : "Seleccione un comparador", + "Remove filter" : "Retirar o filtro", "Select a file type" : "Seleccione un tipo de ficheiro", "e.g. httpd/unix-directory" : "p. ex.: httpd/unix-directory", "Folder" : "Cartafol", "Images" : "Imaxes", "Office documents" : "Documentos de oficina", "PDF documents" : "Documentos PDF", - "Custom mimetype" : "Mimetipe personalizado", + "Custom MIME type" : "Tipo MIME personalizado", + "Custom mimetype" : "Tipo MIME personalizado", "Please enter a valid time span" : "Introduza un intervalo de tempo válido", "Select a request URL" : "Seleccione un URL de solicitude", "Files WebDAV" : "Ficheiros WebDAV", @@ -69,6 +71,7 @@ OC.L10N.register( "Add new flow" : "Engadir un novo fluxo", "When" : "Cando", "and" : "e", + "Add a new filter" : "Engadir un novo filtro", "Cancel" : "Cancelar", "Delete" : "Eliminar", "The configuration is invalid" : "A configuración é incorrecta", diff --git a/apps/workflowengine/l10n/gl.json b/apps/workflowengine/l10n/gl.json index 1d2ef1ffce2..f53b96cbc07 100644 --- a/apps/workflowengine/l10n/gl.json +++ b/apps/workflowengine/l10n/gl.json @@ -46,13 +46,15 @@ "Nextcloud workflow engine" : "Motor de fluxo de traballo de Nextcloud", "Select a filter" : "Seleccione un filtro", "Select a comparator" : "Seleccione un comparador", + "Remove filter" : "Retirar o filtro", "Select a file type" : "Seleccione un tipo de ficheiro", "e.g. httpd/unix-directory" : "p. ex.: httpd/unix-directory", "Folder" : "Cartafol", "Images" : "Imaxes", "Office documents" : "Documentos de oficina", "PDF documents" : "Documentos PDF", - "Custom mimetype" : "Mimetipe personalizado", + "Custom MIME type" : "Tipo MIME personalizado", + "Custom mimetype" : "Tipo MIME personalizado", "Please enter a valid time span" : "Introduza un intervalo de tempo válido", "Select a request URL" : "Seleccione un URL de solicitude", "Files WebDAV" : "Ficheiros WebDAV", @@ -67,6 +69,7 @@ "Add new flow" : "Engadir un novo fluxo", "When" : "Cando", "and" : "e", + "Add a new filter" : "Engadir un novo filtro", "Cancel" : "Cancelar", "Delete" : "Eliminar", "The configuration is invalid" : "A configuración é incorrecta", diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php index 991d7ebc739..dfcfed9466b 100644 --- a/apps/workflowengine/lib/Check/FileMimeType.php +++ b/apps/workflowengine/lib/Check/FileMimeType.php @@ -107,13 +107,7 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck { * @return bool */ public function executeCheck($operator, $value) { - $actualValue = $this->getActualValue(); - $plainMimetypeResult = $this->executeStringCheck($operator, $value, $actualValue); - if ($actualValue === 'httpd/unix-directory') { - return $plainMimetypeResult; - } - $detectMimetypeBasedOnFilenameResult = $this->executeStringCheck($operator, $value, $this->mimeTypeDetector->detectPath($this->path)); - return $plainMimetypeResult || $detectMimetypeBasedOnFilenameResult; + return $this->executeStringCheck($operator, $value, $this->getActualValue()); } /** diff --git a/apps/workflowengine/src/components/Checks/request.js b/apps/workflowengine/src/components/Checks/request.js index 04d2069c7c8..9f33bac6676 100644 --- a/apps/workflowengine/src/components/Checks/request.js +++ b/apps/workflowengine/src/components/Checks/request.js @@ -38,7 +38,7 @@ const RequestChecks = [ component: RequestURL, }, { - class: 'OCA\\WorkflowEngine\\Check\\RequestTimeController', + class: 'OCA\\WorkflowEngine\\Check\\RequestTime', name: t('workflowengine', 'Request time'), operators: [ { operator: 'in', name: t('workflowengine', 'between') }, diff --git a/apps/workflowengine/src/components/Event.vue b/apps/workflowengine/src/components/Event.vue index b2a68c16dbd..c9b93f3f097 100644 --- a/apps/workflowengine/src/components/Event.vue +++ b/apps/workflowengine/src/components/Event.vue @@ -4,36 +4,35 @@ <img class="option__icon" :src="entity.icon" alt=""> <span class="option__title option__title_single">{{ operation.triggerHint }}</span> </div> - <NcMultiselect v-else - :value="currentEvent" - :options="allEvents" - track-by="id" - :multiple="true" - :auto-limit="false" + <NcSelect v-else :disabled="allEvents.length <= 1" + :multiple="true" + :options="allEvents" + :value="currentEvent" + :placeholder="placeholderString" + class="event__trigger" + label="displayName" @input="updateEvent"> - <template slot="selection" slot-scope="{ values, isOpen }"> - <div v-if="values.length && !isOpen" class="eventlist"> - <img class="option__icon" :src="values[0].entity.icon" alt=""> - <span v-for="(value, index) in values" :key="value.id" class="text option__title option__title_single">{{ value.displayName }} <span v-if="index+1 < values.length">, </span></span> - </div> + <template #option="option"> + <img class="option__icon" :src="option.entity.icon" alt=""> + <span class="option__title">{{ option.displayName }}</span> </template> - <template slot="option" slot-scope="props"> - <img class="option__icon" :src="props.option.entity.icon" alt=""> - <span class="option__title">{{ props.option.displayName }}</span> + <template #selected-option="option"> + <img class="option__icon" :src="option.entity.icon" alt=""> + <span class="option__title">{{ option.displayName }}</span> </template> - </NcMultiselect> + </NcSelect> </div> </template> <script> -import NcMultiselect from '@nextcloud/vue/dist/Components/NcMultiselect.js' +import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js' import { showWarning } from '@nextcloud/dialogs' export default { name: 'Event', components: { - NcMultiselect, + NcSelect, }, props: { rule: { @@ -54,10 +53,15 @@ export default { currentEvent() { return this.allEvents.filter(event => event.entity.id === this.rule.entity && this.rule.events.indexOf(event.eventName) !== -1) }, + placeholderString() { + // TRANSLATORS: Users should select a trigger for a workflow action + return t('workflowengine', 'Select a trigger') + }, }, methods: { updateEvent(events) { if (events.length === 0) { + // TRANSLATORS: Users must select an event as of "happening" or "incident" which triggers an action showWarning(t('workflowengine', 'At least one event must be selected')) return } @@ -81,6 +85,10 @@ export default { <style scoped lang="scss"> .event { margin-bottom: 5px; + + &__trigger { + max-width: 550px; + } } .isComplex { img { @@ -91,51 +99,15 @@ export default { display: inline-block; } } - .multiselect { - width: 100%; - max-width: 550px; - margin-top: 4px; - } - .multiselect::v-deep .multiselect__single { - display: flex; - } - .multiselect:not(.multiselect--active)::v-deep .multiselect__tags { - background-color: var(--color-main-background) !important; - border: 1px solid transparent; - } - - .multiselect::v-deep .multiselect__tags { - background-color: var(--color-main-background) !important; - height: auto; - min-height: 34px; - } - - .multiselect:not(.multiselect--disabled)::v-deep .multiselect__tags .multiselect__single { - background-image: var(--icon-triangle-s-dark); - background-repeat: no-repeat; - background-position: right center; - } - - input { - border: 1px solid transparent; - } .option__title { margin-left: 5px; color: var(--color-main-text); } - .option__title_single { - font-weight: 900; - } .option__icon { width: 16px; height: 16px; filter: var(--background-invert-if-dark); } - - .eventlist img, - .eventlist .text { - vertical-align: middle; - } </style> diff --git a/apps/workflowengine/tests/Check/FileMimeTypeTest.php b/apps/workflowengine/tests/Check/FileMimeTypeTest.php index 3ebcaa8f4b3..e5a4c99269f 100644 --- a/apps/workflowengine/tests/Check/FileMimeTypeTest.php +++ b/apps/workflowengine/tests/Check/FileMimeTypeTest.php @@ -127,7 +127,7 @@ class FileMimeTypeTest extends TestCase { $check = new FileMimeType($this->l10n, $this->request, $this->mimeDetector); $check->setFileInfo($storage, 'foo/bar.txt'); - $this->assertTrue($check->executeCheck('is', 'text/plain-path-detected')); + $this->assertTrue($check->executeCheck('is', 'text/plain-content-detected')); } public function testFallback() { @@ -142,7 +142,7 @@ class FileMimeTypeTest extends TestCase { public function testFromCacheCached() { $storage = new Temporary([]); $storage->mkdir('foo'); - $storage->file_put_contents('foo/bar.txt', 'asd'); + $storage->file_put_contents('foo/bar.txt', 'text-content'); $storage->getScanner()->scan(''); $check = new FileMimeType($this->l10n, $this->request, $this->mimeDetector); @@ -156,7 +156,7 @@ class FileMimeTypeTest extends TestCase { $newCheck = new FileMimeType($this->l10n, $this->request, $this->mimeDetector); $newCheck->setFileInfo($storage, 'foo/bar.txt'); - $this->assertTrue($newCheck->executeCheck('is', 'text/plain-path-detected')); + $this->assertTrue($newCheck->executeCheck('is', 'text/plain-content-detected')); } public function testExistsCached() { |