mobile optimization

This commit is contained in:
Peter Papp
2021-05-03 09:07:35 +02:00
parent 434c45299c
commit 23611defc1
12 changed files with 195 additions and 58 deletions

View File

@@ -76,7 +76,9 @@ export default {
methods: {
goToCompany() {
this.$router.push({name: 'ClientDetail', params: {id: this.item.client_id}})
events.$emit('file-preview:hide')
this.isVisible = false
},
downloadItem() {
@@ -94,7 +96,15 @@ export default {
this.$store.dispatch('fileInfoToggle', true)
},
deleteItem() {
events.$emit('confirm:open', {
title: `Are you sure you want to delete invoice number ${this.item.invoiceNumber}?`,
message: 'Your invoice will be permanently deleted.',
buttonColor: 'danger-solid',
action: {
id: this.item.id,
operation: 'delete-invoice'
}
})
},
closeAndResetContextMenu() {
// Close context menu

View File

@@ -2,11 +2,11 @@
<MenuMobile name="invoice-create">
<MenuMobileGroup>
<OptionGroup>
<Option @click.native="showLocation('regular-invoice')" title="Create Invoice" icon="file-plus" is-hover-disabled="true" />
<Option @click.native="showLocation('advance-invoice')" title="Create Advance Invoice" icon="clock" is-hover-disabled="true" />
<Option @click.native="createInvoice('regular-invoice')" title="Create Invoice" icon="file-plus" is-hover-disabled="true" />
<Option @click.native="createInvoice('advance-invoice')" title="Create Advance Invoice" icon="clock" is-hover-disabled="true" />
</OptionGroup>
<OptionGroup>
<Option @click.native="showLocation('clients')" title="Create Client" icon="user-plus" is-hover-disabled="true" />
<Option @click.native="createClient" title="Create Client" icon="user-plus" is-hover-disabled="true" />
</OptionGroup>
</MenuMobileGroup>
</MenuMobile>
@@ -33,32 +33,12 @@ export default {
]),
},
methods: {
showLocation(location) {
createInvoice(type) {
this.$router.push({name: 'CreateInvoice', query: {type: type}})
},
createClient() {
this.$router.push({name: 'CreateClient'})
},
flushBrowseHistory() {
this.$store.commit('FLUSH_FOLDER_HISTORY')
},
goToFiles() {
this.$store.dispatch('getFolder', [{folder: this.homeDirectory, back: false, init: true}])
this.flushBrowseHistory()
},
goToLatest() {
this.$store.dispatch('getLatest')
this.flushBrowseHistory()
},
goToTrash() {
this.$store.dispatch('getTrash')
this.flushBrowseHistory()
},
goToShared() {
this.$store.dispatch('getShared', [{back: false, init: false}])
this.flushBrowseHistory()
},
goToParticipantUploads() {
this.$store.dispatch('getParticipantUploads')
this.flushBrowseHistory()
}
}
}
</script>

View File

@@ -128,8 +128,18 @@
events.$emit('popover:open', 'desktop-create-invoices')
},
deleteInvoice() {
if (this.clipboard.length > 0)
this.$store.dispatch('deleteInvoice')
if (this.clipboard.length > 0) {
events.$emit('confirm:open', {
title: `Are you sure you want to delete invoice number ${this.clipboard[0].invoiceNumber}?`,
message: 'Your invoice will be permanently deleted.',
buttonColor: 'danger-solid',
action: {
id: this.clipboard[0].id,
operation: 'delete-invoice'
}
})
}
},
shareInvoice() {
alert('Send Invoice')

View File

@@ -117,6 +117,9 @@ export default {
}
if (!this.isMobileSelectMode && this.$isMobile()) {
this.$store.commit('CLIPBOARD_CLEAR')
this.$store.commit('ADD_ITEM_TO_CLIPBOARD', this.item)
events.$emit('file-preview:show')
}

View File

@@ -14,12 +14,11 @@
<Option @click.native="" title="Edit Invoice" icon="rename" />
<Option @click.native="" title="Send Invoice" icon="send" />
<Option @click.native="goToCompany" title="Go to Company" icon="user" />
<Option @click.native="" :title="$t('context_menu.delete')" icon="trash" />
<Option @click.native="deleteInvoice" :title="$t('context_menu.delete')" icon="trash" />
</OptionGroup>
<OptionGroup>
<Option @click.native="" :title="$t('context_menu.detail')" icon="detail" />
<Option @click.native="" :title="$t('context_menu.download')" icon="download" />
<Option @click.native="downloadInvoice" :title="$t('context_menu.download')" icon="download" />
</OptionGroup>
</MenuMobileGroup>
</MenuMobile>
@@ -33,6 +32,7 @@ import OptionGroup from '@/components/FilesView/OptionGroup'
import MenuMobile from '@/components/Mobile/MenuMobile'
import Option from '@/components/FilesView/Option'
import {mapGetters} from 'vuex'
import {events} from '@/bus'
export default {
name: 'FileMenuMobile',
@@ -56,8 +56,22 @@ export default {
}
},
methods: {
downloadInvoice() {
this.$downloadFile(this.clipboard[0].file_url, this.clipboard[0].name + '.' + this.clipboard[0].mimetype)
},
goToCompany() {
this.$router.push({name: 'ClientDetail', params: {id: this.item.client_id}})
this.$router.push({name: 'ClientDetail', params: {id: this.clipboard[0].client_id}})
},
deleteInvoice() {
events.$emit('confirm:open', {
title: `Are you sure you want to delete invoice number ${this.clipboard[0].invoiceNumber}?`,
message: 'Your invoice will be permanently deleted.',
buttonColor: 'danger-solid',
action: {
id: this.clipboard[0].id,
operation: 'delete-invoice'
}
})
},
}
}