Skip to content

Commit

Permalink
Fixed issue: #15906 you can not enter anything in the input validatio…
Browse files Browse the repository at this point in the history
…n question attribute
  • Loading branch information
Jessica Höck committed Mar 9, 2020
1 parent f4f1389 commit 395768b
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 73 deletions.
64 changes: 30 additions & 34 deletions assets/packages/questioneditor/src/components/_inputtypes/text.vue
@@ -1,6 +1,34 @@
<template>
<div class="form-row">
<i class="fa fa-question pull-right"
@click="triggerShowHelp=!triggerShowHelp"
v-if="(elHelp.length>0) && !readonly"
:aria-expanded="!triggerShowHelp"
:aria-controls="'help-'+(elName || elId)"
/>
<label class="form-label" :for="elId"> {{elLabel}} </label>
<div class="input-group col-12">
<div v-if="hasPrefix" class="input-group-addon"> {{elOptions.inputGroup.prefix}} </div>
<input
type="text"
v-model="curValue"
:pattern="elOptions.elInputPattern"
:class="getClasses"
:name="elName || elId"
:id="elId"
:readonly="readonly"/>
<div v-if="hasSuffix" class="input-group-addon"> {{elOptions.inputGroup.suffix}} </div>
</div>
<div
class="question-option-help well"
:id="'help-'+(elName || elId)"
v-show="showHelp"
v-html="elHelp"
/>
</div>
</template>
<script>
import empty from 'lodash/isEmpty';
import abstractBaseType from '../abstracts/_abstractInputType';
export default {
Expand Down Expand Up @@ -49,36 +77,4 @@
}
}
};
</script>

<template>
<div class="form-row">
<i
class="fa fa-question pull-right"
@click="triggerShowHelp=!triggerShowHelp"
v-if="(elHelp.length>0) && !readonly"
:aria-expanded="!triggerShowHelp"
:aria-controls="'help-'+(elName || elId)"
/>
<label class="form-label" :for="elId"> {{elLabel}} </label>
<div class="input-group col-12">
<div v-if="hasPrefix" class="input-group-addon"> {{elOptions.inputGroup.prefix}} </div>
<input
type="text"
v-model="curValue"
:pattern="elOptions.elInputPattern"
:class="getClasses"
:name="elName || elId"
:id="elId"
:readonly="readonly"
/>
<div v-if="hasSuffix" class="input-group-addon"> {{elOptions.inputGroup.suffix}} </div>
</div>
<div
class="question-option-help well"
:id="'help-'+(elName || elId)"
v-show="showHelp"
v-html="elHelp"
/>
</div>
</template>
</script>
@@ -1,3 +1,23 @@
<template>
<div class="form-row">
<i class="fa fa-question pull-right"
@click="triggerShowHelp=!triggerShowHelp"
v-if="(elHelp.length>0) && !readonly"
:aria-expanded="!triggerShowHelp"
:aria-controls="'help-'+(elName || elId)"/>
<label class="form-label" :for="elId">
{{elLabel}}
</label>
<div :class="getClasses"
:name="elName || elId"
:id="elId"
v-html="curValue" />
<div class="question-option-help well"
:id="'help-'+(elName || elId)"
v-show="showHelp"
v-html="elHelp"/>
</div>
</template>
<script>
import empty from 'lodash/isEmpty';
import abstractBaseType from '../abstracts/_abstractInputType';
Expand Down Expand Up @@ -34,24 +54,4 @@
}
}
};
</script>

<template>
<div class="form-row">
<i
class="fa fa-question pull-right"
@click="triggerShowHelp=!triggerShowHelp"
v-if="(elHelp.length>0) && !readonly"
:aria-expanded="!triggerShowHelp"
:aria-controls="'help-'+(elName || elId)"
/>
<label class="form-label" :for="elId"> {{elLabel}} </label>
<div :class="getClasses" :name="elName || elId" :id="elId" v-html="curValue" />
<div
class="question-option-help well"
:id="'help-'+(elName || elId)"
v-show="showHelp"
v-html="elHelp"
/>
</div>
</template>
</script>
Expand Up @@ -2,6 +2,7 @@
import empty from 'lodash/isEmpty';
export default {
name: 'AbstractInputType',
props: {
elId: {type: String, required: true},
elName: {type: [String, Boolean], default: ''},
Expand Down
40 changes: 22 additions & 18 deletions assets/packages/questioneditor/src/components/generalSettings.vue
Expand Up @@ -11,19 +11,21 @@
</div>
<div class="panel-body">
<div class="list-group">
<div class="list-group-item question-option-general-setting-block" v-for="generalSetting in generalSettingOptions" :key="generalSetting.name">
<div class="list-group-item question-option-general-setting-block"
v-for="generalSetting in generalSettingOptions"
:key="generalSetting.name">
<component
v-bind:is="getComponentName(generalSetting.inputtype)"
:elId="generalSetting.formElementId"
:elName="generalSetting.formElementName"
:elLabel="generalSetting.title"
:elHelp="generalSetting.formElementHelp"
:currentValue="generalSetting.formElementValue"
:elOptions="generalSetting.formElementOptions"
:debug="generalSetting"
:readonly="isReadonly(generalSetting)"
@change="reactOnChange($event, generalSetting)"
></component>
v-bind:is="getComponentName(generalSetting.inputtype)"
:elId="generalSetting.formElementId"
:elName="generalSetting.formElementName"
:elLabel="generalSetting.title"
:elHelp="generalSetting.formElementHelp"
:currentValue="generalSetting.formElementValue"
:elOptions="generalSetting.formElementOptions"
:debug="generalSetting"
:readonly="isReadonly(generalSetting)"
@change="reactOnChange($event, generalSetting)">
</component>
</div>
</div>
</div>
Expand Down Expand Up @@ -51,7 +53,6 @@ import filter from 'lodash/filter';
import SettingSwitch from './_inputtypes/switch.vue';
import SettingText from './_inputtypes/text.vue';
import SettingSelect from './_inputtypes/select.vue';
import SettingTextdisplay from './_inputtypes/textdisplay.vue';
import SettingTextarea from './_inputtypes/textarea.vue';
import SettingButtongroup from './_inputtypes/buttongroup.vue';
import SettingQuestiontheme from './_inputtypes/questiontheme.vue';
Expand All @@ -68,9 +69,8 @@ export default {
'setting-questiontheme': SettingQuestiontheme,
'setting-questiongroup': SettingQuestiongroup,
'setting-switch': SettingSwitch,
'setting-text': SettingTextdisplay,
'setting-select': SettingSelect,
'setting-textinput': SettingText,
'setting-text': SettingText,
'setting-textarea': SettingTextarea,
'setting-buttongroup': SettingButtongroup,
'setting-columns': SettingColumns,
Expand Down Expand Up @@ -100,9 +100,13 @@ export default {
},
methods: {
getComponentName(componentRawName){
if(componentRawName != undefined)
return 'setting-'+componentRawName;
return 'stub-set';
let name = '';
if(componentRawName != undefined) {
name = 'setting-' + componentRawName;
} else {
name = 'stub-set';
}
return name;
},
reactOnChange(newValue, oSettingObject) {
this.$store.commit('setQuestionGeneralSetting', {newValue, settingName: oSettingObject.formElementId});
Expand Down

0 comments on commit 395768b

Please sign in to comment.