|
18 | 18 | </template> |
19 | 19 | {{ allowedFileTypesLabel }} |
20 | 20 | </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" /> |
21 | 46 | </template> |
22 | 47 |
|
23 | 48 | <template v-else> |
|
41 | 66 | </NcActionCheckbox> |
42 | 67 |
|
43 | 68 | <NcActionInput |
| 69 | + key="allowed-file-extensions-multiselect" |
44 | 70 | :label="t('forms', 'Custom file extensions')" |
45 | 71 | type="multiselect" |
46 | 72 | multiple |
47 | 73 | taggable |
48 | | - :modelValue="extraSettings?.allowedFileExtensions || []" |
| 74 | + :modelValue="allowedFileExtensions" |
49 | 75 | @option:created="onAllowedFileExtensionsAdded" |
50 | 76 | @option:deselected="onAllowedFileExtensionsDeleted" /> |
51 | 77 |
|
52 | 78 | <NcActionSeparator /> |
53 | 79 | </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> |
80 | 80 | </template> |
81 | 81 |
|
82 | 82 | <div class="question__content"> |
@@ -238,6 +238,10 @@ export default { |
238 | 238 | return this.extraSettings?.maxAllowedFilesCount || 1 |
239 | 239 | }, |
240 | 240 |
|
| 241 | + allowedFileExtensions() { |
| 242 | + return this.extraSettings?.allowedFileExtensions || [] |
| 243 | + }, |
| 244 | +
|
241 | 245 | allowedFileTypesLabel() { |
242 | 246 | const allowedFileTypes = [] |
243 | 247 | if (this.extraSettings?.allowedFileTypes?.length) { |
|
0 commit comments