diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-10-10 15:32:55 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-10-29 18:03:54 +0100 |
commit | e72f58b000efbca5efa74098dbfa7f2f7418bcc0 (patch) | |
tree | 7c28fdc5525cddf6a102d7aca6587c8fa3627fc9 /apps/workflowengine/src/components | |
parent | 6878d36e501801daa736a97a3b0137083272bc84 (diff) | |
download | nextcloud-server-e72f58b000efbca5efa74098dbfa7f2f7418bcc0.tar.gz nextcloud-server-e72f58b000efbca5efa74098dbfa7f2f7418bcc0.zip |
Fix bugs with check plugins
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/workflowengine/src/components')
3 files changed, 39 insertions, 17 deletions
diff --git a/apps/workflowengine/src/components/Checks/FileMimeType.vue b/apps/workflowengine/src/components/Checks/FileMimeType.vue index 2f2487c9adf..862c4a42011 100644 --- a/apps/workflowengine/src/components/Checks/FileMimeType.vue +++ b/apps/workflowengine/src/components/Checks/FileMimeType.vue @@ -32,17 +32,20 @@ :tagging="false" @input="setValue"> <template slot="singleLabel" slot-scope="props"> - <span class="option__icon" :class="props.option.icon" /> + <span v-if="props.option.icon" class="option__icon" :class="props.option.icon" /> + <img v-else :src="props.option.iconUrl" /> <span class="option__title option__title_single">{{ props.option.label }}</span> </template> <template slot="option" slot-scope="props"> - <span class="option__icon" :class="props.option.icon" /> + <span v-if="props.option.icon" class="option__icon" :class="props.option.icon" /> + <img v-else :src="props.option.iconUrl" /> <span class="option__title">{{ props.option.label }}</span> </template> </Multiselect> <input v-if="!isPredefined" type="text" :value="currentValue.pattern" + :placeholder="t('workflowengine', 'e.g. httpd/unix-directory')" @input="updateCustom"> </div> </template> @@ -68,12 +71,12 @@ export default { pattern: '/image\\/.*/' }, { - icon: 'icon-category-office', + iconUrl: OC.imagePath('core', 'filetypes/x-office-document'), label: t('workflowengine', 'Office documents'), pattern: '/(vnd\\.(ms-|openxmlformats-).*))$/' }, { - icon: 'icon-filetype-file', + iconUrl: OC.imagePath('core', 'filetypes/application-pdf'), label: t('workflowengine', 'PDF documents'), pattern: 'application/pdf' } @@ -130,3 +133,15 @@ export default { } } </script> +<style scoped> + .multiselect, input[type='text'] { + width: 100%; + } + .multiselect >>> .multiselect__content-wrapper li>span, + .multiselect >>> .multiselect__single { + display: flex; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } +</style> diff --git a/apps/workflowengine/src/components/Checks/RequestTime.vue b/apps/workflowengine/src/components/Checks/RequestTime.vue index 1d7950f64f8..cd702ecae82 100644 --- a/apps/workflowengine/src/components/Checks/RequestTime.vue +++ b/apps/workflowengine/src/components/Checks/RequestTime.vue @@ -4,12 +4,13 @@ <input v-model="newValue.startTime" type="text" class="timeslot--start" - placeholder="08:00" + placeholder="e.g. 08:00" @input="update"> <input v-model="newValue.endTime" type="text" - placeholder="18:00" + placeholder="e.g. 18:00" @input="update"> + <p v-if="!valid" class="invalid-hint">{{ t('workflowengine', 'Please enter a valid time span')}}</p> </div> </template> @@ -30,7 +31,7 @@ export default { props: { value: { type: String, - default: '1 MB' + default: '' } }, data() { @@ -46,15 +47,16 @@ export default { }, methods: { updateInternalValue(value) { - var data = JSON.parse(value) - var startTime = data[0].split(' ', 2)[0] - var endTime = data[1].split(' ', 2)[0] - var timezone = data[0].split(' ', 2)[1] - this.newValue = { - startTime: startTime, - endTime: endTime, - timezone: timezone - } + try { + const data = JSON.parse(value) + if (data.length === 2) { + this.newValue = { + startTime: data[0].split(' ', 2)[0], + endTime: data[1].split(' ', 2)[0], + timezone: data[0].split(' ', 2)[1] + } + } + } catch (e) {} }, validate() { return this.newValue.startTime && this.newValue.startTime.match(/^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$/i) !== null @@ -90,10 +92,15 @@ export default { width: 50%; margin: 0; margin-bottom: 5px; + &.timeslot--start { margin-right: 5px; width: calc(50% - 5px); } } + + .invalid-hint { + color: var(--color-text-maxcontrast); + } } </style> diff --git a/apps/workflowengine/src/components/Checks/file.js b/apps/workflowengine/src/components/Checks/file.js index 76f998da007..0cc49c2d4c1 100644 --- a/apps/workflowengine/src/components/Checks/file.js +++ b/apps/workflowengine/src/components/Checks/file.js @@ -65,7 +65,7 @@ const FileChecks = [ { operator: 'greater', name: t('workflowengine', 'greater') } ], placeholder: (check) => '5 MB', - validate: (check) => check.value.match(/^[0-9]+[ ]?[kmgt]?b$/i) !== null + validate: (check) => check.value ? check.value.match(/^[0-9]+[ ]?[kmgt]?b$/i) !== null : false }, { |