Skip to content

Commit 45ff693

Browse files
authored
Merge pull request #3142 from nextcloud/enh/grid-submenu
feat: extract subtype check and show submenu indicator for questions with subtypes
2 parents eee722b + 5b6c195 commit 45ff693

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/views/Create.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,12 @@
162162
<NcActionButton
163163
v-for="(answer, type) in answerTypesFilter"
164164
:key="answer.label"
165-
:close-after-click="!answer.subtypes"
165+
:close-after-click="!hasSubtypes(answer)"
166166
:disabled="isLoadingQuestions"
167+
:is-menu="hasSubtypes(answer)"
167168
class="question-menu__question"
168169
@click="
169-
answer.subtypes
170+
hasSubtypes(answer)
170171
? (activeQuestionType = type)
171172
: addQuestion(type)
172173
">
@@ -344,6 +345,11 @@ export default {
344345
return filteredAnswerTypes
345346
},
346347
348+
hasSubtypes() {
349+
return (answer) =>
350+
answer && answer.subtypes && Object.keys(answer.subtypes).length > 0
351+
},
352+
347353
lockedUntilFormatted() {
348354
return moment(this.form.lockedUntil, 'X').fromNow()
349355
},

0 commit comments

Comments
 (0)