Fix operation list when scope is limited

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2019-10-11 15:05:58 +02:00 committed by Arthur Schiwon
parent 0fccda86c2
commit fce33f39d3
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
5 changed files with 15 additions and 12 deletions

View File

@ -33,12 +33,12 @@
@input="setValue">
<template slot="singleLabel" slot-scope="props">
<span v-if="props.option.icon" class="option__icon" :class="props.option.icon" />
<img v-else :src="props.option.iconUrl" />
<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 v-if="props.option.icon" class="option__icon" :class="props.option.icon" />
<img v-else :src="props.option.iconUrl" />
<img v-else :src="props.option.iconUrl">
<span class="option__title">{{ props.option.label }}</span>
</template>
</Multiselect>

View File

@ -10,7 +10,9 @@
type="text"
placeholder="e.g. 18:00"
@input="update">
<p v-if="!valid" class="invalid-hint">{{ t('workflowengine', 'Please enter a valid time span')}}</p>
<p v-if="!valid" class="invalid-hint">
{{ t('workflowengine', 'Please enter a valid time span') }}
</p>
</div>
</template>
@ -56,7 +58,9 @@ export default {
timezone: data[0].split(' ', 2)[1]
}
}
} catch (e) {}
} catch (e) {
// ignore invalid values
}
},
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

View File

@ -15,7 +15,7 @@
<template slot="selection" slot-scope="{ values, search, isOpen }">
<div v-if="values.length && !isOpen" class="eventlist">
<img class="option__icon" :src="values[0].entity.icon">
<span class="text option__title option__title_single" v-for="(value, index) in values">{{ value.displayName }} <span v-if="index+1 < values.length">, </span></span>
<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>
<template slot="option" slot-scope="props">

View File

@ -27,24 +27,21 @@ const validateRegex = function(string) {
if (!string) {
return false
}
const result = regexRegex.exec(string)
return result !== null
return regexRegex.exec(string) !== null
}
const validateIPv4 = function(string) {
if (!string) {
return false
}
const result = regexIPv4.exec(string)
return result !== null
return regexIPv4.exec(string) !== null
}
const validateIPv6 = function(string) {
if (!string) {
return false
}
const result = regexIPv6.exec(string)
return result !== null
return regexIPv6.exec(string) !== null
}
const stringValidator = (check) => {

View File

@ -71,7 +71,9 @@ const store = new Vuex.Store({
plugin = Object.assign(
{ color: 'var(--color-primary-element)' },
plugin, state.operations[plugin.id] || {})
Vue.set(state.operations, plugin.id, plugin)
if (typeof state.operations[plugin.id] !== 'undefined') {
Vue.set(state.operations, plugin.id, plugin)
}
}
},
actions: {