Skip to content

Commit b0e97ab

Browse files
committed
feat(taskTypeSelect): show all task types inline
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
1 parent 8228927 commit b0e97ab

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/components/AssistantTextProcessingForm.vue

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<TaskTypeSelect
1111
:value.sync="mySelectedTaskTypeId"
1212
class="task-custom-select"
13-
:inline="5"
1413
:options="sortedTaskTypes"
1514
@update:value="onTaskTypeUserChange" />
1615
<div v-if="showHistory"
@@ -38,14 +37,6 @@
3837
@load-task="onHistoryLoadTask" />
3938
</div>
4039
<div v-else class="task-input-output-form">
41-
<!--h2 v-if="selectedTaskType"
42-
class="task-name">
43-
{{ selectedTaskType.name }}
44-
</h2>
45-
<span v-if="selectedTaskType"
46-
class="task-description">
47-
{{ selectedTaskType.description }}
48-
</span-->
4940
<AssistantFormInputs v-if="selectedTaskType"
5041
:inputs.sync="myInputs"
5142
:selected-task-id="selectedTaskId"

src/components/TaskTypeSelect.vue

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@click="onTaskSelected(t)">
99
{{ t.name }}
1010
</NcButton>
11-
<NcActions v-if="actionTypes.length > 0"
11+
<NcActions v-if="!onlyInline && actionTypes.length > 0"
1212
:force-menu="true"
1313
:container="$refs.taskTypeSelect">
1414
<NcActionButton v-for="(t, i) in actionTypes"
@@ -49,9 +49,13 @@ export default {
4949
type: Array,
5050
required: true,
5151
},
52+
/**
53+
* Number of inline elements
54+
* All elements are inline if this prop is null
55+
*/
5256
inline: {
53-
type: Number,
54-
default: 3,
57+
type: [Number, null],
58+
default: null,
5559
},
5660
},
5761
@@ -66,7 +70,13 @@ export default {
6670
},
6771
6872
computed: {
73+
onlyInline() {
74+
return this.inline === null
75+
},
6976
buttonTypes() {
77+
if (this.onlyInline) {
78+
return this.options
79+
}
7080
// extra button replaces the last one
7181
if (this.extraButtonType !== null) {
7282
const types = this.options.slice(0, this.inline - 1)
@@ -104,6 +114,9 @@ export default {
104114
105115
methods: {
106116
moveSelectedIfInMenu() {
117+
if (this.onlyInline) {
118+
return
119+
}
107120
// if the initially selected value is in the dropdown, get it out
108121
const selectedAction = this.actionTypes.find(a => a.id === this.value)
109122
if (this.actionTypes.find(a => a.id === this.value)) {

0 commit comments

Comments
 (0)