Skip to content

Commit

Permalink
Fix linting errors/warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Brückner <johannes@dotplex.com>
  • Loading branch information
brueckner committed Nov 10, 2020
1 parent b69a444 commit 39f8c89
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 38 deletions.
8 changes: 4 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ export default {
</script>

<style lang="scss">
// TODO: move to mail.scss
// The drag-ghost is appended to the body
// and cannot be styled from within a
// component with scoped CSS
// TODO: move to mail.scss
// The drag-ghost is appended to the body
// and cannot be styled from within a
// component with scoped CSS
.drag-ghost {
height: auto;
width: 300px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ComposerAttachments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import Vue from 'vue'
import Logger from '../logger'
import { uploadLocalAttachment } from '../service/AttachmentService'
import { shareFile } from '../service/FileSharingService'
import EventBus from '../util/EventBus';
import EventBus from '../util/EventBus'

export default {
name: 'ComposerAttachments',
Expand Down
22 changes: 11 additions & 11 deletions src/components/Envelope.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default {
selectedEnvelopes: {
type: Array,
required: false,
default: [],
default: () => [],
},
},
data() {
Expand All @@ -178,12 +178,6 @@ export default {
showMoveModal: false,
}
},
mounted() {
this.attachDraggableEventListeners()
},
beforeDestroy() {
this.detachDraggableEventListeners()
},
computed: {
account() {
return this.$store.getters.getAccount(this.data.accountId)
Expand Down Expand Up @@ -249,6 +243,12 @@ export default {
}
},
},
mounted() {
this.attachDraggableEventListeners()
},
beforeDestroy() {
this.detachDraggableEventListeners()
},
methods: {
setSelected(value) {
if (this.selected !== value) {
Expand Down Expand Up @@ -303,7 +303,7 @@ export default {
this.showMoveModal = false
},
onDragStart(event) {
event.dataTransfer.effectAllowed = 'move';
event.dataTransfer.effectAllowed = 'move'
this.$store.commit('expandAccount', this.mailbox.accountId)
const envelopes = []
if (this.selectMode && this.selected) {
Expand Down Expand Up @@ -361,15 +361,15 @@ export default {
})
dragNode.appendChild(labelWrapperNode)
document.body.appendChild(dragNode);
document.body.appendChild(dragNode)
event.dataTransfer.setDragImage(dragNode, 0, 15);
event.dataTransfer.setDragImage(dragNode, 0, 15)
// the item can be removed immediately, because the
// browser will take a "screenshot" of the dragImage
// upon initialization to be used while dragging
setTimeout(() => {
document.body.removeChild(dragNode);
document.body.removeChild(dragNode)
})
},
},
Expand Down
8 changes: 4 additions & 4 deletions src/components/EnvelopeList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
:mailbox="mailbox"
:selected="isEnvelopeSelected(index)"
:select-mode="selectMode"
:selectedEnvelopes="selectedEnvelopes"
:selected-envelopes="selectedEnvelopes"
@delete="$emit('delete', env.databaseId)"
@update:selected="onEnvelopeSelectToggle(index, ...$event)"
@select-multiple="onEnvelopeSelectMultiple(index)" />
Expand Down Expand Up @@ -175,9 +175,6 @@ export default {
lastToggledIndex: undefined,
}
},
mounted() {
EventBus.$on('onDropEnvelopes', this.unselectAll)
},
computed: {
selectMode() {
// returns true when in selection mode (where the user selects several emails at once)
Expand All @@ -195,6 +192,9 @@ export default {
return this.selection.map((idx) => this.envelopes[idx])
},
},
mounted() {
EventBus.$on('onDropEnvelopes', this.unselectAll)
},
methods: {
isEnvelopeSelected(idx) {
if (this.selection.length === 0) {
Expand Down
1 change: 0 additions & 1 deletion src/components/MailboxThread.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ import Popover from '@nextcloud/vue/dist/Components/Popover'
import infiniteScroll from 'vue-infinite-scroll'
import isMobile from '@nextcloud/vue/dist/Mixins/isMobile'
import SectionTitle from './SectionTitle'
import Vue from 'vue'
import AppDetailsToggle from './AppDetailsToggle'
import logger from '../logger'
Expand Down
30 changes: 15 additions & 15 deletions src/components/NavigationMailbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<template>
<AppNavigationItem
v-if="visible"
ref="link"
:id="genId(mailbox)"
ref="link"
:key="genId(mailbox)"
:class="[
{ 'drop-target': isValidDropTarget },
Expand Down Expand Up @@ -207,12 +207,6 @@ export default {
showMoveModal: false,
}
},
mounted() {
this.attachDroppableEventListeners()
},
beforeDestroy() {
this.detachDraggableEventListeners()
},
computed: {
visible() {
return (
Expand Down Expand Up @@ -296,11 +290,17 @@ export default {
if (this.envelopesBeingDragged[0].accountId !== this.mailbox.accountId) {
return false
}
return this.isDroppableSpecialMailbox || !this.mailbox.specialRole && !this.account.isUnified
return this.isDroppableSpecialMailbox || (!this.mailbox.specialRole && !this.account.isUnified)
},
isDroppableSpecialMailbox() {
return this.droppableSpecialMailboxes.includes(this.mailbox.specialRole)
}
},
},
mounted() {
this.attachDroppableEventListeners()
},
beforeDestroy() {
this.detachDraggableEventListeners()
},
methods: {
/**
Expand Down Expand Up @@ -478,7 +478,7 @@ export default {
this.showSaving = false
},
attachDroppableEventListeners() {
if (this.account.isUnified || this.mailbox.specialRole && !this.isDroppableSpecialMailbox) {
if (this.account.isUnified || (this.mailbox.specialRole && !this.isDroppableSpecialMailbox)) {
return
}

Expand All @@ -489,7 +489,7 @@ export default {
anchorTag.addEventListener('drop', this.onDrop)
},
onDragOver(event) {
event.preventDefault();
event.preventDefault()
// Prevent dropping into current folder
if (this.envelopesBeingDragged[0].mailboxId === this.mailbox.databaseId) {
return
Expand All @@ -499,7 +499,7 @@ export default {
this.dragover = true
},
async onDrop(event) {
event.preventDefault();
event.preventDefault()
this.dragover = false
const sourceMailboxId = this.envelopesBeingDragged[0].mailboxId

Expand All @@ -517,15 +517,15 @@ export default {
})
await Promise.all(processedEnvelopes)
} catch (error) {
console.log(error);
logger.error('could not process dropped messages', error)
} finally {
await this.$store.dispatch('setEnvelopesBeingDragged', { envelopes: [] })
await this.$store.dispatch('syncEnvelopes', { mailboxId: this.mailbox.databaseId })
await this.$store.dispatch('syncEnvelopes', { mailboxId: sourceMailboxId })
}
},
onDragLeave(event) {
event.preventDefault();
event.preventDefault()
this.dragover = false
},
async processDroppedItem(messageId) {
Expand All @@ -539,7 +539,7 @@ export default {
})
} catch (error) {
item.classList.remove('move-pending')
console.log(error);
logger.error('could not move messages', error)
}
},
onOpenMoveModal() {
Expand Down
1 change: 0 additions & 1 deletion src/components/SignatureSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import logger from '../logger'
import TextEditor from './TextEditor'
import { detect, toHtml } from '../util/text'
import EventBus from '../util/EventBus'

export default {
name: 'SignatureSettings',
Expand Down
2 changes: 1 addition & 1 deletion src/store/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ export const getters = {
},
getEnvelopesBeingDragged: (state) => {
return state.envelopesBeingDragged
}
},
}

0 comments on commit 39f8c89

Please sign in to comment.