Merge branch '1197-admin-interface-created-transactions-list' into 1196-send-registration-link

This commit is contained in:
elweyn 2021-12-20 09:15:29 +01:00
commit d3105bbbad
9 changed files with 312 additions and 58 deletions

View File

@ -0,0 +1,40 @@
import { mount } from '@vue/test-utils'
import ConfirmRegisterMailFormular from './ConfirmRegisterMailFormular.vue'
const localVue = global.localVue
const mocks = {
$moment: jest.fn(() => {
return {
format: jest.fn((m) => m),
subtract: jest.fn(() => {
return {
format: jest.fn((m) => m),
}
}),
}
}),
}
const propsData = {
email: '',
dateLastSend: '',
}
describe('ConfirmRegisterMailFormular', () => {
let wrapper
const Wrapper = () => {
return mount(ConfirmRegisterMailFormular, { localVue, mocks, propsData })
}
describe('mount', () => {
beforeEach(() => {
wrapper = Wrapper()
})
it('has a DIV element with the class.component-confirm-register-mail', () => {
expect(wrapper.find('.component-confirm-register-mail').exists()).toBeTruthy()
})
})
})

View File

@ -0,0 +1,47 @@
<template>
<div class="component-confirm-register-mail">
<div class="shadow p-3 mb-5 bg-white rounded">
<div class="h5">
Die letzte Email wurde am
<b>{{ dateLastSend }} Uhr</b>
an das Mitglied ({{ email }}) gesendet.
</div>
<!-- Using components -->
<b-input-group prepend="Email bestätigen, wiederholt senden an:" class="mt-3">
<b-form-input readonly :value="email"></b-form-input>
<b-input-group-append>
<b-button variant="outline-success" class="test-button" @click="sendRegisterMail">
Registrierungs-Email bestätigen, jetzt senden
</b-button>
</b-input-group-append>
</b-input-group>
</div>
</div>
</template>
<script>
// import { verifyLogin } from '../graphql/verifyLogin'
// import { createPendingCreation } from '../graphql/createPendingCreation'
export default {
name: 'ConfirmRegisterMail',
props: {
email: {
type: String,
},
dateLastSend: {
type: String,
},
},
methods: {
sendRegisterMail() {
// eslint-disable-next-line no-console
console.log('sende wiederholt den ConfirmText an die register E-Mail des User!')
},
},
}
</script>
<style>
.input-group-text {
background-color: rgb(255, 252, 205);
}
</style>

View File

@ -204,8 +204,6 @@ export default {
// Die anzahl der Mitglieder aus der Mehrfachschöpfung // Die anzahl der Mitglieder aus der Mehrfachschöpfung
const i = Object.keys(this.itemsMassCreation).length const i = Object.keys(this.itemsMassCreation).length
// hinweis das eine Mehrfachschöpfung ausgeführt wird an (Anzahl der MItgleider an die geschöpft wird) // hinweis das eine Mehrfachschöpfung ausgeführt wird an (Anzahl der MItgleider an die geschöpft wird)
// eslint-disable-next-line no-console
console.log('SUBMIT CREATION => ' + this.type + ' >> für VIELE ' + i + ' Mitglieder')
this.submitObj = [ this.submitObj = [
{ {
item: this.itemsMassCreation, item: this.itemsMassCreation,
@ -216,8 +214,6 @@ export default {
moderator: this.$store.state.moderator.id, moderator: this.$store.state.moderator.id,
}, },
] ]
// eslint-disable-next-line no-console
console.log('MehrfachSCHÖPFUNG ABSENDEN FÜR >> ' + i + ' Mitglieder')
// $store - offene Schöpfungen hochzählen // $store - offene Schöpfungen hochzählen
this.$store.commit('openCreationsPlus', i) this.$store.commit('openCreationsPlus', i)

View File

@ -0,0 +1,59 @@
<template>
<div class="component-creation-transaction-list">
Alle Geschöpften Transaktionen für den User
<b-table striped hover :items="items"></b-table>
</div>
</template>
<script>
export default {
name: 'CreationTransactionList',
data() {
return {
items: [
{
gdd: 700,
date: '16.11.2021',
memo: 'klaljk jakldasjd lajlaldjalajsd aasj asdl jaljaldj aa jda l jdla jda',
moderator: 'Moderator Eins',
},
{
gdd: 800,
date: '23.10.2021',
memo: 'jij ijdas ijad sa jsd a ijaojodjajd jiaojdja dij aij doa aojd ao jd',
moderator: 'Moderator Eins',
},
{
gdd: 1000,
date: '13.09.2021',
memo: 'asdd d adad adsdadda dsdadadasds asdadada da dadadad adadada d',
moderator: 'Moderator Eins',
},
{
gdd: 400,
date: '03.07.2021',
memo: 'casc acas ac acacacs cac acacac acc acac ca cacac',
moderator: 'Moderator Zwei',
},
{
gdd: 210,
date: '04.06.2021',
memo: 'asc dfdvdvdf vfvd vdfvdff vdvdfvd vff dvfd vdfv dfv dfvdf vdfvdfv',
moderator: 'Moderator Eins',
},
{
gdd: 890,
date: '07.05.2021',
memo: 'reett ttertt etet et et ertetetet et ert et ertertertet',
moderator: 'Moderator Eins',
},
{
gdd: 380,
date: '22.04.2021',
memo: 'bnnbnbbncvbcv bcbcbc bcb cbc bcb cvb cbccvvbcvb bvbcbcbcbc bcb cb',
moderator: 'Moderator Zwei',
},
],
}
},
}
</script>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="component-nabvar"> <div class="component-nabvar">
<b-navbar toggleable="sm" type="dark" variant="success"> <b-navbar toggleable="md" type="dark" variant="success" class="p-3">
<b-navbar-brand to="/"> <b-navbar-brand to="/">
<img src="img/brand/green.png" class="navbar-brand-img" alt="..." /> <img src="img/brand/green.png" class="navbar-brand-img" alt="..." />
</b-navbar-brand> </b-navbar-brand>
@ -9,19 +9,18 @@
<b-collapse id="nav-collapse" is-nav> <b-collapse id="nav-collapse" is-nav>
<b-navbar-nav> <b-navbar-nav>
<b-nav-item to="/">Übersicht |</b-nav-item> <b-nav-item to="/">Übersicht</b-nav-item>
<b-nav-item to="/user">Usersuche |</b-nav-item> <b-nav-item to="/user">Usersuche</b-nav-item>
<b-nav-item to="/creation">Mehrfachschöpfung</b-nav-item> <b-nav-item to="/creation">Mehrfachschöpfung</b-nav-item>
<b-nav-item <b-nav-item
v-show="$store.state.openCreations > 0" v-show="$store.state.openCreations > 0"
class="h5 bg-danger" class="bg-color-creation p-1"
to="/creation-confirm" to="/creation-confirm"
> >
| {{ $store.state.openCreations }} offene Schöpfungen {{ $store.state.openCreations }} offene Schöpfungen
</b-nav-item> </b-nav-item>
<b-nav-item @click="wallet">Wallet</b-nav-item> <b-nav-item @click="wallet">Wallet</b-nav-item>
<b-nav-item @click="logout">Logout</b-nav-item> <b-nav-item @click="logout">Logout</b-nav-item>
<!-- <b-nav-item v-show="open < 1" to="/creation-confirm">| keine offene Schöpfungen</b-nav-item> -->
</b-navbar-nav> </b-navbar-nav>
</b-collapse> </b-collapse>
</b-navbar> </b-navbar>
@ -49,4 +48,7 @@ export default {
height: 2rem; height: 2rem;
padding-left: 10px; padding-left: 10px;
} }
.bg-color-creation {
background-color: #cf1010dc;
}
</style> </style>

View File

@ -40,7 +40,8 @@
<b-button <b-button
variant="info" variant="info"
size="md" size="md"
@click="editCreationUserTable(row, row.item)" :class="'details_' + row.detailsShowing"
@click="editCreationUserTable(row)"
class="mr-2" class="mr-2"
> >
<b-icon v-if="row.detailsShowing" icon="x" aria-label="Help"></b-icon> <b-icon v-if="row.detailsShowing" icon="x" aria-label="Help"></b-icon>
@ -49,18 +50,55 @@
</template> </template>
<template #cell(show_details)="row"> <template #cell(show_details)="row">
<b-button variant="info" size="md" @click="row.toggleDetails" class="mr-2"> <b-button
variant="info"
size="md"
:ref="'showing_detals_' + row.detailsShowing"
@click="rowDetailsToogle(row, row.detailsShowing)"
class="mr-2"
>
<b-icon v-if="row.detailsShowing" icon="eye-slash-fill" aria-label="Help"></b-icon> <b-icon v-if="row.detailsShowing" icon="eye-slash-fill" aria-label="Help"></b-icon>
<b-icon v-else icon="eye-fill" aria-label="Help"></b-icon> <b-icon v-else icon="eye-fill" aria-label="Help"></b-icon>
</b-button> </b-button>
</template> </template>
<template #cell(confirm_mail)="row">
<b-button
:variant="row.item.firstName === 'Peter' ? 'success' : 'danger'"
size="md"
:ref="'showing_registermail_detals_' + row.detailsShowing"
@click="
row.item.firstName !== 'Peter'
? rowDetailsToogleRegisterMail(row, row.detailsShowing)
: ''
"
class="mr-2"
>
<b-icon
:icon="row.item.firstName === 'Peter' ? 'envelope-open' : 'envelope'"
aria-label="Help"
></b-icon>
</b-button>
</template>
<template #cell(transactions_list)="row">
<b-button
variant="warning"
size="md"
:ref="'showing_transactions_list_' + row.detailsShowing"
@click="rowDetailsToogleTransactionsList(row, row.detailsShowing)"
class="mr-2"
>
<b-icon icon="list"></b-icon>
</b-button>
</template>
<template #row-details="row"> <template #row-details="row">
<b-card class="shadow-lg p-3 mb-5 bg-white rounded"> <b-card class="shadow-lg pl-3 pr-3 mb-5 bg-white rounded">
<b-row class="mb-2"> <b-row class="mb-2">
<b-col></b-col> <b-col></b-col>
</b-row> </b-row>
{{ type }} <div v-if="showCreationFormular">
<creation-formular <creation-formular
v-if="type === 'PageUserSearch'" v-if="type === 'PageUserSearch'"
type="singleCreation" type="singleCreation"
@ -82,6 +120,14 @@
@update-creation-data="updateCreationData" @update-creation-data="updateCreationData"
@update-user-data="updateUserData" @update-user-data="updateUserData"
/> />
</div>
<confirm-register-mail-formular
v-if="showConfirmRegisterMailFormular"
:email="row.item.email"
:dateLastSend="$moment().subtract(1, 'month').format('dddd, DD.MMMM.YYYY HH:mm'),"
/>
<creation-transaction-list-formular v-if="showCreationTransactionListFormular" />
<b-button size="sm" @click="row.toggleDetails"> <b-button size="sm" @click="row.toggleDetails">
<b-icon <b-icon
@ -132,6 +178,9 @@
<script> <script>
import CreationFormular from '../components/CreationFormular.vue' import CreationFormular from '../components/CreationFormular.vue'
import EditCreationFormular from '../components/EditCreationFormular.vue' import EditCreationFormular from '../components/EditCreationFormular.vue'
import ConfirmRegisterMailFormular from '../components/ConfirmRegisterMailFormular.vue'
import CreationTransactionListFormular from '../components/CreationTransactionListFormular.vue'
import { confirmPendingCreation } from '../graphql/confirmPendingCreation' import { confirmPendingCreation } from '../graphql/confirmPendingCreation'
export default { export default {
@ -162,9 +211,14 @@ export default {
components: { components: {
CreationFormular, CreationFormular,
EditCreationFormular, EditCreationFormular,
ConfirmRegisterMailFormular,
CreationTransactionListFormular,
}, },
data() { data() {
return { return {
showCreationFormular: null,
showConfirmRegisterMailFormular: null,
showCreationTransactionListFormular: null,
creationUserData: {}, creationUserData: {},
overlay: false, overlay: false,
overlayBookmarkType: '', overlayBookmarkType: '',
@ -181,6 +235,73 @@ export default {
} }
}, },
methods: { methods: {
rowDetailsToogle(row, details) {
if (
this.showConfirmRegisterMailFormular === true ||
this.showCreationTransactionListFormular === true
) {
this.showCreationFormular = true
this.showConfirmRegisterMailFormular = false
this.showCreationTransactionListFormular = false
return
}
if (details) {
row.toggleDetails()
this.showCreationFormular = null
this.showConfirmRegisterMailFormular = null
this.showCreationTransactionListFormular = null
}
if (!details) {
row.toggleDetails()
this.showCreationFormular = true
if (this.$refs.showing_detals_true !== undefined) {
this.$refs.showing_detals_true.click()
}
}
},
rowDetailsToogleRegisterMail(row, details) {
if (this.showCreationFormular === true || this.showCreationTransactionListFormular === true) {
this.showCreationFormular = false
this.showConfirmRegisterMailFormular = true
this.showCreationTransactionListFormular = false
return
}
if (details) {
row.toggleDetails()
this.showCreationFormular = null
this.showConfirmRegisterMailFormular = null
this.showCreationTransactionListFormular = null
}
if (!details) {
row.toggleDetails()
this.showConfirmRegisterMailFormular = true
if (this.$refs.showing_registermail_detals_true !== undefined) {
this.$refs.showing_registermail_detals_true.click()
}
}
},
rowDetailsToogleTransactionsList(row, details) {
if (this.showCreationFormular === true || this.showConfirmRegisterMailFormular === true) {
this.showCreationFormular = false
this.showConfirmRegisterMailFormular = false
this.showCreationTransactionListFormular = true
return
}
if (details) {
row.toggleDetails()
this.showCreationFormular = null
this.showConfirmRegisterMailFormular = null
this.showCreationTransactionListFormular = null
}
if (!details) {
row.toggleDetails()
this.showCreationTransactionListFormular = true
if (this.$refs.showing_transactions_list_true !== undefined) {
this.$refs.showing_transactions_list_true.click()
}
}
},
overlayShow(bookmarkType, item) { overlayShow(bookmarkType, item) {
this.overlay = true this.overlay = true
this.overlayBookmarkType = bookmarkType this.overlayBookmarkType = bookmarkType

View File

@ -40,7 +40,6 @@
:items="itemsMassCreation" :items="itemsMassCreation"
@remove-all-bookmark="removeAllBookmark" @remove-all-bookmark="removeAllBookmark"
/> />
{{ itemsMassCreation }}
</b-col> </b-col>
</b-row> </b-row>
</div> </div>

View File

@ -28,28 +28,6 @@
</b-link> </b-link>
</b-card-text> </b-card-text>
</b-card> </b-card>
<br />
<hr />
<br />
<b-list-group>
<b-list-group-item class="bg-secondary text-light" href="user">
zur Usersuche
</b-list-group-item>
<b-list-group-item class="d-flex justify-content-between align-items-center">
Mitglieder
<b-badge class="bg-success" pill>2400</b-badge>
</b-list-group-item>
<b-list-group-item class="d-flex justify-content-between align-items-center">
aktive Mitglieder
<b-badge class="bg-primary" pill>2201</b-badge>
</b-list-group-item>
<b-list-group-item class="d-flex justify-content-between align-items-center">
nicht bestätigte Mitglieder
<b-badge class="bg-warning text-dark" pill>120</b-badge>
</b-list-group-item>
</b-list-group>
</div> </div>
</template> </template>
<script> <script>

View File

@ -4,16 +4,23 @@
<b-input <b-input
type="text" type="text"
v-model="criteria" v-model="criteria"
class="shadow p-3 mb-5 bg-white rounded" class="shadow p-3 mb-3 bg-white rounded"
placeholder="User suche" placeholder="User suche"
@input="getUsers" @input="getUsers"
></b-input> ></b-input>
<user-table <user-table
type="PageUserSearch" type="PageUserSearch"
:itemsUser="searchResult" :itemsUser="searchResult"
:fieldsTable="fields" :fieldsTable="fields"
:criteria="criteria" :criteria="criteria"
/> />
<div>
<b-button block variant="danger" @click="unconfirmedRegisterMails">
<b-icon icon="envelope" variant="light"></b-icon>
Anzeigen aller nicht registrierten E-Mails.
</b-button>
</div>
</div> </div>
</template> </template>
<script> <script>
@ -40,6 +47,8 @@ export default {
}, },
}, },
{ key: 'show_details', label: 'Details' }, { key: 'show_details', label: 'Details' },
{ key: 'confirm_mail', label: 'Mail' },
{ key: 'transactions_list', label: 'Transaction' },
], ],
searchResult: [], searchResult: [],
massCreation: [], massCreation: [],
@ -48,6 +57,9 @@ export default {
}, },
methods: { methods: {
unconfirmedRegisterMails() {
alert('Apollo anfrage, alle Mitglieder, die nicht ihre Register E-Mail bestätigt haben.')
},
getUsers() { getUsers() {
this.$apollo this.$apollo
.query({ .query({