changeset 492:5a9dde6951ae

fix: N.N as Username is now a placeholder See Issue104
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 24 Aug 2018 14:21:46 +0200
parents 89682badcd3a
children ab5d2cf65f3c
files client/src/components/Userdetail.vue client/src/stores/usermanagement.js
diffstat 2 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Userdetail.vue	Fri Aug 24 14:11:10 2018 +0200
+++ b/client/src/components/Userdetail.vue	Fri Aug 24 14:21:46 2018 +0200
@@ -2,7 +2,7 @@
   <div class="userdetails shadown fadeIn animated">
     <div class="card">
       <div class="card-header shadow-sm text-white bg-info mb-3">
-          {{ currentUser.user }}
+          {{ this.cardHeader }}
         <span @click="closeDetailview" class="pull-right"><i class="fa fa-close"></i></span>
       </div>
       <div class="card-body">
@@ -10,7 +10,7 @@
           <div class="formfields">
             <div v-if="currentUser.isNew" class="form-group row">
               <label for="user">Username</label>
-              <input type="user" class="form-control form-control-sm" id="user" aria-describedby="userHelp" v-model="currentUser.user">
+              <input type="user" :placeholder="userNamePlaceholder" class="form-control form-control-sm" id="user" aria-describedby="userHelp" v-model="currentUser.user">
               <div v-show="errors.user" class="text-danger"><small><i class="fa fa-warning"></i> {{ errors.user }}</small></div>
             </div>
             <div class="form-group row">
@@ -154,6 +154,14 @@
     }
   },
   computed: {
+    cardHeader() {
+      if (this.currentUser.isNew) return "N.N";
+      return this.currentUser.user;
+    },
+    userNamePlaceholder() {
+      if (this.currentUser.isNew) return "N.N";
+      return "";
+    },
     ...mapGetters("application", ["countries"]),
     user() {
       return this.$store.getters["usermanagement/currentUser"];
--- a/client/src/stores/usermanagement.js	Fri Aug 24 14:11:10 2018 +0200
+++ b/client/src/stores/usermanagement.js	Fri Aug 24 14:21:46 2018 +0200
@@ -2,7 +2,7 @@
 
 const newUser = () => {
   return {
-    user: "N.N",
+    user: "",
     email: "",
     country: null,
     role: null,