diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2025-03-19 22:32:36 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2025-04-03 12:40:48 +0200 |
commit | eaf02682302cf6b95a82bdf187c9155955ec2937 (patch) | |
tree | 62444e2caf7c6620abfbd0b98ca40b8fb7d53f8d /apps/workflowengine/src/components/Checks/file.js | |
parent | 492fa1e24c6c3ab05843fb59d89b456ddd1f793f (diff) | |
download | nextcloud-server-eaf02682302cf6b95a82bdf187c9155955ec2937.tar.gz nextcloud-server-eaf02682302cf6b95a82bdf187c9155955ec2937.zip |
fix(workflowengine): minimally adapt check operator FileMimeType to use web component
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/workflowengine/src/components/Checks/file.js')
-rw-r--r-- | apps/workflowengine/src/components/Checks/file.js | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/apps/workflowengine/src/components/Checks/file.js b/apps/workflowengine/src/components/Checks/file.js index 5a5b5d22b41..568efc81cd3 100644 --- a/apps/workflowengine/src/components/Checks/file.js +++ b/apps/workflowengine/src/components/Checks/file.js @@ -4,6 +4,7 @@ */ import { stringValidator, validateIPv4, validateIPv6 } from '../../helpers/validators.js' +import { registerCustomElement } from '../../helpers/window.js' import FileMimeType from './FileMimeType.vue' import FileSystemTag from './FileSystemTag.vue' @@ -34,7 +35,7 @@ const FileChecks = [ class: 'OCA\\WorkflowEngine\\Check\\FileMimeType', name: t('workflowengine', 'File MIME type'), operators: stringOrRegexOperators, - component: FileMimeType, + element: registerCustomElement(FileMimeType, 'oca-workflowengine-checks-file_mime_type'), }, { @@ -80,25 +81,8 @@ const FileChecks = [ { operator: 'is', name: t('workflowengine', 'is tagged with') }, { operator: '!is', name: t('workflowengine', 'is not tagged with') }, ], - webComponent: registerWebComponent(FileSystemTag, 'oca-workflowengine-file_system_tag'), + element: registerCustomElement(FileSystemTag, 'oca-workflowengine-file_system_tag'), }, ] -/** - * - * @param VueComponent - * @param webComponentId - */ -function registerWebComponent(VueComponent, webComponentId) { - const WrappedComponent = wrap(Vue, VueComponent) - window.customElements.define(webComponentId, WrappedComponent) - - // In Vue 2, wrap doesn't support disabling shadow :( - // Disable with a hack - Object.defineProperty(WrappedComponent.prototype, 'attachShadow', { value() { return this } }) - Object.defineProperty(WrappedComponent.prototype, 'shadowRoot', { get() { return this } }) - - return webComponentId -} - export default FileChecks |