* Removed arrows from notification

* Added trash can function
* Tweaked status text to always be the same
* Removed some open second note code
* Edior always focuses on text now
* Added some extra loading note messages
* Notes are now removed from search index when deleted
* Lots more things happen and update in real time on multiple machines
* Shared notes can be reverted
* WAY more tests
* Note Categories are much more reliable
* Lots of code is much cleaner
This commit is contained in:
Max G
2020-05-18 07:45:35 +00:00
parent b0eee636b5
commit 9c4fff7913
18 changed files with 644 additions and 368 deletions

View File

@@ -29,12 +29,10 @@
<!-- Title display -->
<span v-if="note.title.length > 0"
data-test-id="title"
class="big-text"><p>{{ note.title }}</p></span>
<!-- Sub text display -->
<span v-if="note.subtext.length > 0 && !isShowingSearchResults()"
data-test-id="subtext"
class="small-text"
v-html="note.subtext"></span>
@@ -71,13 +69,6 @@
<!-- Toolbar on the bottom -->
<div class="tool-bar" @click.self="cardClicked" v-if="!titleView">
<div class="icon-bar">
<!-- <span v-if="note.pinned == 1" data-position="top left" data-tooltip="Pinned" data-inverted>
<i class="green pin icon"></i>
</span>
<span v-if="note.archived == 1" data-position="top left" data-tooltip="Archived" data-inverted>
<i class="green archive icon"></i>
</span> -->
<span class="tags" v-if="note.tags">
<span v-for="tag in (note.tags.split(','))" class="little-tag">{{ tag }}</span>
@@ -90,24 +81,43 @@
<span class="teeny-buttons" :class="{ 'hover-hide':(!$store.getters.getIsUserOnMobile) }">
<i class="teeny-button" data-tooltip="Tags" data-inverted v-on:click="toggleTags(true)">
<i class="tags icon"></i>
</i>
<span v-if="!note.trashed">
<i class="teeny-button"
data-tooltip="Archive"
:data-tooltip="note.archived ? 'Un-Archive':'Archive' "
data-inverted v-on:click="archiveNote">
<i class="archive icon" :class="{'green':note.archived}"></i>
</i>
<i class="teeny-button" data-tooltip="Tags" data-inverted v-on:click="toggleTags(true)">
<i class="tags icon"></i>
</i>
<i class="teeny-button"
:data-tooltip="note.pinned ? 'Un-Pin':'Pin' "
data-inverted v-on:click="pinNote">
<i class="pin icon" :class="{'green':note.pinned}"></i>
</i>
<i class="teeny-button"
data-tooltip="Archive"
:data-tooltip="note.archived ? 'Un-Archive':'Archive' "
data-inverted v-on:click="archiveNote">
<i class="archive icon" :class="{'green':note.archived}"></i>
</i>
<delete-button class="teeny-button" :note-id="note.id" />
<i class="teeny-button"
:data-tooltip="note.pinned ? 'Un-Pin':'Pin' "
data-inverted v-on:click="pinNote">
<i class="pin icon" :class="{'green':note.pinned}"></i>
</i>
<i class="teeny-button"
data-tooltip="Move to Trash"
data-inverted v-on:click="trashNote()">
<i class="trash icon"></i>
</i>
</span>
<!-- Trash note options -->
<span v-if="note.trashed">
<i class="teeny-button"
data-tooltip="Un-Trash"
data-inverted v-on:click="trashNote()">
<i class="reply icon"></i>
</i>
<delete-button class="teeny-button" :note-id="note.id" />
</span>
</span>
</div>
@@ -185,7 +195,7 @@
let postData = {'pinned': !this.note.pinned, 'noteId':this.note.id}
axios.post('/api/note/setpinned', postData)
.then(data => {
this.$bus.$emit('update_single_note', this.note.id)
// this.$bus.$emit('update_single_note', this.note.id)
})
.catch(error => { this.$bus.$emit('notification', 'Failed to Pin Note') })
},
@@ -197,20 +207,35 @@
//Show message so no one worries where note went
let message = 'Moved to Archive'
if(postData.archived != 1){
message = 'Move to main list'
message = 'Moved to main list'
}
this.$bus.$emit('notification', message)
this.$bus.$emit('update_single_note', this.note.id)
// this.$bus.$emit('update_single_note', this.note.id)
})
.catch(error => { this.$bus.$emit('notification', 'Failed to Archive Note') })
},
trashNote(){ //toggleArchived() <- old name
let postData = {'trashed': !this.note.trashed, 'noteId':this.note.id}
axios.post('/api/note/settrashed', postData)
.then(data => {
//Show message so no one worries where note went
let message = 'Moved to Trash'
if(postData.trashed == 0){
message = 'Moved to main list'
}
this.$bus.$emit('notification', message)
})
.catch(error => { this.$bus.$emit('notification', 'Failed to Trash Note') })
},
toggleTags(state){
this.showTagSlideMenu = state
if(state == false){
this.$bus.$emit('update_single_note', this.note.id)
// this.$bus.$emit('update_single_note', this.note.id)
}
},
@@ -330,6 +355,10 @@
color: var(--text_color);
background-color: var(--background_color);
}
.subtext {
display: inline-block;
width: 100%;
}
/*Strict font sizes for card display*/
.small-text {