init #2

Closed
samuelbrinkmann wants to merge 1 commit from feature/user-profil-edit into master
6 changed files with 132 additions and 8 deletions
Showing only changes of commit 6ddcdef8a3 - Show all commits

3
package-lock.json generated
View file

@ -10086,8 +10086,7 @@
"version": "4.0.8", "version": "4.0.8",
"resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz",
"integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=",
"dev": true, "dev": true
"optional": true
}, },
"rx-lite-aggregates": { "rx-lite-aggregates": {
"version": "4.0.8", "version": "4.0.8",

View file

@ -57,6 +57,9 @@
<v-list-tile @click="$router.push({'name': 'userMails'})"> <v-list-tile @click="$router.push({'name': 'userMails'})">
<v-list-tile-title >Contact Information</v-list-tile-title> <v-list-tile-title >Contact Information</v-list-tile-title>
</v-list-tile> </v-list-tile>
<v-list-tile @click="$router.push({'name': 'userMails'})">
<v-list-tile-title >Profil</v-list-tile-title>
</v-list-tile>
<v-list-tile @click="clickLoogut()"> <v-list-tile @click="clickLoogut()">
<v-list-tile-title >Logout</v-list-tile-title> <v-list-tile-title >Logout</v-list-tile-title>
</v-list-tile> </v-list-tile>

View file

@ -65,7 +65,18 @@
<v-list> <v-list>
<v-list-item> <v-list-item>
<v-list-item-title @click="clickLoogut()">Logout</v-list-item-title> <router-link to="/user/profile">
<v-list-item-title>
<v-icon>person</v-icon> Profil
</v-list-item-title>
</router-link>
</v-list-item>
<v-list-item>
<a href="#">
<v-list-item-title @click="clickLoogut()">
<v-icon>exit_to_app</v-icon> Logout
</v-list-item-title>
</a>
</v-list-item> </v-list-item>
</v-list> </v-list>
@ -145,5 +156,12 @@
} }
} }
</script> </script>
<style>
a{
text-decoration: none;
color: rgba(0, 0, 0, 0.87) !important
}
v-list-item-title{
cursor: pointer;
}
</style>

View file

@ -9,6 +9,7 @@ import ListApps from '../views/ListApps'
import AppDetails from '../views/AppDetails' import AppDetails from '../views/AppDetails'
import NewApp from '../views/NewApp' import NewApp from '../views/NewApp'
import Mail from '../views/Mail' import Mail from '../views/Mail'
import UserProfile from '../views/UserProfile'
Vue.use(Router) Vue.use(Router)
@ -67,6 +68,12 @@ export default new Router({
path: '/user/mails', path: '/user/mails',
name: 'userMails', name: 'userMails',
component: Mail component: Mail
},
{
beforeEnter: guard,
path: '/user/profile',
name: 'userProfile',
component: UserProfile
} }
] ]
}) })

View file

@ -69,15 +69,12 @@
} }
}, },
mounted: function() { mounted: function() {
console.log("REDIRECT: "+this.$store.state.redirectIfLoggedIn)
if(this.$store.state.loggedIn == true) { if(this.$store.state.loggedIn == true) {
if(this.$store.state.redirectIfLoggedIn != null) { if(this.$store.state.redirectIfLoggedIn != null) {
this.$router.push(this.$store.state.redirectIfLoggedIn); this.$router.push(this.$store.state.redirectIfLoggedIn);
} else { } else {
this.$router.push({name: 'Dashboard'}); this.$router.push({name: 'Dashboard'});
} }
} }
this.nameBig = this.$store.getters.getSettingValue("name_big"); this.nameBig = this.$store.getters.getSettingValue("name_big");
this.nameSmall = this.$store.getters.getSettingValue("name_small"); this.nameSmall = this.$store.getters.getSettingValue("name_small");

100
src/views/UserProfile.vue Normal file
View file

@ -0,0 +1,100 @@
<template>
<div style="margin-top:50px;">
<v-container grid-list-md pa-10 >
<v-layout row wrap>
<v-flex md12>
<h1>Profil von: {{$store.getters.getMe["username"]}}</h1>
<br>
<h4>
Benutzername
<v-tooltip top>
<template v-slot:activator="{ on }">
<span v-on="on">
<v-icon>info</v-icon>
</span>
</template>
<span>
Den Benutzernamen kannst du nachträglich nicht verändern.
</span>
</v-tooltip>
</h4>
<span>{{user.username}}</span>
<v-form
ref="form"
v-model="valid"
:lazy-validation="lazy"
>
<v-row>
<v-col
cols="12"
md="4"
>
<v-text-field
Review

Primary Mail ist nur ein attribut für mail, hier müsste die liste mit allen mail adressen angezeigt werden und ein "Diese Mail als primary mail" button o.ä. siehe altes Frontend.

Außerdem neue mail inzufügen.

Primary Mail ist nur ein attribut für mail, hier müsste die liste mit allen mail adressen angezeigt werden und ein "Diese Mail als primary mail" button o.ä. siehe altes Frontend. Außerdem neue mail inzufügen.
v-model="user.primaryMail"
:rules="emailRules"
label="Primäre E-Mail Adresse"
required
></v-text-field>
</v-col>
</v-row>
</v-form>
<v-btn
:disabled="!valid"
color="success"
class="mr-4"
@click="validate()"
>
Speichern
</v-btn>
<hr/>
<pre>
{{user}}
</pre>
</v-flex>
</v-layout>
</v-container>
</div>
</template>
<script>
import ServerService from '../services/Server'
import UserService from '../services/User'
import AppService from '../services/Apps'
export default {
data () {
return {
nameBig: '',
nameSmall: '',
user: this.$store.getters.getMe,
emailRules: [
v => !!v || 'Primäre E-Mail muss Angegeben werden',
v => /.+@.+/.test(v) || 'E-Mail ist ungültig',
],
valid: true,
lazy: true,
}
},
components: {
},
methods: {
validate () {
if (this.$refs.form.validate()) {
console.log('lets go and save this information')
}
},
},
mounted: function() {
this.nameBig = this.$store.getters.getSettingValue("name_big");
this.nameSmall = this.$store.getters.getSettingValue("name_small");
}
}
</script>
<style>
</style>