Commit 1f741748 authored by Christian Wansart's avatar Christian Wansart Committed by Johannes

Fix vue bootstrap tables

parent 089efe3b
Pipeline #106023380 passed with stages
in 14 minutes and 52 seconds
......@@ -104,6 +104,7 @@
- Removed SQL statements from Session, BasketXhr, and XhrMethods + fix !1261 !1247 #9 @alex.simm
- Switched use of Session::id to Session::may !1257 @pfaufisch
- Refactored FoodsaverModel to FoodsaverGateway !1178 !1266 #9 @svenpascal
- Updated dependencies and fixed broken templates !1272 !1283 @ctwx_ok
## Dev/Test/CI stuff
......
......@@ -2137,9 +2137,9 @@ [email protected]^1.6.0:
integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==
[email protected]^2.10.1:
version "2.11.1"
resolved "https://registry.yarnpkg.com/consola/-/consola-2.11.1.tgz#1df259c0a7aef44c9eb4f448e3a20ba0850a65e7"
integrity sha512-zFH/xFAE/KHJiWqwyTEDmdFe34Swc0pqMKJeowTvR3irepx8kKPu8bjaKzRd+RLjLH+0TvFxFBnohbSUQ+hOsw==
version "2.11.2"
resolved "https://registry.yarnpkg.com/consola/-/consola-2.11.2.tgz#e2d2028d634b2c44db81c26cc328b8e42d24f2f5"
integrity sha512-kiOd0jqR5wo4swTf/aTu/Y+mynBjFD70tEpVS83jMtzqahKLPLJTDjVFDhg9ihuiWVV5TLQ43LlwleXuz2yYKg==
[email protected]^1.1.0:
version "1.1.0"
......
......@@ -79,9 +79,10 @@ export default {
data () {
return {
sortBy: 'gender',
sortDesc: 'true',
fields: {
gender: {
sortDesc: true,
fields: [
{
key: 'gender',
label: this.$i18n('genderlist.gender_table_header'),
formatter: item => {
switch (item) {
......@@ -99,11 +100,12 @@ export default {
},
sortable: true
},
NumberOfGender: {
{
key: 'NumberOfGender',
label: this.$i18n('genderlist.number_table_header'),
sortable: true
}
}
]
}
}
}
......
......@@ -64,25 +64,23 @@
class="foto-table"
>
<template
slot="imageUrl"
slot-scope="data"
v-slot:cell(imageUrl)="row"
>
<div>
<img
:src="data.value"
:src="row.value"
:alt="$i18n('terminology.profile_picture')"
class="user_pic_width"
>
</div>
</template>
<template
slot="user.name"
slot-scope="{ item: { user } }"
v-slot:cell(userName)="row"
>
<a
:href="$url('profile', user.id)"
:href="$url('profile', row.item.user.id)"
>
{{ user.name }}
{{ row.item.user.name }}
</a>
</template>
</b-table>
......@@ -124,18 +122,19 @@ export default {
currentPage: 1,
perPage: 20,
filterText: '',
fields: {
imageUrl: {
label: '',
fields: [
{
key: 'imageUrl',
sortable: false,
label: '',
class: 'foto-column'
},
'user.name': {
}, {
key: 'userName',
label: this.$i18n('group.name'),
sortable: false,
class: 'align-middle'
}
}
]
}
},
computed: {
......
......@@ -142,34 +142,39 @@ export default {
data () {
return {
sortBy: 'time',
sortDesc: 'true',
sortDesc: true,
currentPageDaily: 1,
currentPageWeekly: 1,
currentPageMonthly: 1,
currentPageYearly: 1,
perPage: 14,
fields: {
time: {
fields: [
{
key: 'time',
label: this.$i18n('pickuplist.time_table_header'),
sortable: true
},
NumberOfStores: {
{
key: 'NumberOfStores',
label: this.$i18n('pickuplist.NumberOfStores_table_header'),
sortable: true
},
NumberOfAppointments: {
{
key: 'NumberOfAppointments',
label: this.$i18n('pickuplist.NumberOfAppointments_table_header'),
sortable: true
},
NumberOfSlots: {
{
key: 'NumberOfSlots',
label: this.$i18n('pickuplist.NumberOfSlots_table_header'),
sortable: true
},
NumberOfFoodsavers: {
{
key: 'NumberOfFoodsavers',
label: this.$i18n('pickuplist.NumberOfFoodSavers_table_header'),
sortable: true
}
}
]
}
}
}
......
......@@ -18,8 +18,7 @@
responsive
>
<template
slot="avatar"
slot-scope="row"
v-slot:cell(avatar)="row"
>
<div class="avatars">
<a :href="`/profile/${row.item.fs_id}`">
......@@ -51,8 +50,7 @@
</b-button>
</template>
<template
slot="row-details"
slot-scope="row"
v-slot:cell(row-details)="row"
>
<div class="report">
<p><strong>{{ $i18n('reports.report_id') }}</strong>: {{ row.item.id }}</p>
......@@ -119,42 +117,51 @@ export default {
currentPage: 1,
perPage: 50,
reports: [],
fields: {
avatar: {
fields: [
{
key: 'avatar',
label: ''
},
fs_stadt: {
{
key: 'fs_stadt',
label: this.$i18n('reports.city'),
sortable: true
},
time: {
{
key: 'time',
label: this.$i18n('reports.time'),
sortable: true
},
fs_name: {
{
key: 'fs_name',
label: this.$i18n('reports.about_first_name'),
sortable: true
},
fs_nachname: {
{
key: 'fs_nachname',
label: this.$i18n('reports.about_last_name'),
sortable: true
},
rp_name: {
{
key: 'rp_name',
label: this.$i18n('reports.from_first_name'),
sortable: true
},
rp_nachname: {
{
key: 'rp_nachname',
label: this.$i18n('reports.from_last_name'),
sortable: true
},
b_name: {
{
key: 'b_name',
label: this.$i18n('reports.region'),
sortable: true
},
actions: {
{
key: 'actions',
label: ''
}
}
]
}
},
async created () {
......
......@@ -59,8 +59,7 @@
responsive
>
<template
slot="status"
slot-scope="row"
v-slot:cell(status)="row"
:v-if="isMobile"
>
<div class="text-center">
......@@ -68,8 +67,7 @@
</div>
</template>
<template
slot="name"
slot-scope="row"
v-slot:cell(name)="row"
>
<a
:href="$url('store', row.item.id)"
......@@ -79,8 +77,7 @@
</a>
</template>
<template
slot="actions"
slot-scope="row"
v-slot:cell(actions)="row"
>
<b-button
@click.stop="row.toggleDetails"
......@@ -90,8 +87,7 @@
</b-button>
</template>
<template
slot="row-details"
slot-scope="row"
v-slot:cell(row-details)="row"
>
<b-card>
<div class="details">
......@@ -158,50 +154,59 @@ export default {
data () {
return {
sortBy: 'added',
sortDesc: 'true',
sortDesc: true,
currentPage: 1,
perPage: 20,
filterText: '',
filterStatus: null,
fields: {
status: {
fields: [
{
key: 'status',
label: 'Status',
tdClass: 'status',
sortable: true
},
name: {
{
key: 'name',
label: 'Name',
sortable: true
},
address: {
{
key: 'address',
label: 'Straße',
sortable: true
},
zipcode: {
{
key: 'zipcode',
label: 'PLZ',
sortable: true
},
city: {
{
key: 'city',
label: 'Ort',
sortable: true
},
added: {
{
key: 'added',
label: 'Eingetragen',
sortable: true
},
region: {
{
key: 'region',
label: 'Bezirk',
sortable: true
},
geo: {
{
key: 'geo',
label: 'geo',
sortable: false
},
actions: {
{
key: 'actions',
label: '',
sortable: false
}
},
],
statusOptions: [
{ value: null, text: 'Status' },
{ value: 1, text: 'Noch kein Kontakt' },
......@@ -231,21 +236,22 @@ export default {
},
fieldsFiltered: function () {
const regions = []
const fields = {}
const fields = []
this.stores.map(function (value) {
if (!regions.includes(value.region)) regions.push(value.region)
})
if (window.innerWidth > 800 && window.innerHeight > 600) {
for (const key in this.fields) {
if (key === 'region' && regions.length > 1) fields[key] = this.fields[key]
else if (key !== 'region' && key !== 'geo' && key !== 'actions') fields[key] = this.fields[key]
}
} else {
for (const key in this.fields) {
if (key === 'region' && regions.length > 1) fields[key] = this.fields[key]
else if (key !== 'region' && key !== 'geo' && key !== 'address' && key !== 'added' && key !== 'zipcode') fields[key] = this.fields[key]
const displayableFields = (window.innerWidth > 800 && window.innerHeight > 600)
? ['region', 'geo', 'actions']
: ['region', 'geo', 'address', 'added', 'zipcode']
this.fields.forEach(field => {
if ((field.key === 'region' && regions.length > 1) ||
!displayableFields.includes(field.key)) {
fields.push(field)
}
}
})
return fields
}
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment