Skip to content

Commit 070beef

Browse files
committed
fixup! feat(LeftSidebar): add controls for conversations sort
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
1 parent 89db6d9 commit 070beef

1 file changed

Lines changed: 25 additions & 12 deletions

File tree

src/components/LeftSidebar/LeftSidebar.vue

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,22 @@
110110

111111
<NcActionButton
112112
closeAfterClick
113-
type="checkbox"
114-
:modelValue="groupMode === CONVERSATION.GROUP_MODE.PRIVATE_FIRST"
115-
@click="handleGroupMode(CONVERSATION.GROUP_MODE.PRIVATE_FIRST)">
113+
type="radio"
114+
:value="CONVERSATION.GROUP_MODE.NONE"
115+
:modelValue="groupMode"
116+
@update:modelValue="handleGroupMode">
117+
<template #icon>
118+
<IconCancel :size="20" />
119+
</template>
120+
{{ SORT_LABELS.GROUPBY_NONE }}
121+
</NcActionButton>
122+
123+
<NcActionButton
124+
closeAfterClick
125+
type="radio"
126+
:value="CONVERSATION.GROUP_MODE.PRIVATE_FIRST"
127+
:modelValue="groupMode"
128+
@update:modelValue="handleGroupMode">
116129
<template #icon>
117130
<IconAccountOutline :size="20" />
118131
</template>
@@ -121,9 +134,10 @@
121134

122135
<NcActionButton
123136
closeAfterClick
124-
type="checkbox"
125-
:modelValue="groupMode === CONVERSATION.GROUP_MODE.GROUP_FIRST"
126-
@click="handleGroupMode(CONVERSATION.GROUP_MODE.GROUP_FIRST)">
137+
type="radio"
138+
:value="CONVERSATION.GROUP_MODE.GROUP_FIRST"
139+
:modelValue="groupMode"
140+
@update:modelValue="handleGroupMode">
127141
<template #icon>
128142
<IconAccountMultipleOutline :size="20" />
129143
</template>
@@ -381,6 +395,7 @@ import IconArchiveOutline from 'vue-material-design-icons/ArchiveOutline.vue'
381395
import IconArrowLeft from 'vue-material-design-icons/ArrowLeft.vue'
382396
import IconAt from 'vue-material-design-icons/At.vue'
383397
import IconCalendarBlankOutline from 'vue-material-design-icons/CalendarBlankOutline.vue'
398+
import IconCancel from 'vue-material-design-icons/Cancel.vue'
384399
import IconChatPlusOutline from 'vue-material-design-icons/ChatPlusOutline.vue'
385400
import IconClockOutline from 'vue-material-design-icons/ClockOutline.vue'
386401
import IconCogOutline from 'vue-material-design-icons/CogOutline.vue'
@@ -457,6 +472,8 @@ const SORT_LABELS = {
457472
// TRANSLATORS Navigation actions: group (verb) by putting private or group (noun) conversations higher in the list
458473
GROUPBY_HEADER: t('spreed', 'Group conversations'),
459474
// TRANSLATORS Navigation actions: group (verb) by putting private or group (noun) conversations higher in the list
475+
GROUPBY_NONE: t('spreed', 'Do not group'),
476+
// TRANSLATORS Navigation actions: group (verb) by putting private or group (noun) conversations higher in the list
460477
GROUPBY_PRIVATE_FIRST: t('spreed', 'Show private ones first'),
461478
// TRANSLATORS Navigation actions: group (verb) by putting private or group (noun) conversations higher in the list
462479
GROUPBY_GROUP_FIRST: t('spreed', 'Show group ones first'),
@@ -492,6 +509,7 @@ export default {
492509
// Icons
493510
IconAccountMultiplePlusOutline,
494511
IconAt,
512+
IconCancel,
495513
IconMessageBadgeOutline,
496514
IconMessageOutline,
497515
IconFilterCogOutline,
@@ -852,12 +870,7 @@ export default {
852870
},
853871
854872
handleGroupMode(newValue) {
855-
if (newValue === this.groupMode) {
856-
// Reset mode
857-
this.settingsStore.updateGroupMode(CONVERSATION.GROUP_MODE.NONE)
858-
} else {
859-
this.settingsStore.updateGroupMode(newValue)
860-
}
873+
this.settingsStore.updateGroupMode(newValue)
861874
},
862875
863876
handleFilter(filter) {

0 commit comments

Comments
 (0)