Skip to content

Commit 9b18098

Browse files
joachimeichbornjuliusknorr
authored andcommitted
Three column layout
Squashed commit of the following: commit e42c44d Author: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> Date: Fri Jan 27 23:41:34 2023 +0100 Added deep styles to make breadcrumbs appear non-interactive Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 082aaff Merge: 978c4c3 85953e1 Author: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> Date: Fri Jan 27 22:32:39 2023 +0100 Merge branch 'master' into three-column-layout Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 85953e1 Merge: ce4401c 3e403aa Author: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> Date: Fri Jan 27 18:08:17 2023 +0100 Merge remote-tracking branch 'upstream/master' commit 978c4c3 Author: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> Date: Sat Sep 17 22:25:11 2022 +0200 Fixed disappearing note group captions for long note lists Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit b0e945f Author: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> Date: Sat May 14 15:18:04 2022 +0200 Updated nextcloud/vue library to fix bug with app navigation close button Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 378555d Author: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> Date: Sat May 14 12:00:19 2022 +0200 Use standard AppConentList functionality to display notes list Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit f7fad21 Author: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> Date: Sat Apr 2 00:45:01 2022 +0200 Lint fixes Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 0eb4605 Author: joachimeichborn <jeichborn@gmail.com> Date: Wed Mar 30 21:29:31 2022 +0200 Minor UI improvements Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 3859c00 Author: joachimeichborn <jeichborn@gmail.com> Date: Tue Mar 29 21:57:42 2022 +0200 NotesView can change with; UI fixes Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 359b3da Author: joachimeichborn <jeichborn@gmail.com> Date: Tue Mar 29 21:54:25 2022 +0200 Replaced AppNavigationCaption usage Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 8911153 Author: joachimeichborn <jeichborn@gmail.com> Date: Mon Mar 28 22:55:26 2022 +0200 Added icons and category information in notes list Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit a6b2a58 Author: joachimeichborn <jeichborn@gmail.com> Date: Mon Mar 28 08:45:43 2022 +0200 Added favorite option to note action menu, fixed lint warnings Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 0843c54 Author: joachimeichborn <jeichborn@gmail.com> Date: Sun Mar 27 23:16:04 2022 +0200 Improved note renaming Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 98d6dc1 Author: joachimeichborn <jeichborn@gmail.com> Date: Sun Mar 27 22:21:22 2022 +0200 Edit mode is active for new notes, fixed bugs in highlighting new notes as active and breadcrumbs Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 0cc2c76 Author: joachimeichborn <jeichborn@gmail.com> Date: Sun Mar 27 22:01:15 2022 +0200 Fixed layout issues Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 134c6f2 Author: joachimeichborn <jeichborn@gmail.com> Date: Sun Mar 27 15:40:41 2022 +0200 Improved note renaming Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit e18810f Author: joachimeichborn <jeichborn@gmail.com> Date: Sun Mar 27 15:40:25 2022 +0200 Added breadcrumbs to note Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 3ee52ea Author: joachimeichborn <jeichborn@gmail.com> Date: Sun Mar 27 14:00:11 2022 +0200 Introduced three column layout Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit fdd2a36 Author: joachimeichborn <jeichborn@gmail.com> Date: Sat Mar 26 23:34:03 2022 +0100 Removed NavigationList component Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 383fe2c Author: joachimeichborn <jeichborn@gmail.com> Date: Sat Mar 26 22:09:01 2022 +0100 Removed option to collapse categories in navigation list Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> commit 4412195 Author: joachimeichborn <jeichborn@gmail.com> Date: Sat Mar 26 00:20:46 2022 +0100 Added option to have all categories always visible in the navigation listgit Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com> Revert "Fixed disappearing note group captions for long note lists" This reverts commit 6880f7b7618d3bf062935da7fe79f94f4354133d.
1 parent d954fa0 commit 9b18098

File tree

12 files changed

+377
-318
lines changed

12 files changed

+377
-318
lines changed

src/App.vue

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111
</NcAppNavigationNew>
1212

1313
<template #list>
14-
<NavigationList v-show="!loading.notes"
15-
:filtered-notes="filteredNotes"
16-
:category="filter.category"
17-
@category-selected="onSelectCategory"
18-
@note-deleted="onNoteDeleted"
14+
<CategoriesList v-show="!loading.notes"
15+
v-if="numNotes"
1916
/>
2017
<NcAppNavigationItem
2118
:title="t('notes', 'Help')"
@@ -39,7 +36,7 @@
3936
<p>{{ t('notes', 'Please see Nextcloud server log for details.') }}</p>
4037
</div>
4138
</NcAppContent>
42-
<router-view v-else />
39+
<router-view v-else @note-deleted="onNoteDeleted" />
4340

4441
<router-view name="sidebar" />
4542
</NcContent>
@@ -61,9 +58,9 @@ import InfoIcon from 'vue-material-design-icons/Information.vue'
6158
import PlusIcon from 'vue-material-design-icons/Plus.vue'
6259
6360
import AppSettings from './components/AppSettings.vue'
64-
import NavigationList from './components/NavigationList.vue'
6561
import AppHelp from './components/AppHelp.vue'
6662
import EditorHint from './components/Modal/EditorHint.vue'
63+
import CategoriesList from './components/CategoriesList.vue'
6764
6865
import { config } from './config.js'
6966
import { fetchNotes, noteExists, createNote, undoDeleteNote } from './NotesService.js'
@@ -77,13 +74,13 @@ export default {
7774
AppSettings,
7875
EditorHint,
7976
InfoIcon,
80-
NavigationList,
8177
NcAppContent,
8278
NcAppNavigation,
8379
NcAppNavigationNew,
8480
NcAppNavigationItem,
8581
NcContent,
8682
PlusIcon,
83+
CategoriesList,
8784
},
8885
8986
data() {
@@ -106,37 +103,16 @@ export default {
106103
},
107104
108105
computed: {
106+
numNotes() {
107+
return store.getters.numNotes()
108+
},
109+
109110
notes() {
110111
return store.state.notes.notes
111112
},
112113
113114
filteredNotes() {
114-
const notes = this.notes.filter(note => {
115-
if (this.filter.category !== null
116-
&& this.filter.category !== note.category
117-
&& !note.category.startsWith(this.filter.category + '/')) {
118-
return false
119-
}
120-
return true
121-
})
122-
123-
function cmpRecent(a, b) {
124-
if (a.favorite && !b.favorite) return -1
125-
if (!a.favorite && b.favorite) return 1
126-
return b.modified - a.modified
127-
}
128-
129-
function cmpCategory(a, b) {
130-
const cmpCat = a.category.localeCompare(b.category)
131-
if (cmpCat !== 0) return cmpCat
132-
if (a.favorite && !b.favorite) return -1
133-
if (!a.favorite && b.favorite) return 1
134-
return a.title.localeCompare(b.title)
135-
}
136-
137-
notes.sort(this.filter.category === null ? cmpRecent : cmpCategory)
138-
139-
return notes
115+
return store.getters.getFilteredNotes()
140116
},
141117
},
142118
@@ -257,7 +233,7 @@ export default {
257233
return
258234
}
259235
this.loading.create = true
260-
createNote(this.filter.category)
236+
createNote(store.getters.getSelectedCategory())
261237
.then(note => {
262238
this.routeToNote(note.id, { new: null })
263239
})
@@ -268,15 +244,6 @@ export default {
268244
})
269245
},
270246
271-
onSelectCategory(category) {
272-
this.filter.category = category
273-
274-
const appNavigation = document.querySelector('#app-navigation > ul')
275-
if (appNavigation) {
276-
appNavigation.scrollTop = 0
277-
}
278-
},
279-
280247
onNoteDeleted(note) {
281248
this.deletedNotes.push(note)
282249
this.clearUndoTimer()
Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
<template>
2-
<NcAppNavigationItem
3-
:title="title"
4-
class="app-navigation-noclose separator-below"
5-
:class="{ 'category-header': selectedCategory !== null }"
6-
:open.sync="open"
7-
:allow-collapse="true"
8-
@click.prevent.stop="onToggleCategories"
9-
>
10-
<FolderIcon slot="icon" :size="20" />
2+
<Fragment>
113
<NcAppNavigationItem
124
:title="t('notes', 'All notes')"
5+
icon="icon-recent"
6+
:class="{ active: null === selectedCategory }"
137
@click.prevent.stop="onSelectCategory(null)"
148
>
159
<HistoryIcon slot="icon" :size="20" />
@@ -21,6 +15,8 @@
2115
<NcAppNavigationItem v-for="category in categories"
2216
:key="category.name"
2317
:title="categoryTitle(category.name)"
18+
:icon="category.name === '' ? 'icon-emptyfolder' : 'icon-files'"
19+
:class="{ active: category.name === selectedCategory }"
2420
@click.prevent.stop="onSelectCategory(category.name)"
2521
>
2622
<FolderOutlineIcon v-if="category.name === ''" slot="icon" :size="20" />
@@ -29,14 +25,15 @@
2925
{{ category.count }}
3026
</NcAppNavigationCounter>
3127
</NcAppNavigationItem>
32-
</NcAppNavigationItem>
28+
</Fragment>
3329
</template>
3430

3531
<script>
3632
import {
3733
NcAppNavigationItem,
3834
NcAppNavigationCounter,
3935
} from '@nextcloud/vue'
36+
import { Fragment } from 'vue-fragment'
4037
4138
import FolderIcon from 'vue-material-design-icons/Folder.vue'
4239
import FolderOutlineIcon from 'vue-material-design-icons/FolderOutline.vue'
@@ -47,27 +44,15 @@ import { categoryLabel } from '../Util.js'
4744
import store from '../store.js'
4845
4946
export default {
50-
name: 'NavigationCategoriesItem',
47+
name: 'CategoriesList',
5148
5249
components: {
50+
Fragment,
51+
NcAppNavigationItem,
52+
NcAppNavigationCounter,
5353
FolderIcon,
5454
FolderOutlineIcon,
5555
HistoryIcon,
56-
NcAppNavigationItem,
57-
NcAppNavigationCounter,
58-
},
59-
60-
props: {
61-
selectedCategory: {
62-
type: String,
63-
default: null,
64-
},
65-
},
66-
67-
data() {
68-
return {
69-
open: false,
70-
}
7156
},
7257
7358
computed: {
@@ -79,8 +64,8 @@ export default {
7964
return getCategories(1, true)
8065
},
8166
82-
title() {
83-
return this.selectedCategory === null ? this.t('notes', 'Categories') : categoryLabel(this.selectedCategory)
67+
selectedCategory() {
68+
return store.getters.getSelectedCategory()
8469
},
8570
},
8671
@@ -89,19 +74,9 @@ export default {
8974
return categoryLabel(category)
9075
},
9176
92-
onToggleCategories() {
93-
this.open = !this.open
94-
},
95-
9677
onSelectCategory(category) {
97-
this.open = false
98-
this.$emit('category-selected', category)
78+
store.commit('setSelectedCategory', category)
9979
},
10080
},
10181
}
10282
</script>
103-
<style scoped>
104-
.separator-below {
105-
border-bottom: 1px solid var(--color-border);
106-
}
107-
</style>

src/components/EditorEasyMDE.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,5 +374,6 @@ export default {
374374
z-index: 10;
375375
height: 40px;
376376
margin-right: 5px;
377+
top: 65px;
377378
}
378379
</style>

0 commit comments

Comments
 (0)