Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Three column layout #842

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4412195
Added option to have all categories always visible in the navigation …
joachimeichborn Mar 25, 2022
383fe2c
Removed option to collapse categories in navigation list
joachimeichborn Mar 26, 2022
fdd2a36
Removed NavigationList component
joachimeichborn Mar 26, 2022
3ee52ea
Introduced three column layout
joachimeichborn Mar 27, 2022
e18810f
Added breadcrumbs to note
joachimeichborn Mar 27, 2022
134c6f2
Improved note renaming
joachimeichborn Mar 27, 2022
0cc2c76
Fixed layout issues
joachimeichborn Mar 27, 2022
98d6dc1
Edit mode is active for new notes, fixed bugs in highlighting new not…
joachimeichborn Mar 27, 2022
0843c54
Improved note renaming
joachimeichborn Mar 27, 2022
a6b2a58
Added favorite option to note action menu, fixed lint warnings
joachimeichborn Mar 28, 2022
8911153
Added icons and category information in notes list
joachimeichborn Mar 28, 2022
359b3da
Replaced AppNavigationCaption usage
joachimeichborn Mar 29, 2022
3859c00
NotesView can change with; UI fixes
joachimeichborn Mar 29, 2022
0eb4605
Minor UI improvements
joachimeichborn Mar 30, 2022
f7fad21
Lint fixes
joachimeichborn Apr 1, 2022
378555d
Use standard AppConentList functionality to display notes list
joachimeichborn May 14, 2022
b0e945f
Updated nextcloud/vue library to fix bug with app navigation close bu…
joachimeichborn May 14, 2022
978c4c3
Fixed disappearing note group captions for long note lists
joachimeichborn Sep 17, 2022
85953e1
Merge remote-tracking branch 'upstream/master'
joachimeichborn Jan 27, 2023
082aaff
Merge branch 'master' into three-column-layout
joachimeichborn Jan 27, 2023
e42c44d
Added deep styles to make breadcrumbs appear non-interactive
joachimeichborn Jan 27, 2023
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
55 changes: 11 additions & 44 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
</NcAppNavigationNew>

<template #list>
<NavigationList v-show="!loading.notes"
:filtered-notes="filteredNotes"
:category="filter.category"
@category-selected="onSelectCategory"
@note-deleted="onNoteDeleted"
<CategoriesList v-show="!loading.notes"
v-if="numNotes"
/>
<NcAppNavigationItem
:title="t('notes', 'Help')"
Expand All @@ -38,7 +35,7 @@
<p>{{ t('notes', 'Please see Nextcloud server log for details.') }}</p>
</div>
</NcAppContent>
<router-view v-else />
<router-view v-else @note-deleted="onNoteDeleted" />

<router-view name="sidebar" />
</NcContent>
Expand All @@ -59,8 +56,8 @@ import InfoIcon from 'vue-material-design-icons/Information.vue'
import PlusIcon from 'vue-material-design-icons/Plus.vue'

import AppSettings from './components/AppSettings.vue'
import NavigationList from './components/NavigationList.vue'
import AppHelp from './components/AppHelp.vue'
import CategoriesList from './components/CategoriesList.vue'

import { config } from './config.js'
import { fetchNotes, noteExists, createNote, undoDeleteNote } from './NotesService.js'
Expand All @@ -73,13 +70,13 @@ export default {
AppHelp,
AppSettings,
InfoIcon,
NavigationList,
NcAppContent,
NcAppNavigation,
NcAppNavigationNew,
NcAppNavigationItem,
NcContent,
PlusIcon,
CategoriesList,
},

data() {
Expand All @@ -101,37 +98,16 @@ export default {
},

computed: {
numNotes() {
return store.getters.numNotes()
},

notes() {
return store.state.notes.notes
},

filteredNotes() {
const notes = this.notes.filter(note => {
if (this.filter.category !== null
&& this.filter.category !== note.category
&& !note.category.startsWith(this.filter.category + '/')) {
return false
}
return true
})

function cmpRecent(a, b) {
if (a.favorite && !b.favorite) return -1
if (!a.favorite && b.favorite) return 1
return b.modified - a.modified
}

function cmpCategory(a, b) {
const cmpCat = a.category.localeCompare(b.category)
if (cmpCat !== 0) return cmpCat
if (a.favorite && !b.favorite) return -1
if (!a.favorite && b.favorite) return 1
return a.title.localeCompare(b.title)
}

notes.sort(this.filter.category === null ? cmpRecent : cmpCategory)

return notes
return store.getters.getFilteredNotes()
},
},

Expand Down Expand Up @@ -252,7 +228,7 @@ export default {
return
}
this.loading.create = true
createNote(this.filter.category)
createNote(store.getters.getSelectedCategory())
.then(note => {
this.routeToNote(note.id, { new: null })
})
Expand All @@ -263,15 +239,6 @@ export default {
})
},

onSelectCategory(category) {
this.filter.category = category

const appNavigation = document.querySelector('#app-navigation > ul')
if (appNavigation) {
appNavigation.scrollTop = 0
}
},

onNoteDeleted(note) {
this.deletedNotes.push(note)
this.clearUndoTimer()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
<template>
<NcAppNavigationItem
:title="title"
class="app-navigation-noclose separator-below"
:class="{ 'category-header': selectedCategory !== null }"
:open.sync="open"
:allow-collapse="true"
@click.prevent.stop="onToggleCategories"
>
<FolderIcon slot="icon" :size="20" />
<Fragment>
<NcAppNavigationItem
:title="t('notes', 'All notes')"
icon="icon-recent"
:class="{ active: null === selectedCategory }"
@click.prevent.stop="onSelectCategory(null)"
>
<HistoryIcon slot="icon" :size="20" />
Expand All @@ -21,6 +15,8 @@
<NcAppNavigationItem v-for="category in categories"
:key="category.name"
:title="categoryTitle(category.name)"
:icon="category.name === '' ? 'icon-emptyfolder' : 'icon-files'"
:class="{ active: category.name === selectedCategory }"
@click.prevent.stop="onSelectCategory(category.name)"
>
<FolderOutlineIcon v-if="category.name === ''" slot="icon" :size="20" />
Expand All @@ -29,14 +25,15 @@
{{ category.count }}
</NcAppNavigationCounter>
</NcAppNavigationItem>
</NcAppNavigationItem>
</Fragment>
</template>

<script>
import {
NcAppNavigationItem,
NcAppNavigationCounter,
} from '@nextcloud/vue'
import { Fragment } from 'vue-fragment'

import FolderIcon from 'vue-material-design-icons/Folder.vue'
import FolderOutlineIcon from 'vue-material-design-icons/FolderOutline.vue'
Expand All @@ -47,27 +44,15 @@ import { categoryLabel } from '../Util.js'
import store from '../store.js'

export default {
name: 'NavigationCategoriesItem',
name: 'CategoriesList',

components: {
Fragment,
NcAppNavigationItem,
NcAppNavigationCounter,
FolderIcon,
FolderOutlineIcon,
HistoryIcon,
NcAppNavigationItem,
NcAppNavigationCounter,
},

props: {
selectedCategory: {
type: String,
default: null,
},
},

data() {
return {
open: false,
}
},

computed: {
Expand All @@ -79,8 +64,8 @@ export default {
return getCategories(1, true)
},

title() {
return this.selectedCategory === null ? this.t('notes', 'Categories') : categoryLabel(this.selectedCategory)
selectedCategory() {
return store.getters.getSelectedCategory()
},
},

Expand All @@ -89,19 +74,9 @@ export default {
return categoryLabel(category)
},

onToggleCategories() {
this.open = !this.open
},

onSelectCategory(category) {
this.open = false
this.$emit('category-selected', category)
store.commit('setSelectedCategory', category)
},
},
}
</script>
<style scoped>
.separator-below {
border-bottom: 1px solid var(--color-border);
}
</style>
1 change: 1 addition & 0 deletions src/components/EditorEasyMDE.vue
Original file line number Diff line number Diff line change
Expand Up @@ -374,5 +374,6 @@ export default {
z-index: 10;
height: 40px;
margin-right: 5px;
top: 65px;
}
</style>
156 changes: 0 additions & 156 deletions src/components/NavigationNoteItem.vue

This file was deleted.

Loading