diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-03-06 18:54:33 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-03-06 18:54:33 +0300 |
commit | 8f53c7484901f87723725111715b902f8c70b7e3 (patch) | |
tree | d3d5a357e97b8ee98396d0302c1a3fdfdc7f6f3e /src | |
parent | 7e2325859e48f898dbc6d322f816e87434dc4824 (diff) |
Apply lint:autofix on all views
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'src')
-rw-r--r-- | src/App.vue | 41 | ||||
-rw-r--r-- | src/views/AccountSettings.vue | 88 | ||||
-rw-r--r-- | src/views/Home.vue | 160 | ||||
-rw-r--r-- | src/views/KeyboardShortcuts.vue | 23 | ||||
-rw-r--r-- | src/views/Setup.vue | 63 |
5 files changed, 178 insertions, 197 deletions
diff --git a/src/App.vue b/src/App.vue index 453345874..b38baca57 100644 --- a/src/App.vue +++ b/src/App.vue @@ -21,28 +21,29 @@ --> <template> - <router-view/> + <router-view /> </template> <script> - export default { - name: 'App', - mounted () { - this.sync() +export default { + name: 'App', + mounted() { + this.sync() + }, + methods: { + sync() { + setTimeout(() => { + this.$store + .dispatch('syncInboxes') + .catch(err => { + console.error('background sync failed', err) + }) + .then(() => { + // Start over + this.sync() + }) + }, 30 * 1000) }, - methods: { - sync () { - setTimeout(() => { - this.$store.dispatch('syncInboxes') - .catch(err => { - console.error('background sync failed', err) - }) - .then(() => { - // Start over - this.sync() - }); - }, 30 * 1000) - } - } - } + }, +} </script> diff --git a/src/views/AccountSettings.vue b/src/views/AccountSettings.vue index 9f5351e28..35d37dc95 100644 --- a/src/views/AccountSettings.vue +++ b/src/views/AccountSettings.vue @@ -1,16 +1,13 @@ <template> <AppContent app-name="mail"> - <Navigation slot="navigation"/> + <Navigation slot="navigation" /> <template slot="content"> - <div class="section" id="account-info"> - <h2>{{ t ('mail', 'Account Settings') }} - {{ email }}</h2> + <div id="account-info" class="section"> + <h2>{{ t('mail', 'Account Settings') }} - {{ email }}</h2> </div> <div class="section"> <div id="mail-settings"> - <AccountForm :displayName="displayName" - :email="email" - :save="onSave" - :account="account"/> + <AccountForm :display-name="displayName" :email="email" :save="onSave" :account="account" /> </div> </div> </template> @@ -18,50 +15,47 @@ </template> <script> - import {AppContent} from 'nextcloud-vue' +import {AppContent} from 'nextcloud-vue' - import AccountForm from '../components/AccountForm' - import Navigation from '../components/Navigation' +import AccountForm from '../components/AccountForm' +import Navigation from '../components/Navigation' - export default { - name: 'AccountSettings', - components: { - AccountForm, - AppContent, - Navigation, +export default { + name: 'AccountSettings', + components: { + AccountForm, + AppContent, + Navigation, + }, + computed: { + menu() { + return this.buildMenu() }, - extends: SidebarItems, - computed: { - menu () { - return this.buildMenu() - }, - account () { - return this.$store.getters.getAccount(this.$route.params.accountId) - }, - displayName () { - return this.$store.getters.getAccount(this.$route.params.accountId) - .name - }, - email () { - return this.$store.getters.getAccount(this.$route.params.accountId) - .emailAddress - }, + account() { + return this.$store.getters.getAccount(this.$route.params.accountId) }, - methods: { - onSave (data) { - console.log('data to save:', data) - return this.$store - .dispatch('updateAccount', { - ...data, - accountId: this.$route.params.accountId, - }) - .then(account => account) - .catch(err => { - console.error('account update failed:', err) + displayName() { + return this.$store.getters.getAccount(this.$route.params.accountId).name + }, + email() { + return this.$store.getters.getAccount(this.$route.params.accountId).emailAddress + }, + }, + methods: { + onSave(data) { + console.log('data to save:', data) + return this.$store + .dispatch('updateAccount', { + ...data, + accountId: this.$route.params.accountId, + }) + .then(account => account) + .catch(err => { + console.error('account update failed:', err) - throw err - }) - }, + throw err + }) }, - } + }, +} </script> diff --git a/src/views/Home.vue b/src/views/Home.vue index 3f1645463..c0dc6b03d 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -1,104 +1,96 @@ <template> - <AppContent app-name="mail" - v-shortkey.once="['c']" - @shortkey.native="onNewMessage"> + <AppContent v-shortkey.once="['c']" app-name="mail" @shortkey.native="onNewMessage"> <Navigation slot="navigation" /> <template slot="content"> - <FolderContent :account="activeAccount" - :folder="activeFolder" /> + <FolderContent :account="activeAccount" :folder="activeFolder" /> </template> </AppContent> </template> <script> - import {AppContent} from 'nextcloud-vue' +import {AppContent} from 'nextcloud-vue' - import Navigation from '../components/Navigation' - import FolderContent from '../components/FolderContent' +import Navigation from '../components/Navigation' +import FolderContent from '../components/FolderContent' - export default { - name: 'Home', - components: { - AppContent, - FolderContent, - Navigation, +export default { + name: 'Home', + components: { + AppContent, + FolderContent, + Navigation, + }, + computed: { + activeAccount() { + return this.$store.getters.getAccount(this.$route.params.accountId) }, - computed: { - activeAccount () { - return this.$store.getters.getAccount( - this.$route.params.accountId - ) - }, - activeFolder () { - return this.$store.getters.getFolder( - this.$route.params.accountId, - this.$route.params.folderId - ) - }, - menu () { - return this.buildMenu() - } + activeFolder() { + return this.$store.getters.getFolder(this.$route.params.accountId, this.$route.params.folderId) + }, + menu() { + return this.buildMenu() }, - created () { - const accounts = this.$store.getters.getAccounts() + }, + created() { + const accounts = this.$store.getters.getAccounts() - if (this.$route.name === 'home' && accounts.length > 0) { - // Show first account - let firstAccount = accounts[0] - // FIXME: this assumes that there's at least one folder - let firstFolder = this.$store.getters.getFolders(firstAccount.id)[0] + if (this.$route.name === 'home' && accounts.length > 0) { + // Show first account + let firstAccount = accounts[0] + // FIXME: this assumes that there's at least one folder + let firstFolder = this.$store.getters.getFolders(firstAccount.id)[0] - console.debug('loading first folder of first account', firstAccount.id, firstFolder.id) + console.debug('loading first folder of first account', firstAccount.id, firstFolder.id) - this.$router.replace({ - name: 'folder', - params: { - accountId: firstAccount.id, - folderId: firstFolder.id, - } - }) - } else if (this.$route.name === 'mailto') { - if (accounts.length === 0) { - console.error('cannot handle mailto:, no accounts configured') - return - } + this.$router.replace({ + name: 'folder', + params: { + accountId: firstAccount.id, + folderId: firstFolder.id, + }, + }) + } else if (this.$route.name === 'mailto') { + if (accounts.length === 0) { + console.error('cannot handle mailto:, no accounts configured') + return + } - // Show first account - let firstAccount = accounts[0] - // FIXME: this assumes that there's at least one folder - let firstFolder = this.$store.getters.getFolders(firstAccount.id)[0] + // Show first account + let firstAccount = accounts[0] + // FIXME: this assumes that there's at least one folder + let firstFolder = this.$store.getters.getFolders(firstAccount.id)[0] - console.debug('loading composer with first account and folder', firstAccount.id, firstFolder.id) + console.debug('loading composer with first account and folder', firstAccount.id, firstFolder.id) - this.$router.replace({ - name: 'message', - params: { - accountId: firstAccount.id, - folderId: firstFolder.id, - messageUid: 'new', - }, - query: { - to: this.$route.query.to, - cc: this.$route.query.cc, - bcc: this.$route.query.bcc, - subject: this.$route.query.subject, - body: this.$route.query.body, - } - }) - } - }, - methods: { - onNewMessage () { - // FIXME: assumes that we're on the 'message' route already - this.$router.push({ - name: 'message', - params: { - accountId: this.$route.params.accountId, - folderId: this.$route.params.folderId, - messageUid: 'new', - } - }); - } + this.$router.replace({ + name: 'message', + params: { + accountId: firstAccount.id, + folderId: firstFolder.id, + messageUid: 'new', + }, + query: { + to: this.$route.query.to, + cc: this.$route.query.cc, + bcc: this.$route.query.bcc, + subject: this.$route.query.subject, + body: this.$route.query.body, + }, + }) } - } + }, + methods: { + onNewMessage() { + // FIXME: assumes that we're on the 'message' route already + this.$router.push({ + name: 'message', + params: { + accountId: this.$route.params.accountId, + folderId: this.$route.params.folderId, + messageUid: 'new', + }, + }) + }, + }, +} </script> diff --git a/src/views/KeyboardShortcuts.vue b/src/views/KeyboardShortcuts.vue index 4b696d827..1219a91c1 100644 --- a/src/views/KeyboardShortcuts.vue +++ b/src/views/KeyboardShortcuts.vue @@ -53,20 +53,17 @@ </template> <script> - import {AppContent} from 'nextcloud-vue' +import {AppContent} from 'nextcloud-vue' - import AppSettingsMenu from '../components/AppSettingsMenu' - import Navigation from '../components/Navigation' +import Navigation from '../components/Navigation' - export default { - name: 'KeyboardShortcuts', - components: { - AppContent, - AppSettingsMenu, - Navigation, - } - } +export default { + name: 'KeyboardShortcuts', + components: { + AppContent, + Navigation, + }, +} </script> -<style> -</style>
\ No newline at end of file +<style></style> diff --git a/src/views/Setup.vue b/src/views/Setup.vue index f8a627c49..234603d50 100644 --- a/src/views/Setup.vue +++ b/src/views/Setup.vue @@ -3,48 +3,45 @@ <div id="emptycontent"> <div class="icon-mail"></div> <h2>{{ t('mail', 'Connect your mail account') }}</h2> - <AccountForm :displayName="displayName" - :email="email" - :save="onSave"/> + <AccountForm :display-name="displayName" :email="email" :save="onSave" /> </div> </AppContent> </template> <script> - import {AppContent} from 'nextcloud-vue' - import AccountForm from '../components/AccountForm' +import {AppContent} from 'nextcloud-vue' +import AccountForm from '../components/AccountForm' - export default { - name: 'Setup', - components: { - AccountForm, - AppContent, +export default { + name: 'Setup', + components: { + AccountForm, + AppContent, + }, + computed: { + displayName() { + return $('#user-displayname').text() || '' }, - computed: { - displayName () { - return $('#user-displayname').text() || '' - }, - email () { - return $('#user-email').text() || '' - } + email() { + return $('#user-email').text() || '' }, - methods: { - onSave (data) { - return this.$store.dispatch('createAccount', data) - .then(account => { - this.$router.push({ - name: 'home', - }) + }, + methods: { + onSave(data) { + return this.$store.dispatch('createAccount', data).then(account => { + this.$router.push({ + name: 'home', + }) - return account - }) - } - } - } + return account + }) + }, + }, +} </script> <style> - #emptycontent { - margin-top: 10vh; - } -</style>
\ No newline at end of file +#emptycontent { + margin-top: 10vh; +} +</style> |