File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 7878 </template >
7979 </template >
8080
81+ <NcNoteCard v-if =" hasError" :id =" errorId" type =" error" >
82+ {{ errorMessage }}
83+ </NcNoteCard >
84+
8185 <div class =" question__content" >
8286 <ul >
8387 <NcListItem
@@ -201,6 +205,7 @@ export default {
201205 data () {
202206 return {
203207 fileTypes,
208+ errorMessage: null ,
204209 fileLoading: false ,
205210 maxFileSizeUnit: Object .keys (FILE_SIZE_UNITS )[0 ],
206211 maxFileSizeValue: ' ' ,
@@ -239,6 +244,14 @@ export default {
239244
240245 return t (' forms' , ' All file types are allowed.' )
241246 },
247+
248+ hasError () {
249+ return !! this .errorMessage
250+ },
251+
252+ errorId () {
253+ return ` q${ this .index } _error`
254+ },
242255 },
243256
244257 mounted () {
@@ -394,6 +407,18 @@ export default {
394407
395408 this .$emit (' update:values' , values)
396409 },
410+
411+ async validate () {
412+ if (this .fileLoading ) {
413+ this .errorMessage = t (
414+ ' forms' ,
415+ ' Please wait until the file has been uploaded.' ,
416+ )
417+ return false
418+ }
419+ this .errorMessage = null
420+ return true
421+ },
397422 },
398423}
399424< / script>
You can’t perform that action at this time.
0 commit comments