Skip to content

Commit ee174d4

Browse files
committed
fix: Fix unit selection in file type and migrate from input event
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
1 parent f046a81 commit ee174d4

4 files changed

Lines changed: 37 additions & 33 deletions

File tree

src/FormsSettings.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
:placeholder="t('forms', 'Select groups')"
2323
class="forms-settings__creation__multiselect"
2424
label="displayName"
25-
@input="onCreationAllowedGroupsChange" />
25+
@update:modelValue="onCreationAllowedGroupsChange" />
2626
</NcSettingsSection>
2727
<NcSettingsSection
2828
:name="t('forms', 'Confirmation emails')"

src/components/Questions/Question.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
:labelOutside="false"
103103
:showTrailingButton="false"
104104
:modelValue="name"
105-
@input="onNameChange">
105+
@update:modelValue="onNameChange">
106106
<template #icon>
107107
<NcIconSvgWrapper :svg="IconIdentifier" />
108108
</template>
@@ -374,8 +374,8 @@ export default {
374374
this.$emit('update:description', target.value)
375375
},
376376
377-
onNameChange({ target }) {
378-
this.$emit('update:name', target.value)
377+
onNameChange(name) {
378+
this.$emit('update:name', name)
379379
},
380380
381381
onRequiredChange(isRequired) {

src/components/Questions/QuestionFile.vue

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,31 @@
1818
</template>
1919
{{ allowedFileTypesLabel }}
2020
</NcActionButton>
21+
22+
<NcActionInput
23+
type="number"
24+
:modelValue="maxAllowedFilesCount"
25+
labelOutside
26+
:label="t('forms', 'Maximum number of files')"
27+
:showTrailingButton="false"
28+
@update:modelValue="onMaxAllowedFilesCountInput" />
29+
30+
<NcActionInput
31+
type="number"
32+
:modelValue="maxFileSizeValue"
33+
labelOutside
34+
:showTrailingButton="false"
35+
:label="t('forms', 'Maximum file size')"
36+
@update:modelValue="onMaxFileSizeValueInput" />
37+
38+
<NcActionInput
39+
type="multiselect"
40+
:modelValue="maxFileSizeUnit"
41+
:options="availableUnits"
42+
required
43+
:clearable="false"
44+
:searchable="false"
45+
@update:modelValue="onMaxFileSizeUnitInput" />
2146
</template>
2247

2348
<template v-else>
@@ -41,42 +66,17 @@
4166
</NcActionCheckbox>
4267

4368
<NcActionInput
69+
key="allowed-file-extensions-multiselect"
4470
:label="t('forms', 'Custom file extensions')"
4571
type="multiselect"
4672
multiple
4773
taggable
48-
:modelValue="extraSettings?.allowedFileExtensions || []"
74+
:modelValue="allowedFileExtensions"
4975
@option:created="onAllowedFileExtensionsAdded"
5076
@option:deselected="onAllowedFileExtensionsDeleted" />
5177

5278
<NcActionSeparator />
5379
</template>
54-
55-
<template v-if="!allowedFileTypesDialogOpened">
56-
<NcActionInput
57-
type="number"
58-
:modelValue="maxAllowedFilesCount"
59-
labelOutside
60-
:label="t('forms', 'Maximum number of files')"
61-
:showTrailingButton="false"
62-
@input="onMaxAllowedFilesCountInput($event.target.value)" />
63-
64-
<NcActionInput
65-
type="number"
66-
:modelValue="maxFileSizeValue"
67-
labelOutside
68-
:showTrailingButton="false"
69-
:label="t('forms', 'Maximum file size')"
70-
@input="onMaxFileSizeValueInput($event.target.value)" />
71-
72-
<NcActionInput
73-
type="multiselect"
74-
:modelValue="maxFileSizeUnit"
75-
:options="availableUnits"
76-
required
77-
:clearable="false"
78-
@input="onMaxFileSizeUnitInput($event)" />
79-
</template>
8080
</template>
8181

8282
<div class="question__content">
@@ -238,6 +238,10 @@ export default {
238238
return this.extraSettings?.maxAllowedFilesCount || 1
239239
},
240240
241+
allowedFileExtensions() {
242+
return this.extraSettings?.allowedFileExtensions || []
243+
},
244+
241245
allowedFileTypesLabel() {
242246
const allowedFileTypes = []
243247
if (this.extraSettings?.allowedFileTypes?.length) {

src/components/Questions/QuestionGrid.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@
7171
<NcInputField
7272
type="number"
7373
:modelValue="plainValues[row.id][column.id]"
74-
@input="
74+
@update:modelValue="
7575
onChangeTextNumber(
7676
row.id,
7777
column.id,
78-
$event.target.value,
78+
$event,
7979
)
8080
" />
8181
</template>

0 commit comments

Comments
 (0)