profile and register changes and bugfixes
This commit is contained in:
parent
e12c82aa98
commit
fc1e7c4b67
@ -63,6 +63,18 @@
|
||||
</q-expansion-item>
|
||||
</q-card>
|
||||
</q-list>
|
||||
<!--<div v-show="hasAdminState">-->
|
||||
<!--<p class="text-h5 q-mt-sm"> Neuen Admin hinzufügen </p>-->
|
||||
<!--<q-input lazy-rules outlined filled stack-label v-model="newAdminMail"-->
|
||||
<!--type="text" label="Email des Nutzers" class="col-9"-->
|
||||
<!--:rules="[val=>validateEmail(val)||'Bitte Email verwenden']"/>-->
|
||||
<!--<q-btn class="col-3"-->
|
||||
<!--icon="arrow_right_alt"-->
|
||||
<!--@click="getUser()"-->
|
||||
<!--:disabled="!adminInviteChecked"-->
|
||||
<!--color="positive"-->
|
||||
<!--type="submit"/>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel v-if="boolAlreadyInTeam" name="teams" class="q-pa-none">
|
||||
@ -72,6 +84,7 @@
|
||||
<p v-show="!boolStatus" class="text-white">
|
||||
Unser Status: {{currentTeamStatus}}
|
||||
<q-btn icon="create"
|
||||
unelevated
|
||||
class="on-right"
|
||||
@click="updateStatus()"
|
||||
color="amber"/>
|
||||
@ -81,12 +94,14 @@
|
||||
:rules="[val=>val.length<=160||'Status zu lang!']"/>
|
||||
<div v-show="boolStatus" align="center">
|
||||
<q-btn icon="done"
|
||||
unelevated
|
||||
class="on-left"
|
||||
:disabled="!teamStatusChecked"
|
||||
@click="setTeamStatus()"
|
||||
color="positive"
|
||||
type="submit"/>
|
||||
<q-btn icon="clear"
|
||||
unelevated
|
||||
class="on-right"
|
||||
@click="updateStatus()"
|
||||
color="negative"
|
||||
@ -101,32 +116,32 @@
|
||||
:data="teamData"
|
||||
:columns="teamColumns"
|
||||
row-key="name"
|
||||
table-class="my-custom"
|
||||
hide-bottom
|
||||
:pagination.sync="pagination"
|
||||
/>
|
||||
<br/>
|
||||
<div align="center">
|
||||
<q-btn label="Nutzer einladen"
|
||||
unelevated
|
||||
@click="activateInvite()"
|
||||
color="primary"
|
||||
class="full-width"
|
||||
class="full-width q-mt-sm"
|
||||
type="submit"/>
|
||||
</div>
|
||||
<div align="center" class="row q-mt-sm">
|
||||
<q-input v-show="inviteActivated" lazy-rules outlined filled stack-label v-model="inviteMail"
|
||||
type="text" label="Email des Nutzers" class="col-9"
|
||||
<div v-if="inviteActivated" align="center" class="row q-mt-sm justify-between">
|
||||
<q-input lazy-rules outlined filled stack-label v-model="inviteMail"
|
||||
type="text" label="Email des Nutzers" class="col q-mr-sm"
|
||||
:rules="[val=>validateEmail(val)||'Bitte Email verwenden']"/>
|
||||
<q-btn v-show="inviteActivated"
|
||||
class="col-3"
|
||||
icon="arrow_right_alt"
|
||||
<q-btn label="Einladen"
|
||||
unelevated
|
||||
@click="sendTeamInvite()"
|
||||
:disabled="!teamInviteChecked"
|
||||
color="positive"
|
||||
type="submit"/>
|
||||
</div>
|
||||
<div align="center" class="q-mt-sm">
|
||||
<div align="center" class="q-mt-lg">
|
||||
<q-btn label="Team verlassen"
|
||||
unelevated
|
||||
@click="confirmLeave()"
|
||||
color="negative"
|
||||
class="full-width"
|
||||
@ -204,6 +219,7 @@
|
||||
page: 1,
|
||||
rowsPerPage: 10
|
||||
},
|
||||
// newAdminMail: "",
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
@ -235,7 +251,13 @@
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
},
|
||||
adminInviteChecked() {
|
||||
if (this.validateEmail(this.newAdminMail)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
},
|
||||
created: function () {
|
||||
// this.$store.commit('auth/SET_AUTHENTICATED');
|
||||
@ -344,6 +366,7 @@
|
||||
color: "blue"
|
||||
});
|
||||
this.updateTeamData();
|
||||
this.tab = 'teams';
|
||||
}).catch((error) => {
|
||||
this.handleError(error);
|
||||
})
|
||||
@ -364,6 +387,7 @@
|
||||
color: "blue"
|
||||
});
|
||||
this.updateTeamData();
|
||||
this.tab = 'profile';
|
||||
}).catch((error) => {
|
||||
this.handleError(error);
|
||||
})
|
||||
@ -435,6 +459,7 @@
|
||||
color: "blue"
|
||||
});
|
||||
this.updateTeamData();
|
||||
this.tab = 'teams';
|
||||
}).catch((error) => {
|
||||
this.handleError(error);
|
||||
})
|
||||
@ -494,6 +519,73 @@
|
||||
});
|
||||
this.updateStatus();
|
||||
},
|
||||
// getUser() {
|
||||
// const data = {
|
||||
// "email" : this.newAdminMail
|
||||
// }
|
||||
// JSON.stringify(data);
|
||||
// const token = JSON.parse(localStorage.getItem('userToken')).token;
|
||||
// this.$axios.get(process.env.USER_API + '/account/email', data, {
|
||||
// headers: {
|
||||
// 'Authorization': 'Bearer ' + token,
|
||||
// }
|
||||
// }).then((response) => {
|
||||
// let newAdminAccount = response.data;
|
||||
// if (response.status === 200) {
|
||||
// this.addAdmin(JSON.parse(response).data);
|
||||
// }
|
||||
// })
|
||||
// .catch((error) => {
|
||||
// let message;
|
||||
// let header = "Unbekannter Fehler...";
|
||||
// if (error.response) {
|
||||
// console.log(error.response)
|
||||
// if (error.response.status === 400) {
|
||||
// message = "Es gibt keinen Nutzer mit dieser Email!";
|
||||
// header = "Email überprüfen!";
|
||||
// }
|
||||
// } else if (error.request) {
|
||||
// console.log(error.request);
|
||||
// header = "Anfrage fehlgeschlagen!";
|
||||
// message = "Die Verbindung zum Server ist gestört. Versuchen Sie es später noch einmal.";
|
||||
// }
|
||||
// this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {message: message, title: header});
|
||||
// });
|
||||
// },
|
||||
// addAdmin(newAdmin) {
|
||||
// const token = JSON.parse(localStorage.getItem('userToken')).token;
|
||||
// newAdmin.roles.role = "ADMIN";
|
||||
// JSON.stringify(newAdmin);
|
||||
// this.$axios.patch(process.env.USER_API, '/account', newAdmin, {
|
||||
// headers: {
|
||||
// 'Authorization': 'Bearer ' + token,
|
||||
// }
|
||||
// }).then((response) => {
|
||||
// if (response.status === 200) {
|
||||
// this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {
|
||||
// message: "Du hast den Nutzer mit der Email " + this.newAdminMail + " als Admin freigeschalten!",
|
||||
// title: "Nutzerverwaltung",
|
||||
// color: "blue"
|
||||
// });
|
||||
// }
|
||||
// })
|
||||
// .catch((error) => {
|
||||
// let message;
|
||||
// let header = "Unbekannter Fehler...";
|
||||
// if (error.response) {
|
||||
// console.log(error.response)
|
||||
// if (error.response.status === 400) {
|
||||
// message = JSON.parse(error).error;
|
||||
// header = "Probleme mit dem zu bearbeitenden Nutzeraccount!";
|
||||
// }
|
||||
// } else if (error.request) {
|
||||
// console.log(error.request);
|
||||
// header = "Anfrage fehlgeschlagen!";
|
||||
// message = "Die Verbindung zum Server ist gestört. Versuchen Sie es später noch einmal.";
|
||||
// }
|
||||
// this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {message: message, title: header});
|
||||
// });
|
||||
// },
|
||||
handleError(error) {
|
||||
// Error
|
||||
let msg;
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<div class="col">
|
||||
<div class="">
|
||||
<div class="" style="max-width: 440px">
|
||||
<q-input lazy-rules outlined filled stack-label v-model="user.name" type="text" label="Name"
|
||||
<q-input lazy-rules outlined filled stack-label v-model="user.name" type="text" label="Vor- und Nachname"
|
||||
:rules="[val=>validateUsername(val)||'Name muss mindestens 2 Zeichen lang sein und darf nur aus Buchstaben, Zahlen und Unterstrichen bestehen!']"/>
|
||||
</div>
|
||||
</div>
|
||||
@ -84,7 +84,7 @@
|
||||
validationSuccesful() {
|
||||
if (this.validateUsername(this.user.name)
|
||||
&& this.validateEmail(this.user.email)
|
||||
&& this.user.email === this.user.checkemail
|
||||
&& this.user.email.toLowerCase() === this.user.checkemail.toLowerCase()
|
||||
&& this.user.password.length >= 8
|
||||
&& this.user.password === this.user.checkpassword) {
|
||||
return true;
|
||||
@ -102,7 +102,7 @@
|
||||
},
|
||||
register: function () {
|
||||
|
||||
if (this.user.email === this.user.checkemail && this.user.password === this.user.checkpassword) {
|
||||
if (this.user.email.toLowerCase() === this.user.checkemail.toLowerCase() && this.user.password === this.user.checkpassword) {
|
||||
const data = {
|
||||
name: this.user.name,
|
||||
password: this.user.password,
|
||||
@ -151,7 +151,7 @@
|
||||
});
|
||||
} else {
|
||||
|
||||
if (this.user.email != this.user.checkemail) {
|
||||
if (this.user.email.toLowerCase() != this.user.checkemail.toLowerCase()) {
|
||||
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {
|
||||
message: "Email stimmt nicht überein",
|
||||
title: "Fehler",
|
||||
@ -198,7 +198,7 @@
|
||||
|
||||
},
|
||||
validateUsername(fld) {
|
||||
var illegalChars = /\W/; // allow letters, numbers, and underscores
|
||||
var illegalChars = /[^A-Za-z0-9_äÄöÖüÜß. -]/g;
|
||||
if (fld === "") {
|
||||
return false;
|
||||
} else if (fld.length < 2) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user