From 83fc483eafed1b8d2e89e92bcaa48df72efa1ac2 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 24 Mar 2021 19:42:17 +0100 Subject: [PATCH] added prettier package --- frontend/.eslintignore | 1 + frontend/package.json | 1 + frontend/src/App.vue | 8 ++--- frontend/src/apis/communityAPI.js | 6 ++-- frontend/src/apis/loginAPI.js | 2 +- frontend/src/components/BasePagination.vue | 2 +- frontend/src/components/BaseProgress.vue | 2 +- .../components/Breadcrumb/RouteBreadcrumb.vue | 2 +- frontend/src/components/Charts/config.js | 6 ++-- .../Charts/roundedCornersExtension.js | 2 +- frontend/src/components/Collapse/Collapse.vue | 2 +- .../src/components/Inputs/BaseCheckbox.vue | 4 +-- frontend/src/components/Inputs/BaseInput.vue | 2 +- frontend/src/components/Inputs/BaseRadio.vue | 4 +-- .../NotificationPlugin/Notification.vue | 12 ++++---- .../NotificationPlugin/Notifications.vue | 2 +- .../components/NotificationPlugin/index.js | 4 +-- .../src/components/SidebarPlugin/SideBar.vue | 8 ++--- .../components/SidebarPlugin/SidebarItem.vue | 4 +-- frontend/src/components/Tabs/Tabs.vue | 6 ++-- frontend/src/directives/click-ouside.js | 6 ++-- frontend/src/i18n.js | 2 +- frontend/src/main.js | 2 +- frontend/src/plugins/dashboard-plugin.js | 2 +- frontend/src/store/store.js | 4 +-- frontend/src/views/AdminOverview.vue | 28 ++++++++--------- .../views/AdminOverview/AdminUserCreation.vue | 4 +-- .../views/AdminOverview/AdminUserSearch.vue | 20 ++++--------- frontend/src/views/AdminOverview/default.vue | 4 +-- frontend/src/views/Dashboard/GoodTable.vue | 4 +-- frontend/src/views/GoogleMaps.vue | 6 ++-- .../src/views/KontoOverview/GddAddWork.vue | 2 +- .../src/views/KontoOverview/GddAddWork2.vue | 20 +++++-------- frontend/src/views/KontoOverview/GddSend.vue | 30 +++++++------------ frontend/src/views/KontoOverview/GddTable.vue | 6 ++-- .../src/views/KontoOverview/GddWorkTable.vue | 4 +-- frontend/src/views/KontoOverview/default.vue | 4 +-- frontend/src/views/Landing.vue | 20 ++++--------- frontend/src/views/Layout/AuthLayout.vue | 6 ++-- frontend/src/views/Layout/ContentFooter.vue | 4 +-- frontend/src/views/Layout/DashboardNavbar.vue | 2 +- frontend/src/views/Pages/Explorer.vue | 4 +-- frontend/src/views/Pages/Login.vue | 2 +- frontend/src/views/Pages/Password.vue | 2 +- frontend/src/views/Pages/Register.vue | 4 +-- frontend/src/views/Pages/UserProfile.vue | 7 ++++- .../Pages/UserProfile/ImageUploaderAvatar.vue | 2 +- .../src/views/Pages/UserProfileActivity.vue | 2 +- .../Pages/UserProfileTransactionList.vue | 2 +- frontend/src/views/default.vue | 4 +-- frontend/yarn.lock | 5 ++++ 51 files changed, 124 insertions(+), 170 deletions(-) diff --git a/frontend/.eslintignore b/frontend/.eslintignore index 5033deba2..f6b255e92 100644 --- a/frontend/.eslintignore +++ b/frontend/.eslintignore @@ -1,2 +1,3 @@ node_modules **/*.min.js +build \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index 73689b5fa..2a470f312 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -45,6 +45,7 @@ "nouislider": "^12.1.0", "particles-bg-vue": "1.2.3", "perfect-scrollbar": "^1.3.0", + "prettier": "^2.2.1", "qrcode": "^1.4.4", "quill": "^1.3.6", "sweetalert2": "^9.5.4", diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 2127f2631..2b0449c88 100755 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -10,12 +10,8 @@ class="m-md-2" > - - Deutsch - - - English - + Deutsch + English diff --git a/frontend/src/apis/communityAPI.js b/frontend/src/apis/communityAPI.js index 8a8a4ce88..9c8b502ff 100644 --- a/frontend/src/apis/communityAPI.js +++ b/frontend/src/apis/communityAPI.js @@ -1,7 +1,7 @@ import axios from 'axios' import CONFIG from '../config' -const apiGet = async url => { +const apiGet = async (url) => { try { const result = await axios.get(url) if (result.status !== 200) { @@ -32,10 +32,10 @@ const apiPost = async (url, payload) => { } const communityAPI = { - balance: async session_id => { + balance: async (session_id) => { return apiGet(CONFIG.COMMUNITY_API_STATE_BALANCE_URL + 'ajaxGetBalance/' + session_id) }, - transactions: async session_id => { + transactions: async (session_id) => { return apiGet(CONFIG.COMMUNITY_API_STATE_BALANCE_URL + 'ajaxListTransactions/' + session_id) }, create: async (session_id, email, amount, memo, target_date = new Date()) => { diff --git a/frontend/src/apis/loginAPI.js b/frontend/src/apis/loginAPI.js index ba3a69147..e10a19c3f 100644 --- a/frontend/src/apis/loginAPI.js +++ b/frontend/src/apis/loginAPI.js @@ -30,7 +30,7 @@ const loginAPI = { } return apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', payload) }, - logout: async session_id => { + logout: async (session_id) => { const payload = { session_id } return apiPost(CONFIG.LOGIN_API_URL + 'logout', payload) }, diff --git a/frontend/src/components/BasePagination.vue b/frontend/src/components/BasePagination.vue index e5cde8783..9fc633481 100755 --- a/frontend/src/components/BasePagination.vue +++ b/frontend/src/components/BasePagination.vue @@ -6,7 +6,7 @@ :per-page="perPage" :size="size" :value="value" - @change="val => $emit('change', val)" + @change="(val) => $emit('change', val)" :align="align" :total-rows="total" > diff --git a/frontend/src/components/BaseProgress.vue b/frontend/src/components/BaseProgress.vue index d10148e31..c2f44bf2c 100755 --- a/frontend/src/components/BaseProgress.vue +++ b/frontend/src/components/BaseProgress.vue @@ -59,7 +59,7 @@ export default { value: { type: Number, default: 0, - validator: value => { + validator: (value) => { return value >= 0 && value <= 100 }, description: 'Progress value', diff --git a/frontend/src/components/Breadcrumb/RouteBreadcrumb.vue b/frontend/src/components/Breadcrumb/RouteBreadcrumb.vue index b4aaa2ad6..bd378f312 100644 --- a/frontend/src/components/Breadcrumb/RouteBreadcrumb.vue +++ b/frontend/src/components/Breadcrumb/RouteBreadcrumb.vue @@ -9,7 +9,7 @@ v-for="(route, index) in $route.matched.slice()" :key="route.name" :active="index === $route.matched.length - 1" - style="display:inline-block" + style="display: inline-block" > {{ route.name }} diff --git a/frontend/src/components/Charts/config.js b/frontend/src/components/Charts/config.js index c8e422d67..5da4578f0 100644 --- a/frontend/src/components/Charts/config.js +++ b/frontend/src/components/Charts/config.js @@ -93,11 +93,11 @@ function chartOptions() { mode: 'point', }, cutoutPercentage: 83, - legendCallback: function(chart) { + legendCallback: function (chart) { let data = chart.data let content = '' - data.labels.forEach(function(label, index) { + data.labels.forEach(function (label, index) { let bgColor = data.datasets[0].backgroundColor[index] content += '' @@ -129,7 +129,7 @@ function chartOptions() { ticks: { beginAtZero: true, padding: 10, - callback: function(value) { + callback: function (value) { if (!(value % 10)) { return value } diff --git a/frontend/src/components/Charts/roundedCornersExtension.js b/frontend/src/components/Charts/roundedCornersExtension.js index 8c1c6c8a0..ae7f84ce8 100644 --- a/frontend/src/components/Charts/roundedCornersExtension.js +++ b/frontend/src/components/Charts/roundedCornersExtension.js @@ -3,7 +3,7 @@ // Code from: https://codepen.io/jedtrow/full/ygRYgo // import Chart from 'chart.js' -Chart.elements.Rectangle.prototype.draw = function() { +Chart.elements.Rectangle.prototype.draw = function () { let ctx = this._chart.ctx let vm = this._view let left, right, top, bottom, signX, signY, borderSkipped, radius diff --git a/frontend/src/components/Collapse/Collapse.vue b/frontend/src/components/Collapse/Collapse.vue index 8ad149fac..e0ea57945 100644 --- a/frontend/src/components/Collapse/Collapse.vue +++ b/frontend/src/components/Collapse/Collapse.vue @@ -53,7 +53,7 @@ export default { } }, deactivateAll() { - this.items.forEach(item => { + this.items.forEach((item) => { item.active = false }) }, diff --git a/frontend/src/components/Inputs/BaseCheckbox.vue b/frontend/src/components/Inputs/BaseCheckbox.vue index dd2249470..2aaa06fba 100755 --- a/frontend/src/components/Inputs/BaseCheckbox.vue +++ b/frontend/src/components/Inputs/BaseCheckbox.vue @@ -72,9 +72,7 @@ export default { }, }, created() { - this.cbId = Math.random() - .toString(16) - .slice(2) + this.cbId = Math.random().toString(16).slice(2) }, } diff --git a/frontend/src/components/Inputs/BaseInput.vue b/frontend/src/components/Inputs/BaseInput.vue index 469327f5c..c4e323696 100644 --- a/frontend/src/components/Inputs/BaseInput.vue +++ b/frontend/src/components/Inputs/BaseInput.vue @@ -58,7 +58,7 @@ -
+
{{ errors[0] }}
diff --git a/frontend/src/components/Inputs/BaseRadio.vue b/frontend/src/components/Inputs/BaseRadio.vue index 358b50997..697812698 100755 --- a/frontend/src/components/Inputs/BaseRadio.vue +++ b/frontend/src/components/Inputs/BaseRadio.vue @@ -58,9 +58,7 @@ export default { }, }, created() { - this.cbId = Math.random() - .toString(16) - .slice(2) + this.cbId = Math.random().toString(16).slice(2) }, } diff --git a/frontend/src/components/NotificationPlugin/Notification.vue b/frontend/src/components/NotificationPlugin/Notification.vue index faf7ea73e..20251d9fa 100644 --- a/frontend/src/components/NotificationPlugin/Notification.vue +++ b/frontend/src/components/NotificationPlugin/Notification.vue @@ -40,7 +40,7 @@ export default { components: { contentRender: { props: ['component'], - render: function(createElement) { + render: function (createElement) { return createElement(this.component) }, }, @@ -58,7 +58,7 @@ export default { verticalAlign: { type: String, default: 'top', - validator: value => { + validator: (value) => { let acceptedValues = ['top', 'bottom'] return acceptedValues.indexOf(value) !== -1 }, @@ -67,7 +67,7 @@ export default { horizontalAlign: { type: String, default: 'right', - validator: value => { + validator: (value) => { let acceptedValues = ['left', 'center', 'right'] return acceptedValues.indexOf(value) !== -1 }, @@ -76,7 +76,7 @@ export default { type: { type: String, default: 'info', - validator: value => { + validator: (value) => { let acceptedValues = ['default', 'info', 'primary', 'danger', 'warning', 'success'] return acceptedValues.indexOf(value) !== -1 }, @@ -86,7 +86,7 @@ export default { timeout: { type: Number, default: 5000, - validator: value => { + validator: (value) => { return value >= 0 }, description: 'Notification timeout (closes after X milliseconds). Default is 5000 (5s)', @@ -131,7 +131,7 @@ export default { customPosition() { let initialMargin = 20 let alertHeight = this.elmHeight + 10 - let sameAlertsCount = this.$notifications.state.filter(alert => { + let sameAlertsCount = this.$notifications.state.filter((alert) => { return ( alert.horizontalAlign === this.horizontalAlign && alert.verticalAlign === this.verticalAlign && diff --git a/frontend/src/components/NotificationPlugin/Notifications.vue b/frontend/src/components/NotificationPlugin/Notifications.vue index 3a1d18730..f180a7f37 100644 --- a/frontend/src/components/NotificationPlugin/Notifications.vue +++ b/frontend/src/components/NotificationPlugin/Notifications.vue @@ -44,7 +44,7 @@ export default { this.$notifications.settings.overlap = this.overlap }, watch: { - overlap: function(newVal) { + overlap: function (newVal) { this.$notifications.settings.overlap = newVal }, }, diff --git a/frontend/src/components/NotificationPlugin/index.js b/frontend/src/components/NotificationPlugin/index.js index b036cd2d7..fbf48d214 100644 --- a/frontend/src/components/NotificationPlugin/index.js +++ b/frontend/src/components/NotificationPlugin/index.js @@ -15,7 +15,7 @@ const NotificationStore = { this.settings = Object.assign(this.settings, options) }, removeNotification(timestamp) { - const indexToDelete = this.state.findIndex(n => n.timestamp === timestamp) + const indexToDelete = this.state.findIndex((n) => n.timestamp === timestamp) if (indexToDelete !== -1) { this.state.splice(indexToDelete, 1) } @@ -33,7 +33,7 @@ const NotificationStore = { }, notify(notification) { if (Array.isArray(notification)) { - notification.forEach(notificationInstance => { + notification.forEach((notificationInstance) => { this.addNotification(notificationInstance) }) } else { diff --git a/frontend/src/components/SidebarPlugin/SideBar.vue b/frontend/src/components/SidebarPlugin/SideBar.vue index 1c9be5b93..3c4b17b7f 100755 --- a/frontend/src/components/SidebarPlugin/SideBar.vue +++ b/frontend/src/components/SidebarPlugin/SideBar.vue @@ -27,15 +27,15 @@ {{ $t('site.overview.account_overview') }} - + {{ $t('site.navbar.my-profil') }} - + {{ $t('site.navbar.settings') }} - + Transactions @@ -46,7 +46,7 @@ --> -