11<template >
2- <NcAppNavigationSettings :title =" t('notes', 'Notes settings')" :class =" { loading: saving }" >
3- <div class =" settings-block" >
4- <p class =" settings-hint" >
5- <label for =" notesPath" >{{ t('notes', 'Folder to store your notes') }}</label >
2+ <NcAppSettingsDialog
3+ :title =" t('notes', 'Notes settings')"
4+ :class =" { loading: saving }"
5+ :show-navigation =" true"
6+ :open =" settingsOpen"
7+ @update:open =" setSettingsOpen($event)"
8+ >
9+ <NcAppSettingsSection id =" notes-path-section" :title =" t('notes', 'Notes path')" >
10+ <p class =" app-settings-section__desc" >
11+ {{ t('notes', 'Folder to store your notes') }}
612 </p >
713 <form @submit.prevent =" onChangeSettingsReload" >
814 <input id =" notesPath"
1319 @change =" onChangeSettingsReload"
1420 ><input type =" submit" class =" icon-confirm" value =" " >
1521 </form >
16- </div >
17- <div class = " settings-block " >
18- <p class =" settings-hint " >
19- < label for = " fileSuffix " > {{ t('notes', 'File extension for new notes') }}</ label >
22+ </NcAppSettingsSection >
23+ <NcAppSettingsSection id = " file-suffix-section " :title = " t('notes', 'File extension') " >
24+ <p class =" app- settings-section__desc " >
25+ {{ t('notes', 'File extension for new notes') }}
2026 </p >
2127 <select id =" fileSuffix" v-model =" settings.fileSuffix" @change =" onChangeSettings" >
2228 <option v-for =" extension in extensions" :key =" extension.value" :value =" extension.value" >
3137 placeholder =" .txt"
3238 @change =" onChangeSettings"
3339 >
34- </div >
35- <div class = " settings-block " >
36- <p class =" settings-hint " >
37- < label for = " noteMode " > {{ t('notes', 'Display mode for notes') }}</ label >
40+ </NcAppSettingsSection >
41+ <NcAppSettingsSection id = " note-mode-section " :title = " t('notes', 'Display mode') " >
42+ <p class =" app- settings-section__desc " >
43+ {{ t('notes', 'Display mode for notes') }}
3844 </p >
3945 <select id =" noteMode" v-model =" settings.noteMode" @change =" onChangeSettings" >
4046 <option v-for =" mode in noteModes" :key =" mode.value" :value =" mode.value" >
4147 {{ mode.label }}
4248 </option >
4349 </select >
44- </div >
45- </NcAppNavigationSettings >
50+ </NcAppSettingsSection >
51+ </NcAppSettingsDialog >
4652</template >
4753
4854<script >
4955import {
50- NcAppNavigationSettings ,
56+ NcAppSettingsDialog ,
57+ NcAppSettingsSection ,
5158} from ' @nextcloud/vue'
5259
5360import { setSettings } from ' ../NotesService.js'
@@ -57,7 +64,12 @@ export default {
5764 name: ' AppSettings' ,
5865
5966 components: {
60- NcAppNavigationSettings,
67+ NcAppSettingsDialog,
68+ NcAppSettingsSection,
69+ },
70+
71+ props: {
72+ open: Boolean ,
6173 },
6274
6375 data () {
@@ -73,6 +85,7 @@ export default {
7385 { value: ' preview' , label: t (' notes' , ' Open in preview mode' ) },
7486 ],
7587 saving: false ,
88+ settingsOpen: this .open ,
7689 }
7790 },
7891
@@ -82,6 +95,12 @@ export default {
8295 },
8396 },
8497
98+ watch: {
99+ open (newValue ) {
100+ this .settingsOpen = newValue
101+ },
102+ },
103+
85104 created () {
86105 if (! window .OCA .Text ? .createEditor ) {
87106 this .noteModes .splice (0 , 1 )
@@ -105,6 +124,11 @@ export default {
105124 this .$emit (' reload' )
106125 })
107126 },
127+
128+ setSettingsOpen (newValue ) {
129+ this .settingsOpen = newValue
130+ this .$emit (' update:open' , newValue)
131+ },
108132 },
109133}
110134< / script>
0 commit comments