Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/Service/SettingsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ public function __construct(
return '.' . $out;
},
],
'showCategoryInList' => [
'default' => true,
'validate' => function ($value) {
return filter_var($value, FILTER_VALIDATE_BOOLEAN);
},
],
];
}

Expand Down
15 changes: 15 additions & 0 deletions src/components/AppSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
</NcRadioGroupButton>
</NcRadioGroup>

<NcCheckboxRadioSwitch
:checked="settings.showCategoryInList !== false"
type="switch"
@update:checked="onChangeShowCategoryInList"
>
{{ t('notes', 'Show category names in the list of all notes') }}
</NcCheckboxRadioSwitch>

<NcRadioGroup
v-model="settings.fileSuffix"
:label="t('notes', 'File extension')"
Expand Down Expand Up @@ -91,6 +99,7 @@ import NcAppSettingsSection from '@nextcloud/vue/components/NcAppSettingsSection
import NcAppSettingsShortcutsSection from '@nextcloud/vue/components/NcAppSettingsShortcutsSection'
import NcHotkeyList from '@nextcloud/vue/components/NcHotkeyList'
import NcHotkey from '@nextcloud/vue/components/NcHotkey'
import NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwitch'
import NcRadioGroup from '@nextcloud/vue/components/NcRadioGroup'
import NcRadioGroupButton from '@nextcloud/vue/components/NcRadioGroupButton'
import NcFormBox from '@nextcloud/vue/components/NcFormBox'
Expand All @@ -112,6 +121,7 @@ export default {
name: 'AppSettings',

components: {
NcCheckboxRadioSwitch,
NcTextField,
NcAppSettingsDialog,
NcAppSettingsSection,
Expand Down Expand Up @@ -201,6 +211,11 @@ export default {
await filePicker.pick()

},
onChangeShowCategoryInList(checked) {
this.$set(this.settings, 'showCategoryInList', checked)
this.onChangeSettings()
},

onChangeSettings() {
this.saving = true
return setSettings(this.settings)
Expand Down
8 changes: 6 additions & 2 deletions src/components/NotesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<NotesList v-if="groupedNotes.length === 1"
:notes="groupedNotes[0].notes"
:show-category-title="category === null"
:show-category-title="showCategoryTitles"
@note-selected="onNoteSelected"
/>
<template v-for="(group, idx) in groupedNotes" v-else>
Expand All @@ -41,7 +41,7 @@
<NotesList
:key="idx"
:notes="group.notes"
:show-category-title="category === null"
:show-category-title="showCategoryTitles"
@note-selected="onNoteSelected"
/>
</template>
Expand Down Expand Up @@ -142,6 +142,10 @@ export default {
}
},

showCategoryTitles() {
return this.category === null && store.state.app.settings.showCategoryInList !== false
},

// group notes by time ("All notes") or by category (if category chosen)
groupedNotes() {
if (this.category === null) {
Expand Down