diff --git a/community_server/src/Controller/AppRequestsController.php b/community_server/src/Controller/AppRequestsController.php
index 6b744ff69..ff3314e94 100644
--- a/community_server/src/Controller/AppRequestsController.php
+++ b/community_server/src/Controller/AppRequestsController.php
@@ -152,10 +152,7 @@ class AppRequestsController extends AppController
if($result !== true) {
return $this->returnJson($result);
}
- $required_fields = $this->checkAndCopyRequiredFields(['target_date'], $params, $data);
- if($required_fields !== true) {
- return $this->returnJson($required_fields);
- }
+
if(!isset($params['memo']) || strlen($params['memo']) < 5 || strlen($params['memo']) > 150) {
return $this->returnJson(['state' => 'error', 'msg' => 'memo is not set or not in expected range [5;150]']);
}
diff --git a/frontend/src/apis/loginAPI.js b/frontend/src/apis/loginAPI.js
index 91e92a2cc..2eeec754e 100644
--- a/frontend/src/apis/loginAPI.js
+++ b/frontend/src/apis/loginAPI.js
@@ -120,12 +120,12 @@ const loginAPI = {
}
return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload)
},
- changeUsernameProfile: async (sessionId, email, usernameNew) => {
+ changeUsernameProfile: async (sessionId, email, username) => {
const payload = {
session_id: sessionId,
email,
update: {
- 'User.usernameNew': usernameNew,
+ 'User.username': username,
},
}
return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload)
diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue
index 70a35a40a..564b4e430 100755
--- a/frontend/src/views/Layout/DashboardLayout_gdd.vue
+++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue
@@ -2,6 +2,7 @@
+
{{ $t('form.message') }}
-
- {{ $d($moment(date), 'long') }}
- {{ $t('form.date') }}
-
@@ -42,7 +38,6 @@ export default {
email: { type: String, default: '' },
amount: { type: Number, default: 0 },
memo: { type: String, default: '' },
- date: { type: String, default: '' },
loading: { type: Boolean, default: false },
},
}
diff --git a/frontend/src/views/Pages/UserProfile.spec.js b/frontend/src/views/Pages/UserProfile.spec.js
new file mode 100644
index 000000000..7716be9cf
--- /dev/null
+++ b/frontend/src/views/Pages/UserProfile.spec.js
@@ -0,0 +1,23 @@
+import { shallowMount } from '@vue/test-utils'
+
+import UserProfile from './UserProfile'
+
+const localVue = global.localVue
+
+describe('UserProfile', () => {
+ let wrapper
+
+ const Wrapper = () => {
+ return shallowMount(UserProfile, { localVue })
+ }
+
+ describe('shallowMount', () => {
+ beforeEach(() => {
+ wrapper = Wrapper()
+ })
+
+ it('renders the component', () => {
+ expect(wrapper.findComponent({ name: 'user-card' }).exists()).toBeTruthy()
+ })
+ })
+})
diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue
index a1f6a5919..e07313c96 100644
--- a/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue
+++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUserData.vue
@@ -6,31 +6,36 @@
style="background-color: #ebebeba3 !important"
>
-
-
-
- {{ $t('form.edit') }}
-
-
+
+
+
+ {{ $t('form.change') }}
+
+
+
+
-
+
+
{{ $t('form.firstname') }}
-
- {{ form.firstName }}
+
+ {{ $store.state.firstName }}
@@ -40,8 +45,8 @@
{{ $t('form.lastname') }}
-
- {{ form.lastName }}
+
+ {{ $store.state.lastName }}
@@ -51,14 +56,30 @@
{{ $t('form.description') }}
-
- {{ form.description }}
+
+ {{ $store.state.description }}
-
+
-
+
+
+
+
+
+ {{ $t('form.save') }}
+
+
+
+
+
@@ -80,9 +101,21 @@ export default {
lastName: this.$store.state.lastName,
description: this.$store.state.description,
},
+ loading: true,
}
},
methods: {
+ loadSubmitButton() {
+ if (
+ this.form.firstName !== this.$store.state.firstName ||
+ this.form.lastName !== this.$store.state.lastName ||
+ this.form.description !== this.$store.state.description
+ ) {
+ this.loading = false
+ } else {
+ this.loading = true
+ }
+ },
async onSubmit() {
const result = await loginAPI.updateUserInfos(
this.$store.state.sessionId,
@@ -98,6 +131,7 @@ export default {
this.$store.commit('lastName', this.form.lastName)
this.$store.commit('description', this.form.description)
this.editUserdata = true
+ alert('Deine Daten wurden gespeichert und sind geändert.')
} else {
alert(result.result.message)
}
diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue
index e1ade4ae0..6bc1d8942 100644
--- a/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue
+++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUserPasswort.vue
@@ -1,62 +1,105 @@
-
-
-
- {{ $t('form.password') }} {{ $t('form.change') }}
-
-
-
-
-
-
-
- {{ $t('form.password_old') }}
-
-
-
+
-
-
- {{ $t('form.password_new') }}
-
-
-
-
-
-
-
- {{ $t('form.password_new_repeat') }}
-
-
-
-
-
-
+
+
+
+
+ {{ $t('form.password_old') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('form.password_new') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('form.password_new_repeat') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('form.save') }}
+
+
+
+
+
+
@@ -71,10 +114,30 @@ export default {
email: null,
password: '',
passwordNew: '',
- passwordNew2: '',
+ passwordNewRepeat: '',
+ passwordVisibleOldPwd: false,
+ passwordVisibleNewPwd: false,
+ passwordVisibleNewPwdRepeat: false,
+ loading: true,
}
},
methods: {
+ togglePasswordVisibilityNewPwd() {
+ this.passwordVisibleNewPwd = !this.passwordVisibleNewPwd
+ },
+ togglePasswordVisibilityNewPwdRepeat() {
+ this.passwordVisibleNewPwdRepeat = !this.passwordVisibleNewPwdRepeat
+ },
+ togglePasswordVisibilityOldPwd() {
+ this.passwordVisibleOldPwd = !this.passwordVisibleOldPwd
+ },
+ loadSubmitButton() {
+ if (this.passwordVisibleNewPwd === this.passwordVisibleNewPwdRepeat) {
+ this.loading = false
+ } else {
+ this.loading = true
+ }
+ },
async onSubmit() {
// console.log(this.data)
const result = await loginAPI.changePasswordProfile(
diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.vue b/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.vue
index b195f6ef6..38738e54a 100644
--- a/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.vue
+++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.vue
@@ -1,42 +1,61 @@
-
-
-
- {{ $t('form.username') }} {{ $t('form.change') }}
-
-
+
+
+
+ {{ $t('form.change') }}
+
+
+
-
+
+
{{ $t('form.username') }}
- @{{ $store.state.username }}
-
-
-
-
+ @{{ username }}
+
+
+
+
+
+ {{ $t('form.username') }}
+
+
+
+
+
{{ $t('form.change_username_info') }}
-
-
- {{ $t('form.save') }}
-
-
+
+
+
+
+
+ {{ $t('form.save') }}
+
+
+
+
@@ -47,16 +66,27 @@ export default {
name: 'FormUsername',
data() {
return {
- edit_username: true,
- username: '',
+ editUsername: true,
+ username: this.$store.state.username,
+ form: {
+ username: this.$store.state.username,
+ },
}
},
+ props: {
+ UserProfileTestData: { type: Object },
+ },
methods: {
async onSubmit() {
- // console.log(this.data)
- const result = await loginAPI.changeUsernameProfile(this.username)
+ const result = await loginAPI.changeUsernameProfile(
+ this.$store.state.sessionId,
+ this.$store.state.email,
+ this.form.username,
+ )
if (result.success) {
- alert('changeUsername success')
+ this.$store.commit('username', this.form.username)
+ this.editUserdata = this.editUsername = !this.editUsername
+ alert('Dein Username wurde geändert.')
} else {
alert(result.result.message)
}